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
Get the error messages for the defined validation rules.
public function messages() { return [ 'title.required' => 'O título é obrigatório', 'description.required'=> 'A descrição é obrigatório', 'section_id.required'=>'A seção é obrigatório' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidationMessages();", "public function errorMessages()\n {\n return [\n self::RULE_REQUIRED => 'This field is required',\n self::RULE_EMAIL => 'This field must be a valid email address',\n self::RULE_MIN => 'Min length of this field must be {min}',\n self::RULE_MAX => 'Max length of this field must be {max}',\n self::RULE_MATCH => 'This field must be the same as {match}',\n self::RULE_UNIQUE => 'Record with this {field} already exists'\n ];\n }", "public function getValidationErrorMessages() {}", "public function getValidationMessages()\n {\n return $this->validationMessages;\n }", "public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "public function getErrorMessages() {}", "public function getValidatorMessages()\n {\n $messages = [];\n \n foreach ($this->owner->getValidatorRules() as $rule) {\n \n if ($rule->hasMessage()) {\n $messages[$rule->getType()] = $rule->getMessage();\n }\n \n }\n \n return $messages;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function errors()\n {\n return $this->getRules()->getMessageBag()->all();\n }", "public function get_validation_messages() {\n\t\t$field = $this->field;\n\t\t$id = $this->get_id( $field );\n\t\t$is_required = $this->is_required( $field );\n\t\t$messages = '';\n\n\t\t$post_title = self::get_property( 'post_title', $field, '' );\n\t\t$post_content = self::get_property( 'post_content', $field, '' );\n\t\t$post_excerpt = self::get_property( 'post_excerpt', $field, '' );\n\t\t$post_image = self::get_property( 'post_image', $field, '' );\n\t\t$setting_required_message = self::get_property( 'required_message', $field, '' );\n\t\t$post_type = self::get_property( 'post_type', $field, 'post' );\n\n\t\t$post_title_enabled = ! empty( $post_title );\n\t\t$post_content_enabled = ! empty( $post_content );\n\t\t$post_excerpt_enabled = ! empty( $post_excerpt );\n\t\t$post_image_enabled = ! empty( $post_image );\n\t\t$category_list = forminator_post_categories( $post_type );\n\n\t\tif ( $is_required ) {\n\t\t\tif ( $post_title_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-title\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_title_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post title', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_content_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-content\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_content_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post content', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_excerpt_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-excerpt\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_excerpt_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please enter the post excerpt', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif ( $post_image_enabled ) {\n\t\t\t\t$messages .= '\"' . $id . '-post-image\": {' . \"\\n\";\n\n\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t'forminator_postdata_field_post_image_validation_message',\n\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please upload a post image', Forminator::DOMAIN ) ),\n\t\t\t\t\t$id,\n\t\t\t\t\t$field\n\t\t\t\t);\n\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t}\n\t\t\tif( ! empty( $category_list ) ) {\n\t\t\t\tforeach ( $category_list as $category ) {\n\t\t\t\t\t$post_category_enabled = self::get_property( $category['value'], $field, '' );\n\t\t\t\t\tif ( $post_category_enabled ) {\n\t\t\t\t\t\t$post_category_multiple = self::get_property( $category['value'].'_multiple', $field, '' );\n\t\t\t\t\t\tif( $post_category_multiple ){\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '[]\": {' . \"\\n\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$messages .= '\"' . $id . '-' . $category['value'] . '\": {' . \"\\n\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$required_message = apply_filters(\n\t\t\t\t\t\t\t'forminator_postdata_field_' . $category['value'] . '_validation_message',\n\t\t\t\t\t\t\t( ! empty( $setting_required_message ) ? $setting_required_message : __( 'This field is required. Please select a '. $category['singular'], Forminator::DOMAIN ) ),\n\t\t\t\t\t\t\t$id,\n\t\t\t\t\t\t\t$field\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$messages = $messages . '\"required\": \"' . forminator_addcslashes( $required_message ) . '\",' . \"\\n\";\n\n\t\t\t\t\t\t$messages .= '},' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $messages;\n\t}", "public function validation_errors()\n\t{\n\t\t$errors = array();\n\n\t\tforeach ($this->validators as $fld=>$arr)\n\t\t{\n\t\t\tforeach ($arr as $vl)\n\t\t\t{\n\t\t\t\t$vl->page = $this;\n\n\t\t\t\tif (!$vl->validate($fld, $this->vars))\n\t\t\t\t{\n\t\t\t\t\t$errors[$fld] = $vl->error_message($fld, $this->vars);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $errors;\n\t}", "public function errors()\n {\n return $this->validation->messages()->messages();\n }", "public function getErrors()\n {\n return $this->getInputFilter()->getMessages();\n }", "public function getErrorMessages() {\n\t\t$errorMessages = '';\n\t\tforeach ($this->errorMessages as $index => $error) {\n\t\t\t$errorMessages .= \"[Error:\" . $index . '] ' . $error . \"\\n<br />\";\n\t\t}\n\t\treturn $errorMessages;\n\t}", "public static function getMessageRule(){\n return [\n 'title.required' => 'Please input the title',\n 'cat_id.required' => 'Please chose a category',\n 'country_id.required' => 'Please chose a country',\n ];\n }", "public function getValidationErrors();", "public function getValidationErrors();", "public function getErrorMessages()\n {\n return $this->errorMessages;\n }", "public function messages()\n {\n return [\n 'started_at.required_if' => __('validation.required'),\n 'ended_at.required_if' => __('validation.required'),\n 'subject_id.required_if' => __('validation.required'),\n 'competency.required_if' => __('validation.required'),\n 'learning_goals.required_if' => __('validation.required'),\n 'behavior.required_if' => __('validation.required'),\n ];\n }", "public function get_error_messages();", "function getMessages() {\n\t\t$fields = $this->getFields();\n\t\t$allMessages = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldMessages = $field->getValidationMessages();\n\t\t\tif ($fieldMessages) {\n\t\t\t\t$allMessages[$field->getName()] = $fieldMessages;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $allMessages;\n\t}", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function getErrorMessages()\n {\n $errors = [];\n foreach ($this->fields as $field) {\n if ($field instanceof AbstractFormField && !$field->isValid()) {\n $fldErrors = $field->getErrorMessages();\n $errors = array_merge($errors, $fldErrors);\n }\n }\n\n return $errors;\n }", "public function errors()\n {\n return $this->validator->errors()->messages();\n }", "public function getErrorMessages() : array\n {\n return $this->errors_messages;\n }", "public function getMessages()\n {\n return $this->_errorMessages;\n }", "public function getMandatoryValidationMessages() {}", "public function getValidationErrors()\n {\n $fields = $this->getFields();\n if (!$fields) {\n return [];\n }\n\n $result = [];\n foreach ($fields as $field) {\n if ($field instanceof AbstractFormField) {\n if (!$field->isValid()) {\n $result = array_merge($result, $field->getErrorMessages());\n }\n }\n }\n\n return $result;\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.required' => trans('strings.request_password_required'),\n 'password.confirmed' => trans('strings.request_password_confirmed'),\n 'password.min' => trans('strings.request_password_min', ['chars' => config('db_limits.users.minPasswordLength')]),\n ];\n }", "protected function getValidationErrors()\n {\n return $this->validation->errors();\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function messages()\n {\n return [\n 'file.required' => trans('validation.downloadable_required'),\n 'category_list.required' => trans('validation.category_list_required'),\n ];\n }", "public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The field ' . $message->getField() . ' is required');\n break;\n case 'Uniqueness':\n $message->setMessage('The field ' . $message->getField() . ' must be unique');\n break;\n case 'Email':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid email');\n break;\n case 'Url':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid url');\n break;\n case 'InclusionIn':\n $message->setMessage('The field ' . $message->getField() . ' must contain a value in [' . implode(',', $message->getDomain()) . ']');\n break;\n case 'DateValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid date.');\n break;\n case 'TimestampValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid timestamps.');\n break;\n }\n }\n\n return parent::getMessages();\n }", "public function getValidationErrors() {\n if (true == ($this->validation instanceof Validation)) {\n return $this->validation->getErrors();\n }\n\n return array();\n }", "public function getErrorMessagesList(){\n \t$errors = $this->getMessages();\n \tif(count($errors)){\n \t\t$result = [];\n \t\tforeach ($errors as $elementName => $elementErrors){\n \t\t\tforeach ($elementErrors as $errorMsg){\n \t\t\t\t$result[] = $errorMsg;\n \t\t\t}\n \t\t}\n \t\treturn $result;\n \t}\n \treturn null;\n }", "protected function get_errors_description() {\n $errors = array();\n if ($this->options->is_check_errors == true) {\n\n $i = 0;\n $rules_names = $this->get_error_hints_names();\n\n foreach($rules_names as $rule_name) {\n $rule = new $rule_name($this->get_dst_root());\n $rhr = $rule->check_hint();\n\n if (count($rhr->problem_ids) > 0) {\n $errors[$i] = array();\n\n $errors[$i][\"problem\"] = $rhr->problem;\n $errors[$i][\"solve\"] = $rhr->solve;\n $errors[$i][\"problem_ids\"] = $rhr->problem_ids;\n $errors[$i][\"problem_type\"] = $rhr->problem_type;\n $errors[$i][\"problem_indfirst\"] = $rhr->problem_indfirst;\n $errors[$i][\"problem_indlast\"] = $rhr->problem_indlast;\n\n ++$i;\n }\n }\n }\n return $errors;\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.regex' => 'Password must contain at least 1 uppercase letter and 1 number.',\n ];\n }", "public function customValidationMessages()\n {\n return [\n 'role_id.required' => 'The role ID is required.',\n 'role_id.exists' => 'The role ID provided does not exist.',\n 'staff_code.required' => 'The staff code is required.',\n 'name.required' => 'The name field is required.',\n 'name.max' => 'The name field exceeds the maximum length of 255.',\n 'email.email' => 'Please provide an email address.',\n ];\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function getErrors()\n {\n $errors = $this->getValue('klarna_validation_errors');\n return $errors ? $errors : array();\n }", "public function getMessage(): array\n {\n return [\n self::RULE_REQUIRED => 'This Field is required',\n self::RULE_EMAIL => 'Please input valid email address',\n self::RULE_MATCH => 'The Passwords must match',\n self::RULE_UNIQUE => 'This record exists in the database',\n self::RULE_VALID_START_DATE => 'Project start date cannot be before today',\n self::RULE_VALID_END_DATE => 'Project end date cannot be before start date'\n\n ];\n }", "public function getErrorMessages()\n {\n $translator = Mage::helper('importexport');\n $messages = array();\n\n foreach ($this->_errors as $errorCode => $errorRows) {\n if (isset($this->_messageTemplates[$errorCode])) {\n $errorCode = $translator->__($this->_messageTemplates[$errorCode]);\n }\n foreach ($errorRows as $errorRowData) {\n $key = $errorRowData[1] ? sprintf($errorCode, $errorRowData[1]) : $errorCode;\n $messages[$key][] = $errorRowData[0];\n }\n }\n return $messages;\n }", "public function getErrors(): array\n {\n return $this->getInputFilter()->getMessages();\n }", "protected function _getValidationErrors()\n {\n if (is_null($this->validationErrors)) {\n return array();\n }\n\n return $this->validationErrors;\n }", "public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}", "public function get_errors() {\n\t\treturn $this->errors->get_error_messages();\n\t}", "public function getValidationErrors()\n\t{\n\t\treturn $this->validationErrors;\n\t}", "public function messages() \n {\n return[\n 'name.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.required' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.numeric' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity'],\n 'price.major' => ['code' => 'ERROR-1', 'title' => 'Unprocessable Entity']\n ];\n }", "public function get_clear_error_msgs()\n {\n $msgs = array();\n foreach ($this->errors as $e) {\n $msgs[$e['field']][$e['rule']] = $this->get_validation_error_msg($e['field'], $e['rule'], $e['value']);\n\n }\n return $msgs;\n }", "public function messages()\n {\n $items = [];\n foreach (static::attributes() as $key => $val) {\n $items[$key . '.required'] = t('common.form.errors.required', [\n 'attribute' => $val,\n ]);\n }\n \n return $items;\n }", "public function messages()\n {\n return [\n 'name.required' => 'A Team Name is required',\n 'filename.required' => 'A Team Logo is required',\n 'club_state.required' => 'A Club state is required',\n ];\n }", "public function messages()\n {\n return [\n 'code_day.required' => 'Code day must required!',\n 'name.required' => 'Name must required!',\n ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'Email is required!',\n 'year.required' => 'Year is required!',\n 'artist_id.required' => 'Artist is required!'\n ];\n }", "public function messages()\n {\n return [\n 'required' => ':attribute field must be filled',\n 'email' => ':attribute field must be an email',\n 'unique' => ':attribute field already registered',\n ];\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function messages()\n {\n return [\n 'baskets.required' => trans('validation.recipe baskets'),\n 'steps.required' => trans('validation.recipe steps'),\n 'ingredients.required' => trans('validation.recipe ingredients'),\n ];\n }", "public function getValidationErrors() {\n\t\t$out = array();\n\t\t$this->loadFields();\n\t\tforeach($this->fields as $field) {\n\t\t\t$out = array_merge($out, $field->getValidationErrors());\n\t\t}\n\t\tif ((!$this->lat || !$this->lng) && !$this->feature_id) {\n\t\t\t$out[] = \"You must set a location!\";\n\t\t}\n\t\treturn $out;\n\t}", "public function errors() {\n $errors = array();\n foreach ($this->properties as $property) {\n if (!$property->rulesPassed()) {\n $errors[$property->getName()] = $property->getErrors();\n }\n }\n return $errors;\n }", "public function messages()\n {\n return [\n 'curp.required' => 'Falta la C.U.R.P.',\n 'curp.unique' => 'Esta C.U.R.P. ya existe',\n 'curp.min' => 'C.U.R.P. incorrecta',\n 'curp.max' => 'C.U.R.P. incorrecta',\n 'nombre1.required' => 'Falta el nombre',\n 'nombre1.min' => 'Nombre incorrecto',\n 'nombre1.max' => 'Nombre incorrecto',\n 'apellido1.required' => 'Falta el apellido',\n 'apellido1.min' => 'Apellido incorrecto',\n 'apellido1.max' => 'Apellido incorrecto',\n 'fechanacimiento.required' => 'Falta la fecha de nac.',\n 'genero.required' => 'Obligatorio'\n ];\n }", "public function getValidationErrors() {\n\t\treturn $this->_validationErrors;\n\t}", "private function getErrorMessages(): array\n {\n return [\n 'notEmpty' => 'Campo {{name}} obligatorio',\n 'date' => '{{name}} debe tener una fecha valida. Ejemplo de formato: {{format}}\\'',\n 'intVal' => '',\n 'between' => '',\n 'in' => '',\n 'floatVal' => '',\n 'length' => '',\n 'stringType' => '',\n 'objectType' => '',\n 'cantidadRegistros' => 'dsfsdfsd',\n 'periodo.notEmpty' => 'Campo Periodo: es obligatorio',\n 'periodo' => 'Campo Periodo: Debe tener el formato AAAAMM, donde AAAA indica el año y MM el mes en números',\n 'orden.notEmpty' => 'Campo Orden: es obligatorio',\n 'orden' => 'Campo Orden: Debe ser igual a 1 ó 2.',\n 'codigoComprobante.notEmpty' => 'Campo Codigo de Comprobante: es obligatorio',\n 'codigoComprobante' => 'Campo Codigo de Comprobante: Debe debe estar comprendido entre 1 y 9998.',\n 'numeroComprobante.notEmpty' => 'Campo Numero de Comprobante: es obligatorio',\n 'numeroComprobante' => 'Campo Numero de Comprobante: Debe debe estar comprendido entre 1 y 99999999.',\n 'puntoVenta.notEmpty' => 'Punto de venta: es obligatorio',\n 'puntoVenta' => 'Punto de venta: Debe debe estar comprendido entre 1 y 9998.',\n ];\n }", "public function messages()\n {\n return [\n 'code_area.required' => 'Code area cannot be blank',\n 'name.required' => 'Name area cannot be blank'\n ];\n }", "public function messages()\n {\n return [\n 'zipcode.required' => 'A Zipcode is required',\n 'publicPlace.required' => 'A Public Place is required',\n 'neighbordhood.required' => 'A Neighbordhood is required',\n 'complement.required' => 'A Complement Name is required',\n 'number.required' => 'A Number is required',\n 'city.required' => 'A City is required',\n 'state.required' => 'A State is required',\n\n 'zipcode.max' => 'A Zipcode max 255 characteres required.',\n 'publicPlace.max' => 'A Public Place max 255 characteres required.',\n 'neighbordhood.max' => 'A Neighbordhood max 255 characteres required.',\n 'complement.max' => 'A Complementmax 255 characteres required.',\n 'number.max' => 'A Number max 255 characteres required.',\n 'city.max' => 'A City max 255 characteres required.',\n 'state.max' => 'A State max 255 characteres required.',\n ];\n }", "public function validateAll()\n {\n $errorMsgs = array();\n return $errorMsgs;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function messages() : array\n {\n return [\n 'department_id.required' => 'The department field is required.',\n 'user_group_id.required' => 'The user group field is required.',\n 'password.required_if' => 'The password field is required.',\n ];\n }", "public function messages()\n {\n return [\n 'style.required' => 'Please the style is required',\n 'service.required' => 'Please select service type',\n 'session.required' => 'Please select session'\n ];\n }", "public function messages()\n {\n return [\n 'candidates_needed.required' => 'The candidates number field is required!',\n 'start_posting_date.required' => 'The start posting date field is required!',\n 'end_posting_date.required' => 'The end posting date field is required!',\n 'appl_deadline_date.required' => 'The application deadline field is required!',\n 'start_trial_date.required' => 'The start trial field is required!',\n 'end_trial_date.required' => 'The end trial field is required!',\n ];\n }", "public function messages()\n {\n return [\n 'title.required' => 'A title is required',\n 'title.max' => 'Title is too long',\n 'image.required' => 'An image is required',\n ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'A name is required.',\n 'color.required' => 'Please select a color.'\n ];\n }", "public function messages() {\n\t\treturn [\n\t\t\t'titulo.required' => 'El :attribute es obligatorio.',\n\t\t\t'descripcion.required' => 'La :attribute es obligatoria',\n\t\t\t'ciudad.required' => 'La :attribute es obligatoria',\n\t\t\t'telefono.required' => 'El :attribute es obligatorio.',\n\t\t\t'latitud.required' => 'La :attribute es obligatoria',\n\t\t\t'longitud.required' => 'La :attribute es obligatoria',\n\t\t\t'subcategoria.required' => 'La :attribute es obligatoria',\n\t\t\t'tags.required' => 'Los :attribute son obligatorios',\n\t\t];\n\t}", "public function messages() {\n return [\n 'name.required' => 'Missing name.',\n 'description.required' => 'Missing description.',\n 'max_level.required' => 'Missing max level.',\n 'bonus_per_level.required' => 'Missing bonus per level.',\n 'effect_type.required' => 'Missing effect type.',\n 'hours_per_level.required' => 'Missing length of time per level.'\n ];\n }", "public function messages()\n {\n return [\n 'contractor_account_id.exists' => 'Invalid data.',\n 'truck_id.exists' => 'Invalid data.',\n 'source_id.exists' => 'Invalid data.',\n 'destination_id.exists' => 'Invalid data.',\n 'driver_id.exists' => 'Invalid data.',\n 'material_id.exists' => 'Invalid data.',\n ];\n }", "public function getErrors()\n {\n return $this->_arrValidationErrors;\n }", "public function messages()\n {\n return [\n 'origin.required' => 'INVALID_PARAMETERS',\n 'destination.required' => 'INVALID_PARAMETERS',\n ];\n }", "public function messages()\n {\n return [\n 'name.required' => 'Name is required!',\n 'category.required' => 'category is required!',\n 'price.required' => 'price is required!',\n 'price.regex' => 'invalid price!',\n 'weight.required' => 'weight is required!',\n 'stock.required' => 'stock is required!',\n 'stock.integer' => 'invalid stock!',\n 'files.mimes' => 'invalid File(s)!',\n 'files.max' => 'File size must be 2MB or lesser !',\n ];\n }", "public function messages()\n {\n return [\n 'first_name.required' => 'First name cannot be blank.',\n 'first_name.string' => 'First name must be formatted as a string.',\n 'first_name.max' => 'First name exceeded the max number of characters.',\n 'last_name.required' => 'Last name cannot be blank.',\n 'last_name.string' => 'Last name must be formatted as a string.',\n 'last_name.max' => 'Last name exceeded the max number of characters.',\n 'email.required' => 'Email cannot be blank.',\n 'email.string' => 'Email name must be formatted as a string.',\n 'email.email' => 'Email must be formatted as a valid email address',\n 'email.max' => 'Email exceeded the max number of characters.',\n ];\n }", "public function messages()\n {\n return [\n 'name' => 'required',\n 'address' => 'required',\n 'city' => 'required',\n 'latitude' => 'required',\n 'longitude' => 'required',\n 'type' => 'required',\n 'is_public' => 'required',\n 'school_zone' => 'required',\n ];\n }", "public function getErrors()\n {\n return $this->validator->errors();\n }", "public function getValidationErrors()\n\t{\n\t\tif(is_array($this->validation_errors) && \n\t\t\tsizeof($this->validation_errors))\n\t\t{\n\t\t\treturn array_unique($this->validation_errors);\n\t\t}\n\t\treturn array();\n\t}", "public function messages()\n {\n return [\n 'name.required' => 'Full Name is required',\n 'name.min' => 'Name must be of minimum 3 characters',\n 'name.max' => 'Name can be of maximum 190 characters',\n 'support_pin.required' => 'Support PIN is required',\n 'support_pin.numeric' => 'Support PIN can only be numeric',\n 'support_pin.digits' => 'Only 4 digit Support PIN is accepted',\n 'rng_level.required' => 'Random Generator Difficutly is required',\n 'rng_level.numeric' => 'Invalid Random Generator Setting',\n 'rng_level.digits' => 'Invalid Random Generator Setting',\n 'dob.required' => 'Date of Birth is required',\n 'mobile.required' => 'Mobile Number is required',\n 'mobile.numeric' => 'Mobile Number can only be numeric',\n 'country' => 'Country is required',\n ];\n }", "public function getErrors()\n\t{\n\t\t$errors = array();\n\t\t/** @var Miao_Form_Control $control */\n\t\t/** @var Miao_Form_Validate $validator */\n\t\tforeach ( $this->getControls() as $control )\n\t\t{\n\t\t\tif ( !$control->isValid() )\n\t\t\t{\n\t\t\t\t$validator = $control->error();\n\t\t\t\t$errors[] = array(\n\t\t\t\t\t'name' => $control->getName(),\n\t\t\t\t\t'error' => $validator->getMessage() );\n\t\t\t}\n\t\t}\n\t\treturn $errors;\n\t}", "public function messages()\n {\n return [\n 'title.required' => Lang::get('controller.title_required'),\n 'title.string' => Lang::get('controller.title_required'),\n 'description.required' => Lang::get('controller.description_required'),\n 'topic_id.required' => Lang::get('controller.topic_id_required'),\n 'grade_id.required' => Lang::get('controller.grade_id_required'),\n 'skill_category_id.required' => Lang::get('controller.skill_category_id_required'),\n 'language_id.required' => Lang::get('controller.language_id_required'),\n 'publish_status.required' => Lang::get('controller.publish_status_required'),\n 'minimum_age.required' => Lang::get('controller.minimum_age_required'),\n 'maximum_age.required' => Lang::get('controller.maximum_age_required'),\n ];\n }", "public function messages()\n {\n return [\n 'created_by_id.required' => 'Employer Id is required',\n 'created_by_id.numeric' => 'Employer Id must be an integer type',\n 'team_name.required' => 'Team Name is required',\n 'team_name.string' => 'Team Name must be a string type',\n 'company_id.required' => 'Company Id is required',\n 'company_id.numeric' => 'Company Id must be an integer',\n ];\n }", "public function messages()\n {\n return array_merge(trans('news::validation'), trans('news::validation.custom'));\n }", "protected function messages()\n {\n return [\n 'id.required' => HttpAttributeInvalidCode::ID_REQUIRED,\n 'password.required' => HttpAttributeInvalidCode::PASSWORD_REQUIRED,\n 'password.same' => HttpAttributeInvalidCode::CONFIRM_PASSWORD_NOT_SAME,\n 'display_name.required' => HttpAttributeInvalidCode::DISPLAY_NAME_REQUIRED,\n 'role_id.required' => HttpAttributeInvalidCode::ROLE_REQUIRED,\n 'status.required' => HttpAttributeInvalidCode::STATUS_REQUIRE\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function messages()\n {\n $illegalFields = [ 'email', 'type', 'status', 'branches', ];\n $messages = [];\n\n foreach ($illegalFields as $key => $attribute) {\n $messages[\"{$attribute}.not_present\"] = __('The field :attribute must not be present.');\n }\n\n return $messages;\n }", "public function messages()\n {\n return [\n 'truck_id.required' => 'The truck field is required.',\n 'truck_id.exists' => 'Invalid data.',\n 'account_id.required' => 'The supplier field is required.',\n 'account_id.exists' => 'Invalid data.'\n ];\n }", "public function getValidationErrors() {\n\t\tif ($this->_errors === null) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->_errors->toArray();\n\t}", "public function getErrors(): array {\n return $this->validationError;\n }", "function getErrors()\n {\n $errMsg = '';\n foreach ($this->errors as $error) {\n $errMsg .= $error;\n $errMsg .= '<br/>';\n }\n return $errMsg;\n }", "public function messages()\n {\n return $messages = [\n 'source_funds.required' => trans('common.error_messages.req_this_field'),\n 'jurisdiction_funds.required' => trans('common.error_messages.req_this_field'),\n 'annual_income.required' => trans('common.error_messages.req_this_field'),\n 'other_source.required' => trans('common.error_messages.req_this_field'),\n 'estimated_wealth.required' => trans('common.error_messages.req_this_field'),\n 'wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'other_wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'tin_code.required' => trans('common.error_messages.req_this_field'),\n 'is_abandoned.required' => trans('common.error_messages.req_this_field'),\n 'date_of_abandonment.required' => trans('common.error_messages.req_this_field'),\n 'abandonment_reason.required' => trans('common.error_messages.req_this_field'),\n 'justification.required' => trans('common.error_messages.req_this_field'),\n 'tin_country_name.required' => trans('common.error_messages.req_this_field'),\n 'tin_number.required' => trans('common.error_messages.req_this_field'),\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function messages()\n {\n /*\n return [\n 'bio.required' => 'Bio is required',\n 'state.required' => 'State is required',\n 'city.required' => 'City name is required',\n 'postalcode.required' => 'Postal Code is required',\n 'gender.required' => 'Gender is required',\n 'seeking_gender.requred' => 'Gender you are searching for is required',\n ];\n */\n }", "private function getValidationRules(): array\n {\n return [\n 'year_month' => new Assert\\DateTime(\n [\n 'format' => 'Y-m',\n 'message' => 'Unexpected $yearMonth value. `Y-m` format is expected.',\n ]\n ),\n 'months_count' => new Assert\\Range(\n [\n 'min' => 1,\n 'max' => 12,\n 'minMessage' => 'Months count must be at least {{ limit }}',\n 'maxMessage' => 'Months count must not be greater than {{ limit }}',\n ]\n ),\n ];\n }", "public function getErrorMessages(){\n return $this->arr_msg; \n }" ]
[ "0.82462656", "0.8072122", "0.79855305", "0.7869173", "0.7831077", "0.7776483", "0.7776483", "0.7589036", "0.75582355", "0.75402904", "0.75402904", "0.7525044", "0.75227535", "0.7516879", "0.7475822", "0.7457696", "0.7425241", "0.74180096", "0.7405273", "0.7405273", "0.7400484", "0.7395581", "0.7392798", "0.7389888", "0.7360024", "0.73180616", "0.73162127", "0.7305573", "0.7279752", "0.7274237", "0.7268171", "0.7261277", "0.7242113", "0.72149134", "0.7214028", "0.7211038", "0.72069424", "0.7205835", "0.71890676", "0.7186795", "0.7184488", "0.71786416", "0.7169952", "0.7161326", "0.715333", "0.7151148", "0.7149324", "0.7133506", "0.712178", "0.7110109", "0.71095705", "0.7093795", "0.7087011", "0.70712256", "0.7070143", "0.70600915", "0.7059444", "0.7056968", "0.704947", "0.70437986", "0.70437384", "0.7041736", "0.7038512", "0.7036984", "0.7032627", "0.70229805", "0.70208246", "0.702044", "0.7007877", "0.7000938", "0.69963926", "0.69936424", "0.69912916", "0.6985551", "0.6982829", "0.6981308", "0.6980877", "0.6979931", "0.69782096", "0.6977083", "0.69753224", "0.69692177", "0.6966572", "0.6958873", "0.6957573", "0.6957456", "0.6944549", "0.69384116", "0.6934856", "0.69259256", "0.6918059", "0.6914203", "0.6909962", "0.69095904", "0.6906319", "0.6900933", "0.6900174", "0.6893932", "0.6892958", "0.68911815", "0.6887292" ]
0.0
-1
Get the posts for the pages.
public function companies() { return $this->hasMany('App\Company'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPages()\n {\n return $this->getPosts();\n }", "public function getPosts();", "public function getPosts();", "static function get_pages(){\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'page' AND post_status = 'publish'\";\n\t\t\n\t\treturn $wpdb->get_results($sql);\n\t}", "public function getPosts() {}", "public function get_posts()\n\t{\n\t\t$this->post_posts();\n\t}", "public function getPage(): array\n {\n $postIdList = $this->getPostIdList();\n $postRepository = new PostRepository();\n $postsArray= $postRepository->getByIds($postIdList);\n foreach ($postsArray as $post)\n $post->picLinkMin = picHandler::getMin($post->pic_link);\n\n return $postsArray;\n }", "public function get_posts()\n {\n }", "public function getPosts()\n {\n return $this->posts;\n }", "public function getPosts()\n {\n return $this->posts;\n }", "public function getPosts()\n {\n return $this->posts;\n }", "public function getPosts()\n {\n return $this->posts;\n }", "public function getPages()\n\t {\n\t \t$args = array(\n\t\t\t\t'sort_order' => 'asc',\n\t\t\t\t'sort_column' => 'post_title',\n\t\t\t\t'hierarchical' => 1,\n\t\t\t\t'child_of' => 0,\n\t\t\t\t'parent' => -1,\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_status' => 'publish'\n\t\t\t); \n\n\t\t\treturn get_pages($args);\n\t }", "public function getPosts(){\n return $this->_posts;\n }", "protected function posts($post = NULL){\n\n\t\t\n\t\tif($posts = NULL){\n\n\t\t\t$posts = WinkPost::with('tags')\n\t ->live()\n\t ->orderBy('publish_date')\n\t ->simplePaginate(5);\n\n\t \treturn $posts;\n\n\t\t}else{\n\n\t\t\t$post = WinkPost::whereSlug($post)->firstOrFail();\n\n\t\t\treturn $post;\n\t\t} \n\n\t}", "public function getPosts($currentPage)\n {\n $nbPerPage = $this->getNbPerPage();\n $postPage = $this->PostPage($currentPage);\n $dbName = $this->dbConnect();\n $req = $dbName->prepare(\"SELECT id, title,chapo, content,status,user_id, DATE_FORMAT(dateLastModification, '%d/%m/%Y à %Hh%imin%ss')\n AS dateLastModification FROM blogpost WHERE status = 1 ORDER BY dateLastModification DESC LIMIT :postPage ,:nbPerPage\");\n $req->bindValue(\":postPage\", $postPage, PDO::PARAM_INT);\n $req->bindValue(\":nbPerPage\", $nbPerPage, PDO::PARAM_INT);\n $req->execute();\n\n $posts = [];\n while ($row = $req->fetch(PDO::FETCH_ASSOC)) {\n $post = new BlogPost();\n $post->setId($row['id']);\n $post->setTitle($row['title']);\n $post->setContent($row['content']);\n $post->setDate($row['dateLastModification']);\n $post->setStatus($row['status']);\n $post->setUserId($row['user_id']);\n $post->setChapo($row['chapo']);\n $posts[] = $post;\n }\n return $posts;\n }", "public function getPosts(){\n \t$posts = Post::latest()->paginate(3);\n \treturn new PostCollection($posts);\n }", "public function allPostsPage(){\n require_once \"controller/Post.php\";\n $post = new Post();\n $content = $post->getAllPosts();\n $html = \"<div class=\\\"page_all_chapters\\\"><h1>Tous les chapitres:</h1>\";\n $html .= View::makeLoopHtml($content, \"all_posts_template\");\n $html .= \"</div>\";\n return [\n \"{{ pageTitle }}\" => \"Tous les chapitres\",\n \"{{ content }}\" => $html,\n \"{{ path }}\" => $GLOBALS[\"path\"]\n ] ;\n }", "private function get_rendered_posts() {\n // get all posts\n// leave only user's posts\n $author = null;\n if (isset($_GET['post-author']) && $_GET['post-author'] == 'user') {\n $author = $_SESSION['user_id'];\n }\n $category = null;\n// filter them by category\n if (isset($_GET['category']) && $_GET['category'] != 'all') {\n $category = $_GET['category'];\n }\n// sort them\n $sort_method = null;\n if (isset($_GET['sort-method'])) {\n $sort_method = $_GET['sort-method'];\n }\n $limit = 6;\n if (isset($_GET['limit'])) {\n $limit = $_GET['limit'];\n }\n $offset = 0;\n if (isset($_GET['offset'])) {\n $offset = $_GET['offset'];\n }\n $posts = Post::render_all($author, $category, $sort_method, $limit, $offset);\n return $posts;\n }", "public function getPages() {}", "public function getAllPublishedPosts() \n\t{\n $q = \"SELECT * FROM in_posts WHERE publish_flag = 1 ORDER BY publish_time DESC\";\n $ps = $this->execute($q);\n $result = $this->getDataRowsAsObjects($ps, 'Post');\n return $result;\n }", "protected function load()\r\n {\r\n $this->ensureSorter();\r\n $posts = iterator_to_array($this->iterator);\r\n\r\n // Find the previous and next posts, if the parent page is in there.\r\n if ($this->page != null)\r\n {\r\n $pageIndex = -1;\r\n foreach ($posts as $i => $post)\r\n {\r\n if ($post === $this->page)\r\n {\r\n $pageIndex = $i;\r\n break;\r\n }\r\n }\r\n if ($pageIndex >= 0)\r\n {\r\n // Get the previous and next posts.\r\n $prevAndNextPost = array(null, null);\r\n if ($pageIndex > 0)\r\n $prevAndNextPost[0] = $posts[$pageIndex - 1];\r\n if ($pageIndex < count($posts) - 1)\r\n $prevAndNextPost[1] = $posts[$pageIndex + 1];\r\n\r\n // Get their template data.\r\n $prevAndNextPostData = $this->getPostsData($prevAndNextPost);\r\n\r\n // Posts are sorted by reverse time, so watch out for what's\r\n // \"previous\" and what's \"next\"!\r\n $this->previousPost = $prevAndNextPostData[1];\r\n $this->nextPost = $prevAndNextPostData[0];\r\n }\r\n }\r\n \r\n // Get the posts data, and use that as the items we'll return.\r\n $items = $this->getPostsData($posts);\r\n\r\n // See whether there's more than what we got.\r\n $this->hasMorePosts = false;\r\n $currentIterator = $this->iterator;\r\n while ($currentIterator != null)\r\n {\r\n if ($currentIterator instanceof SliceIterator)\r\n {\r\n $this->hasMorePosts |= $currentIterator->hadMoreItems();\r\n if ($this->hasMorePosts)\r\n break;\r\n }\r\n $currentIterator = $currentIterator->getInnerIterator();\r\n }\r\n\r\n return $items;\r\n }", "public function index()\n {\n $posts = $this->postService->getAll();\n\n return $posts;\n }", "public function getPosts(): Collection\n {\n return $this->posts;\n }", "public function getPages();", "public function getPublishedPosts() {\r\n $sql = 'SELECT p.ID as ID, post_title, post_subtitle,\r\n username, name, word_count, b.status as bookmark_status,\r\n UNIX_TIMESTAMP(post_date) as post_date \r\n FROM posts p JOIN users u ON (post_author=u.id) \r\n LEFT JOIN bookmarks b ON (b.post_id=p.ID AND b.user_id=?)\r\n WHERE post_status = \"publish\" \r\n ORDER BY post_date DESC LIMIT 0, 10';\r\n $sth = $this->db->prepare($sql);\r\n $sth->execute(array($GLOBALS['user']['id']));\r\n\r\n $rows = array();\r\n while($row = $sth->fetch()) {\r\n $row['post_date_supertag'] = date('j<b\\r>M', $row['post_date']);\r\n $row['reading_time'] = ceil($row['word_count'] / WORDS_PER_MINUTE);\r\n\r\n $rows[] = $row;\r\n }\r\n\r\n return $rows;\r\n }", "function readPosts($page = 1){\n $posts = getPostsFiles();\n\n // read each post's data without parsing/reading html\n foreach ($posts as $i => $postFileName){\n $posts[$i] = readPost($postFileName);\n }\n\n // sort posts by primary and secondary sort features\n // ATTENTION: This also re-calculates the numeric keys of the array,\n // which is intentional, here! They don't have to be calculated again!\n usort($posts, function($a, $b) {\n $compOne = strcmp($a[LOGMD_POSTS_SORT_BY_1], $b[LOGMD_POSTS_SORT_BY_1]);\n $compOne *= LOGMD_POSTS_SORT_BY_1_ASC ? 1 : -1;\n if (!$compOne){\n $compOne = strcmp($a[LOGMD_POSTS_SORT_BY_2], $b[LOGMD_POSTS_SORT_BY_2]);\n $compOne *= LOGMD_POSTS_SORT_BY_2_ASC ? 1 : -1;\n }\n return $compOne;\n });\n\n // PAGINATION: calculate values\n $size = LOGMD_POSTS_PER_PAGE; // results size\n $total = sizeof($posts); // total posts count\n $pages = intval($total / $size) + ($total % $size == 0 ? 0 : 1); // no. of pages\n if ($total <= $size || $page > $pages) $page = 1; // set page to 1\n $from = ($page - 1) * LOGMD_POSTS_PER_PAGE; // index of first post to return\n $range = range($from, $from + LOGMD_POSTS_PER_PAGE - 1); // indexes range to return\n \n // PAGINATION: filter for posts of requested page\n $posts = array_filter(\n $posts,\n function ($key) use ($range) {\n return in_array($key, $range);\n },\n ARRAY_FILTER_USE_KEY\n );\n\n // Get / render html content of each post to show\n foreach ($posts as $post){\n $post['POST'] = readPostContent($post);\n }\n\n // put it all together\n return [\n 'POSTS' => $posts,\n 'TOTAL' => $total,\n 'SIZE' => $size,\n 'PAGE' => $page,\n 'PAGES' => $pages\n ];\n }", "public function allPosts()\n {\n return Post::all();\n }", "public function posts()\n\t{\n\t\t$this -> template = 'default_1';\n\t\t$url = $this -> basepath();\n\n\t\t$posts = \\App\\App::getInstance() -> getTable('postsManager');\n\t\t$posts = $posts -> getPosts();\n\t\t$categories = \\App\\App::getInstance() -> getTable('categoriesManager');\n\t\t$categories = $categories -> getCategories();\n\t\t$this -> page('posts/posts', compact('posts', 'categories', 'url'));\n\t}", "public function get_content_posts() {\r\n\t\tglobal $wpdb;\r\n\t\t$options = get_option( 'mf_timeline' );\r\n\t\t\r\n\t\tif( isset( $options['options']['wp']['content']) && !empty($options['options']['wp']['content'] ) ) {\t\t\t\r\n\t\t\t/**\r\n\t\t\t * // HACK\r\n\t\t\t * Wordpress $wpdb->prepare() doesn't handle passing multiple arrays to its values. So we have to merge them.\r\n\t\t\t * It is also unable to determine how many placeholders are needed for handling array values, so we have to work out how many we need.\r\n\t\t\t * To be blunt, this is crap and needs to be looked at by the Wordpress dev team.\r\n\t\t\t **/\r\n\t\t\t$post_types = array_keys( $options['options']['wp']['content'] );\r\n\t\t\t\r\n\t\t\tforeach( $post_types as $post_type ) {\r\n\t\t\t\t$post_types_escape[] = '%s';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$since = date('Y-m-01', strtotime('-1 months'));\r\n\t\t\t$sql = \"SELECT {$wpdb->posts}.ID AS id, {$wpdb->posts}.post_title AS title, {$wpdb->posts}.post_content AS content, {$wpdb->posts}.post_excerpt AS excerpt, {$wpdb->posts}.post_date AS date, {$wpdb->posts}.post_author AS author, {$wpdb->terms}.term_id AS term_id\r\n\t\t\t\tFROM `{$wpdb->posts}` \r\n\t\t\t\tINNER JOIN {$wpdb->term_relationships} ON ({$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id) \r\n\t\t\t\tINNER JOIN {$wpdb->term_taxonomy} ON ({$wpdb->term_relationships}.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)\r\n\t\t\t\tINNER JOIN {$wpdb->terms} ON ({$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id)\r\n\t\t\t\tWHERE {$wpdb->posts}.post_status = 'publish' AND {$wpdb->posts}.post_date >= '$since'\r\n\t\t\t\tAND {$wpdb->posts}.post_type IN (\".implode(',', $post_types_escape).\")\";\r\n\t\t\t\r\n\t\t\t// Check if we are filtering the post types by hireachrical taxonomy terms\r\n\t\t\tif( isset( $options['options']['wp']['filter']['taxonomy'] ) && !empty( $options['options']['wp']['filter']['taxonomy'] ) ) {\r\n\t\t\t\t$term_ids = array_keys( $options['options']['wp']['filter']['taxonomy'] );\r\n\t\t\t\t\r\n\t\t\t\tforeach( $term_ids as $term_id ) {\r\n\t\t\t\t\t$term_ids_escape[] = '%d';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if we are filter the post types by non-hireachrical taxonomy terms\r\n\t\t\tif( isset($options['options']['wp']['filter']['term'] ) && !empty( $options['options']['wp']['filter']['term'] ) ) {\r\n\t\t\t\tforeach( $options['options']['wp']['filter']['term'] as $taxonomy_name=>$terms ) {\r\n\t\t\t\t\tforeach( explode( ',', $terms ) as $term ) {\r\n\t\t\t\t\t\t$the_term = get_term_by( 'slug', str_replace( ' ', '-', trim( $term ) ), $taxonomy_name );\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif( $the_term != false ) {\r\n\t\t\t\t\t\t\t$term_ids[] = $the_term->term_id;\r\n\t\t\t\t\t\t\t$term_ids_escape[] = '%d';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Append the filters to the SQL statement\r\n\t\t\tif( isset( $term_ids_escape ) && !empty( $term_ids_escape ) ) {\r\n\t\t\t\t$sql .= \"AND {$wpdb->terms}.term_id IN (\" . implode( ',', $term_ids_escape ) . \")\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$sql .= \"GROUP BY {$wpdb->posts}.ID\";\r\n\t\t\t\r\n\t\t\t$query = $wpdb->prepare( $sql, array_merge( (array) $post_types, (array) $term_ids ) );\r\n\t\t\t$results = $wpdb->get_results( $query, 'ARRAY_A' );\r\n\t\t\t\r\n\t\t\tforeach($results as $post) {\r\n\t\t\t\t$date_group = date( 'F Y', strtotime( $post['date'] ) );\r\n\t\t\t\t$post['source'] = 'wp';\r\n\t\t\t\t$posts[$date_group][] = $post;\r\n\t\t\t}\r\n\t\t\r\n\t\t\treturn $posts;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "static function extractPosts($page_no){\n\t\t$page_length=2;\n\t\t$db = (new Database())->connectToDatabase();\n\t\t$no_of_posts = $page_length*$page_no+$page_length;\n\t\t// echo $no_of_posts;\n\t\t$db->query(\"SELECT * FROM post ORDER BY timestamp DESC LIMIT $no_of_posts\");\n\t\t$result = $db->fetch_assoc_all();\n\t\t$rows_ret = $db->returned_rows;\n\n\t\t// print_r($result);\n\t\t//$result contains all results we want for specific page\n\t\t$low = $page_no*$page_length;\n\n\t\t$high = $low+$page_length;\n\t\t// echo 'low'.$low.' high '.$high.' rows '.$rows_ret.'<br>';\n\t\t$results_to_send = array();\n\t\t$count = 0;\n\t\tfor($i=$low;($i<$high)&&($i<$rows_ret);$i++){\n\t\t\t// echo $result[$i]['post_id'];\n\t\t\t// echo '<br>';\n\t\t\t\n\t\t\t$count++;\n\t\t\t\n\t\t\t$total_votes = Post::calculateVotes($result[$i]['post_id']);\n\t\t\t\n\t\t\t$tags = Post::extractTags($result[$i]['post_id']);\n\t\t\t\n\t\t\t$answers = Post::extractAnswers($result[$i]['post_id']);\n\t\t\t\n\t\t\t$comments=Post::extractComments($result[$i]['post_id']);\n\t\t\n\t\t\t$ques = new Post($result[$i]['post_id'],$result[$i]['title'],$result[$i]['description'],$answers,$comments,$result[$i]['user_name'],$total_votes,$tags,$result[$i]['timestamp'],$result[$i]['closed'],NULL);\n\t\t\tarray_push($results_to_send, $ques);\n\t\t\t\t\n\t\t}\n\t\tif($count==0){\n\t\t\treturn array(\"status_code\"=>204,\"detail\"=>\"No more content\");\n\t\t}\n\t\tarray_push($results_to_send);\n\t\treturn $results_to_send;\n\t\t\n\n\t}", "public function get_all_posts() : array {\n\t\treturn $this->posts;\n\t}", "public function getPosts(Request $request)\n {\n // Get featured post\n $featuredPost = BlogPost::where([\n ['status', '=', 'PUBLISHED'],\n ['featured', '=', '1'],\n ])->whereDate('published_date', '<=', Carbon::now())\n ->orderBy('created_at', 'desc')\n ->first();\n $featuredPostId = $featuredPost ? $featuredPost->id : 0;\n\n // Get all posts\n $posts = BlogPost::where([\n ['status', '=', 'PUBLISHED'],\n ['id', '!=', $featuredPostId],\n ])->whereDate('published_date', '<=', Carbon::now())\n ->orderBy('created_at', 'desc')\n ->paginate(12);\n return $this->makeResponse($request, \"{$this->viewPath}::modules/posts/posts\", [\n 'featuredPost' => $featuredPost,\n 'posts' => $posts,\n ], BlogPostResource::collection($posts->load('authorId'))->additional(['meta' => [\n 'featuredPost' => ($featuredPost) ? new BlogPostResource($featuredPost): [],\n ]]));\n }", "function getPosts()\r\n\t{\r\n\t\t$db = pg_connect( 'dbname=thedarkvortex user=thedarkvortex_web password=JXEC:hu=3=N9rTZkQ8T#H%xl?fR-Ww' );\r\n\t\t$r = pg_query( $db, 'SELECT * FROM website.blog_posts ORDER BY \"created\" DESC;' );\r\n\t\t\r\n\t\t$retVal = array();\r\n\t\twhile( $row = pg_fetch_assoc($r) ) {\r\n\t\t\t$retVal[] = $row;\r\n\t\t}\r\n\t\treturn $retVal;\r\n\t}", "function getPosts($posts_per_page, $type){\r\n $paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1;\r\n // query ultimo trabajo\r\n $args = array(\r\n 'post_type'=> $type,\r\n 'posts_per_page' => $posts_per_page,\r\n 'order'=>'DESC',\r\n 'orderby'=> 'date',\r\n 'paged' => $paged\r\n );\r\n $posts = new WP_Query($args);\r\n return $posts;\r\n }", "public function index()\n {\n $posts = Post::paginate(15);\n return $posts;\n }", "public function pages() {\n\t\t// Build the MindTouch API URL to fetch the pages.\n\t\t$url = \"pages\";\n\n\t\t// Get output from API.\n\t\t$output = $this->get($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function posts()\n\t{\n\t\t//To do : Blog Posts by Category, Author, tags\n\n\t\t$wheres = $this->checkInputData(array('category_id', 'id', 'author_id', 'tag'));\n\n\t\t$before_after = $this->checkInputData(array('after_id', 'before_id', 'since', 'until'));\n\n\t\t$limit = (Input::get('limit')) ?: 0;\n\n\t\t$offset = (Input::get('offset')) ?: 0;\n\n\t\tif (empty($wheres) and empty($before_after)) {\n\n\t\t\t$blog = Provider::allPublicPosts($limit, $offset);\n\n\t\t} else {\n\n\t\t\tif (!empty($wheres)) {\n\t\t\t\t$conditions['wheres'] = $wheres;\n\t\t\t}\n\n\t\t\tif (!empty($before_after)) {\n\t\t\t\t$conditions['before_after'] = $before_after;\n\t\t\t}\n\n\t\t\t$blog = Provider::getPostsBy($conditions, $limit, $offset);\n\n\t\t}\n\n\t\t$data = $this->transform($blog);\n\n\t\treturn Response::json(array(\n\t\t\t'total_items' => count($data),\n\t\t\t'type'\t\t => 'posts',\n\t\t\t'items'\t\t => $data\n\t\t));\n\n\t}", "public function getAllPost()\n {\n return Post::get();\n }", "private function getAllPostsData(){\n\t\tglobal $wpdb;\n\n\t\tif( empty ( $this->posts ) ){\n\t\t\t$posts = wp_cache_get( 'pi_all_posts', 'post' );\n\t\t\tif( ! is_array( $posts ) ){\n\t\t\t\t$posts = $wpdb -> get_results( \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' LIMIT 100\", ARRAY_A );\n\t\t\t\twp_cache_set( 'pi_all_posts', $posts, 'post', 120);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$posts = $this -> posts;\n\t\t}\n\n\t\treturn $posts;\n\n\t}", "private function getPosts(){\n $posts = DB::connection('mysql')->select('\n SELECT e.title, eu.titleURL, e.teaser, Date_Format(e.publishAt, \"%b %e, %Y\") AS publishDate,\n c.name AS categoryName, cu.name AS categoryURL,\n count(distinct(ed.id)) AS discussionCount,\n fsp.squareURL AS imageURL, fsp.title AS imageTitle,\n group_concat(DISTINCT concat(\"<a href=\\'/category/\", cu.name ,\"\\'>\", c.name, \"</a>\")) AS categoryNames\n FROM entries e\n INNER JOIN entryurls eu ON eu.entryId = e.id AND eu.isActive = 1 AND eu.deletedAt IS NULL\n LEFT JOIN entrycategories ec ON ec.entryId = e.id AND ec.deletedAt IS NULL\n LEFT JOIN categories c ON c.id = ec.categoryId\n LEFT JOIN categoryurls cu ON cu.categoryId = c.id AND cu.isActive = 1 AND cu.deletedAt iS NULL\n LEFT JOIN entrydiscussions ed ON ed.entryId = e.id AND ed.deletedAt IS NULL\n LEFT JOIN entryflickrsets efs ON efs.entryId = e.id AND efs.deletedAt IS NULL\n LEFT JOIN flickrsets fs ON fs.id = efs.flickrSetId AND fs.deletedAt IS NULL\n LEFT JOIN flickrcollections fc ON fc.id = fs.flickrCollectionid AND fc.deletedAt IS NULL\n LEFT JOIN flickrsetphotos fsp ON fsp.flickrSetId = fs.id AND fsp.deletedAt IS NULL\n WHERE e.deletedAt IS NULL\n GROUP BY e.id\n ORDER BY e.publishAt desc\n LIMIT 10');\n\n return $posts;\n }", "public function findAllPublishedPosts()\n {\n $posts = [];\n $query = \"\"\n . \"SELECT post.*, user.name as author \"\n . \"FROM post \"\n . \"LEFT JOIN user ON post.id_user = user.id \"\n . \"WHERE status > 0 \"\n . \"ORDER BY post.date_created DESC\";\n $result = $this->db->query($query);\n if ($result) {\n // Cycle through results\n while ($row = $result->fetch_assoc()) {\n $posts[] = [\n 'id' => $row['id'],\n 'title' => $row['title'],\n 'content' => $row['content'],\n 'author' => $row['author'],\n 'id_user' => $row['id_user'],\n 'date_created' => $row['date_created'],\n 'tags' => '' //$row['firstname']\n ];\n }\n // Free result set\n $result->close();\n } else {\n echo($this->db->error);\n }\n return $posts;\n }", "public function getAllPosts() \n\t{\n $q = \"SELECT * FROM in_posts\";\n $ps = $this->execute($q);\n $result = $this->getDataRowsAsObjects($ps, 'Post');\n return $result;\n }", "function posts($page)\n\t{\n\t\t// constant defined in config/constants.php\n\t\t$postOffset = $page * POSTS_PER_PAGE;\n\t\t// how many results do we want and where in the result set do we want\n\t\t// them to start? If there are 50 posts, then for, e.g., Page 3, we\n\t\t// want select 20 (current value of POSTS_PER_PAGE) AFTER the first\n\t\t// 40 (2 previous pages * POSTS_PER_PAGE)\n\t\t$this->db->limit(POSTS_PER_PAGE,$postOffset);\n\t\t$res = $this->db->get($this->posts_table);\n\t\t// if there are no posts in the database, then send back false\n\t\t// we'll test for this in the view to display a 'No Posts' message\n\t\tif ($res->num_rows() == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t$posts = array();\n\t\tforeach ($res->result() as $row) {\n\t\t\t$posts[] = $row;\n\t\t}\n\t\treturn $posts;\n\t}", "public function getPosts()\r\n\t{\r\n\t\t$jsonData = $this->getAll();\r\n\r\n\t\treturn $jsonData;\r\n\t}", "public function getPosts()\n {\n $query = self::find()->published();\n return new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => self::PAGE_SIZE,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'created_at' => SORT_DESC,\n 'sort' => SORT_ASC,\n ]\n ]\n ]);\n }", "public function getPublishedPosts(){\n $query = \"SELECT * FROM `posts` WHERE `published`='1';\";\n $result = $this->executeQuery($query);\n $result = $result->fetchAll();\n\n if($result != null && count($result)>0){\n return $result;\n } else {\n return null;\n }\n }", "public function actionPages()\n {\n $searchModel = new PostSearchPages();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n\n return $this->render('pages/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function allblogpostsActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla posts i databasen\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = <<<EOD\nSELECT\n *,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%dT%TZ') AS published_iso8601,\n DATE_FORMAT(COALESCE(updated, published), '%Y-%m-%d') AS published\nFROM content\nWHERE type=?\nORDER BY published DESC\n;\nEOD;\n $resultset = $db->executeFetchAll($sql, [\"post\"]);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/allblogposts\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function getPosts() {\n $db = $this->dbConnect();\n $req = $db->query('SELECT id, title, content, DATE_FORMAT(creation_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS creation_date_fr FROM posts ORDER BY creation_date DESC');\n return $req;\n }", "public function getAllPosts(){\n $sql = 'SELECT * FROM userposts LIMIT 100';\n $entries = self::query($sql);\n return $entries;\n }", "protected function _get_posts()\n {\n $posts = array();\n if ($handle = opendir('posts')) {\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n $file = explode(\".\", $entry);\n $post_name = $file[0];\n $post = array();\n $post['filename'] = $entry;\n $post['name'] = $post_name;\n $url = \"/posts\";\n $words = explode('-', $post_name);\n foreach ($words as $word) {\n $url .= '/';\n $url .= $word;\n }\n $post['url'] = $url;\n $post['title'] = $words[count($words) - 1];\n $tmp = $this->_get_post($entry);\n $post = array_merge($post, $tmp);\n $posts[$post_name] = $post;\n }\n }\n closedir($handle);\n }\n krsort($posts);\n return $posts;\n }", "function transfer_pages() {\n\tglobal $post;\n\t$args = [\n\t\t'post_type' => 'page',\n\t\t'posts_per_page' => -1,\n\t\t'post_status' => 'any',\n\t\t'meta_key' => '_cfct_build_data_backup',\n\t\t'meta_compare' => 'NOT EXISTS',\n\t];\n\n\t$posts = get_posts($args);\n\n\tvar_dump(count($posts));\n\n\t$i = 0;\n\tforeach ($posts as $post) {\n\t\tsetup_postdata($post);\n\t\tvar_dump($post->post_title);\n\t\ttransform_meta_to_elementor();\n\t\t$i++;\n\t\tif($i > 30)\n\t\t\tbreak;\n\t}\n\n\twp_reset_postdata();\n}", "protected function getPosts($limit = null)\n {\n $posts = $this->post->published()->latest()->take($limit)->get();\n\n foreach ($posts as $post)\n {\n Sitemap::addTag(\n route('posts.show', $post->slug),\n $post->updated_at,\n 'daily',\n '0.9'\n );\n }\n }", "public function indexPosts()\n {\n /**\n * The page\n *\n * @var integer\n */\n $page = Input::get('page', 0);\n $repo = App::make('Pulse\\Cms\\PostRepository');\n $posts = $repo->all($page);\n\n return $this->render('pulse::front.posts.index', compact('posts'));\n }", "function display_pages()\n {\n $this->Admin_model->procedure = 'GET_POST_PAGES';\n $rs = $this->Admin_model->get_post();\n $data['rows'] = $rs;\n $this->load->view('display_posts', $data);\n }", "function wv_wp_page_list() {\n\n $arglist = array(\n 'sort_order' => 'ASC',\n 'sort_column' => 'post_title',\n 'hierarchical' => 1,\n 'post_type' => 'page',\n 'post_status' => 'publish'\n );\n $mypages = get_pages($arglist);\n return $mypages;\n }", "function retrievePostsForMainPage(Request $request);", "public function index()\n {\n $post = Post::paginate(5);\n return postresource::collection($post);\n }", "static function get_serach_posts_or_page(){\n\t\t\n\t\tswitch ($_GET['pt']){\n\t\t\tcase 1 :\n\t\t\t\t$post_type = 'page';\n\t\t\t\tbreak;\n\t\t\tcase 2 :\n\t\t\t\t$post_type = 'post';\n\t\t\t\tbreak;\n\t\t\tdefault: \n\t\t\t\t$post_type = array('post', 'page');\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$tax_query = array();\n\t\tforeach(self::$taxonomies as $slug => $taxonomy){\n\t\t\tif(!empty($_GET[$slug]) && strlen($_GET[$slug]>0)){\n\t\t\t\t$tax_query[] = array(\n\t\t\t\t\t'taxonomy' => $slug,\n\t\t\t\t\t'field' => id,\n\t\t\t\t\t'terms' => array($_GET[$slug])\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$args = array(\n\t\t\t'post_type' => $post_type,\n\t\t\t'tax_query' => $tax_query\n\t\t);\n\n\t\t$args['tax_query']['relation'] = 'AND';\n\t\t\n\t\t//var_dump($args);\n\t\t\n\t\treturn new WP_Query($args);\n\t\t\n\t}", "public function get_posts() {\n $posts = self::get_rendered_posts();\n $json_data = json_encode($posts);\n header( 'Content-Type: application/json' );\n echo $json_data;\n }", "public function listPosts()\n {\n $query = $this->getPostsQuery();\n\n $this->handlePostFilters($query);\n\n $this->handleOrder($query);\n\n $posts = $query->paginate($this->resultsPerPage, $this->currentPage);\n\n $this->setPostUrls($posts);\n\n $this->posts = $posts;\n }", "function getPublishedPosts() {\n\t// use global $conn object in function\n\tglobal $conn;\n\t$sql = \"SELECT * FROM news ORDER BY date DESC\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\treturn $posts;\n}", "public function getBlogPostNav()\n {\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $BlogMapper = $dataMapper('BlogMapper');\n\n // Get posts\n $posts = $BlogMapper->getPosts();\n\n // Nest array by month\n $priorPosts = [];\n foreach ($posts as $post) {\n $priorPosts[(new \\DateTime($post->published_date))->format('Y-m')][] = $post;\n }\n\n return $priorPosts;\n }", "public function posts()\n {\n return $this->morphedByMany(\n Post::class,\n 'metable',\n 'metables',\n 'meta_id',\n );\n }", "public function index()\n {\n $post = Post::all();\n return PostsCollection::make($post);\n }", "public function get_posts($params) {\n\t\t$error = $this->_validate_capabilities(array('edit_posts'));\n\t\tif (!empty($error)) return $error;\n\n\t\t// check paged parameter; if empty set to defaults\n\t\t$paged = !empty($params['paged']) ? (int) $params['paged'] : 1;\n\t\t$numberposts = !empty($params['numberposts']) ? (int) $params['numberposts'] : 10;\n\t\t$offset = ($paged - 1) * $numberposts;\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => $numberposts,\n\t\t\t'paged' => $paged,\n\t\t\t'offset' => $offset,\n\t\t\t'post_type' => 'post',\n\t\t\t'post_status' => 'publish,private,draft,pending,future',\n\t\t);\n\n\t\tif (!empty($params['keyword'])) {\n\t\t\t$args['s'] = $params['keyword'];\n\t\t}\n\n\t\t$query = new WP_Query($args);\n\t\t$result = $query->posts;\n\n\t\t$count_posts = (int) $query->found_posts;\n\t\t$page_count = 0;\n\t\t\n\t\tif ($count_posts > 0) {\n\t\t\t$page_count = absint($count_posts / $numberposts);\n\t\t\t$remainder = absint($count_posts % $numberposts);\n\t\t\t$page_count = ($remainder > 0) ? ++$page_count : $page_count;\n\t\t}\n\t\t\n\t\t$info = array(\n\t\t\t'page' => $paged,\n\t\t\t'pages' => $page_count,\n\t\t\t'results' => $count_posts,\n\t\t\t'items_from' => (($paged * $numberposts) - $numberposts) + 1,\n\t\t\t'items_to' => ($paged == $page_count) ? $count_posts : $paged * $numberposts,\n\t\t);\n\n\t\t$posts = array();\n\t\tif (!empty($result)) {\n\t\t\tforeach ($result as $post) {\n\t\t\t\tarray_push($posts, array('ID' => $post->ID, 'title' => $post->post_title));\n\t\t\t}\n\t\t}\n\n\t\t$response = array(\n\t\t\t'posts' => $posts,\n\t\t\t'info' => $info\n\t\t);\n\t\treturn $this->_response($response);\n\t}", "public function fetchAllPost()\n {\n $posts = Post::All();\n $this->response['post'] = $this->postTransformer->transformCollection($this->getPostDetails($posts));\n\n return ($this->response);\n }", "public static function get_pages( $post_types = array() ) {\n\n\t\t\tif ( $post_types ) {\n\t\t\t\t$args = array(\n\t\t\t\t\t'post_type' => $post_types,\n\n\t\t\t\t\t// Query performance optimization.\n\t\t\t\t\t'fields' => 'ids',\n\t\t\t\t\t'no_found_rows' => true,\n\t\t\t\t\t'post_status' => 'publish',\n\t\t\t\t\t'posts_per_page' => -1,\n\t\t\t\t);\n\n\t\t\t\t$query = new WP_Query( $args );\n\n\t\t\t\t// Have posts?\n\t\t\t\tif ( $query->have_posts() ) :\n\n\t\t\t\t\treturn $query->posts;\n\n\t\t\t\tendif;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "function getPublishedPosts() {\n\t// use global $conn object in function\n\tglobal $conn;\n\t$sql = \"SELECT report.report_desc as decription ,report.image as img,report.created_at as createdat,users.user_name as uname FROM report INNER JOIN users on report.user_id = users.user_id WHERE report.published=true\";\n\t$result = mysqli_query($conn, $sql);\n\n\t// fetch all posts as an associative array called $posts\n\t$posts = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\treturn $posts;\n}", "public function get_posts() {\n\t\tif (!isset($this->_xml->posts)\n\t\t\t\t|| !isset($this->_xml->posts->post)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$posts_info = array();\n\t\tforeach ($this->_xml->posts->post as $post_node) {\n\t\t\t$post_attributes = $post_node->attributes();\n\n\t\t\t$current_post_info = array(\n\t\t\t\t'name' => (string) $post_attributes->name,\n\t\t\t\t'title' => (string) $post_attributes->title,\n\t\t\t\t'path' => '/Blog%20Posts/' . (string) $post_attributes->name,\n\t\t\t\t'status' => (string) $post_attributes->status,\n\t\t\t\t'content' => (string) $post_node->content,\n\t\t\t\t'styles' => (string) $post_node->styles,\n\t\t\t\t'pageHead' => (string) $post_node->pageHead\n\t\t\t);\n\n\t\t\tarray_unshift($posts_info, $current_post_info);\n\t\t}\n\t\treturn $posts_info;\n\t}", "public function posts()\n {\n return $this->morphedByMany(App\\Post::class, 'mediable');\n }", "protected function getPostFeed()\n {\n\n $postFeed = array();\n \n $sql = \"SELECT p.ID, p.post_image, p.post_author,\n p.post_date, p.post_modified, p.post_title,\n p.post_slug, p.post_content, p.post_type,\n p.post_status, u.user_login\n \t\t FROM posts AS p\n \t\t INNER JOIN users AS u ON p.post_author = u.ID\n \t\t WHERE p.post_type = 'blog' AND p.post_status = 'publish'\n \t\t ORDER BY p.ID DESC LIMIT 10\";\n \n $stmt = $this->dbc->query($sql);\n \n foreach ($stmt -> fetchAll() as $results) {\n \n $postFeed[] = $results;\n \n }\n \n return $postFeed;\n \n }", "public function postsActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla inlägg\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = \"SELECT * FROM content;\";\n $resultset = $db->executeFetchAll($sql);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/posts\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function grabAllPost()\n {\n // grab all the posts\n $allPost = $this->dbCon->query(\"SELECT search_info_content, search_info_year FROM search_info\");\n \n return $allPost;\n }", "public function readAllPosts()\r\n {\r\n \t\t\t$query = $this->bd->prepare(\"SELECT * FROM posts ORDER BY posts_ID DESC \");\r\n \t\t\t$query->execute();\r\n\r\n \t\t $result= $query->fetchAll();\r\n \t\t $posts= [];\r\n \t\t foreach ($result as $data) \r\n \t\t {\r\n \t\t \t$arrPosts = new Posts($data);\r\n \t\t \t$posts[] = $arrPosts;\r\n \t\t }\r\n \t\t return $posts;\r\n }", "public function showAllPosts()\n {\n $posts = \\Blog\\Models\\Posts::find();\n $dataPosts = [];\n foreach ($posts as $post) {\n $dataPosts[] = [\n 'id' => $post->getPostId(),\n 'date' => $post->getDate(),\n 'category' => $post->getCategory(),\n 'user_id' => $post->getUserId(),\n 'title' => $post->getTitle(),\n 'status' => $post->getStatus(),\n ];\n }\n return $dataPosts;\n }", "private function getPosts() {\r\n\t\t$this->getPostFiles();\r\n\t\tforeach($this->validposts as $post) { \r\n\t\t\t$xml = file_get_contents($this->post_dir.'/'.$post);\r\n\t\t\t$xml_obj = new SimpleXMLElement($xml);\r\n\t\t\t$postdate = (string)$xml_obj->postdate;\r\n\t\t\t$json = json_encode($xml_obj);\r\n\t\t\t$allposts[$postdate] = json_decode($json,TRUE);\r\n\t\t}\r\n\t\tkrsort($allposts);\r\n\t\treturn $allposts;\r\n\t}", "public function posts()\n {\n return $this->morphedByMany(Post::class, 'taggable', 'taxonomy_relationships')->withTimestamps();\n }", "public function getPosts()\n {\n return $this->hasMany(Post::class, ['fk_thread' => 'id'])->orderBy('id ASC');\n }", "public function index()\n {\n \n $posts = Post::orderBy('created_at', 'desc')->paginate(10);\n \n\n return $posts;\n }", "public function index()\n {\n $posts = Post::included()->filter()->sort()->getOrPaginate();\n // return $categories;\n return PostResource::collection($posts); //Para una o varias respuestas\n }", "public function index()\n {\n $posts = PostResource::collection(Post::orderByDesc('created_at')->whereIn('id', PostProfil::pluck('post_id')->all())->where('public', 0)->paginate(10));\n\n if ($posts) {\n return $posts;\n } else\n return response('No posts found', 440);\n }", "public function pages()\n {\n return $this->morphedByMany('App\\Page', 'imageable');\n }", "public function getPosts(Request $request)\n {\n $merchant = $this->merchantRepo->findBySubDomain($request->subDomain);\n\n $posts = $this->postRepo->findByMerchantId($merchant->id);\n\n return PostFullResource::collection($posts);\n }", "public function getPosts(Request $request)\n {\n $merchant = $this->merchantRepo->findBySubDomain($request->subDomain);\n\n $posts = $this->postRepo->findByMerchantId($merchant->id);\n\n return PostFullResource::collection($posts);\n }", "public function getPages()\n {\n return $this->pages;\n }", "public function getPages()\n {\n return $this->pages;\n }", "public function getPages()\n {\n return $this->pages;\n }", "public function get_posts()\n {\n $this->Friend_model->get_posts_model();\n }", "public function posts()\n {\n session_start();\n $posts = new PostManager;\n $resultat = $posts->getPosts(100);\n echo $this->getRender()->render('listPostsView.twig', [\n 'posts' => $resultat,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "public function getRelatedPosts() {}", "public static function getFeedItems()\n {\n return Post::where('published', true)->get();\n }", "public function getPosts($postType)\n {\n return get_posts([\n 'post_type' => $postType,\n 'numberposts' => -1\n ]);\n }", "public function ajax_get_posts() {\n\n\t\t// Get post type.\n\t\t$post_type = isset( $_GET['post_type'] ) ? $_GET['post_type'] : '';\n\t\tif ( ! empty( $post_type ) ) {\n\n\t\t\t// Get the posts.\n\t\t\t$posts = get_posts(\n\t\t\t\t[\n\t\t\t\t\t'post_type' => $post_type,\n\t\t\t\t\t'posts_per_page' => - 1,\n\t\t\t\t\t'post_status' => [ 'publish', 'future', 'draft', 'pending' ],\n\t\t\t\t\t'orderby' => 'title',\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t\t'suppress_filters' => true,\n\t\t\t\t]\n\t\t\t);\n\n\t\t\tif ( ! empty( $posts ) ) {\n\n\t\t\t\t// If we have a post ID and meta key, then get selected posts.\n\t\t\t\t$post_id = isset( $_GET['post_id'] ) ? $_GET['post_id'] : 0;\n\t\t\t\t$meta_key = isset( $_GET['meta_key'] ) ? $_GET['meta_key'] : '';\n\t\t\t\tif ( $post_id && $meta_key ) {\n\n\t\t\t\t\t// Get the selected posts.\n\t\t\t\t\t$selected_posts = get_post_meta( $post_id, $meta_key, false );\n\t\t\t\t\tif ( ! empty( $selected_posts ) ) {\n\n\t\t\t\t\t\t// Mark selected posts.\n\t\t\t\t\t\tif ( ! empty( $selected_posts ) ) {\n\t\t\t\t\t\t\tforeach ( $posts as $post ) {\n\t\t\t\t\t\t\t\t$post->is_selected = in_array( $post->ID, $selected_posts );\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\n\t\t\techo json_encode( $posts );\n\n\t\t} else {\n\t\t\techo json_encode( [] );\n\t\t}\n\n\t\twp_die();\n\t}", "public function index()\n {\n $posts = PostProvider::paginate();\n $links = PostProvider::links();\n\n return Viewer::make('posts.index', array('posts' => $posts, 'links' => $links));\n }", "public function getPagePosts($pageId = null, $options = array()) {\n if (empty($pageId)) $pageId = $this->settings['pageId'];\n $posts = $this->api(\"/$pageId/posts\", $options);\n return $posts;\n }", "public function index()\n {\n $posts = QueryBuilder::for(Post::class)\n ->allowedIncludes(['comments'])\n ->get();\n\n return PostGetResource::collection($posts);\n }", "public function for_posts_page() {\n\t\t$posts_page_id = (int) \\get_option( 'page_for_posts' );\n\t\tif ( $posts_page_id !== 0 ) {\n\t\t\t$indexable = $this->repository->find_by_id_and_type( $posts_page_id, 'post' );\n\n\t\t\tif ( ! $indexable ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn $this->build_meta( $this->context_memoizer->get( $indexable, 'Static_Posts_Page' ) );\n\t\t}\n\n\t\t$indexable = $this->repository->find_for_home_page();\n\n\t\tif ( ! $indexable ) {\n\t\t\treturn false;\n\t\t}\n\n\n\t\treturn $this->build_meta( $this->context_memoizer->get( $indexable, 'Home_Page' ) );\n\t}", "public function findAll()\r\n {\r\n $posts = [];\r\n $req = $this->connexion->connect()->prepare('SELECT id, title, content, DATE_FORMAT(dateposts, \\' % d /%m /%Y à % Hh % imin % ss\\') AS creation_date_fr FROM posts ORDER BY dateposts DESC LIMIT 0, 5');\r\n $req->execute();\r\n $datas = $req->fetchAll();\r\n foreach ($datas as $data) {\r\n $posts[] = new Article($data);\r\n }\r\n return $posts;\r\n\r\n }", "public function getPagesAction() {\n\n //FETCH\n $paramss = array();\n $paramss['title'] = $this->_getParam('text');\n $paramss['viewer_id'] = Engine_Api::_()->user()->getViewer()->getIdentity();\n $paramss['limit'] = $this->_getParam('limit', 40);\n $paramss['orderby'] = 'title ASC';\n $usersitepages = Engine_Api::_()->getDbtable('pages', 'sitepage')->getSuggestClaimPage($paramss);\n $data = array();\n $mode = $this->_getParam('struct');\n if ($mode == 'text') {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n } else {\n foreach ($usersitepages as $usersitepage) {\n $content_photo = $this->view->itemPhoto($usersitepage, 'thumb.icon');\n $data[] = array(\n 'id' => $usersitepage->page_id,\n 'label' => $usersitepage->title,\n 'photo' => $content_photo\n );\n }\n }\n return $this->_helper->json($data);\n }" ]
[ "0.79762226", "0.7587926", "0.7587926", "0.75838864", "0.7496552", "0.7429954", "0.7161099", "0.70881397", "0.70480144", "0.7034406", "0.7034406", "0.7034406", "0.6953173", "0.6936173", "0.6923194", "0.691767", "0.6909743", "0.68933684", "0.68912596", "0.68821144", "0.6879623", "0.68635267", "0.6860457", "0.68283546", "0.6819285", "0.6809118", "0.67971236", "0.67959327", "0.6736193", "0.6726039", "0.6724454", "0.6708856", "0.6675982", "0.6674401", "0.666733", "0.66508585", "0.6646934", "0.6637193", "0.6633559", "0.66309524", "0.6630355", "0.66219264", "0.661513", "0.66113985", "0.66094375", "0.65947485", "0.6582572", "0.6569802", "0.65652835", "0.65500015", "0.65302914", "0.6528331", "0.65156895", "0.65139043", "0.65127385", "0.65048146", "0.6493288", "0.64867234", "0.64714414", "0.6451897", "0.64515483", "0.6442885", "0.6419801", "0.6407806", "0.6407064", "0.6405283", "0.63687456", "0.63648385", "0.63573676", "0.6357055", "0.63510376", "0.63452876", "0.6342731", "0.6341553", "0.63342583", "0.6332191", "0.63310045", "0.63281965", "0.63200223", "0.6311918", "0.6308831", "0.6302751", "0.63019484", "0.6299555", "0.62979615", "0.62979615", "0.62931323", "0.62931323", "0.62931323", "0.62739724", "0.6256308", "0.6255401", "0.62470716", "0.6245324", "0.62372696", "0.62312067", "0.62308973", "0.62284464", "0.62266755", "0.62251526", "0.6224932" ]
0.0
-1
Get the item type that owns the item.
public function district() { return $this->belongsTo('App\DistrictOffice'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeOfItem()\n {\n return $this->type;\n }", "public function getTipoItem()\n {\n return $this->tipo_item;\n }", "protected function _getItemType()\n {\n return $this->getItemType()\n ? $this->getItemType()\n : $this->getConfig()->getDefaultItemType($this->getStoreId());\n }", "public function getGwItemType()\n {\n return $this->itemType;\n }", "public function type(): string\n {\n return $this->item['type'];\n }", "public function get_type() {\n\t\treturn isset( $this->item['type'] ) ? esc_attr( $this->item['type'] ) : false;\n\t}", "public function get_item_type() {\n $query = $this->db->get('item_type');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }", "public function getItemType(): ?QNameType\n {\n return $this->itemTypeAttr;\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 }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->type()->getID();\n }", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "public function getType()\n\t{\n\t\treturn $this->getObject('type', null, 'type');\n\t}", "public function get_type() {\n return $this->_type;\n }", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "function getType() {\n\t\treturn $this->_type;\n\t}", "final protected function get_type() {\n return $this->type;\n }", "public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}", "public function getItemId()\n\t{\n\t\treturn $this->getTypeId();\n\t}", "public function getContentType()\n {\n return $this->item['type'];\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function get_type() {\n return $this->type;\n }", "function getType() {\n\t\treturn $this->_Type;\n\t}", "public function get_type() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n return $this->_type;\n }", "public function getType() {\n return $this->_type;\n }", "public function getType()\r\n {\r\n return $this->m_type;\r\n }", "public function getType()\n {\n return $this->type = $this->get()->post_type;\n }", "public function getItemViewType(): string\n {\n return $this->itemViewType;\n }", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public function getType()\r\n {\r\n return $this->_type;\r\n }", "public function getType()\n\t{\n\t\t$type = $_GET['type'];\n\t\t$validTypes = array(CAuthItem::TYPE_OPERATION, CAuthItem::TYPE_TASK, CAuthItem::TYPE_ROLE);\n\t\tif( in_array($type, $validTypes)===true )\n\t\t\treturn $type;\n\t\telse\n\t\t\tthrow new CException(Rights::t('core', 'Invalid authorization item type.'));\n\t}", "public function getType()\n {\n return $this->getProperty('type');\n }", "function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n return $this->shareData[\"type\"];\n }", "function getType () {\n\t\treturn $this->type;\n\t}", "public function getType()\n {\n return $this->factory->resolveType($this);\n }", "public function type()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_Type;\n }", "public function getProductType() {\n return $this->item->getProductType();\n }", "function getType() { \n\t\treturn $this->_type; \n\t}", "public function type() {\n\t\t\treturn $this->_type;\n\t\t}", "public function get_type(){\n\t\treturn $this->_type;\n\t}", "static function GetItemType() { return \"\"; }", "public function getType()\n\t\t{\n\t\t\treturn $this->type;\n\t\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType()\n {\n\t\treturn $this->rules->getFirstItem()->getType();\n\t}", "function getType() { return $this->_type; }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }" ]
[ "0.82205683", "0.73993444", "0.737449", "0.7168789", "0.7143061", "0.711147", "0.6937231", "0.68404543", "0.66264707", "0.66264707", "0.66264707", "0.6625296", "0.6625296", "0.6625296", "0.6625296", "0.6625296", "0.6625296", "0.6625296", "0.6625296", "0.6625296", "0.6625296", "0.65498483", "0.65405804", "0.6528844", "0.6520487", "0.65057683", "0.6502615", "0.64805835", "0.6478792", "0.6447765", "0.6444506", "0.64329404", "0.64329404", "0.64329404", "0.64329404", "0.64329404", "0.64329404", "0.64329404", "0.6419363", "0.6418694", "0.6418329", "0.6413166", "0.6413166", "0.64036304", "0.64016217", "0.6396516", "0.6381181", "0.6381181", "0.6371688", "0.6366064", "0.6364035", "0.6362395", "0.63594264", "0.63586974", "0.6356448", "0.63540465", "0.6340455", "0.63342845", "0.6332215", "0.63227606", "0.6321393", "0.63197106", "0.63190013", "0.63189894", "0.63189894", "0.63189894", "0.63189894", "0.6312977", "0.63076735", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575", "0.63064575" ]
0.0
-1
Get the item type that owns the item.
public function central() { return $this->belongsTo('App\CentralOffice'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeOfItem()\n {\n return $this->type;\n }", "public function getTipoItem()\n {\n return $this->tipo_item;\n }", "protected function _getItemType()\n {\n return $this->getItemType()\n ? $this->getItemType()\n : $this->getConfig()->getDefaultItemType($this->getStoreId());\n }", "public function getGwItemType()\n {\n return $this->itemType;\n }", "public function type(): string\n {\n return $this->item['type'];\n }", "public function get_type() {\n\t\treturn isset( $this->item['type'] ) ? esc_attr( $this->item['type'] ) : false;\n\t}", "public function get_item_type() {\n $query = $this->db->get('item_type');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }", "public function getItemType(): ?QNameType\n {\n return $this->itemTypeAttr;\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 }", "public function getType()\n {\n return $this->get(self::_TYPE);\n }", "public function getType()\n {\n return $this->type()->getID();\n }", "function _get_type() {\n\t\treturn $this->type();\n\n\t}", "public function getType()\n\t{\n\t\treturn $this->getObject('type', null, 'type');\n\t}", "public function get_type() {\n return $this->_type;\n }", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "function getType() {\n\t\treturn $this->_type;\n\t}", "final protected function get_type() {\n return $this->type;\n }", "public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}", "public function getItemId()\n\t{\n\t\treturn $this->getTypeId();\n\t}", "public function getContentType()\n {\n return $this->item['type'];\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_type;\n }", "public function get_type() {\n return $this->type;\n }", "function getType() {\n\t\treturn $this->_Type;\n\t}", "public function get_type() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n return $this->_type;\n }", "public function getType() {\n return $this->_type;\n }", "public function getType()\r\n {\r\n return $this->m_type;\r\n }", "public function getType()\n {\n return $this->type = $this->get()->post_type;\n }", "public function getItemViewType(): string\n {\n return $this->itemViewType;\n }", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public function getType()\n\t{\n\t\treturn $this->_type;\n\t}", "public function getType()\r\n {\r\n return $this->_type;\r\n }", "public function getType()\n\t{\n\t\t$type = $_GET['type'];\n\t\t$validTypes = array(CAuthItem::TYPE_OPERATION, CAuthItem::TYPE_TASK, CAuthItem::TYPE_ROLE);\n\t\tif( in_array($type, $validTypes)===true )\n\t\t\treturn $type;\n\t\telse\n\t\t\tthrow new CException(Rights::t('core', 'Invalid authorization item type.'));\n\t}", "public function getType()\n {\n return $this->getProperty('type');\n }", "function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n return $this->shareData[\"type\"];\n }", "function getType () {\n\t\treturn $this->type;\n\t}", "public function getType()\n {\n return $this->factory->resolveType($this);\n }", "public function type()\n {\n return $this->_type;\n }", "public function getType()\n {\n return $this->_Type;\n }", "public function getProductType() {\n return $this->item->getProductType();\n }", "function getType() { \n\t\treturn $this->_type; \n\t}", "public function type() {\n\t\t\treturn $this->_type;\n\t\t}", "public function get_type(){\n\t\treturn $this->_type;\n\t}", "static function GetItemType() { return \"\"; }", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType() {\n\t\treturn $this->type;\n\t}", "public function getType()\n\t\t{\n\t\t\treturn $this->type;\n\t\t}", "public function getType()\n {\n\t\treturn $this->rules->getFirstItem()->getType();\n\t}", "function getType() { return $this->_type; }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }", "public function getType()\n {\n return $this->type;\n }" ]
[ "0.821994", "0.7398939", "0.73722017", "0.71682596", "0.71430695", "0.7111213", "0.69357187", "0.6839211", "0.6625035", "0.6625035", "0.6625035", "0.6623865", "0.6623865", "0.6623865", "0.6623865", "0.6623865", "0.6623865", "0.6623865", "0.6623865", "0.6623865", "0.6623865", "0.65491223", "0.6539943", "0.6527437", "0.65197426", "0.650579", "0.65023065", "0.6479824", "0.64782095", "0.64483327", "0.6443914", "0.64319426", "0.64319426", "0.64319426", "0.64319426", "0.64319426", "0.64319426", "0.64319426", "0.6418333", "0.64182276", "0.6417229", "0.64123064", "0.64123064", "0.6401863", "0.64004123", "0.63959575", "0.63800925", "0.63800925", "0.63708204", "0.63662523", "0.63633513", "0.63621193", "0.6360094", "0.6358556", "0.63543934", "0.63535726", "0.63393295", "0.6333085", "0.63323367", "0.6322063", "0.63210213", "0.63209885", "0.63180625", "0.63180625", "0.63180625", "0.63180625", "0.63177204", "0.63116515", "0.630854", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496", "0.6305496" ]
0.0
-1
/ Get office with admin
public static function getOfficesWithAdmin(){ $offices = self::all(); if(count($offices) > 0 ){ foreach($offices as $office){ $where = ['unit_id'=>$office->id,'role'=>3]; $office->head = TermRelation::findMyAdmin($where); $office->office_name = $office->unit_name; } } return $offices; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getoffice()\n {\n return $this->office;\n }", "public function getOffice(){\r\n\t\t\treturn $this->office;\r\n\t\t}", "public function getOffice()\n {\n return $this->hasOne(MsOffice::className(), ['id' => 'office_id']);\n }", "public function show(Office $office)\n {\n //\n }", "public function show(Office $office)\n {\n //\n }", "public function getAllOfficeEmployers();", "public function index()\n {\n $offices = Office::query()\n ->where('approval_status', Office::APPROVAL_APPROVED)\n ->where('hidden', false)\n ->when(request('user_id'), fn($builder) => $builder->whereUserId(request('user_id')))\n ->when(request('visitor_id'), \n fn(Builder $builder) \n => $builder->whereRelation('reseravations', 'user_id', '=', request('visitor_id')))\n ->latest('id')\n ->when(\n request('lat') && request('lng'),\n fn($builder) => $builder->nearestTo(request('lat'), request('lng')),\n fn($builder) => $builder->orderBy('id', 'ASC')\n )\n ->with(['images', 'tags', 'user'])\n ->withCount(['reservations' => fn ($builder) => $builder->where('status', Reservation::STATUS_ACTIVE)])\n ->paginate(20);\n\n return OfficeResource::collection(\n $offices\n );\n }", "public function office(){\n \n return view('sarana.office');\n }", "public function getOffice()\n {\n return $this->hasOne(Office::class, ['row_id' => 'office_id']);\n }", "public function getAdministrator() {\n\n return database::getInstance()->select('staff',\"*\");\n\n\n }", "function getHouseholdAdmin(){\n\t\t$members = $this->getMembers();\n\t\tforeach ($members as $member) {\n\t\t\t$level = $member->getUserLevel();\n\t\t\tif($level == 'admin'){\n\t\t\t\t$admin = $member;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $admin;\n\t}", "public function index()\n {\n //$allStaff = Staff::all();\n\n\n $office = EloquentUser::find(Sentinel::getUser()->id)->office; //GET OFFICE OF MANAGER LOGGED IN\n $allStaff = Office::find($office->id)->staff; //GET ALL STAFF OF OFFICE OF MANAGER LOGGED IN\n return view('manager.staff.index')->with('allStaff',$allStaff);\n }", "public function show(Office $office)\n {\n return response()->json($office);\n\n }", "public function getAdministrator() {}", "public function GetAdmin ();", "public function getAdmin() {\n $sql = \"SELECT *\n FROM {$this->tablename} p\n WHERE p.status='admin'\";\n return $this->db->query($sql)->single($this->entity);\n }", "public function edit(Office $office)\n {\n //\n }", "public static function get_admins();", "public function index()\n {\n return view('admin.office.index');\n }", "public function index()\n {\n //\n $offices = Office::all();\n return view('officeCRUD.index', compact('offices'));\n\n }", "public function getOfficeLocation()\n {\n return $this->getProperty(\"OfficeLocation\");\n }", "function dsp_single_office_info()\n {\n $VIEW_DATA['arr_single_office_info'] = $this->model->qry_single_office_info();\n $this->view->render('dsp_single_office_info',$VIEW_DATA);\n }", "function printToolAdmin() {\r\n $criteria = array('status' => Appeal::$STATUS_AWAITING_ADMIN);\r\n return printAppealList($criteria);\r\n}", "function admin_office($product_id = null) {\n\t if (!$product_id) {\n\t $this->Session->setFlash(__('Invalid product', true));\n\t $this->redirect(array(\n\t 'controller' => 'products',\n\t 'action' => 'index'\n\t ));\n }\n\n if (!empty($this->data)) {\n $this->ProductInfo->create();\n if ($this->ProductInfo->save($this->data)) {\n $this->Session->setFlash(__('Product info has been saved', true));\n\t $this->redirect(array(\n\t 'controller' => 'product_infos',\n\t 'action' => 'office',\n\t 'product_id' => $product_id\n\t ));\n }\n } else {\n $this->data = $this->ProductInfo->find('first', array(\n 'conditions' => compact('product_id')\n ));\n }\n\n\t $product = $this->ProductInfo->Product->read(array('id', 'title'), $product_id);\n\t if (!$product) {\n\t $this->Session->setFlash(__('Invalid product', true));\n\t $this->redirect(array(\n\t 'controller' => 'products',\n\t 'action' => 'index'\n\t ));\n }\n $paths = $this->ProductInfo->Product->getPath($product_id, array('id', 'parent_id', 'title'), -1);\n\t\t$isOffice = \"active\";\n $isDetail = $isGallery = $isTabs = $isRatings = $isServices = \"\";\n $this->set(compact(\n 'isDetail', 'isOffice', 'isGallery', 'isTabs', 'isRatings', 'isServices',\n 'product', 'product_id',\n 'paths'\n ));\n\t}", "public function show($id)\n {\n //\n \n \n $office = office::find($id);\n return view('officeCRUD.show',compact('office'));\n }", "function dsp_all_office_info()\n {\n $VIEW_DATA['arr_all_office_info'] = $this->model->qry_all_office_info();\n $this->view->render('dsp_all_office_info',$VIEW_DATA);\n }", "public function index()\n {\n \n\n // $medics = (auth()->user()->offices->count()) ? auth()->user()->offices->first()->users : [];\n $office = auth()->user()->offices->first();\n\n $medics = $this->medicRepo->findAllByOffice($office->id);\n\n if(request('medic'))\n $medic = $this->medicRepo->findById(request('medic'));\n else\n $medic = null;\n \n return view('clinic.agenda.index',compact('medics','medic','office'));\n\n\n }", "public function getOGAdminID();", "function get_admin()\n {\n return DB::table(\"admin_tbl\")->get();\n }", "public function showOfficeImages()\n {\n $officeImages = $this->service->getOfficeImages();\n\n return view('admin.office.showimages',['officeImages' => $officeImages]);\n }", "public function index()\n {\n $invlocations = InvLocation::getAllInvLocation();\n return InvLocationResource::collection($invlocations);\n }", "function update_office_info()\n {\n $this->model->update_office_info();\n }", "public function getAdmin()\n {\n return $this->admin;\n }", "public function getOfficeT()\n {\n return $this->office_t;\n }", "public static function officeIds()\n {\n return collect([\n AdminOffice::all()->first()->office_id,\n Auth::user()->office_id,\n ])->unique();\n }", "public function getAdmin()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true) {\n $this->_f3->set('admin', $admin);\n }\n }", "public function show($id)\n {\n if (!empty($id)) {\n $officeDetails = $this->service->getDetailsById($id);\n\n return view('admin.office.show', ['office' => $officeDetails]);\n }\n\n return redirect(route('office.list'));\n }", "function getAdmin() {\n return mysqli_query($this->link, \"SELECT * from account where position = 0\");\n }", "public function getAdmin(){\n $sql =\"SELECT * from admin INNER JOIN country on admin.admin_country=country.countryID \";\n \n $result = $this->db->query($sql);\n \n \n if($result->num_rows > 0){\n while($row = $result->fetch_assoc()){\n $data[] = $row;\n }\n }\n return !empty($data)?$data:false;\n }", "function Ephemerids_admin_view()\n{\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing. However,\n // in this case we had to wait until we could obtain the item name to\n // complete the instance information so this is the first chance we get to\n // do the check\n if (!pnSecAuthAction(0, 'Ephemerids::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n $startnum = pnVarCleanFromInput('startnum');\n\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Ephemerids');\n\n\t// As Admin output changes often, we do not want caching.\n\t$pnRender->caching = false;\n\n // The user API function is called. This takes the number of items\n // required and the first number in the list of all items, which we\n // obtained from the input and gets us the information on the appropriate\n // items.\n $items = pnModAPIFunc('Ephemerids',\n 'user',\n 'getall',\n array('startnum' => $startnum,\n 'numitems' => pnModGetVar('Ephemerids',\n 'itemsperpage')));\n\n $ephemerids = array();\n if(isset($items) && is_array($items)) {\n foreach ($items as $item) {\n\n $row = array();\n\n if (pnSecAuthAction(0, 'Ephemerids::', \"$item[content]::$item[eid]\", ACCESS_READ)) {\n \n // Options for the item. Note that each item has the appropriate\n // levels of authentication checked to ensure that it is suitable\n // for display\n $options = array();\n if (pnSecAuthAction(0, 'Ephemerids::', \"$item[content]::$item[eid]\", ACCESS_EDIT)) {\n $options[] = array('url' => pnModURL('Ephemerids', 'admin', 'modify', array('eid' => $item['eid'])),\n 'title' => _EDIT);\n if (pnSecAuthAction(0, 'Ephemerids::', \"$item[content]::$item[eid]\", ACCESS_DELETE)) {\n $options[] = array('url' => pnModURL('Ephemerids', 'admin', 'delete', array('eid' => $item['eid'])),\n 'title' => _DELETE);\n }\n }\n $item['options'] = $options;\n $ephemerids[] = $item;\n\t\t\t}\n }\n }\n $pnRender->assign('ephemerids', $ephemerids);\n\n // Assign the values for the smarty plugin to produce a pager in case of there\n // being many items to display.\n //\n // Note that this function includes another user API function. The\n // function returns a simple count of the total number of items in the item\n // table so that the pager function can do its job properly\n\t$pnRender->assign('pager', array('numitems' => pnModAPIFunc('Ephemerids', 'user', 'countitems'),\n\t 'itemsperpage' => pnModGetVar('Ephemerids', 'itemsperpage')));\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('ephemerids_admin_view.htm');\n}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM office';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function index()\n {\n //\n return EstabelecimentoSaudeResource::collection(EstabelecimentoSaude::get());\n }", "public function authorize()\n {\n return $this->user('office')->isActive();\n }", "public static function getAdminList()\n {\n \t$type = \"text/html\";\n \t$terms = array(\n \t\t\t'isapproved' => 1\n \t);\n \t$data = self::getListByFilter($terms);\n \n \treturn response()->view('adminlist', [ 'data' => $data, 'isadmin' => self::isAdmin()])->header('Content-Type', $type);\n }", "public function getAdmin($id)\n {\n return $this->user->where('salon_id',$id)->first();\n }", "public function index()\n {\n return view('office.index');\n }", "public function index()\n { \n \n return view('office.index');\n }", "public function index()\n {\n return EtatsDoccupation::getEtatFromTypeAndOccupation(1, '0');\n }", "public function getActSchoolAdminPerson() {\n return $this->dataBase->getEntry('person',\"role like '%admin%' and classID=\".$this->getStafClassBySchoolId(getActSchoolId())[\"id\"]);\n }", "public function getIdoffice0()\n {\n return $this->hasOne(Office::className(), ['idoffice' => 'idoffice']);\n }", "public function get_list_admin()\n {\n $this->db->where('type', 1);\n $query = $this->db->get('user');\n return $query->result();\n }", "function adminIndex(){\r\n\t\t$data = $this->paginate('AdminBooking');\r\n\t\t$this->set(compact('data'));\r\n\t}", "public function admin() {\n return $this->teachers()->where('role', '=', User::SCHOOL_ADMIN)->first();\n }", "public function getAdmin() {\n \n return $this->admin;\n }", "public function central()\n {\n return $this->belongsTo('App\\CentralOffice');\n }", "public function searchAdmin()\n {\n $this->connect();\n $bind = $this->bind($this->conn);\n $filter = sprintf($this->to_filter_admin, $this->login);\n if ($this->to_get_type_admin == 'string') {\n $wanted = array($this->to_get_admin);\n }\n if ($this->to_get_type_admin == 'array') {\n $to_get_array = explode(',', $this->to_get_admin);\n }\n $sr = ldap_search($this->conn, $this->dn, $filter, $wanted);\n $sr_res = ldap_get_entries($this->conn, $sr);\n $result = $sr_res;\n ldap_close($this->connect());\n\n return $result;\n }", "public function documento()\n {\n if (auth()->user()->hasRole('Administrador')) {\n \n $roles = Role::get(); \n $documentos = Documentos::get();\n return view ('admin.iglesias.documentos.index', compact('documentos','roles'));\n }\n $roles = Role::get();\n $documentos = Documentos::where('user_id', auth()->user()->id)->get();\n return view ('admin.iglesias.documentos.index', compact('documentos','roles'));\n \n }", "function getOGRole();", "function getOGRole();", "public function indexAdmin()\n\t{\n\t\treturn ResourcesWorks::collection(Works::all());\n\t}", "function current_admin()\n {\n return admin_auth()->user();\n }", "public function existingAdminList()\n {\n $groceries = $this->getList();\n return $this->renderExistingAdminList($groceries);\n }", "public function officeAction() {\n try {\n if ($this->getRequest()->isPost()) {\n\n $post = $this->getRequest()->getPost();\n $storeId = (int)$this->getRequest()->getParam('store_id', 0);\n if ($storeId <= 0) {\n throw new Exception('Store ID must be supplied');\n }\n $url = $this->getUrl('balticode_postoffice/adminhtml_postoffice/office', array('store_id' => $storeId, '_secure' => true));\n $addressId = $post['address_id'];\n $carrierCode = $post['carrier_code'];\n $carrierId = $post['carrier_id'];\n $divId = $post['div_id'];\n $groupId = isset($post['group_id']) ? ((int) $post['group_id']) : 0;\n $placeId = isset($post['place_id']) ? ((int) $post['place_id']) : 0;\n $shippingModel = Mage::getModel('shipping/shipping')->getCarrierByCode($carrierCode);\n \n //we are in admin section, so we need to set the store it manually\n $shippingModel->setStoreId($storeId);\n \n if (!$shippingModel->isAjaxInsertAllowed($addressId)) {\n throw new Exception('Invalid Shipping method');\n }\n if (!($shippingModel instanceof Balticode_Postoffice_Model_Carrier_Abstract)) {\n throw new Exception('Invalid Shipping model');\n }\n\n if ($placeId > 0) {\n $place = $shippingModel->getTerminal($placeId);\n if ($place) {\n $shippingModel->setOfficeToSession($addressId, $place);\n echo 'true';\n return;\n } else {\n echo 'false';\n return;\n }\n }\n\n $groups = $shippingModel->getGroups($addressId);\n $html = '';\n\n if ($groups) {\n $groupSelectWidth = (int)$shippingModel->getConfigData('group_width');\n $style = '';\n if ($groupSelectWidth > 0) {\n $style = ' style=\"width:'.$groupSelectWidth.'px\"';\n }\n $html .= '<select onclick=\"return false;\" ' . $style . ' name=\"' . $carrierCode . '_select_group\" onchange=\"new Ajax.Request(\\'' . $url . '\\',{method:\\'post\\',parameters:{carrier_id:\\'' . $carrierId . '\\',carrier_code:\\'' . $carrierCode . '\\',div_id:\\'' . $divId . '\\',address_id:\\'' . $addressId . '\\',group_id: $(this).getValue()},onSuccess:function(a){$(\\'' . $divId . '\\').update(a.responseText)}});\">';\n $html .= '<option value=\"\">';\n $html .= htmlspecialchars(Mage::helper('balticode_postoffice')->__('-- select --'));\n $html .= '</option>';\n\n foreach ($groups as $group) {\n $html .= '<option value=\"' . $group->getGroupId() . '\"';\n if ($groupId > 0 && $groupId == $group->getGroupId()) {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>';\n $html .= $shippingModel->getGroupTitle($group);\n $html .= '</option>';\n }\n $html .= '</select>';\n }\n\n //get the group values\n if ($groupId > 0 || $groups === false) {\n $terminals = array();\n if ($groups !== false) {\n $terminals = $shippingModel->getTerminals($groupId, $addressId);\n } else {\n $terminals = $shippingModel->getTerminals(null, $addressId);\n }\n $officeSelectWidth = (int)$shippingModel->getConfigData('office_width');\n $style = '';\n if ($officeSelectWidth > 0) {\n $style = ' style=\"width:'.$officeSelectWidth.'px\"';\n }\n $html .= '<select onclick=\"return false;\" '.$style.' name=\"' . $carrierCode . '_select_office\" onchange=\"var sel = $(this); new Ajax.Request(\\'' . $url . '\\',{method:\\'post\\',parameters:{carrier_id:\\'' . $carrierId . '\\',carrier_code:\\'' . $carrierCode . '\\',div_id:\\'' . $divId . '\\',address_id:\\'' . $addressId . '\\',place_id: sel.getValue()},onSuccess:function(a){ if (a.responseText == \\'true\\') { $(\\'' . $carrierId . '\\').writeAttribute(\\'value\\', \\'' . $carrierCode . '_' . $carrierCode . '_\\' + sel.getValue()); $(\\'' . $carrierId . '\\').click(); }}});\">';\n $html .= '<option value=\"\">';\n $html .= htmlspecialchars(Mage::helper('balticode_postoffice')->__('-- select --'));\n $html .= '</option>';\n\n $optionsHtml = '';\n $previousGroup = false;\n $optGroupHtml = '';\n $groupCount = 0;\n\n foreach ($terminals as $terminal) {\n if ($shippingModel->getGroupTitle($terminal) != $previousGroup && !$shippingModel->getConfigData('disable_group_titles')) {\n if ($previousGroup != false) {\n $optionsHtml .= '</optgroup>';\n $optionsHtml .= '<optgroup label=\"'.$shippingModel->getGroupTitle($terminal).'\">';\n } else {\n $optGroupHtml .= '<optgroup label=\"'.$shippingModel->getGroupTitle($terminal).'\">';\n }\n $groupCount++;\n }\n $optionsHtml .= '<option value=\"' . $terminal->getRemotePlaceId() . '\"';\n if (false) {\n $optionsHtml .= ' selected=\"selected\"';\n }\n $optionsHtml .= '>';\n $optionsHtml .= $shippingModel->getTerminalTitle($terminal);\n $optionsHtml .= '</option>';\n \n $previousGroup = $shippingModel->getGroupTitle($terminal);\n }\n if ($groupCount > 1) {\n $html .= $optGroupHtml . $optionsHtml . '</optgroup>';\n } else {\n $html .= $optionsHtml;\n }\n\n $html .= '</select>';\n \n \n }\n\n\n echo $html;\n } else {\n throw new Exception('Invalid request method');\n }\n } catch (Exception $e) {\n $this->getResponse()->setHeader('HTTP/1.1', '500 Internal error');\n $this->getResponse()->setHeader('Status', '500 Internal error');\n throw $e;\n }\n return;\n }", "protected function getCurrentOffice()\n {\n if ($this->currentOffice) {\n return $this->currentOffice;\n }\n\n if ($this->getSession()->has(self::CURRENT_OFFICE_KEY)) {\n $this->currentOffice = $this->getDoctrine()->getManager()->find('TerramarSalesBundle:Office', $this->getSession()->get(self::CURRENT_OFFICE_KEY));\n } else {\n $user = $this->getUser();\n\n if ($user) {\n $officeRepository = $this->get('terramar.sales.repository.office');\n\n $this->currentOffice = $officeRepository->findOfficeByUser($user);\n }\n }\n\n if (!$this->currentOffice) {\n throw new \\RuntimeException('This action requires that the current user be assigned to a company');\n }\n\n return $this->currentOffice;\n }", "function userAdmin( )\n {\n return $this->UserAdmin ;\n }", "function EV_admin() {\n\treturn EV_Admin::get_instance();\n}", "public function getWebsitesAdmin()\n {\n $res = $this->searchAdmin();\n if ($res) {\n array_push($this->site_ids, array('access' => 'admin', 'ids' => array()));\n if ($res['count'] > 0) {\n foreach ($res as $r) {\n if (is_array($r)) {\n array_push($site_ids[1]['ids'], $this->getSiteId($r[strtolower($this->to_get_admin)][0]));\n }\n }\n }\n }\n }", "public function getInAdmin() {\n\t\treturn $this->in_admin;\n\t}", "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 }", "function get_super_admins()\n {\n }", "function get_office_id($office_alias_name) {\n $this->db->from('offices');\n $this->db->where('alias_name', $office_alias_name);\n $query = $this->db->get();\n if ($query->num_rows() == 1) {\n return $query->row()->office_id;\n }\n return false;\n }", "public function index()\n {\n $query = [];\n if(!$this->user->is_admin){\n array_push($query,['user_id','=',$this->user->id]);\n }\n return $this->helper->get(null,$query);\n }", "function getAdmin() {\n if (auth()->guard('staff')->check()) {\n // Check if the auth user is a staff => get the admin id\n $project_id = auth()->guard('staff')->user()->project_id;\n $project = App\\Models\\Project::where('id', $project_id)->first();\n // We already have a relationship between the User and the Project models\n $user = $project->user;\n } else {\n $user = auth()->user();\n }\n return $user;\n }", "public function getIdentifiantAdmin() {\n\t\treturn $this->identifiant_admin;\n\t}", "function getAdminInfo($rso_id, $email, $db){\n\t$temp = $db->query(\"SELECT r.admin AS admin FROM rso_member_list AS r\n\t\tWHERE (r.rid) = '\" . $rso_id . \"'\n\t\t&& (r.email) = '\" . $email . \"'\");\n\t$rso_member = $temp->fetch_assoc();\n\treturn $rso_member;\n}", "function admin_getter_options() {\n\treturn array(\n\t\t'wheres' => array(\n\t\t\t\"ue.admin = 'yes'\"\n\t\t)\n\t);\n}", "function get_office_name($office_alias_name) {\n $this->db->from('offices');\n $this->db->where('alias_name', $office_alias_name);\n $query = $this->db->get();\n if ($query->num_rows() == 1) {\n return $query->row()->office_name;\n }\n return false;\n }", "public function officer()\n {\n //data yang di ambil di simpan dengan variabel $items\n $items = User::where('level','officer')->get();\n //data di bawa ke folder pages.auth.index.php\n return view('pages.auth.index')->with([\n 'items' => $items\n ]);\n }", "public function getAdmins()\n {\n $query = $this->newQuery();\n $query->where('admin', true);\n\n return $this->doQuery($query, false, false);\n }", "function office() //get all records from database \n\t{\n\t $result;\n\t $csrf_token=$this->security->get_csrf_hash();\n\t $this->load->model('Sup_admin');\n\t $query=$this->Sup_admin->office(); \n\t $res=$query->result();\n\t if($res){\n\t\t $data;\n\t\t $i = 0;\n\t \t foreach($res as $r){\n\t\t\t $code = $r->office_id_pk;\n\t\t\t $type = $r->office_name;\n\t\t\t $data[$i] = array('code'=>$code,'type'=>$type);\n\t\t\t $i = $i+1;\n\t\t }\n\t\t $result = array('status'=>1,'message'=>'data found','data'=>$data,'csrf_token'=>$csrf_token);\n\t \t}\n\t\telse{\n\t\t $result = array('status'=>0,'message'=>'no data found','csrf_token'=>$csrf_token);\n\n\t \t}\n\t echo json_encode($result);\n }", "public function getLogged()\n {\n $user = \\Auth::user();\n return $this->repo->getAdministrator(\n $user\n );\n }", "public function index()\n {\n return Auto::with('type', 'organizations', 'employers', 'employers.position')->get();\n }", "public static function getAdmin(){\n $db = DBInit::getInstance();\n $funkcija = \"administrator\";\n $statement = $db->prepare(\"SELECT email FROM zaposleni WHERE funkcija = :funkcija\");\n $statement->bindParam(\":funkcija\", $funkcija);\n $statement->execute();\n\n return $statement->fetch();\n \n }", "public static function getAdmin() {\n\t\t$conn = Connection::get ();\n\t\t\n\t\t$select = $conn->query ( \"SELECT id_admin, identifiant_admin, mdp_admin, nom_admin, prenom_admin FROM admin\" );\n\t\t$result = array ();\n\t\t\n\t\twhile ( $row = $select->fetch () ) {\n\t\t\t$result [] = $row;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getAdminpage() {\n\t\t // $result = mysqli_query($this->connect(), $sql);\n\t\t\t// return $result;\n\t\t}", "function VisibleToAdminUser()\n {\n\tinclude (\"dom.php\");\n return $this->CheckPermission($pavad.' Use');\n }", "public function findByUserIdAndOfficeId($office_id){\n $servicedisplay = Servicedisplay::find()\n ->andwhere(['user_id' => Yii::$app->user->identity->id])\n ->andwhere(['office_id' => $office_id])\n ->all();\n\n return $servicedisplay;\n }", "public function getOffice_phone()\n {\n return $this->office_phone;\n }", "public function admin_view(){\n\n\n\t\t$dt = new DateTime('now', new DateTimezone('Asia/Dhaka'));\n $today = $dt->format('Y-m-d');\n\t\t////////////////////////// Morning ///////////////////////////////////\n\t\t$morning = array();\n $morning_shift_members_query = \t\"SELECT shift_member \n\t\t\t\t\t\t\t\t\tFROM `daytable` \n\t\t\t\t\t\t\t\t\tJOIN shifttable ON shifttable.shift_id = daytable.shift_id \n\t\t\t\t\t\t\t\t\tWHERE shifttable.shift_date = '\".$today.\"'\";\n\n\t\t$morning_shift_members = \\DB::select(\\DB::raw($morning_shift_members_query));\n\n\t\t$morning_person = \"\";\n\n\t\tforeach ($morning_shift_members as $row) {\n\t\t\t$morning_person .= $row->shift_member.\",\";\n\t\t}\n\n\t\t$morning_person = rtrim($morning_person,\",\");\n\t\t$morning = explode(\",\",$morning_person);\n\t\t$morning_person = \"\";\n\t\tforeach ($morning as $person) {\n\t\t\t$morning_person .= \"'\".$person.\"',\";\n\t\t}\n\t\t$morning_person = rtrim($morning_person,\",\");\n\n\t\t$morning_shift_address_query = \"SELECT * FROM rosterdb.emp_address_table WHERE emp_id IN ($morning_person)\";\n\t\t$morning_address = \\DB::select(\\DB::raw($morning_shift_address_query));\n\t\t////////////////////////////////////////////////////////////////////////\n\n\n\t\t////////////////////////// Evening ///////////////////////////////////\n\t\t$evening = array();\n\n $evening_shift_members_query = \t\"SELECT shift_member \n\t\t\t\t\t\t\t\t\tFROM `eveningtable` \n\t\t\t\t\t\t\t\t\tJOIN shifttable ON shifttable.shift_id = eveningtable.shift_id \n\t\t\t\t\t\t\t\t\tWHERE shifttable.shift_date = '\".$today.\"'\";\n\n\t\t$evening_shift_members = \\DB::select(\\DB::raw($evening_shift_members_query));\n\n\t\t$evening_person = \"\";\n\n\t\tforeach ($evening_shift_members as $row) {\n\t\t\t$evening_person .= $row->shift_member.\",\";\n\t\t}\n\n\t\t$evening_person = rtrim($evening_person,\",\");\n\t\t$evening = explode(\",\",$evening_person);\n\t\t$evening_person = \"\";\n\t\tforeach ($evening as $person) {\n\t\t\t$evening_person .= \"'\".$person.\"',\";\n\t\t}\n\t\t$evening_person = rtrim($evening_person,\",\");\n\n\t\t$evening_shift_address_query = \"SELECT * FROM rosterdb.emp_address_table WHERE emp_id IN ($evening_person)\";\n\t\t$evening_address = \\DB::select(\\DB::raw($evening_shift_address_query));\n\t\t////////////////////////////////////////////////////////////////////////\n\n\n\t\t////////////////////////// Night ///////////////////////////////////\n\t\t$night = array();\n\n $night_shift_members_query = \"SELECT shift_member \n\t\t\t\t\t\t\t\t\tFROM `nighttable` \n\t\t\t\t\t\t\t\t\tJOIN shifttable ON shifttable.shift_id = nighttable.shift_id \n\t\t\t\t\t\t\t\t\tWHERE shifttable.shift_date = '\".$today.\"'\";\n\n\t\t$night_shift_members = \\DB::select(\\DB::raw($night_shift_members_query));\n\n\t\t$night_person = \"\";\n\n\t\tforeach ($night_shift_members as $row) {\n\t\t\t$night_person .= $row->shift_member.\",\";\n\t\t}\n\n\t\t$night_person = rtrim($night_person,\",\");\n\t\t$night = explode(\",\",$night_person);\n\t\t$night_person = \"\";\n\t\tforeach ($night as $person) {\n\t\t\t$night_person .= \"'\".$person.\"',\";\n\t\t}\n\t\t$night_person = rtrim($night_person,\",\");\n\n\t\t$night_shift_address_query = \"SELECT * FROM rosterdb.emp_address_table WHERE emp_id IN ($night_person)\";\n\t\t$night_address = \\DB::select(\\DB::raw($night_shift_address_query));\n\t\t////////////////////////////////////////////////////////////////////////\n\t\t\n\t\t// print_r($morning_address);\n\t\t// echo \"<br>\";\n\t\t// echo \"<br>\";\n\t\t// print_r($evening_address);\n\t\t// echo \"<br>\";\n\t\t// echo \"<br>\";\n\t\t// print_r($night_address);\n\n\n\n\n\t\t// return \"\";\n\n\n\n\n\n\n\n\n\n\n\t\t// $morning_shift_query = \"SELECT daytable.*,emp_address_table.*\n\t\t// \t\t\t\t\t\tFROM `daytable` \n\t\t// \t\t\t\t\t\tJOIN shifttable ON shifttable.shift_id = daytable.shift_id\n\t\t// \t\t\t\t\t\tJOIN emp_address_table ON daytable.shift_member = emp_address_table.emp_id\n\t\t// \t\t\t\t\t\tWHERE shifttable.shift_date = '\".$today.\"'\";\n\n\t\t// echo $morning_shift_query;\n\t\t// dd(\"Stop\");\t\t\t\t\t\t\t\n\n\t\t// $evening_shift_query = \"SELECT eveningtable.*,emp_address_table.*\n\t\t// \t\t\t\t\t\tFROM `eveningtable` \n\t\t// \t\t\t\t\t\tJOIN shifttable ON shifttable.shift_id = eveningtable.shift_id\n\t\t// \t\t\t\t\t\tJOIN emp_address_table ON eveningtable.shift_member = emp_address_table.emp_id\n\t\t// \t\t\t\t\t\tWHERE shifttable.shift_date = '\".$today.\"'\";\n\n\n\t\t// $night_shift_query = \t\"SELECT nighttable.*,emp_address_table.*\n\t\t// \t\t\t\t\t\tFROM `nighttable` \n\t\t// \t\t\t\t\t\tJOIN shifttable ON shifttable.shift_id = nighttable.shift_id\n\t\t// \t\t\t\t\t\tJOIN emp_address_table ON nighttable.shift_member = emp_address_table.emp_id\n\t\t// \t\t\t\t\t\tWHERE shifttable.shift_date = '\".$today.\"'\";\n\n\t\t// $morning = \\DB::select(\\DB::raw($morning_shift_query));\n\t\t// $evening = \\DB::select(\\DB::raw($evening_shift_query));\n\t\t// $night = \\DB::select(\\DB::raw($night_shift_query));\n\t\t\t\t\t\t\t\t\n\n\t\treturn view('admin_view.view_roster',compact('morning_address','evening_address','night_address','today'));\n\t}", "public function getVestiAdmin(){\n\t\t\t$this->db->where('skolaId', 0);\n\t\t\t$query = $this->db->get('vesti');\n\t\t\treturn $query->result_array();\n\t\t}", "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 }", "public function index()\n {\n $this->allowedAdminAction();\n\n return $this->showAll(Organizador::all());\n }", "public function adminInfo($id){\n $info = DB::table('admins')->where('uid', $id)->first();\n return $info;\n }", "public function index()\n {\n if( auth()->user()->is_admin ){\n return Enterprise::orderBy('created_at', 'desc')\n ->paginate(10);\n }\n\n return Enterprise::where('is_active', 1)\n ->with(['stores' => function ($query) {\n $query->where('is_active', 1);\n }])\n ->orderBy('name', 'asc')\n ->get();\n }", "public function index()\n {\n\n if (!Gate::denies('employee_access')) {\n $employeeInfo = EmployeeInfo::with('user:id,name,email')->get();\n } elseif (!Gate::denies('branch_employee_access')) {\n $master = Branch::all();\n $empid = array();\n foreach ($master as $value) {\n if (is_array($value['manager']) && in_array(Auth::id(), $value['manager'])) {\n $empid = array_merge($empid, $value['employee']);\n }\n }\n\n $employeeInfo = EmployeeInfo::with('user:id,name,email')->whereIn('emp_id', $empid)->get();\n } else {\n\n abort_if(true, Response::HTTP_FORBIDDEN, '403 Forbidden');\n }\n\n return view('admin.employee.index', compact('employeeInfo'));\n }", "public function getIsAdmin();", "public function getIsAdmin();", "public function getAdminView(): ?string;", "public function officers()\n {\n $viewData = array(\n 'pageTitle' => 'Activation of Departments By Location',\n 'pageDescription' => 'Manage department location scope and officers.',\n 'jsModules' => array(\n 'department',\n 'utils'\n ),\n 'accountInfo' => user_account_details(),\n );\n\n view('pages/department/officers', $viewData, 'templates/mgovadmin');\n }", "function select_offices_options($person_id){\n $data = $this->db->select(\"*\")\n ->join(\"offices\", \"offices.office_id = offices_info.officeID\")\n ->join('permissions_office','permissions_office.office_id=offices.office_id')\n ->where(\"permissions_office.person_id\",$person_id)\n ->where(\"deleted\", 0)\n ->get(\"offices_info\");\n $option['all'] = lang('reports_all');\n if($data->num_rows() > 0){\n foreach($data->result() as $item){\n $option[$item->office_id] = $item->office_name;\n }\n }\n return $option;\n }" ]
[ "0.7151893", "0.70009077", "0.6762819", "0.6738008", "0.6738008", "0.67120373", "0.6674642", "0.6669353", "0.6448656", "0.642684", "0.6388795", "0.6348977", "0.6319506", "0.6291497", "0.6281836", "0.6202329", "0.6181629", "0.6121038", "0.61152744", "0.6013464", "0.59491885", "0.59226996", "0.5918567", "0.59144497", "0.5907711", "0.5879441", "0.58554703", "0.58299893", "0.57843107", "0.5749967", "0.57229334", "0.57039523", "0.57026875", "0.5686614", "0.56824243", "0.5671206", "0.567055", "0.56510496", "0.5648933", "0.56434476", "0.562463", "0.5605264", "0.56049645", "0.5587959", "0.55857074", "0.55775607", "0.55746573", "0.5552658", "0.554884", "0.554699", "0.5545625", "0.55405426", "0.5531565", "0.5527636", "0.5523614", "0.55228513", "0.55172414", "0.5511586", "0.5511586", "0.5508236", "0.5503834", "0.5502336", "0.5496981", "0.5496154", "0.5486824", "0.5483878", "0.54795146", "0.5472067", "0.5468794", "0.54661876", "0.5465172", "0.5462455", "0.54596215", "0.54584163", "0.54566795", "0.5456043", "0.54443485", "0.54443175", "0.54406816", "0.5429854", "0.5429625", "0.5405606", "0.5404522", "0.5402891", "0.540209", "0.54020405", "0.5391795", "0.53889924", "0.5387788", "0.53866416", "0.53829265", "0.5379186", "0.53774726", "0.5374261", "0.5373547", "0.53693", "0.53693", "0.536707", "0.5365868", "0.536442" ]
0.72466975
0
The HEREDOC terminator must not be indented TODO Can't use variables within HEREDOC for initializing class properties
public static function showHeader() { $title = (array_key_exists('headertitle', $_SESSION))? $_SESSION['headertitle']:""; echo "<!DOCTYPE html>\n"; echo "<html>\n"; echo "<head>\n"; echo "<title>$title</title>\n"; echo "</head>\n\t<body>\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialize () {\n $this->set_openingtag(\"<PRE[attributes]>\");\n\t $this->set_closingtag(\"</PRE>\");\n }", "public function __construct()\n {\n $this->result = '';\n $this->indent = 0;\n }", "function initialize () {\n $this->set_openingtag(\"\");\n\t$this->set_closingtag(\"<BR[attributes]/>\");\n }", "function initialize() {\n $this->set_openingtag(\"<HR[attributes]>\");\n $this->set_closingtag(\"\");\n }", "function initialize () {\n $this->set_openingtag ( \"<HR[attributes]>\" );\n\t$this->set_closingtag ( \"\" );\n }", "function initialize () {\n $this->set_openingtag(\"<P[attributes]>\");\n\t$this->set_closingtag(\"</P>\");\n }", "function initialize() {\n $this->set_openingtag(\"<CODE[attributes]>\");\n $this->set_closingtag(\"</CODE>\");\n }", "function initialize () {\n $this->set_openingtag(\"<SPAN[attributes]>\");\n\t $this->set_closingtag(\"</SPAN>\");\n }", "function initialize() {\n $this->set_openingtag(\"<VAR[attributes]>\");\n $this->set_closingtag(\"</VAR>\");\n }", "function initialize() {\n $this->set_openingtag(\"<WBR[attributes]>\");\n $this->set_closingtag(\"</WBR>\");\n }", "private function parseProperties(): void\n {\n $properties = $this->extractProperties();\n\n foreach ($properties as $property)\n {\n if ($property['docblock']===null)\n {\n $docId = null;\n }\n else\n {\n $docId = PhpAutoDoc::$dl->padDocblockInsertDocblock($property['docblock']['doc_line_start'],\n $property['docblock']['doc_line_end'],\n $property['docblock']['doc_docblock']);\n }\n\n PhpAutoDoc::$dl->padClassInsertProperty($this->clsId,\n $docId,\n $property['name'],\n Cast::toManInt($property['is_static']),\n $property['visibility'],\n $property['value'],\n $property['start'],\n $property['end']);\n }\n }", "function initialize () {\n $this->set_openingtag(\"<SECTION[attributes]>\");\n\t $this->set_closingtag(\"</SECTION>\");\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nWorking with Data in C#\nMAINHEADING;\n }", "function bbQuotations(){ $this->__construct(); }", "function initialize () {\n $this->set_openingtag ( \"<H2[attributes]>\" );\n\t$this->set_closingtag ( \"</H2>\" );\n }", "function initialize () {\n $this->set_openingtag ( \"<H6[attributes]>\" );\n\t$this->set_closingtag ( \"</H6>\" );\n }", "function testBugInternal1() \n {\n $sText = <<<SCRIPT\n<?php\n\\$a = <<<HEREDOC\nsdsdsds\nHEREDOC;\n?>\nSCRIPT;\n $this->setText($sText);\n $sActual = $this->oBeaut->get();\n $this->assertTrue(preg_match(\"/HEREDOC;\\n\\s*?\\?>/ms\", $sActual));\n }", "public function kahlan()\n {\n return <<<EOD\n _ _\n /\\ /\\__ _| |__ | | __ _ _ __\n / //_/ _` | '_ \\| |/ _` | '_ \\\n/ __ \\ (_| | | | | | (_| | | | |\n\\/ \\/\\__,_|_| |_|_|\\__,_|_| |_|\nEOD;\n }", "public function __construct() {\n if (static::$formatter === null) {\n static::$formatter = new Indenter();\n }\n }", "public function open() { \n echo \"<{$this->name}\";\n if ($this->properties) {\n // recorre las propiedades\n foreach ($this->properties as $name => $value) {\n echo \"{$name}=\\\"{$value}\\\"\";\n }\n \n }\n echo '>';\n }", "function initialize () {\n $this->set_openingtag ( \"<H3[attributes]>\" );\n\t$this->set_closingtag ( \"</H3>\" );\n }", "function initialize() {\n $this->set_openingtag(\"<DEL[attributes]>\");\n $this->set_closingtag(\"</DEL>\");\n }", "function initialize () {\n $this->set_openingtag(\"<B[attributes]>\");\n\t$this->set_closingtag(\"</B>\");\n }", "function initialize () {\n $this->set_openingtag ( \"<H7[attributes]>\" );\n\t$this->set_closingtag ( \"</H7>\" );\n }", "public function test_property_docblocks() {\n\n\t\t$this->assertPropertyHasDocs(\n\t\t\t'Test_Class'\n\t\t\t, '$a_string'\n\t\t\t, array( 'description' => 'This is a docblock for a class property.' )\n\t\t);\n\t}", "function initialize () {\n $this->set_openingtag(\"<DIV[attributes]>[content]\");\n\t$this->set_closingtag(\"</DIV>\");\n }", "function initialize () {\n $this->set_openingtag(\"<OL[attributes]>\");\n\t$this->set_closingtag(\"</OL>\");\n }", "public function getValidatorSetUp(): string\n {\n return '\n $properties = $value;\n $invalidProperties = [];\n ';\n }", "function initialize() {\n $this->set_openingtag(\"<ASIDE[attributes]>\");\n $this->set_closingtag(\"</ASIDE>\");\n }", "public function __construct()\n {\n $this->indentInc = 4;\n $this->listCache = null;\n }", "function initialize () {\n $this->set_openingtag(\"<LI[attributes]>\");\n\t$this->set_closingtag(\"</LI>\");\n }", "function initialize () {\n $this->set_openingtag ( \"<H4[attributes]>\" );\n\t$this->set_closingtag ( \"</H4>\" );\n }", "function initialize () {\n $this->set_openingtag(\"<UL[attributes]>\");\n\t$this->set_closingtag(\"</UL>\");\n }", "function initialize () {\n $this->set_openingtag(\"<I[attributes]>\");\n\t$this->set_closingtag(\"</I>\");\n }", "public function __construct()\n {\n parent::__construct();\n $this->setSeparator(PHP_EOL);\n }", "function initialize () {\n $this->set_openingtag(\"<U[attributes]>\");\n\t$this->set_closingtag(\"</U>\");\n }", "private function setDynamicDefaults()\r\n {\r\n $this->_dynamic_1 = <<< WCO\r\n \r\n\r\n\r\n\t\t<div class=\"row align-items-center my-5\">\r\n\t\t\t<div class=\"col-lg-7\">\r\n\t\t\t\t<img class=\"img-fluid rounded mb-4 mb-lg-0\" src=\"img/CNSL_600.JPG\"\r\n\t\t\t\t\talt=\"\">\r\n\t\t\t</div>\r\n\r\n\t\t\t<div class=\"col-lg-5\">\r\n\t\t\t\t<h1 class=\"font-weight-light\">Nintendo Switch</h1>\r\n\t\t\t\t<p>\r\n\t\t\t\t\tThats Right. Nintendo Switch. The most versatile console\r\n\t\t\t\t\tthat functions as a handheld as well as a home console that was\r\n\t\t\t\t\treleased in the year 2017. <br> <br> This small space on the\r\n\t\t\t\t\tinternet is a mighty fine location to compare, read or write user\r\n\t\t\t\t\texperiences for some of the top games on the system, as well as the\r\n\t\t\t\t\tsystem itself**!\r\n <br><br><br>\r\n ** - Coming Soon\r\n\t\t\t\t</p>\r\n\t\t\t\t<a class=\"btn btn-danger\" href=\"#\">Leave A Review!</a>\r\n\t\t\t</div>\r\n\r\n\t\t\r\nWCO;\r\n $this->_dynamic_2 = \"\";\r\n $this->_dynamic_3 = \"\";\r\n }", "function initialize () {\n $this->set_openingtag(\"\");\n\t $this->set_closingtag(\"\");\n }", "function initialize () {\n $this->set_openingtag ( \"<H5[attributes]>\" );\n\t $this->set_closingtag ( \"</H5>\" );\n }", "function initialize() {\n $this->set_openingtag(\"<SUP[attributes]>\");\n $this->set_closingtag(\"</SUP>\");\n }", "function initialize () {\n $this->set_openingtag ( \"<TFOOT[attributes]>\" );\n\t$this->set_closingtag ( \"</TFOOT>\" );\n }", "function initialize () {\n $this->set_openingtag ( \"<H1[attributes]>\" );\n\t$this->set_closingtag ( \"</H1>\" );\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 __construct()\n\t{\n\t\t// Initialisation du contenu HTML du module\n\t\t$this->contenuHTML = \"\";\n\t\t// Le niveau d'indentation d'une page neuve est 0\n\t\t$this->niveauIndentation = 0;\n\t}", "public function createEndClassDeclaration() \n\t{\n\t\treturn \" }\\n?>\\n\";\n\t}", "function initialize () {\n $this->set_openingtag(\"<!DOCTYPE html><HTML[attributes]>\");\n \t$this->set_closingtag(\"</HTML>\");\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nSQL Basics\nMAINHEADING;\n }", "public function t_start_heredoc($sTag) {\n\t\t$this->inHereDoc = true;\n\t\t$this->oBeaut->add('\"');\n\t}", "public function openTag()\n {\n $this->writer->write('<?php' . PHP_EOL);\n return $this;\n }", "public function __construct()\n {\n parent::__construct();\n $this->description = $this->str(\"description\");\n }", "public function __construct()\n {\n $this->uncompiled = true;\n $this->short_open_tag = ini_get('short_open_tag');\n }", "function initialize () {\n $this->set_openingtag(\"<HEADER[attributes]>\");\n\t $this->set_closingtag(\"</HEADER>\");\n }", "function initialize () {\n $this->set_openingtag(\"<LABEL[attributes]>\");\n\t$this->set_closingtag(\"</LABEL>\");\n }", "function initialize () {\n $this->set_openingtag ( \"<TD[attributes]>\" );\n\t$this->set_closingtag ( \"</TD>\" );\n }", "function initialize () {\n $this->set_openingtag ( \"<TH[attributes]>\" );\n\t$this->set_closingtag ( \"</TH>\" );\n }", "public function __construct() {\n $this->sBody=\"<!DOCTYPE html>\\n<html>\\n\";\n }", "function quote_open() {\n $this->doc .= '<blockquote><div class=\"no\">'.DOKU_LF;\n }", "function initialize () {\n $this->set_openingtag(\"<STYLE[attributes]>\");\n\t $this->set_closingtag(\"</STYLE>\");\n }", "function initialize () {\n $this->set_openingtag(\"<STYLE>\");\n\t $this->set_closingtag(\"</STYLE>\");\n }", "function initialize () {\n $this->set_openingtag ( \"<IMG alt=\\\"\" );\n\t $this->set_closingtag ( \"\\\"[attributes]/>\" );\n }", "function initialize () {\n $this->set_openingtag(\"<BODY[attributes]>\");\n\t $this->set_closingtag(\"</BODY>\");\n }", "public function __construct() {\n\t\t$this->setCompileDir(Sys::$sys['smarty_templates_c']);\n// $this->setCacheDir(Coco::get('runtime_dir') . '/smarty/cache/');\n $this->setTemplateDir(Sys::$sys['smarty_template']);\n\t\t$this->setLeftDelimiter('{%');\n\t\t$this->setRightDelimiter('%}');\n\t\tparent::__construct();\n }", "function initialize() {\n $this->set_openingtag(\"<STRIKE[attributes]>\");\n $this->set_closingtag(\"</STRIKE>\");\n }", "function initialize() {\n $this->set_openingtag(\"<BDO[attributes]>\");\n $this->set_closingtag(\"</BDO>\");\n }", "function initialize () {\n $this->set_openingtag ( \"<THEAD[attributes]>\" );\n\t$this->set_closingtag ( \"</THEAD>\" );\n }", "public function __toString() {\n return get_class($this).spl_object_hash($this).\"=( \".\n \"file=\".$this->file.\", \".\n \"class=\".$this->class.\", \".\n \"conf=\".preg_replace(\"/( |\\r|\\n|\\t)+/\", \n \" \", var_export($this->conf,true)).\" )\";\n }", "function initialize () {\n $this->set_openingtag ( \"<TR[attributes]>\" );\n\t$this->set_closingtag ( \"</TR>\" );\n }", "public function outputCssVariablesInline(): void\n\t{\n\t\techo Components::outputCssVariablesInline(); // phpcs:ignore\n\t}", "public function testObjectVariables()\n {\n\n $parser = new HTML_Template_Nest_Parser();\n $output = $parser->parse('${some_var->foo}');\n $this->assertEquals(\"<?php /* {some_var->foo} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo)?>\", $output);\n $output = $parser->parse('${some_var->FOO}');\n $this->assertEquals(\"<?php /* {some_var->FOO} */ echo htmlentities(\\$_o(\\$p, 'some_var')->FOO)?>\", $output);\n $output = $parser->parse('${some_var->foo(bar,bin, baz)}');\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar,bin, baz)} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'),\\$_o(\\$p, 'bin'), \\$_o(\\$p, 'baz')))?>\", \n $output\n );\n \n $output = $parser->parse(\n '${some_var->foo(bar,\"bin\", baz, \\'boo biscuits\\' )}'\n );\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar,\\\"bin\\\", baz, 'boo biscuits' )} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'),\" .\n \"\\\"bin\\\", \\$_o(\\$p, 'baz'), 'boo biscuits' ))?>\", \n $output\n );\n\n $output = $parser->parse(\n '${some_var->foo(bar,\"bin\", baz, \\'boo biscuit\\\\\\'s brother\\' )}'\n );\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar,\\\"bin\\\", baz, 'boo biscuit\\\\'s brother' )} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'),\\\"bin\\\"\" .\n \", \\$_o(\\$p, 'baz'), 'boo biscuit\\'s brother' ))?>\", \n $output\n );\n \n // nested methods\n $output = $parser->parse(\n '${some_var->foo(bar, \"bin\")->bar()->bob(\"bo\\\"oo\\\"\",bin)}'\n );\n $this->assertEquals(\n \"<?php /* {some_var->foo(bar, \\\"bin\\\")->bar()->bob(\\\"bo\\\\\\\"oo\\\\\\\"\\\",bin)} */ echo htmlentities(\\$_o(\\$p, 'some_var')->foo(\\$_o(\\$p, 'bar'), \\\"bin\\\")\" .\n \"->bar()->bob(\\\"bo\\\\\\\"oo\\\\\\\"\\\",\\$_o(\\$p, 'bin')))?>\", \n $output\n );\n \n // null testing\n $output = $parser->parseExpression(\"error != null &amp;&amp; error->getText() != ''\");\n $this->assertEquals(\n \"\\$_o(\\$p, 'error') != null && \\$_o(\\$p, 'error')->getText() != ''\",\n $output);\n \n $output = $parser->parseExpression(\"error->getText(null, 'foo') != ''\");\n $this->assertEquals(\n \"\\$_o(\\$p, 'error')->getText(null, 'foo') != ''\",\n $output); \n }", "private function _class_close ()\n\t{\n\t\treturn \"\\n}\";\n\t}", "function initialize () {\n $this->set_openingtag(\"<ARTICLE[attributes]>\");\n\t$this->set_closingtag(\"</ARTICLE>\");\n }", "function initialize () {\n $this->set_openingtag(\"<A[attributes]>\");\n\t$this->set_closingtag(\"</A>\");\n }", "function initialize () {\n $this->set_openingtag ( \"<TBODY[attributes]>\" );\n\t$this->set_closingtag ( \"</TBODY>\" );\n }", "public function startIndent() {\r\n\t\treturn '<div class=indent>';\r\n\t}", "function initialize () {\n $this->set_openingtag ( \"<TABLE[attributes]>\" );\n\t$this->set_closingtag ( \"</TABLE>\" );\n }", "function initialize () {\n $this->set_openingtag(\"\");\n\t $this->set_closingtag(\"<LINK[attributes]/>\");\n }", "function initialize() {\n $this->set_openingtag(\"<SUB[attributes]>\");\n $this->set_closingtag(\"</SUB>\");\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nAdvanced Collections in C#\nMAINHEADING;\n }", "public function init()\n {\n $this->shortcode->getHandlers()->add('div', function (ShortcodeInterface $sc) {\n $id = $sc->getParameter('id');\n $class = $sc->getParameter('class');\n $style = $sc->getParameter('style');\n\n $id_output = $id ? ' id=\"' . $id . '\" ' : '';\n $class_output = $class ? ' class=\"' . $class . '\"' : '';\n $style_output = $style ? ' style=\"' . $style . '\"' : '';\n\n $content = $this->parseDown->line($sc->getContent());\n\n return '<div ' . $id_output . $class_output . $style_output . '>' . $content . '</div>';\n });\n }", "function initialize() {\n $this->set_openingtag(\"<DD[attributes]>\");\n $this->set_closingtag(\"</DD>\");\n }", "public function getMainHeading() : string\n {\n return <<< 'MAINHEADING'\nScripting in Bash Shell\nMAINHEADING;\n }", "function initialize () {\n $this->set_openingtag(\"<SCRIPT[attributes]>\");\n\t $this->set_closingtag(\"</SCRIPT>\");\n }", "function _toString(){\r\n return \"Class=Car{\\$is_started=$this->is_started,\\gas=$this->gas}\";\r\n }", "function make_initialization($v, $comment = '')\n{\n global $http_vars;\n $c = (empty($comment)) ? '' : ' // ' . $comment;\n return '$' . $v . ' = \\'' . addcslashes($http_vars[$v], '\\'\\\\') . '\\';' . $c;\n}", "function __construct() { //phpcs:ignore ?>\n\n\t\t\t<h3><?php comments_number( __( 'No Responses to', 'foundationpress' ), __( 'One Response to', 'foundationpress' ), __( '% Responses to', 'foundationpress' ) ); ?> &#8220;<?php the_title(); ?>&#8221;</h3>\n\t\t\t<ol class=\"comment-list\">\n\n\t\t\t<?php\n\t\t}", "public function addHeader(){\n$this->page.= <<<EOD\n<html>\n<head>\n</head>\n<title>\n$this->title\n</title>\n<body>\n<h1 align=\"center\">\n$this->title\n</h1>\nEOD;\n}", "function initialize() {\n $this->set_openingtag(\"<DL[attributes]>\");\n $this->set_closingtag(\"</DL>\");\n }", "public function wktGenerateMultilinestring();", "function initialize () {\n $this->set_openingtag ( \"<TITLE[attributes]>\" );\n\t $this->set_closingtag ( \"</TITLE>\" );\n }", "function initialize() {\n $this->set_openingtag(\"<BASE[attributes]>\");\n $this->set_closingtag(\"\");\n }", "function initialize() {\n $this->set_openingtag(\"<COLGROUP[attributes]>\");\n $this->set_closingtag(\"</COLGROUP>\");\n }", "public function __construct()\n {\n \t// Initialise values\n \t$this->_horizontal\t\t\t= PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT;\n \t$this->_vertical\t\t\t= PHPPowerPoint_Style_Alignment::VERTICAL_BASE;\n \t$this->_level\t\t\t\t= 0;\n\t\t$this->_indent\t\t\t\t= 0;\n }", "public function __toString() {\n\t\t\n\t\t// extract config to this context for convenience\n\t\textract(self::$config);\n\t\t\n\t\t// you can specify dimensions for a scrollble div\n\t\tif ($height !== 'auto' OR $width !== 'auto') {\n\n\t\t\t// add \"px\" to height and width\n\t\t\tif (is_numeric($height) AND ! strstr($height, '%')) $height .= 'px';\n\t\t\tif (is_numeric($width) AND ! strstr($width, '%')) $width .= 'px';\n\t\t\t\n\t\t\t// all scrollables get a border\n\t\t\t$this->style .= \" border: 1px solid #ddd; padding: 10px; overflow-y: scroll; height: $height; width: $width;\";\n\t\t\t\n\t\t}\n\n\t\t// styled pre tag\n\t\t$pre = '<pre style=\"'.$this->style.'\">';\n\n\t\t// iterate over data objects and var_dump 'em\n\t\tforeach ($this->data as $data) {\n\t\t\t\n\t\t\t// pull out data and label\n\t\t\textract($data);\n\t\t\t\n\t\t\t// capture var_dump\n\t\t\tob_start();\n\t\t\tvar_dump($data);\n\t\t\t$data = ob_get_clean();\n\n\t\t\t// special case for NULL values\n\t\t\tif (trim($data) == 'NULL')\n\t\t\t\t$data = '<span style=\"color: #777;\">NULL</span>'.\"\\n\";\n\t\t\t\n\t\t\t// add label\n\t\t\tif (! empty($label))\n\t\t\t\t$data = '<span style=\"color: #222; font-weight: bold; background-color: #eee; font-size: 11px; padding: 3px 5px;\">'.$label.\":</span> $data\";\n\t\t\t\n\t\t\t// compile list of class names by searching: object(PreObject)#4 (2) {\n\t\t\tpreg_match_all('/object\\(([A-Za-z0-9_]+)\\)\\#[0-9]+\\ \\([0-9]+\\)\\ {/', $data, $objects);\n\t\t\t\n\t\t\t// we have some objects w/ class names\n\t\t\tif (! empty($objects)) {\n\t\t\t\n\t\t\t\t// just get the list of object names, without duplicates\n\t\t\t\t$objects = array_unique($objects[1]);\n\n\t\t\t\t// fix all class names to look like this: stdClass#3 object(4) {\n\t\t\t\t$data = preg_replace('/object\\(([A-Za-z0-9_]+)\\)\\#([0-9]+)\\ \\(([0-9]+)\\)\\ {/', '<span style=\"color: #222; font-weight: bold;\">\\\\1</span> <span style=\"color: #444;\">#\\\\2</span> <span style=\"color: #777;\">object(\\\\3)</span> {', $data);\n\n\t\t\t\t// remove class name from private members\n\t\t\t\tforeach ($objects as $object)\n\t\t\t\t\t$data = str_replace(':\"'.$object.'\"', '', $data);\n\t\t\t\t\n\t\t\t}\n\n\t\t\t// consistent styling of =>'s\n\t\t\t$arrow = '<span style=\"font-weight: bold; color: #aaa;\"> => </span>';\n\t\t\t\n\t\t\t// style special case NULL\n\t\t\t$data = preg_replace('/=>\\s*NULL/i', '=> <span style=\"color: #777;\">NULL</span>', $data);\n\t\t\t\n\t\t\t// array keys are bolder\n\t\t\t$data = preg_replace('/\\[\\\"([a-z0-9_\\ \\@+\\-\\(\\):]+)\\\"(:?[a-z]*)\\]\\s*=>\\s*/i', '<span style=\"color: #444; font-weight: bold;\">[\\\\1]</span>\\\\2'.$arrow, $data);\n\n\t\t\t// numeric keys are bolder\n\t\t\t$data = preg_replace('/\\[([0-9]+)\\]\\s*=>\\s*/', '<span style=\"color: #444; font-weight: bold;\">[\\\\1]</span>'.$arrow, $data);\n\t\t\t\n\t\t\t// style :private and :protected\n\t\t\t$data = preg_replace('/(:(private|protected))/', '<span style=\"color: #444; font-style: italic;\">\\\\1</span>', $data);\n\n\t\t\t// de-emphasize string labels\n\t\t\t$data = preg_replace('/string\\(([0-9]+)\\)/', '<span style=\"color: #777;\">string(\\\\1)</span>', $data);\n\n\t\t\t// de-emphasize int labels\n\t\t\t$data = preg_replace('/int\\(([0-9-]+)\\)/', '<span style=\"color: #777;\">int(<span style=\"color: #222;\">\\\\1</span>)</span>', $data);\n\t\t\t\n\t\t\t// de-emphasize float labels\n\t\t\t$data = preg_replace('/float\\(([0-9\\.-]+)\\)/', '<span style=\"color: #777;\">float(<span style=\"color: #222;\">\\\\1</span>)</span>', $data);\n\n\t\t\t// de-emphasize bool label\n\t\t\t$data = preg_replace('/bool\\(([A-Za-z]+)\\)/', '<span style=\"color: #777;\">bool(<span style=\"text-transform: uppercase; color: #222;\">\\\\1</span>)</span>', $data);\n\t\t\t// de-emphasize array labels\n\t\t\t$data = preg_replace('/array\\(([0-9]+)\\)/', '<span style=\"color: #777;\">array(\\\\1)</span>', $data);\n\n\t\t\t// boost spacing\n\t\t\t$data = preg_replace_callback('/^(\\s*)(\\S.*)$/m', function($matches) {\n\t\t\t\t// number of spaces that var_dump gave it\n\t\t\t\t$indent = strlen($matches[1]);\n\t\t\t\t// each 2 spaces is one column\n\t\t\t\t$indent = ($indent > 0) ? str_repeat(\" \", $indent/2) : \"\";\n \treturn $indent.$matches[2];\n \t}, $data);\n\n\t\t\t// style opening brackets\n\t\t\t$data = preg_replace('/^(.*)(<\\/span>\\ \\{)$/m', '\\\\1<span style=\"color: #777;\">\\\\2</span>', $data);\n\n\t\t\t// style closing brackets\n\t\t\t$data = preg_replace('/^(\\s*)(\\})$/m', '\\\\1<span style=\"color: #777;\">\\\\2</span>', $data);\n\t\t\t\n\t\t\t// add to pre output\n\t\t\t$pre .= \"$data\";\n\n\t\t}\n\t\t\n\t\t// close pre tag\n\t\t$pre .= \"</pre>\\n\\n\";\n\t\t\n\t\t// reset data\n\t\t$this->data = array();\n\t\t\n\t\t// return output\n\t\treturn $pre;\n\t\t\n\t}", "public function dataHeredocString()\n {\n return [\n [\n 'testMarker' => '/* testSimple1 */',\n 'expectedContent' => '$foo',\n ],\n [\n 'testMarker' => '/* testSimple2 */',\n 'expectedContent' => '{$foo}',\n ],\n [\n 'testMarker' => '/* testSimple3 */',\n 'expectedContent' => '${foo}',\n ],\n [\n 'testMarker' => '/* testDIM1 */',\n 'expectedContent' => '$foo[bar]',\n ],\n [\n 'testMarker' => '/* testDIM2 */',\n 'expectedContent' => '{$foo[\\'bar\\']}',\n ],\n [\n 'testMarker' => '/* testDIM3 */',\n 'expectedContent' => '${foo[\\'bar\\']}',\n ],\n [\n 'testMarker' => '/* testProperty1 */',\n 'expectedContent' => '$foo->bar',\n ],\n [\n 'testMarker' => '/* testProperty2 */',\n 'expectedContent' => '{$foo->bar}',\n ],\n [\n 'testMarker' => '/* testMethod1 */',\n 'expectedContent' => '{$foo->bar()}',\n ],\n [\n 'testMarker' => '/* testClosure1 */',\n 'expectedContent' => '{$foo()}',\n ],\n [\n 'testMarker' => '/* testChain1 */',\n 'expectedContent' => '{$foo[\\'bar\\']->baz()()}',\n ],\n [\n 'testMarker' => '/* testVariableVar1 */',\n 'expectedContent' => '${$bar}',\n ],\n [\n 'testMarker' => '/* testVariableVar2 */',\n 'expectedContent' => '${(foo)}',\n ],\n [\n 'testMarker' => '/* testVariableVar3 */',\n 'expectedContent' => '${foo->bar}',\n ],\n [\n 'testMarker' => '/* testNested1 */',\n 'expectedContent' => '${foo[\"${bar}\"]}',\n ],\n [\n 'testMarker' => '/* testNested2 */',\n 'expectedContent' => '${foo[\"${bar[\\'baz\\']}\"]}',\n ],\n [\n 'testMarker' => '/* testNested3 */',\n 'expectedContent' => '${foo->{$baz}}',\n ],\n [\n 'testMarker' => '/* testNested4 */',\n 'expectedContent' => '${foo->{${\\'a\\'}}}',\n ],\n [\n 'testMarker' => '/* testNested5 */',\n 'expectedContent' => '${foo->{\"${\\'a\\'}\"}}',\n ],\n ];\n\n }", "public function __construct() {\n $this->addSymbol(new SimpleSymbol(self::FIELD_SEPARATOR));\n $this->addSymbol(new NestedExpressionSymbol());\n\n parent::setWillTrimTokens(true);\n }", "function initialize () {\n $this->set_openingtag(\"<FOOTER[attributes]>\");\n\t $this->set_closingtag(\"</FOOTER>\");\n }", "protected function showBeginHTML(): self {\n echo <<<HTML\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>{$this->getTitle()}</title>\n <meta name=\"keywords\" content=\"{$this->getKeywords()}\">\n <meta name=\"description\" content=\"{$this->getDescription()}\">\n <meta name=\"author\" content=\"Dmitri Serõn\">\n <link rel=\"stylesheet\" href=\"/assets/css/styles.css\">\n</head>\n<body>\nHTML;\n\n return $this;\n }", "public function __construct()\n {\n if ('odd' != self::$oddOrEven) {\n $this->author = 'David Sklar and Adam Trachtenberg';\n $this->title = 'PHP Cookbook';\n self::$oddOrEven = 'odd';\n }\n\n $this->author = 'Rasmus Lerdorf and Kevin Tatroe';\n $this->title = 'Programming PHP';\n self::$oddOrEven = 'even';\n }", "public function __construct()\n\t{\n\t\t$this->leading_context_lines = 0;\n\t\t$this->trailing_context_lines = 0;\n\t}", "function doublequoteopening() {\n global $lang;\n $this->doc .= $lang['doublequoteopening'];\n }", "function singlequoteclosing() {\n global $lang;\n $this->doc .= $lang['singlequoteclosing'];\n }" ]
[ "0.6057925", "0.59777194", "0.5662421", "0.56376994", "0.5620864", "0.5604663", "0.56046057", "0.55005765", "0.54826176", "0.5477786", "0.5467602", "0.54026985", "0.5354833", "0.53276044", "0.5312626", "0.53105825", "0.5296456", "0.5291773", "0.5278873", "0.52639866", "0.52564013", "0.5242617", "0.5236129", "0.5232299", "0.52322334", "0.5228716", "0.52238554", "0.51977", "0.51956993", "0.51951426", "0.5191213", "0.5171412", "0.5158461", "0.5153938", "0.51480913", "0.5131863", "0.5130068", "0.5105097", "0.5104109", "0.5100083", "0.50996095", "0.50974303", "0.5093416", "0.5092358", "0.50917196", "0.509034", "0.50863725", "0.5077069", "0.5076122", "0.5053629", "0.5048416", "0.5048077", "0.5044429", "0.5042881", "0.5040528", "0.50400126", "0.50284666", "0.5019629", "0.5017058", "0.5006539", "0.49917275", "0.49728087", "0.49724475", "0.49636298", "0.49572623", "0.49539128", "0.49528176", "0.4948585", "0.49326992", "0.4932391", "0.49258646", "0.4919542", "0.4912465", "0.49116746", "0.4908415", "0.49075064", "0.49036932", "0.48993215", "0.48948994", "0.48925152", "0.48770398", "0.48731977", "0.48649263", "0.48645762", "0.48618928", "0.48572502", "0.48559812", "0.48418927", "0.48386332", "0.48354843", "0.48283", "0.48075145", "0.48066384", "0.48061135", "0.4800728", "0.47860223", "0.4779624", "0.47730246", "0.47725293", "0.47703922", "0.47678936" ]
0.0
-1
Creates a new rate.
public function __construct($value, \DateTimeInterface $date = null) { $this->value = (string) $value; $this->date = $date ?: new \DateTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function newRate(string $percentage, string $operator, int $amount): BookingRate\n {\n return $this->rates()->create([\n 'bookable_id' => static::getKey(),\n 'bookable_type' => static::class,\n 'percentage' => $percentage,\n 'operator' => $operator,\n 'amount' => $amount,\n ]);\n }", "protected function createRateModel()\n {\n $class = '\\\\'.ltrim($this->rateModel, '\\\\');\n $model = new $class();\n return $model;\n }", "public function __construct(Money $rate)\n {\n $this->rate = $rate;\n }", "function CreateTravelRate() {\r\n $conn = conn();\r\n $sql = \"INSERT INTO `travelrates`(`TravelCode`, `TravelAmount`, `Modified`, `ModifiedBy`) \r\n VALUES ('$this->TravCode','$this->TravRate',NOW(),'$this->ModifiedBy')\";\r\n if ($conn->exec($sql)) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n $conn = NULL;\r\n }", "public function setRate($rate)\n {\n $this->Rate = $rate;\n return $this;\n }", "public function setRate($var)\n {\n GPBUtil::checkString($var, True);\n $this->rate = $var;\n\n return $this;\n }", "public function setRate($rate)\n {\n $this->rate = $rate;\n\n return $this;\n }", "public function setRate($rate)\n {\n $this->rate = $rate;\n\n return $this;\n }", "public function store(Request $request)\n {\n //\n return AirlineRate::create([\n 'rate' => $request['rate'],\n 'date' => NOW(),\n 'day' => NOW(),\n 'user_id' => Auth::user()->id\n ]);\n }", "public function store(StoreRateRequest $request)\n {\n \n Rate::create($request->all());\n\n return response()->json('New rate was created successefully', Response::HTTP_CREATED);\n }", "public function create()\n {\n return view('rates.create');\n }", "public function create_tax_rate( $rate ) {\n\t\t// Create the tax class.\n\n\t\t$this->tax_classes[] = WC_Tax::create_tax_class( \"${rate}percent\", \"${rate}percent\" );\n\n\t\t// Set tax data.\n\t\t$tax_data = array(\n\t\t\t'tax_rate_country' => '',\n\t\t\t'tax_rate_state' => '',\n\t\t\t'tax_rate' => $rate,\n\t\t\t'tax_rate_name' => \"Vat $rate\",\n\t\t\t'tax_rate_priority' => 1,\n\t\t\t'tax_rate_compound' => 0,\n\t\t\t'tax_rate_shipping' => 1,\n\t\t\t'tax_rate_order' => 1,\n\t\t\t'tax_rate_class' => \"${rate}percent\",\n\t\t);\n\t\treturn WC_Tax::_insert_tax_rate( $tax_data );\n\t}", "public function toRate(Request $request) {\n\n $id = Auth::id();\n\n $model = new Evaluation();\n\n // minor evaluation\n $min = Evaluation::MIN;\n $max = Evaluation::MAX;\n\n $validatedData = $request->validate([\n 'artistic_value' => \"required|numeric|min:$min|max:$max\",\n 'artistry' => \"required|numeric|min:$min|max:$max\",\n 'evaluation' => \"required|numeric|min:$min|max:100\", // total rate 100\n 'originality' => \"required|numeric|min:$min|max:$max\",\n 'stylistic_matching' => \"required|numeric|min:$min|max:$max\"\n ]);\n\n $data = $request->all();\n\n $data['user_id'] = $id;\n\n $model->create($data);\n\n return response('ok', 200);\n }", "public function create()\n {\n return view('admin.rates.add');\n }", "public function store(CreaterateRequest $request)\n { \n $input = $request->all();\n\n $rate = $this->rateRepository->create($input);\n\n Flash::success('Rate saved successfully.');\n\n return redirect(route('rates.index'));\n }", "public function setRate(?float $rate): self\n {\n $this->initialized['rate'] = true;\n $this->rate = $rate;\n\n return $this;\n }", "public function setRate($rate)\n {\n if (!empty($rate)) {\n $this->rate = $rate;\n }\n\n return $this;\n }", "public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }", "public function rate()\n {\n\n }", "public static function create($taxRateData = [])\n {\n $httpClient = self::getHttpClient();\n $merchantId = self::getMerchantId();\n $version = self::VERSION;\n\n $taxRate = $httpClient->post(\"$version/merchants/$merchantId/tax_rates\", [\n 'json' => $taxRateData,\n ]);\n\n return $taxRate;\n }", "public function __construct($attributes = null)\n {\n if (is_numeric($attributes)) {\n $this->rate = $attributes;\n } elseif (isset($attributes['rate'])) {\n $this->rate = $attributes['rate'];\n } else {\n throw new \\InvalidArgumentException('No rate supplied');\n }\n }", "public function setRate($rate) {\n $this->rate = $rate;\n }", "public function post(Request $request)\n {\n // Validate the form using Lumen's validation\n $this->validate($request, [\n 'source' => 'required|different:target|exists:currencies,symbol',\n 'target' => 'required|different:source|exists:currencies,symbol',\n 'rate' => 'required|numeric',\n ]);\n\n // Validate the currencies\n $source = Currency::where('symbol', strtoupper($request->get('source')))->firstOrFail();\n $target = Currency::where('symbol', strtoupper($request->get('target')))->firstOrFail();\n $precision = env('APP_RATE_PRECISION', 4);\n\n $new = ExchangeRate::create([\n 'source_id' => $source->id,\n 'target_id' => $target->id,\n 'rate' => round($request->get('rate'), $precision)\n ]);\n\n // Create the reverse rate\n ExchangeRate::create([\n 'source_id' => $target->id,\n 'target_id' => $source->id,\n 'rate' => round(1 / $new->rate, $precision)\n ]);\n\n return $new;\n }", "public function created(VoteRate $voteRate)\n {\n $rate = VoteRate::where(['kode_tukang'=>$voteRate->kode_tukang,'value'=>$voteRate->value])->get();\n $recounting = count($rate);\n Rate::where(['kode_tukang'=>$voteRate->kode_tukang,'value_rate'=>$voteRate->value])->update(['count_rate'=>$recounting]);\n Tukang::whereId($voteRate->kode_tukang)->update([\"rate\"=>5.0]);\n\n //for cunting score of rate\n $cal = Rate::where(['kode_tukang'=>$voteRate->kode_tukang])->get();\n $total_data = 0;\n $freq = 0;\n foreach ($cal as $arate){\n $total_data = $total_data + ($arate->value_rate * $arate->count_rate);\n $freq = $freq + $arate->count_rate;\n }\n $score = $total_data/$freq;\n\n Tukang::whereId($voteRate->kode_tukang)->update([\"rate\"=>$score]);\n }", "public function addProductRate(Request $r)\n\t\t{\n\t\t\t$values = Request::json()->all();\n\t\t\t\n\t\t\n\t\t \n\t\t\t\n\t\t$add=\\DB::table('prod_assoc_rates')->insert(array(\n\t\t'Prod_ID' => $values['prod_ID'],\n 'MAssoc_ID' => $values['seg_ID'], \n 'Rate' => $values['Rate'], \n\t\t\t'CurrentDate' => $values['currentDate'], \n\t\t \n\t\t\t'ExpDate' => $values['expiryDate'], \n\t\t\t\n\t\t\t \n\t\t\t \n ));\n\t if(!empty($add))\n\t {$pid=$values['prod_ID'];\n\t\t\t$updateStatus=\\DB::table('products')\n\t\t\t->where('Prod_ID',$pid)\n\t\t\t->update(array('RateStatus' => '2'));\n\t\t \n\t \n\t }\n\t \n\t\t\t$resp=array($pid);\n\t\t\treturn $resp;\n\t\t\t\n\t\t}", "public function createMarketPrice(Request $request)\n {\n $market = CarbonPrice::where('active', 1)->first();\n\n // Check if the market prices have changed\n if(($market->credit_rate == $request->rate) && ($market->value == $request->price)){\n return response([\n 'state' => 'error',\n 'message'=>'You have updated the market prices with the same values.', \n 'data' => $market,\n ], 400); \n }\n\n // Update the status of the current price\n $market->update([\n 'active' => 0\n ]);\n // Create a new price\n $market = CarbonPrice::create([\n 'credit_rate' => $request->rate,\n 'value' => $request->price,\n ]);\n\n \t// Create a new carbon price instance\n \treturn response([\n \t\t'state' => 'success',\n 'message'=>'The market rate has been updated successfully.', \n 'data' => $market,\n \t], 200); \n }", "public function addTaxRate()\n {\n $this->taxRates[] = [\n 'id' => null,\n 'name' => null,\n 'priority' => count($this->taxRates) + 1,\n 'amounts' => $this->taxClasses->map(function ($taxClass) {\n return [\n 'id' => null,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => 0,\n ];\n })->toArray(),\n ];\n }", "public function store(Request $request)\n {\n $this->validateRate();\n $rate_data = request()->all();\n Salonrate::create($rate_data);\n return redirect(route('admin.salonrates.index'))->withSuccess('Успешно создано');;\n }", "public function create()\n {\n $title = \"New Service Rates Form\";\n return view('rates.create', compact('title') );\n }", "public function create()\n {\n if (!Gate::allows('add-ratehistory')) {\n return abort(401);\n }\n return view('rate_history.rate-history.create');\n }", "public function addServiceRate(Request $r)\n\t\t{\n\t\t\t$values = Request::json()->all();\n\t\t\t\n\t\t$add=\\DB::table('ser_assoc_rate')->insert(array(\n\t\t'SerServ_ID' => $values['ser_ID'],\n 'Assoc_ID' => $values['seg_ID'], \n\t\t\t'Pattern' => $values['pattern'], \n 'Rate' => $values['Rate'], \n\t\t\t \n\t\t\t'Current_Date' => $values['currentDate'], \n\t\t \n\t\t\t'Expiry_Date' => $values['expiryDate'], \n\t\t\t\n\t\t\t \n\t\t\t \n ));\n\t \n\t\t\t$resp=array($values);\n\t\t\treturn $resp;\n\t\t}", "public function addUserRate(UserRate $l)\n\t{\n\t\tif ($this->collUserRates === null) {\n\t\t\t$this->initUserRates();\n\t\t}\n\t\tif (!in_array($l, $this->collUserRates, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collUserRates, $l);\n\t\t\t$l->setUser($this);\n\t\t}\n\t}", "public function setRate($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->rate !== $v) {\n $this->rate = $v;\n $this->modifiedColumns[KluBillTableMap::COL_RATE] = true;\n }\n\n return $this;\n }", "public function rateCall(Request $request)\n {\n $rate = new ServiceProviderRating;\n\n if (empty($request->comment)) {\n $rate->comment = \"\";\n } else {\n $rate->comment = $request->comment;\n }\n \n if (empty($request->call_rate)) {\n $rate->call_rate = 0;\n } else {\n $rate->call_rate = $request->call_rate;\n }\n \n if (empty($request->provider_rate)) {\n $rate->provider_rate = 0;\n } else {\n $rate->provider_rate = $request->provider_rate;\n }\n \n $rate->service_provider_id = $request->service_provider_id;\n if (empty($request->good_communication_skills)) {\n $rate->good_communication_skills = 0;\n } else {\n $rate->good_communication_skills = $request->good_communication_skills;\n }\n \n if (empty($request->good_teaching_skills)) {\n $rate->good_teaching_skills = 0;\n } else {\n $rate->good_teaching_skills = $request->good_teaching_skills;\n }\n\n if (empty($request->intersting_conserviation)) {\n $rate->intersting_conserviation = 0;\n } else {\n $rate->intersting_conserviation = $request->intersting_conserviation;\n }\n \n if (empty($request->kind_personality)) {\n $rate->kind_personality = 0;\n } else {\n $rate->kind_personality = $request->kind_personality;\n }\n \n if (empty($request->correcting_my_language)) {\n $rate->correcting_my_language = 0;\n } else {\n $rate->correcting_my_language = $request->correcting_my_language;\n }\n \n $rate->language_id = 1;\n \n $rate->save();\n\n $provider_rates = ServiceProviderRating::where('service_provider_id', '=', $request->service_provider_id)->get();\n $counter = 0;\n $total_rate = 0.0;\n if (count($provider_rates) > 0) {\n foreach ($provider_rates as $provider_rate) {\n ++$counter;\n $total_rate += $provider_rate->provider_rate;\n }\n $provider = ServiceProvider::findOrFail($request->service_provider_id);\n $provider->rating = $total_rate/$counter;\n $provider->save();\n }\n return response()\n ->json([\n 'success' => true,\n 'message' => __('messages.call_rate_message'),\n 'new_rate' => round($provider->rating, 2),\n 'service_provider_id' => $request->service_provider_id\n ]);\n }", "public function create()\n {\n $lance = new Lance();\n }", "protected function fixture($time= self::CLOCK_START) {\n return new RateLimiting(new Rate(self::RATE, $this->unit()), $this->clock->resetTo($time));\n }", "public function setRatePeriod($ratePeriod)\n {\n $this->ratePeriod = $ratePeriod;\n return $this;\n }", "public function create(Request $request)\n {\n if(permissions('rates_add') == 0){\n //set session message\n Session::flash('message', __('strings.do_not_have_permission'));\n return view('permissions');\n }\n\n $id = $request->id;\n $taxs = Tax::where(['org_id' => Auth::user()->org_id, 'active' => 1])->get();\n\n return view('rates.create', compact('taxs', 'id'));\n\n }", "public function getBaseToOrderRate();", "public function saveNewRating($inputArr){\n return self::create($inputArr);\n }", "public function interestRate($value)\n {\n $this->setProperty('interestRate', $value);\n return $this;\n }", "public function store(Request $request)\n {\n date_default_timezone_set('Asia/Manila');\n \n return VehicleRate::create([\n 'MVID_Link' => $request['MVID_Link'],\n 'PlateNumber' => $request['PlateNumber'],\n 'EffectiveDate' => strtoupper($request['EffectiveDate']),\n 'PerHourRate' => $request['PerHourRate']\n \n /*\n 'PerTransactionRate' => number_format($request['PerTransactionRate'],2,\".\",\",\"),\n 'DailyRate' => number_format($request['DailyRate'],2,\".\",\",\")\n 'EffectiveDate' => strtoupper($request['EffectiveDate']),\n 'PerHourRate' => number_format($request['PerHourRate'],2,\".\",\",\"),\n 'PerAreaRate' => number_format($request['PerAreaRate'],2,\".\",\",\"),\n 'FixedMonthlyRate' => number_format($request['FixedMonthlyRate'],2,\".\",\",\"),\n 'PerBagRate' => number_format($request['PerBagRate'],2,\".\",\",\"),\n 'PerDestinationRate' => number_format($request['PerDestinationRate'],2,\".\",\",\"),\n 'Status' => strtoupper($request['Status'])*/\n\n \n ]);\n }", "public function __construct(Order $order, int $rate)\n {\n $this->order = $order;\n $this->rate = $rate;\n }", "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}", "public function store(RateValidationRequest $request)\n {\n $rate = Rate::create([\n 'name' => request('name'), \n 'code' => request('code'), \n 'icon' => request('icon') \n ]);\n\n return redirect('rates/')\n ->with('notification', [\n 'title' => 'Created!',\n 'message' =>'New Service Rate successfully created!',\n 'class' => 'success'\n ]);\n }", "protected function _construct()\n {\n $this->_init(CarrierModel::RATE_TABLE_NAME, 'rate_id');\n }", "public function setRates($rates)\n {\n $this->_rates = $rates;\n }", "function CreateSpecialRate($ratecode, $holidaycode) {\r\n $conn = conn();\r\n $sql = \"INSERT INTO `specialrates`(`RateCode`, `HolidayCode`, `SpecialRate`, `Modified`, `ModifiedBy`) \"\r\n . \"VALUES ('$ratecode','$holidaycode','$this->SpecialRate',NOW(),'$this->ModifiedBy')\";\r\n if ($conn->exec($sql)) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n $conn = NULL;\r\n }", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }", "public function getRate()\n {\n return $this->hasOne(PaymentRate::class, ['id' => 'rate_id']);\n }", "public static function generateRate($data)\n {\n $response = self::send('reservas/calcular_tasas', [\n 'reserva_id' => $data['reserva_id'],\n 'adultos' => $data['adults'],\n 'ninos' => $data['kids'],\n ]);\n\n return $response;\n }", "public function store(Request $request)\n {\n $request->validate([\n 'shipping_class' => 'required',\n 'min' => 'required|numeric|between:0,99999999999',\n 'max' => 'required|numeric|between:0,99999999999',\n 'rate' => 'required|numeric'\n ]);\n \n $rates=new ShippingTableRates;\n $rates->shipping_class=$request->input('shipping_class');\n $rates->min=$request->input('min');\n $rates->max=$request->input('max');\n $rates->rate=$request->input('rate');\n $rates->save();\n\n return redirect('admin/shipping-table-rates')->with('success', 'Rate added successfully');\n }", "public function createRating($rating_name, $rating)\n {\n $this->$rating_name = $rating->expose();\n }", "public function create()\n {\n $country = country::all();\n if ($country->count() > 0) {\n $country = country::orderBy('created_at', 'desc')->first();\n return redirect()->action(\n 'PayoutRates@edit', ['id' => $country->id]\n );\n } else {\n return view('admin.crud.rates.create');\n }\n }", "public function store(Request $request)\n {\n request()->validate([\n 'value' => 'required|numeric',\n 'name' => 'required',\n 'date' => 'required',\n ],[\n\n 'value.required' => 'Rate is required',\n 'value.numeric' => ' Rate must be a number',\n\n\n\n ]);\n\n $tax = $request->all();\n $date=date_create($tax['date']);\n $format = date_format($date,\"Y-m-d\");\n $tax['date'] = strtotime($format);\n CurrencyExchange::create($tax);\n\n\n return redirect()->route('currency-exchange.index')\n ->with('success','Rate has been added successfully.');\n }", "public function limitRate(?string $limitRate): self\n {\n $new = clone $this;\n $new->limitRate = $limitRate;\n\n return $new;\n }", "public function getRate(Currency $currency);", "public function addToRentalRate($item)\n {\n // validation for constraint: itemType\n if (!false) {\n throw new \\InvalidArgumentException(sprintf('The RentalRate property can only contain items of anyType, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->RentalRate[] = $item;\n return $this;\n }", "public function rate($from, $to)\n {\n return $this->_getRateToUse($from, $to);\n }", "function addAlterRate($design_no, $particulars,$particular_rate)\n\t\n\t{\n\t\t/*$stock_id\t\t\t =\tmysql_real_escape_string(trim($stock_id));*/\n\t\t$design_no\t \t\t =\ttrim($design_no);\n\t\t$particulars\t\t\t \t\t= mysql_real_escape_string(trim($particulars));\n\t\t$particular_rate\t\t\t =\tmysql_real_escape_string(trim($particular_rate));\n\t\t\n\t\t//satement to insert in stock table\n\t\t$insert\t\t= \"INSERT INTO alter_rate\n\t\t\t\t\t\t(design_no, particulars, particular_rate, added_on)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t('$design_no', '$particulars', '$particular_rate', \n\t\t\t\t\t\t\tnow())\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\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t//execute quary\n\t\t$query\t\t= mysql_query($insert);\n\t\t//echo $insert.mysql_error();exit;\n\t\t//get the product id\n\t\t$arate_id\t= mysql_insert_id();\n\t\t\n\t\t//return primary key\n\t\treturn $arate_id;\n\n\t}", "public function run()\n {\n Rate::create([\n\n 'general_rate' => '1',\n 'lob' => 'HO3',\n 'cov_a' => '0.009',\n 'other_structures' => '0.009',\n 'loss_of_use' => '0.009',\n 'med_pay_1k' => '1.05',\n 'med_pay_2_5k' => '1',\n 'med_pay_5k' => '0.95',\n 'aop_ded_1' => '1.10',\n 'aop_ded_2' => '1.05',\n 'aop_ded_3' => '1',\n 'aop_ded_4' => '0.95',\n 'aop_ded_5' => '0.90',\n 'frame' => '1',\n 'jm' => '1.05',\n 'bv' => '0.95',\n 'masonry' => '0.009',\n 'protection_class_1' => '1.15',\n 'protection_class_2' => '1.10',\n 'protection_class_3' => '1.05',\n 'protection_class_4' => '1',\n 'protection_class_5' => '1.05',\n 'new_purchase' => '1',\n 'prior_carrier' => '0.9',\n 'prior_carrier_name' => '0.95',\n 'zero_two_losses' => '1.10',\n 'more_than_two_losses' => '1.20',\n ]);\n\n Rate::create([\n\n 'general_rate' => '1.10',\n 'lob' => 'DP3',\n 'cov_a' => '0.009',\n 'other_structures' => '0.009',\n 'loss_of_use' => '0.009',\n 'med_pay_1k' => '1.05',\n 'med_pay_2_5k' => '1',\n 'med_pay_5k' => '0.95',\n 'aop_ded_1' => '1.10',\n 'aop_ded_2' => '1.05',\n 'aop_ded_3' => '1',\n 'aop_ded_4' => '0.95',\n 'aop_ded_5' => '0.90',\n 'frame' => '1',\n 'jm' => '1.05',\n 'bv' => '0.95',\n 'masonry' => '0.009',\n 'protection_class_1' => '1.15',\n 'protection_class_2' => '1.10',\n 'protection_class_3' => '1.05',\n 'protection_class_4' => '1',\n 'protection_class_5' => '1.05',\n 'new_purchase' => '1',\n 'prior_carrier' => '0.9',\n 'prior_carrier_name' => '0.95',\n 'zero_two_losses' => '1.10',\n 'more_than_two_losses' => '1.20',\n ]);\n\n Rate::create([\n\n 'general_rate' => '1.20',\n 'lob' => 'DP3',\n 'cov_a' => '0.009',\n 'other_structures' => '0.009',\n 'loss_of_use' => '0.009',\n 'med_pay_1k' => '1.05',\n 'med_pay_2_5k' => '1',\n 'med_pay_5k' => '0.95',\n 'aop_ded_1' => '1.10',\n 'aop_ded_2' => '1.05',\n 'aop_ded_3' => '1',\n 'aop_ded_4' => '0.95',\n 'aop_ded_5' => '0.90',\n 'frame' => '1',\n 'jm' => '1.05',\n 'bv' => '0.95',\n 'masonry' => '0.009',\n 'protection_class_1' => '1.15',\n 'protection_class_2' => '1.10',\n 'protection_class_3' => '1.05',\n 'protection_class_4' => '1',\n 'protection_class_5' => '1.05',\n 'new_purchase' => '1',\n 'prior_carrier' => '0.9',\n 'prior_carrier_name' => '0.95',\n 'zero_two_losses' => '1.10',\n 'more_than_two_losses' => '1.20',\n ]);\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function rate(Request $request, $id)\n {\n if(Auth::check()){\n $user_id = Auth()->user()->id;\n $project = Project::find($id);\n $maker_id = $project->maker();\n $user = User::find($maker_id);\n $rate = Rating::create([\n 'user_id' => $maker_id,\n 'project_id' => $project->id,\n ]);\n $rate->about = $request->input('about');\n $rate->rate = $request->input('rate');\n $ratings = Rating::where('user_id', $maker_id)->get();\n\n if ($ratings){\n $avgRating = [];\n foreach($ratings as $rating){\n array_push($avgRating, $rating->rate);\n }\n if (array_sum($avgRating) != 0 && count($avgRating) != 0){\n $avgRating = array_sum($avgRating) / count($avgRating) + 1;\n $user->rate = $avgRating;\n $user->save();\n } else {\n $user->rate = $request->input('rate');\n $user->save();\n }\n } else {\n $user->rate = $request->input('rate');\n $user->save();\n }\n \n $project->done = today();\n $project->save();\n $result = $rate->save();\n\n if ($result){\n return response()->json([\n 'message' => 'Vous avez noté la réalisation du projet.',\n 'type' => 'success',\n ], 200);\n } else {\n return response()->json([\n 'message' => 'Un problème est survenu, veuillez réessayer plus tard.',\n 'type' => 'errors',\n ], 500);\n }\n } else {\n return response()->json([\n 'message' => 'Vous n\\êtes pas connecté',\n 'type' => 'errors',\n ], 422);\n }\n }", "public function createPayment()\n\t{\n\n\t}", "public function create($amount, $currency = null): Money;", "public function setBaseToOrderRate($rate);", "protected function loadRates()\n {\n $currencyPairs = ['eurgbp', 'eurusd', 'gbpjpy', 'usdjpy'];\n\n foreach ($currencyPairs as $pair) {\n $pairObject = CurrencyPair::fromString($pair);\n $aRandomValue = mt_rand() / mt_getrandmax();\n $this->currencyRate[$pair] = new CurrencyRate($pairObject, $aRandomValue);\n }\n\n }", "public function createRateLimiter($options)\n {\n list($response) = $this->createRateLimiterWithHttpInfo($options);\n return $response;\n }", "public function getRate() {\n return $this->rate;\n }", "public function calculate()\r\n {\r\n if (! $this->isAvailable()) {\r\n return false;\r\n }\r\n\r\n $object = new CartShippingRate;\r\n\r\n $object->carrier = 'pickup';\r\n $object->carrier_title = $this->getConfigData('title');\r\n $object->method = 'pickup_pickup';\r\n $object->method_title = $this->getConfigData('title');\r\n $object->method_description = $this->getConfigData('description');\r\n $object->price = 0;\r\n $object->base_price = 0;\r\n\r\n return $object;\r\n }", "public function setStoreToBaseRate($rate);", "public function add_review_rating(Request $request){\n $data = $request->all();\n\n return BookReview::create($data);\n }", "public function create()\n {\n $disciplines = Discipline::all()->lists('abbrev', 'id')->all();\n\n return View::make('core::accounting.payrates_create')->with([\n 'disciplines' => $disciplines\n ]);\n }", "public function store(Request $request)\n {\n $price = Price::create($request->all());\n return new PriceResource($price);\n }", "public function create(Comment $comment, array $data)\n {\n $comment->rates()->attach(request()->user(), $data);\n }", "public static function VAT_BUYER(): VatRate\n {\n return self::fromCode('VAT_BUYER');\n }", "public function __construct(string $userName,Currency $currency,float $oldRate)\n {\n $this->userName = $userName;\n $this->currency = $currency;\n $this->oldRate = $oldRate;\n }", "public function create()\n {\n return view('admin.salonrates.create', ['bonuses' => $this->bonuses]);\n }", "public function setRate($rate, $currencyCode = null){\n $this->rate = (string) $rate;\n $this->currencyCode = (string) $currencyCode;\n }", "public function create()\n {\n\n return view('currency.create');\n \n }", "protected function _construct()\n {\n $rates = Mage::getSingleton('avatax/session')->getAvatax16Rates();\n if (is_array($rates)) {\n foreach ($rates as $key => $rate) {\n if ($rate['timestamp'] < $this->_getDateModel()->timestamp('-' . self::CACHE_TTL . ' minutes')) {\n unset($rates[$key]);\n }\n }\n $this->_rates = $rates;\n }\n return parent::_construct();\n }", "public function setBaseToGlobalRate($rate);", "public function store(Request $request)\n {\n $newRating = new Rating();\n $newRating->rate = $request->rate;\n $newRating->comment = $request->comment;\n $newRating->commentDate = now();\n $newRating->save();\n return response()->json([\n \n \"message\"=> \"Nueva valoración creada.\",\n \"idRatingCreated\"=> $newRating->id\n \n ],201);\n }", "public function addRate(Rate $rate, sfUser $user=null)\n {\n if (is_null($this->getItemId()))\n {\n throw new LogicException('You can not rate an object before having saved it');\n }\n\n if (!is_null($user) && !$user->canVote())\n {\n throw new LogicException('The given user can not vote !');\n }\n\n // update the ratable object\n if ($rate->getCreatedAt() == $rate->getUpdatedAt())\n {\n $this->getInvoker()->setNbRates($this->getInvoker()->getNbRates() + 1);\n $this->getInvoker()->setAvgRating(($this->getInvoker()->getAvgRating() + $rate->getValue()) / $this->getInvoker()->getNbRates());\n }\n else\n {\n $this->getInvoker()->setAvgRating($this->getInvoker()->computeAvgRating());\n }\n\n // update the rate object itself\n $rate->set('record_model', $this->getModel());\n $rate->set('record_id', $this->getItemId());\n\n // if needed, we bind the vote to an user\n if(kRateTools::isGuardBindEnabled() && !is_null($user) && $user->isAuthenticated())\n {\n $rate->set('user_id', $user->getGuardUser()->getId());\n }\n\n // save all\n $rate->save();\n $this->getInvoker()->save();\n\n return $this->getInvoker();\n }", "public function create()\n {\n\n $this->validate($this->request, Payment::createRules());\n\n $payment = new Payment;\n\n $payment->bill_id= $this->request->bill_id;\n \n $payment->save();\n \n return $this->response(201,\"Payment\", $payment );\n\n\n }", "public static function newPayment(){\n $result = mysql_query(\"INSERT INTO school_payments () VALUES()\") or die(mysql_error());\n $payment = new payment(mysql_insert_id());\n $payment->completed = date(\"Y-m-d H:i:s\");\n $payment->saveInfo();\n return $payment;\n }", "function createTable() {\r\n \r\n $conn = mysql_connect($this->mysql_host,$this->mysql_user,$this->mysql_pass);\r\n \r\n $rs = mysql_select_db($this->mysql_db,$conn);\r\n \r\n $sql = \"CREATE TABLE \".$this->mysql_table.\" ( currency char(3) NOT NULL default '', rate float NOT NULL default '0', PRIMARY KEY(currency) ) ENGINE=MyISAM\";\r\n \r\n $rs = mysql_query($sql,$conn) or die(mysql_error());\r\n \r\n $sql = \"INSERT INTO \".$this->mysql_table.\" VALUES('EUR',1)\";\r\n \r\n $rs = mysql_query($sql,$conn) or die(mysql_error());\r\n \r\n $this->downloadExchangeRates();\r\n }", "public function create()\n {\n $classes=ShippingClasses::all();\n $zones=ShippingZones::all();\n foreach($zones as $zone) {\n $zone->classes=ShippingClasses::where('zone',$zone->id)->paginate(50);\n }\n \n return view('backend.shipping.rates.create')\n ->with([\n 'classes' => $classes,\n 'zones' => $zones\n ]);\n }", "public function run()\n {\n $taxRates = [\n [\n 'rate' => 0.028\n ],\n [\n 'rate' => 0.016\n ],\n [\n 'rate' => 0.019\n ],\n ];\n\n foreach($taxRates as $taxRate) {\n TaxRate::create($taxRate);\n }\n }", "public function create(Request $request)\n {\n $pres=new Prescription;\n\n $pres->appt_id=$request->input('appt_id');\n $pres->weight=$request->input('weight');\n $pres->bp_low=$request->input('bpLow');\n $pres->bp_high=$request->input('bpHigh');\n $pres->save();\n\n return $pres;\n }", "public function __construct(User $user, Currency $currency, float $oldRate)\n {\n $this->user = $user;\n $this->currency = $currency;\n $this->oldRate = $oldRate;\n }", "public function calculate()\n {\n if (! $this->isAvailable())\n return false;\n\n $cart = Cart::getCart();\n\n $object = new CartShippingRate;\n\n $object->carrier = 'flatrate';\n $object->carrier_title = $this->getConfigData('title');\n $object->method = 'flatrate_flatrate';\n $object->method_title = $this->getConfigData('title');\n $object->method_description = $this->getConfigData('description');\n\n if ($this->getConfigData('type') == 'per_unit') {\n $object->price = core()->convertPrice($this->getConfigData('default_rate')) * $cart->items_qty;\n $object->base_price = $this->getConfigData('default_rate') * $cart->items_qty;\n } else {\n $object->price = core()->convertPrice($this->getConfigData('default_rate'));\n $object->base_price = $this->getConfigData('default_rate');\n }\n\n\n return $object;\n }", "public function __construct($exchange_rate_provider_plugin_id, $timestamp, $source_currency_code, $destination_currency_code, $rate) {\n $this->destinationCurrencyCode = $destination_currency_code;\n $this->exchangeRateProviderPluginId = $exchange_rate_provider_plugin_id;\n $this->rate = $rate;\n $this->sourceCurrencyCode = $source_currency_code;\n $this->timestamp = $timestamp;\n }", "public function getStoreToBaseRate();", "function createrate()\r\n {\r\n $this->set('suffix', 'shippingrates');\r\n $model = $this->getModel( $this->get('suffix') );\r\n \r\n $row = $model->getTable();\r\n $row->bind($_POST);\r\n if ( $row->save() ) \r\n {\r\n $model->clearCache();\r\n \r\n $dispatcher = JDispatcher::getInstance();\r\n $dispatcher->trigger( 'onAfterSave'.$this->get('suffix'), array( $row ) );\r\n } \r\n else \r\n {\r\n $this->messagetype = 'notice'; \r\n $this->message = JText::_('COM_TIENDA_SAVE_FAILED').\" - \".$row->getError();\r\n }\r\n \r\n $redirect = \"index.php?option=com_tienda&controller=shippingmethods&task=setrates&id={$row->shipping_method_id}&tmpl=component\";\r\n $redirect = JRoute::_( $redirect, false );\r\n \r\n $this->setRedirect( $redirect, $this->message, $this->messagetype );\r\n }", "public function testBuyRateObject()\n {\n VCR::insertCassette('orders/buyRateObject.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy($order->rates[0]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }" ]
[ "0.7203546", "0.685958", "0.6459739", "0.6421608", "0.6408829", "0.64032394", "0.63497365", "0.63497365", "0.62897855", "0.62035644", "0.6171757", "0.61704195", "0.60858905", "0.60220295", "0.6018074", "0.60143894", "0.6000861", "0.5987628", "0.59868854", "0.5967426", "0.5952014", "0.5919519", "0.5912758", "0.5831671", "0.58225673", "0.5785939", "0.57858354", "0.57363504", "0.57172525", "0.5678492", "0.55990314", "0.5585727", "0.5578295", "0.5576102", "0.55749667", "0.55487525", "0.55461055", "0.55384874", "0.5505549", "0.5494885", "0.5482346", "0.54571944", "0.545242", "0.54404026", "0.5428622", "0.54190433", "0.54189456", "0.54148084", "0.5380451", "0.5380451", "0.5378446", "0.5355458", "0.53229", "0.53226703", "0.53156245", "0.5307314", "0.52943796", "0.5288888", "0.52838695", "0.52631253", "0.5258162", "0.52573836", "0.5251775", "0.5251775", "0.5251775", "0.5251775", "0.5251775", "0.5236328", "0.5226189", "0.5224057", "0.5221004", "0.5218497", "0.5216274", "0.5201865", "0.5172903", "0.51694787", "0.51642644", "0.5137679", "0.51344717", "0.51332384", "0.512224", "0.508515", "0.5084363", "0.5081332", "0.5068641", "0.50632435", "0.5062204", "0.5060141", "0.5054603", "0.50536495", "0.5051518", "0.50504434", "0.50426656", "0.5034025", "0.5027059", "0.5024269", "0.5022326", "0.5012729", "0.5001008", "0.49986008", "0.49981743" ]
0.0
-1
Create a new controller instance.
public function __construct(HotelRepository $hotelRepo) { $this->middleware('auth'); $this->hotelRepo = $hotelRepo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82678324", "0.8173564", "0.78118384", "0.7706353", "0.76816905", "0.7659159", "0.74858105", "0.7406485", "0.7298472", "0.7253435", "0.7196091", "0.7174443", "0.7016074", "0.6989523", "0.69837826", "0.69728553", "0.69640046", "0.69357765", "0.6897687", "0.689282", "0.68775725", "0.6868809", "0.68633306", "0.6839021", "0.6779905", "0.6705274", "0.6670987", "0.66623807", "0.6652613", "0.6643801", "0.6616729", "0.66143125", "0.65891534", "0.6449129", "0.64461046", "0.6429425", "0.6426337", "0.63015336", "0.6298573", "0.6294075", "0.62801653", "0.6259914", "0.62554234", "0.6167662", "0.61630553", "0.61601174", "0.6141946", "0.6137726", "0.6134302", "0.6133732", "0.61287725", "0.6110795", "0.60950965", "0.6089703", "0.60768735", "0.6066286", "0.60595477", "0.6055387", "0.60451794", "0.6028352", "0.60246956", "0.60228956", "0.6019088", "0.6012698", "0.6011448", "0.60113615", "0.60076576", "0.6004189", "0.5998927", "0.5997798", "0.5993557", "0.59863526", "0.59863526", "0.59863526", "0.59706056", "0.59546155", "0.59493065", "0.5940633", "0.59251904", "0.59143347", "0.5913916", "0.59121555", "0.59111917", "0.5909761", "0.59026676", "0.59009403", "0.5899209", "0.58973104", "0.58964044", "0.58933777", "0.5888429", "0.58760023", "0.5869122", "0.5863149", "0.58622074", "0.5849116", "0.5838678", "0.5831741", "0.5824525", "0.58167094", "0.58122987" ]
0.0
-1
Show the application dashboard.
public function index() { $search['q'] = request('q'); $hotels = $this->hotelRepo->findAll($search); return view('hotels.index',compact('hotels','search')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Mostrar vista crear usuario
public function create() { return view('hotels.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function agregarUsuario(){\n \n }", "public function crearUsuario(){\n\t\t\n\t\t$fecha = date('dmYHis');\n\n\t\techo 'Ahora son las: ' . $fecha;\n\n\t\t/* User::create([\n\t\t\t'name' => 'Nombre ' . $fecha,\n\t\t\t'email' => 'email' . $fecha . '@gmail.com',\n\t\t\t'password' => Hash::make($fecha . $fecha),\n\t\t\t'descripcion' => 'Una descripción: ' . $fecha,\n\t\t\t'admin' => 0,\n\t\t]); */\n\n\t\tUser::create([\n\t\t\t'name' => 'Jorge Cortazar',\n\t\t\t'email' => '[email protected]',\n\t\t\t'password' => Hash::make('jorge'),\n\t\t\t'descripcion' => 'Si... de INTA',\n\t\t\t'admin' => '0',\n\t\t]);\n\n\t\techo '<br><br>Usuario creado';\n\t}", "public function vistaFormularioUsuarioAction(){\n $em = $this->getDoctrine()->getManager();\n $empresas = $em->getRepository('TheClickCmsAdminBundle:Empresa')->findAll();\n\n\t return $this->render('TheClickCmsAdminBundle:Default:agregarUsuarios.html.twig' , array('empresa' => $empresas));\n\t}", "public function create()\n {\n return view('admin.dashboard.usuarios.tecnico.create');\n }", "function cadastrarUser(){\n //$this->session->set_tempdata('erro-acesso', 'login e senha n&atilde;o correspondem!', 5);\n\t \n\t\t/*$verificarUser = $this->login->get_verificar_user('sytesraul', '513482am');\n\t\tif($verificarUser != null) :\n\t\t\techo \"USUARIO JA CADASTRADO \".$verificarUser->name_login;\n\t\tendif;*/\n\t //redirect('login/acessoAceito', 'refresh');\n\t \n\t\t$dados['titulo'] = 'Cadastrar Usuário';\n\t\t$dados['h2'] = 'Tela de Cadastro';\n\t\t$this->load->view('login/cadastrar_user_view', $dados);\n\t\t\n\t\t\n\t}", "public function create()\n {\n return view('usuarios.criar-usuario', [\n 'tipos' => EnumExtractor::title(TipoUsuario::class)\n ]);\n }", "public function create()\n {\n //\n return view(\"local.usuario.create\");\n }", "public function crearUsuario() {\n\n\n if ($this->seguridad->esAdmin()) {\n $id = $this->usuario->getLastId();\n $usuario = $_REQUEST[\"usuario\"];\n $contrasenya = $_REQUEST[\"contrasenya\"];\n $email = $_REQUEST[\"email\"];\n $nombre = $_REQUEST[\"nombre\"];\n $apellido1 = $_REQUEST[\"apellido1\"];\n $apellido2 = $_REQUEST[\"apellido2\"];\n $dni = $_REQUEST[\"dni\"];\n $imagen = $_FILES[\"imagen\"];\n $borrado = 'no';\n if (isset($_REQUEST[\"roles\"])) {\n $roles = $_REQUEST[\"roles\"];\n } else {\n $roles = array(\"2\");\n }\n\n if ($this->usuario->add($id,$usuario,$contrasenya,$email,$nombre,$apellido1,$apellido2,$dni,$imagen,$borrado,$roles) > 1) {\n $this->perfil($id);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n } \n } else {\n $this->gestionReservas();\n }\n \n }", "public function create() {\n return view('fuse.cadastros.usuarios.create');\n }", "public function create()\n {\n $this->checkPermission('cadastrar_usuario');\n return view('user.create');\n }", "public function crear()\n {\n $rols = Rol::orderBy('id')->pluck('nombre', 'id')->toArray();\n return view('admin.usuario.crear', compact('rols'));\n }", "static public function ctrCrearUsuario(){\n \t\tif(isset($_POST[\"nuevoUsuario\"])){\n \t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNombre\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoPassword\"])){\n\n\n\t\t\t\t//Inicializamos la ruta de la foto por si no hay foto.\n\t\t\t\t$ruta =\"\";\n\n\n \t\t\t\t$tabla = \"usuarios\";\n\n \t\t\t\t//$encriptar = crypt($_POST[\"nuevoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n \t\t\t\t$encriptar = $_POST[\"nuevoPassword\"];\n\n\n \t\t\t\t$datos = array (\"nombre\" => $_POST[\"nuevoNombre\"],\n \t\t\t\t\t\t\t\t\"usuario\" => $_POST[\"nuevoUsuario\"],\n \t\t\t\t\t\t\t\"password\" => $encriptar ,\n \t\t\t\t\t\t\"perfil\" => $_POST[\"nuevoPerfil\"]);\n\t\t\t\t\t\t \n\t\t\t\t$nombreValido = ModeloUsuarios::mdlValidadUsuario($tabla, $_POST[\"nuevoUsuario\"]);\n\t\t\t\t$respuesta = \"\";\n\t\t\t\tif($nombreValido)\n\t\t\t\t \t$respuesta = ModeloUsuarios::mdlIngresarUsuario($tabla, $datos);\n\n \t\t\t\tif($respuesta == \"ok\" AND $nombreValido ){\n\n \t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡El usuario ha sido guardado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n \t\t\t\t}else \t\t\n \t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El usuario no se ha logrado ingresar!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n \t\t\t\t\n\n \t\t\t}else {\n \n \t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El usuario no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n\n \t\t\t}\n \n \n\n\n \t\t}\n\n\t}", "public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }", "public function create()\n {\n $usuario = Auth::user();\n if($usuario->usu_rol == 2){\n }\n return view('publico.registro_usuario');\n }", "public function create()\n {\n $this->authorize('crear-usuario');\n\n $roles = Rol::all();\n $lineasInvestigacion = LineaInvestigacion::all();\n return view('panel_administracion.users.crear', compact('roles', 'lineasInvestigacion'));\n }", "public function create()\n {\n return view('usuarios.crear_usuario');\n }", "public function create()\n {\n\t\tif(Auth::user()->rol->permisos->contains(1))\n\t\t{\t\n\t\t\t$prmRol = Rol::All();\n\t\t\treturn view('admin.usuario.create',compact('prmRol'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn abort(401);\n\t\t}\n }", "public function create()\n {\n return view('Administrador.createUsuari');\n }", "function crearUsuario(){\n\t\t$params = array(\n\t\t\t':nombres' => $_POST['nombres'],\n\t\t\t':apellidos' => $_POST['apellidos'],\n\t\t\t':direccion' => $_POST['direccion'],\n\t\t\t':foto' => $_POST['foto'],\n\t\t\t':email' => $_POST['email'],\n\t\t\t':usuario' => $_POST['usuario'],\n\t\t\t':contrasena' => $_POST['contrasena'],\n\t\t\t\n\t\t);\n\t\n\t\t/* Preparamos el query apartir del array $params*/\n\t\t$query = 'INSERT INTO usuarios \n\t\t\t\t\t(nombres, apellidos, direccion, foto, email, usuario, contrasena, permisos) \n\t\t\t\tVALUES \n\t\t\t\t\t(:nombres,:apellidos,:direccion,:foto,:email,:usuario,:contrasena, 2)';\n\n\t\t/* Ejecutamos el query con los parametros */\n\t\t$result = excuteQuery(\"blogs\",\"\", $query, $params);\n\t\tif ($result > 0){\n\t\t\theader('Location: formlogin.php?result=true');\n\t\t}else{\n\t\t\theader('Location: addUser.php?result=false');\n\t\t}\n\t}", "public function create()\n {\n return view('automotores.usuarios.create');\n }", "public function crearUsuarioView()\n {\n $roles=roles::all(); \n return view('layouts.crudUsuario.crearUsuario',compact('roles'));\n }", "public function create()\n {\n $socios = User::where('tipo','=',2)->pluck('nombres','id');\n return view('crud.asistencia.create',compact('socios'));\n }", "public function create()\n {\n if(\\Auth::user()) {\n if(\\Auth::user()->editado != 0) {\n \\Auth::logout();\n session()->flush();\n return redirect('/login')->withErrors('Sua conta foi alterada. Por favor faça login novamente');\n }\n }\n\n return view('pages.users.create',\n ['section_title' => 'Novo Usuário']);\n }", "public function create()\n {\n return view('login.altausuario');\n }", "public function create()\n {\n return view('user.crear');\n }", "public function create()\n {\n $this->setTitleDescription('Uživatelé', 'nový uživatel');\n $roles = Role::enabled()->get();\n return view('admin.users.create', compact('roles'));\n }", "public function create()\n {\n $pacientes = User::where('type', '!=','Especialista')->orderBy('first_name', 'asc')->get(['first_name', 'last_name', 'id']);\n\n return view('admin.pagos.create', compact('pacientes'));\n }", "private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}", "public function actionCreate() {\n $id_user = Yii::app()->user->getId();\n $model = User::model()->findByPk($id_user);\n $tipo = $model->id_tipoUser;\n if ($tipo == \"1\") {\n $model = new Consultor;\n $modelUser = new User;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Consultor'])) {\n $model->attributes = $_POST['Consultor'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n \n \n \n $senha = uniqid(\"\", true);\n $modelUser->password = $senha;\n $modelUser->username = $_POST['username'];\n $modelUser->email = trim($model->email);\n $modelUser->attributes = $modelUser;\n $modelUser->id_tipoUser = 4;\n $modelUser->senha = '0';\n\n if ($modelUser->save()) {\n\n $model->id_user = $modelUser->id;\n if ($model->save()) {\n $this->redirect(array('EnviaEmail', 'nomedestinatario' => $model->nome, \"emaildestinatario\" => $model->email, \"nomedeusuario\" => $modelUser->username, \"senha\" => $modelUser->password));\n }\n }\n \n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n \n }else {\n $this->redirect(array('User/ChecaTipo'));\n }\n }", "public function create()\n {\n return View::make('usuario.create');\n }", "public function create()\n\t{\n\t\treturn view('usuario.create');\n\t}", "public function create()\n {\n PermissionController::temPermissao('usuarios.update');\n $unidades = DB::table('unidade')->get();\n $niveis = DB::table('roles')->where('deleted_at', null)->get();\n return view('usuarios.create', ['unidades' => $unidades, 'niveis' => $niveis]);\n }", "public function create()\n {\n\n return view('fourmulario.nuevo.usuario');\n }", "public function create()\n {\n\n\n //aqui agregamos la vista para crear un usuario\n return view('users.create');\n }", "public function create()\n\t{\n\t\tValidaAccesoController::validarAcceso('usuarios','escritura');\n\t\t$form_data = array('route' => array('usuarios.store'), 'method' => 'post');\n $action = 'Crear';\n $usuario = null;\n\t\treturn View::make('admin/usuario',compact('usuario','form_data','action'));\n\t}", "public function create()\n {\n $usuariosComuns = (new User())->getUsuariosComuns();\n return view('app.projeto.create', ['usuarios' => $usuariosComuns]);\n }", "public function create()\n {\n return view(\"usuarios.create\");\n }", "public function create()\n {\n return view(\"usuarios.create\");\n }", "public function create()\n {\n return view('usuarios.create' );\n }", "public function create()\n {\n //echo \"teste create\";exit();\n return view('admin.usuarios.adicionar');\n }", "public function nuevo(){\r\n if($_SESSION[\"inicio\"] == true){\r\n return Vista::crear(\"admin.usuario.crear\");\r\n }else{\r\n return redirecciona()->to(\"/\");\r\n }\r\n\r\n }", "public function create()\n {\n return view('respostas_usuarios.create');\n }", "public function actionCreate()\n {\n $model = new NuevoUsuario();\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $LoginFrom = new LoginForm;\n $LoginFrom->password = $model->Clave;\n $LoginFrom->username = $model->NombreUsuario;\n if ($LoginFrom->login()){\n // provisoriamente lo inscribe al torneo programate para hacegurar el registro\n //$this->redirect(array('/torneo/inscripcion','idTorneo'=>1));\n $this->redirect(array('/site'));\n \n }else{\n $this->redirect(array('/site/login'));\n }\n }\n return $this->render('nuevousuario', [\n \n 'model' => $model,\n ]);\n \n\n \n }", "public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }", "public function create()\n { \n \n $users = DB::table('usuarios')\n ->select('usuario')\n ->get();\n return view(\"nueva-reserva\")\n ->with(\"users\", $users);\n \n \n \n }", "static public function ctrCrearUsuario(){\n\n\n if(isset($_POST[\"nuevoUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNombre\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoPassword\"])){\n\n\n //Validar la imagen\n\n $revisar = getimagesize($_FILES[\"nuevaFoto\"][\"tmp_name\"]);\n\n if($revisar !== false){\n\n //Crear directorio\n $directorio = \"vistas/img/usuarios/\".$_POST[\"nuevoUsuario\"];\n\t\t\t\t mkdir($directorio, 0755);\n\n //Asignar nombre a la foto\n $aleatorio = mt_rand(100,999);\n $pname = $aleatorio.\"-\".$_FILES[\"nuevaFoto\"][\"name\"];\n\n $tname = $_FILES[\"nuevaFoto\"][\"tmp_name\"];\n\n $ruta = $directorio.\"/\".$pname;\n\n move_uploaded_file($tname, $directorio.'/'.$pname);\n\n } else {\n $ruta = \"\";\n }\n\n \n\n $tabla = \"tblusuarios\";\n\n $encriptar = crypt($_POST[\"nuevoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\n $datos = array(\"nombre\" => $_POST[\"nuevoNombre\"],\n \"usuario\" => $_POST[\"nuevoUsuario\"],\n \"password\" => $encriptar,\n \"perfil\" => $_POST[\"nuevoPerfil\"],\n \"foto\" => $ruta\n );\n \n $respuesta = ModeloUsuarios::MdlIngresarUsuario($tabla, $datos);\n\n if($respuesta == \"ok\"){\n\n echo '<script>\n\n\t\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"success\",\n\t\t\t\t\t\ttitle: \"El usuario ha sido guardado correctamente\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n \n }else{\n\n '<script>\n alert(\"Error al guardar el usuario\");\n\n\t\t\t\t\t</script>';\n\n }\n\n\n\n\t\t\t}else{\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"error\",\n\t\t\t\t\t\ttitle: \"¡El usuario no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n\t }\t}\n\n\n\t}", "public function create()\n {\n //\n if ($this->security(9)) {\n $perfiles = Perfiles::lists('name', 'id')->toArray();\n $entidad = Entidades::all();\n $titulos = Cargos::lists('name', 'id')->toArray();\n $categorias = Usercategories::lists('name', 'id')->toArray();\n return view('administracion.usuarios.new', compact('perfiles', 'entidad', 'titulos', 'categorias'));\n }\n }", "public function createUsuario()\n {\n $hash = password_hash($this->contra, PASSWORD_DEFAULT);\n $sql = 'INSERT INTO administradores(nombre, apellido, correo, usuario, contra)\n VALUES(?, ?, ?, ?, ?)';\n $params = array($this->nombre, $this->apellido, $this->correo, $this->usuario, $hash);\n return Database::executeRow($sql, $params);\n }", "public function create()\n {\n $title = 'Cadastrar novo usuário';\n\n return view('panel.users.create', compact('title'));\n }", "public function create()\n {\n return view('operador/incidencia_create',['usuario' => Auth::user()]);\n }", "public function create(){\n include 'views/usuario/nuevo.php';\n }", "public function create()\n\t{\n // $this->load->view('index', $variaveis);\n \n $variaveis['titulo'] = 'Cadastro Usuários';\n\t\t$this->load->view('usuarios_cad', $variaveis);\n\t}", "public function create()\n {\n return view('resources.admin.tipos_usuarios.create');\n }", "public function create() {\n $roles = Rol::all();\n $carreras = Carrera::all();\n return view('usuario.admin.usuarios.create', ['roles'=>$roles, 'carreras'=>$carreras]);\n }", "public static function getNewUser($request){\r\n //CONTEUDO DA FORMULARIO\r\n $content= View::render('admin/modules/users/form',[\r\n\t\t\t'title' => 'Cadastrar Usuario',\r\n\t\t\t'nome' => '',\r\n\t\t\t'email' => '',\r\n\t\t\t'status' => self::getStatus($request)\r\n ]);\r\n\r\n //RETORNA A PAGINA COMPLETA \r\n return parent::getPanel('Cadastrar Usuarios - AliDEV',$content,'users');\r\n\r\n\r\n }", "public function create()\n {\n return view('usuario.create');\n }", "public function create()\n {\n return view('usuario.create');\n }", "public function create()\n {\n return view('usuario.create');\n }", "public function create()\n {\n return view('usuario.create');\n }", "public function create()\n {\n return view('usuario.create');\n }", "public function create()\n {\n return view('usuario.create');\n }", "static public function ctrCreateUser(){\n\t\t\tif(isset($_POST[\"nuevoUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"nuevoNombre\"]) &&\n\t\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"nuevoUsuario\"]) &&\n\t\t\t\t\tpreg_match('/^[a-zA-Z0-9]+$/',$_POST[\"nuevoPassword\"])){\n\n\t\t\t\t\t/*========================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t========================================*/\n\t\t\t\t\t\n\t\t\t\t\t$ruta = NULL;\n\n\t\t\t\t\tif(isset($_FILES[\"nuevaFoto\"][\"tmp_name\"]) && $_FILES[\"nuevaFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"nuevaFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"nuevoUsuario\"];\n\t\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"nuevaFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"nuevoUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"nuevaFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"nuevaFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"nuevoUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"nuevaFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t\t$crPassword = crypt($_POST[\"nuevoPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"nuevoNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"nuevoUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"nuevoPerfil\"],\n\t\t\t\t\t\t\"ruta\" => $ruta);\n\n\t\t\t\t\t$respuesta = ModelUsers::mdlAddUser($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"El usuario se ha guardado correctamente\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al añadir usuario\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"El usuario no puede ir vacio ni llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t}", "public function create()\n {\n $unidades = Unidad::orderby('numero')->get();\n return view('usuarios.create')->with('unidades',$unidades);\n }", "public function actionCreate()\n {\n if(Permiso::requerirRol('administrador')){\n $this->layout='/main2';\n }\n $mensaje=\"\";\n $model = new Usuario();\n if ($model->load(Yii::$app->request->post())){\n if(!$model1=Usuario::find(['$model->dniUsuario'])->One()){\n $model->claveUsuario = crypt($model->claveUsuario, Yii::$app->params[\"salt\"]);\n $model->authkey = $this->randKey(\"ab1cde7fgh9wxztu5AGTY0UIO3WCBN6XZQ4HK\", 50);//clave será utilizada para activar el usuario\n $model->activado=1;\n if($model->save()) {\n return $this->redirect(['view', 'id' => $model->idUsuario]);\n }\n }else{\n $mensaje=\"El Dni ya existe, revise los registros.\";\n }\n }\n $model->dniUsuario='';\n return $this->render('create', [\n 'model' => $model,\n 'mensaje'=>$mensaje,\n ]);\n }", "public function create()\n {\n $user = Auth::user();\n if ($user->rol == 1) {\n return view('layouts.usuaris.crea');\n }\n return redirect('/');\n\n }", "function agregar($nombre,$correo,$usuario,$rol,$zonah,$estado,$psw)\n {\n $Valores = \"'\".$usuario.\"','\".$psw.\"','\".$nombre.\"','\".$correo.\"',\".$estado.\",\".$zonah.\",\".$rol;\n $this->Insertar(\"usuarios\",\"usuario,password,nombre,correo,activo,zonashorarias_id,roles_id\",$Valores);\n }", "static public function ctrCrearUsuario(){\n\n\t\tif (isset($_POST['newUser'])) {\n\t\t\tif (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"newName\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9 ]+$/', $_POST[\"newUsername\"])) {\n\t\t\t \t/*======================================\n\t\t\t \t= Validar Imagen =\n\t\t\t \t======================================*/\n\t\t\t \t$ruta=\"\";\n\t\t\t \tif (isset($_FILES['photo']['tmp_name']) && !empty($_FILES['photo']['tmp_name'])) {\n\t\t\t \t\tlist($ancho,$alto) = getimagesize($_FILES['photo']['tmp_name']);\n\t\t\t \t\t$nuevoAncho = 500;\n\t\t\t \t\t$nuevoAlto = 500;\n\t\t\t \t\t/*==========================================\n\t\t\t \t\t= CREANDO DIRECTORIO =\n\t\t\t \t\t==========================================*/\n\t\t\t \t\t$directorio = \"Views/img/usuarios/\".$_POST['newUsername'];\n\t\t\t \t\tmkdir($directorio,0755);\n\t\t\t \t\t/*===========================================================================\n\t\t\t \t\t= Funciones defecto PHP dependiendo de tipo de imagen =\n\t\t\t \t\t===========================================================================*/\n\t\t\t \t\tswitch ($_FILES['photo']['type']) {\n\t\t\t \t\t\tcase 'image/jpeg':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.jpg';\n\t\t\t \t\t\t\t$origen = imagecreatefromjpeg($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagejpeg($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tcase 'image/png':\n\t\t\t \t\t\t\t$preruta = date('Y-m-d_his');\n\t\t\t \t\t\t\t$preruta = (string)$preruta;\n\t\t\t \t\t\t\t$ruta = $directorio.'/'.$_POST['newUsername'].'_'.$preruta.'.png';\n\t\t\t \t\t\t\t$origen = imagecreatefrompng($_FILES['photo']['tmp_name']);\n\t\t\t \t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\t\t\t \t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t \t\t\t\timagepng($destino,$ruta);\n\t\t\t \t\t\t\tbreak;\n\t\t\t \t\t\tdefault:\n\t\t\t \t\t\t\t# code...\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\n\t\t\t \t}\n\t\t\t \t$answer = new adminph\\User();\n\t\t\t \t$answer->name = $_POST['newName'];\n\t\t\t \t$answer->username = $_POST['newUsername'];\n\t\t\t \t$answer->password = password_hash($_POST[\"newPassword\"], PASSWORD_DEFAULT);\n\t\t\t \t$answer->type = $_POST['rol'];\n\t\t\t \t$answer->code = $_POST['newOrganizationCode'];\n\t\t\t \t$answer->photo = $ruta;\n\t\t\t if ($answer->save()) {\n\t\t\t \treturn redirect('usuarios');\n\t\t\t }\n\t\t\t } else {\n\t\t\t \treturn view('layouts.users_error');\n\t\t\t }\n\t\t}\n\n\t}", "public function create()\n\t{\n\t\treturn view('usuarios.create');\n\t}", "public function create()\n {\n return view('admin.usuarios.create');\n }", "public function create()\n {\n return view('admin.ajouteruser');\n }", "public function create()\n {\n // cria um registro em branco\n $this->repository->new();\n \n // autoriza\n $this->repository->authorize('create');\n \n // breadcrumb\n $this->bc->addItem('Novo');\n \n // retorna view\n return view('usuario.create', ['bc'=>$this->bc, 'model'=>$this->repository->model]);\n }", "public function create()\n {\n //hace una consulta de todos los usuarios\n $users = User::all();\n return view('admin.dashboard.usuarios.administradores.registroAdmin', compact('users'));\n }", "function ListaUsuario() {\n\t\n\t\t\t$sql = \"SELECT usu.*, CONCAT_WS(' ', per.primer_nombre, per.primer_apellido) as nombre_completo, usu.nombre_usuario, rol.descripcion FROM usuario usu\n\t\t\t\t\tINNER JOIN rol rol ON rol.id = usu.rol_id\n\t\t\t\t\tINNER JOIN persona per ON per.id = usu.persona_id\";\n\t\t\t$db = new conexion();\n\t\t\t$result = $db->consulta($sql);\n\t\t\t$num = $db->encontradas($result);\n\t\t\t$respuesta->datos = [];\n\t\t\t$respuesta->mensaje = \"\";\n\t\t\t$respuesta->codigo = \"\";\n\t\t\tif ($num != 0) {\n\t\t\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t\t\t}\n\t\t\t\t$respuesta->mensaje = \"Ok\";\n\t\t\t\t$respuesta->codigo = 1;\n\t\t\t} else {\n\t\t\t\t$respuesta->mensaje = \"No existen registros de roles.\";\n\t\t\t\t$respuesta->codigo = 0;\n\t\t\t}\n\t\t\treturn json_encode($respuesta);\n\t\t}", "public function getCreate()\n {\n //添加用户\n return view('admin.houtai.user.add',['title'=>'添加用户']);\n }", "public function create()\n {\n \n /* $usuarios = User::all();\n\n return view('editar_usuario', compact('usuarios'));\n */\n\n }", "public function create()\n {\n //\n\n return view('usuario.create');\n }", "public function create() {\n // Obtiene las categorias en que es posible publicar\n $categorias = Categoria::all();\n\n // Se muestra el formulario (se envian las cateogiras para llenar el combobox)\n return view('usuario.create')->with('categorias', $categorias);\n }", "public function crear()\n {\n //\n return view('admin.permiso.crear');\n }", "public function create()\n {\n $misPerfiles = Perfil::getId();\n return view('usuarios.create', compact('misPerfiles'));\n }", "public function create()\n {\n $roles = $this->getRoles();\n $colegios = Colegio::orderBy('nombre')->get()->pluck('nombre', 'id')->toArray();\n\n return view('user::admin.custom-users.create', compact('roles', 'colegios'));\n }", "public function nuevo(){\n $user = \\Auth::user();\n if($user->rol != \"Administrador\"){\n $users = User::where('rol', 'Administrador')->get();\n }else if($user->rol == \"Administrador\"){\n $users = User::all();\n }\n \n return view('mensajes.nuevo', [\n 'user' => $users\n ]);\n }", "public function create()\n {\n $roul=['0'=>'مشترک','1'=>'مدیر'];\n return View('admin.users.create',['roul'=>$roul]);\n }", "public function create(){\n\t\t$this->autenticate();\n\t\t$user_id = $_POST['id'];\n\t\t$nombre = \"'\".$_POST['nombre'].\"'\";\n\t\t$cedula = \"'\".$_POST['cedula'].\"'\";\n\t\t$nacimiento = \"'2000/1/1'\"; //fecha de nacimiento default, despues el mismo usuario la puede editar\n\t\trequire_once(\"../app/models/administrativo.php\");//conexion entre los controladores\n\t\t$administrativo=new Administrativo();// crea el perfil administrativo vacio\n\t\t$administrativo->new($nombre,$cedula,$nacimiento); // inserta la informacion antes ingresada en la base de datos\n\t\t$administrativo_id = $administrativo->where(\"cedula\",$cedula); // se trae el perfil administrativo recien creado con la cedula\n\t\t$administrativo_id = $administrativo_id[0][\"id\"];\n\t\t$administrativo->attach_user($user_id,$administrativo_id); // amarra el usuario a su nuevo perfil docente\n\t\t$administrativo_id = strval($user_id);//convierte el user_id de entero a string\n\t\theader(\"Location: http://localhost:8000/usuarios/show/$user_id\");\n\t\texit;\n\t\t$this->view('administrativos/index', []);\n\t}", "public function create()\n {\n if ( Gate::denies('criar-user')){\n abort(403, 'Não tem Permissão para criar um utilizador');\n }\n return view('users.create');\n }", "public function create() {\n return view('usuarios.create');\n }", "static public function ctrCrearUsuario()\n\t{\n\t\t// $usu = $_POST['nuevoUsuario'];\n\t\t// echo \"<script>console.log( 'Debug Objects: \" . $usu . \"' );</script>\";\n\n\n\t\t// hacemos el filtro cuando llegan por post\n\n\t\t// Devuelve true si la variable existe y tiene un valor distinto de null, false de lo contrario.\n\t\t// if(isset($_POST['nuevoUsuario']) && !empty($_POST['nuevoUsuario']))\n\t\tif(isset($_POST['nuevoUsuario']))\n\t\t{\n\n\t\t\t// $usu = $_POST['nuevoUsuario'];\n\t\t\t// echo \"<script>console.log( 'Debug Objects: \" . $usu . \"' );</script>\";\n\t\t\t// echo \"<script>alert( 'Debug Objects: \" . $usu . \"' );</script>\";\n\t\t\t\n\t\t\t//vamos a permitir caracteres especiales con tilde,espacio en blanco y numericos con expresion regular\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓü ]+$/', $_POST['nuevoNombre']) &&\n\t\t\tpreg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓü ]+$/', $_POST['nuevoUsuario']) &&\n\t\t\tpreg_match('/^[a-zA-Z0-9]+$/', $_POST['nuevoPassword']))\n\t\t\t{\n\t\t\t\t\n\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\n\t\t\t\t$ruta = \"\";\n\n\t\t\t\t// si existe el archivo temporal del archivo file\n\t\t\t\tif(isset($_FILES['nuevaFoto']['tmp_name']))\n\t\t\t\t{\n\t\t\t\t\t// vamos a recortar la imagen 500 x 500 px\n\n\t\t\t\t\t// list — Asignar variables como si fueran un array\n\t\t\t\t\t// getimagesize — Obtener el tamaño de una imagen\n\t\t\t\t\t//en list() toma el indice 0 de [nuevaFoto][tmp_name](los indice del archivo temporal son medidas de la imagen) y asigna a $ancho y el indice 1 asigna a $alto \n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES['nuevaFoto']['tmp_name']);\n\n\t\t\t\t\t// redimensionamos\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t// creamos la ruta donde se va a guardar la imagen\n\t\t\t\t\t$directorio = 'vistas/img/usuarios/'.$_POST['nuevoUsuario'];\n\n\t\t\t\t\t// vamos a crear el directorio\n\t\t\t\t\tmkdir($directorio, 0755);\n\n\n\t\t\t\t\t/*====================================================================\n\t\t\t\t\tDEACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP \n\t\t\t\t\t======================================================================*/\n\n\t\t\t\t\tif($_FILES['nuevaFoto']['type'] == \"image/jpeg\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['nuevoUsuario'].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES['nuevaFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES['nuevaFoto']['type'] == \"image/png\")\n\t\t\t\t\t{\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\t\tGUARDAR LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t// le damos nombre a la imagen , y puede ser un nro aleaterio del 100 al 999\n\t\t\t\t\t\t$ruta = \"vistas/img/usuarios/\".$_POST['nuevoUsuario'].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t// imagecreatefromjpeg — Crea una nueva imagen a partir de un fichero o de una URL\n\t\t\t\t\t\t// imagecreatefromjpeg() devuelve un identificador de imagen que representa la imagen obtenida desde el nombre de fichero dado.\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES['nuevaFoto']['tmp_name']);\n\n\t\t\t\t\t\t// imagecreatetruecolor — Crear una nueva imagen de color verdadero\n\t\t\t\t\t\t// imagecreatetruecolor() devuelve un identificador de imagen que representa una imagen en negro del tamaño especificado.\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\n\t\t\t\t\t\t// imagecopyresized — Copia y cambia el tamaño de parte de una imagen\n\t\t\t\t\t\t// imagecopyresized() copia una porción de una imagen a otra imagen. dst_image es la imagen de destino, src_image es el identificador de la imagen de origen.\n\t\t\t\t\t\t// imagecopyresized(resource $dst_image(destino) , resource $src_image(origen) , int $dst_x(eje x izq) , int $dst_y(eje y up) , int $src_x(desde donde el corte) , int $src_y(dese el eje y) , int $dst_w(ancho de corte) , int $dst_h(alto de corte) , int $src_w(ancho de original) , int $src_h(alto original) )\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\t// imagejpeg — Exportar la imagen al navegador o a un fichero\n\t\t\t\t\t\t// imagejpeg() crea un archivo JPEG desde image.\n\t\t\t\t\t\t// $destino es donde quedo la foto recortada\n\t\t\t\t\t\t//$ruta donde vmos a guardar la foto \n\t\t\t\t\t\timagepng($destino, $ruta);\n\t\t\t\t\t}\n\n\t\t\t\t\t// var_dump($_FILES['nuevaFoto']['tmp_name']);\n\t\t\t\t\t// var_dump(getimagesize($_FILES['nuevaFoto']['tmp_name']));\n\n\t\t\t\t}\n\n\n\t\t\t\t// $usu = $_POST['nuevoUsuario'];\n\t\t\t\t// echo \"<script>alert( 'Debug Objects: \" . $usu . \"' );</script>\";\n\t\t\t\t// echo \"<script>console.log( 'Debug Objects: \" . $usu . \"' );</script>\";\n\n\t\t\t\t$tabla = \"usuarios\";\n\n\t\t\t\t// crypt — Hash de cadenas de un sólo sentido\n\t\t\t\t$encriptar = crypt($_POST['nuevoPassword'], '$2a$07$usesomesillystringforsalt$');\n\n\t\t\t\t$datos = array\n\t\t\t\t(\n\t\t\t\t\t\"nombre\"=> $_POST['nuevoNombre'],\n\t\t\t\t\t\"usuario\"=> $_POST['nuevoUsuario'],\t\n\t\t\t\t\t\"password\"=> $encriptar,\t\n\t\t\t\t\t\"perfil\"=> $_POST['nuevoPerfil'],\n\t\t\t\t\t\"ruta\" => $ruta\t\n\t\t\t\t);\n\n\t\t\t\t\n\t\t\t\t// $usu = $_POST['nuevoUsuario'];\n\t\t\t\t// $nom = $_POST['nuevoNombre'];\n\t\t\t\t// $per = $_POST['nuevoPerfil'];\n\t\t\t\t// echo \"<script>alert( 'Debug Objects: \" . $usu . \"' );</script>\";\n\t\t\t\t// echo \"<script>console.log( 'Debug Objects: \" . $usu . \" \" . $nom . \" \" . $per . \"' );</script>\";\n\n\t\t\t\t$respuesta = ModeloUsuarios::mdlIngresarUsuario($tabla, $datos);\n\n\t\t\t\t// var_dump($respuesta);\n\t\t\t\t// die();\n\n\t\t\t\t// echo \"<script>console.log( 'Debug Objects: \" . $respuesta . \"' );</script>\";\n\t\t\t\t// echo \"<script>alert( \" . $respuesta . \" );</script>\";\n\n\t\t\t\tif($respuesta == \"ok\")\n\t\t\t\t{\n\t\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\t\t\tSwal.fire({\n\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\ttitle: \"El usuario se guardado correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t}).then((result)=>{\n\t\t\t\t\t\t\tif(result.value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\twindow.location = \"usuarios\";\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</script>';\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<script>\n\t\t\t\t\n\t\t\t\tSwal.fire({\n\t\t\t\t\ttype: \"error\",\n\t\t\t\t\ttitle: \"El usuario no puede ir vacio o lleva caracteres especiales\",\n\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t }).then((result)=>{\n\t\t\t\t\t if(result.value)\n\t\t\t\t\t {\n\t\t\t\t\t\t window.location = \"usuarios\";\n\t\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t\n\t\t\t\t</script>';\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n return view('usuarios.crear');\n }", "public function create()\n {\n return view('creatUSER');\n }", "public function create()\n {\n return view('sys_user.create');\n }", "public function create()\n {\n return view('registro_usuarios.create');\n }", "public function create()\n {\n $roles = Rol::lists('nombre','idrol');\n return view('usuario.crear',compact('roles'));\n }", "public function newAction()\n {\n $entity = new Usuario();\n $form = $this->createCreateForm($entity);\n\n return $this->render('RegistroEventosCoreBundle:Usuario:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'error' => '',\n ));\n }", "public function create()\n {\n $prijatelj = DB::table('users')->get();\n\n return view('prijatelji.create', compact('prijatelj'));\n }", "public function create()\n {\n $empresas = Empresa::all();\n $roles = Role::all();\n\n return view('admin.users.create', compact('empresas', 'roles'));\n }", "public function muestraFormularioUsuario(){\n $form=\"<div id='transparenciaGeneral'>\";\n\t\t\t$form.=\"<div id='ventanaDialogo' class='ventanaDialogo'>\";\n $form.=\"<div id='barraTitulo1VentanaDialogo'>IQe Sisco Verificaci&oacute;n...<div id='btnCerrarVentanaDialogo'><a href='#' onclick=\\\"accionesVentana('ventanaDialogo','0')\\\" title='Cerrar Ventana Dialogo'><img src='../../img/close.gif' border='0' /></a></div></div>\";\n $form.=\"<div id='msgVentanaDialogo'></div>\";\n $form.=\"<br><form name='frmVerificaUsuario' id='frmVerificaUsuario' action='' method='post'><table border='0' width='98%' cellpading='1' cellspacing='1'><tr><td align='right'><span style='color:#000;'>Usuario:</span></td><td align='center'><input type='text' name='txtUsuarioMod' id='txtUsuarioMod' /></td></tr><tr><td colspan='2'>&nbsp;</td></tr><tr><td align='right'><span style='color:#000;'>Password:</span></td><td align='center'><input type='password' name='txtPassMod' id='txtPassMod' /></td></tr><tr><td colspan='2'>&nbsp;<div id='verificacionUsuario' class='div'>&nbsp;</div></td></tr><tr><td colspan='2' align='center'><input type='button' value='<< Continuar >>' onclick='verificaUsuario()'></td></tr></table></form>\";\n $form.=\"</div></div>\";\n $form.=\"<script>$(\\\"#txtUsuarioMod\\\").focus();</script>\";\n echo $form;\n }", "public function create()\n {\n return view('usuariosA');\n }", "public function create()\n {\n return view('usuarios.crearusuarios');\n }", "public function create()\n\t{\n\t\t$tipo_usuario = Auth::user()->tipo;\n\t\tif($tipo_usuario == 1) {\n\t\t\treturn view('deshabilitar_horarios_especialistas.create');\n\t\t}\n\t\tif($tipo_usuario == 2) {\n\t\t\treturn view('deshab_especial.create');\n\t\t}\n\t\tif($tipo_usuario == 3) {\n\t\t\treturn view('deshab_asist.create');\n\t\t}\n\t}", "public function create()\n {\n return view('usuarios.create');\n }", "public function create()\n {\n return view('usuarios.create');\n }", "public function create()\n {\n return view('usuarios.create');\n }" ]
[ "0.75839585", "0.7326991", "0.7256162", "0.709685", "0.7095794", "0.7065498", "0.7061321", "0.7043238", "0.70100975", "0.6998299", "0.6977408", "0.69622916", "0.69339883", "0.6924712", "0.69102025", "0.688189", "0.68650466", "0.6856726", "0.68562114", "0.6850818", "0.6845967", "0.6842991", "0.6820378", "0.68130505", "0.68069136", "0.67956626", "0.6791148", "0.67882955", "0.6772667", "0.67626417", "0.6761842", "0.67599624", "0.6756621", "0.6753131", "0.67521286", "0.67461425", "0.67377305", "0.67377305", "0.6737159", "0.6731938", "0.6727839", "0.67274374", "0.66994447", "0.6697901", "0.6695069", "0.66877246", "0.6685757", "0.66740906", "0.6673367", "0.6670396", "0.66687065", "0.6658147", "0.6656241", "0.6656237", "0.6655909", "0.66554314", "0.66554314", "0.66554314", "0.66554314", "0.66554314", "0.66554314", "0.6650719", "0.6648115", "0.66480815", "0.66474825", "0.66389906", "0.66384053", "0.6637326", "0.663347", "0.6633202", "0.6631382", "0.663088", "0.66268855", "0.66155213", "0.66077995", "0.6607738", "0.6604791", "0.6599312", "0.65960205", "0.659575", "0.65903974", "0.6589919", "0.65861785", "0.65838253", "0.6579434", "0.6579279", "0.6578856", "0.65764266", "0.6568554", "0.65627676", "0.65615934", "0.65535456", "0.6552787", "0.6541059", "0.6539771", "0.65351284", "0.6531835", "0.6518628", "0.65167385", "0.65167385", "0.65167385" ]
0.0
-1
Mostrar vista editar usuario
public function edit($id) { $hotel = $this->hotelRepo->findById($id); return view('hotels.edit', compact('hotel')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editar($id){\r\n $usuario = User::find($id);\r\n if(count($usuario)){\r\n if($_SESSION[\"inicio\"] == true){\r\n return Vista::crear('admin.usuario.crear',array(\r\n \"usuario\"=>$usuario,\r\n ));\r\n }\r\n }\r\n return redirecciona()->to(\"usuario\");\r\n }", "public function edita()\n\t {\t\n\t\t$car=$_REQUEST['car'];\n\t\t$per=$_REQUEST['per'];\n\t\t$logi=$_REQUEST['logi'];\n\t\t$pas=$_REQUEST['pas'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$user_data=array();\n\t\t$user_data['carnet']=$car;\n\t\t$user_data['login']=$logi;\n\t\t$user_data['password']=$pas;\n\t\t$user_data['estado']=$est;\n\t\t$user_data['observacion']=$obs;\n\t\t$user_data['perfil']=$per;\n\t\t\n\t\t//print_r($user_data);\n\t\t$usuario=new Usuarios;\n\t\t$usuario->edit($user_data);\n\t\t$data1=$usuario->lista();\n\t\t$this->principal();\n\t }", "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 editarUsuario()\r\n {\r\n if(isset($_REQUEST['id'])){\r\n\r\n $rolController = new App\\Controllers\\RolController;\r\n $roles = $rolController->getAllRoles();\r\n\r\n $userController = new App\\Controllers\\UserController;\r\n $user = $userController->getUser($_REQUEST['id']);\r\n \r\n require_once 'view/users/edit.php';\r\n } else {\r\n\r\n header('Location: ?c=Registro&a=usuarios');\r\n }\r\n\r\n }", "public function editar() {\n\t\t$POST = array();\n\n\t\t\t##apagando indice de tokenrequest pois ele não existe na tabela de categorias\n\t\tunset($this->request->data['TokenRequest']);\t\n\n\t\t$POST = array('UsuarioCliente'=>$this->request->data);\t\n\t\tif ($this->UsuarioCliente->save($POST)) \n\t\t{\n\t\t\t$this->Message = 'Usuario editado com sucesso';\n\t\t\t$this->Return = true;\t\n\t\t} \n\n\t\telse \n\t\t{\n\t\t\t$this->Message = 'Ocorreu um erro na edição de seu Usuario.';\n\t\t\t$this->Return = false;\t\n\t\t}\n\n\t\t$this->EncodeReturn();\t\n\t}", "public function editAction()\r\n {\r\n \r\n $id= $this->container->get('security.context')->getToken()->getUser()->getId();\r\n $em = $this->getDoctrine()->getManager();\r\n $entity = $em->getRepository('UtilisateurBundle:Utilisateur')->find($id);\r\n \r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Utilisateur entity.');\r\n }\r\n\r\n $editForm = $this->createEditForm($entity);\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('UtilisateurBundle:Default:info.html.twig', array(\r\n 'entity' => $entity,\r\n 'edit_form' => $editForm->createView(),\r\n 'delete_form' => $deleteForm->createView(),\r\n ));\r\n }", "public function vistaEditarUsuarioAction($id){\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$usuario = $em->getRepository('TheClickCmsAdminBundle:Usuarios')->find($id);\n\t\treturn $this->render('TheClickCmsAdminBundle:Default:editarUsuario.html.twig', array('usuario'=>$usuario));\n\t}", "public function edit($id)\n {\n return 'Aqui editamos el usuario: ' . $id;\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 edit(User $usuario)\n {\n try {\n $this->authorize($usuario);\n $roles = Role::all();\n $tags = Tag::all();\n\n $perfiles = Perfil::pluck('name','id');\n\n return view('usuarios.formulario',compact('usuario','roles','perfiles','tags'));\n } catch (AuthorizationException $e) {\n return redirect()->route('usuarios.index')->with('error',$e->getMessage());\n }\n\n }", "public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\n }", "public function editar_usuario($codigo_usuario){\n $data['usuario_editar'] = $this->model_admin->form_usuario($codigo_usuario);\n $this->load->view('view_librerias');\n $this->load->view('view_form_nuevo',$data);\n }", "function EDIT()\n{\n\t$comprobar = $this->comprobar_atributos(); //Busca si la tupla es correcta o tiene algun error\n\n\tif($comprobar == true)\n\t{\n\t\t$sql = \"UPDATE USUARIOS\n\t\t\t\tSET \n\t\t\t\t\tpassword = '$this->password',\n\t\t\t\t\tDNI = '$this->DNI',\n\t\t\t\t\tnombre = '$this->nombre',\n\t\t\t\t\tapellidos = '$this->apellidos',\n\t\t\t\t\ttelefono = '$this->telefono',\n\t\t\t\t\temail = '$this->email',\n\t\t\t\t\tFechaNacimiento = '$this->FechaNacimiento',\n\t\t\t\t\tfotopersonal = '$this->fotopersonal',\n\t\t\t\t\tsexo = '$this->sexo'\n\t\t\t\tWHERE (\n\t\t\t\t\tlogin = '$this->login'\n\t\t\t\t)\n\t\t\t\t\";\n\n\t\tif ($this->mysqli->query($sql))\n\t\t{\n\t\t\t$resultado = 'Actualización realizada con éxito';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$resultado = 'Error de gestor de base de datos';\n\t\t}\n\t\treturn $resultado;\n\t}\n\telse{\n\t\treturn $comprobar;\n\t}\n}", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}", "public function editarConsultaUsuariosController()\n\t {\n\t\t\tif (isset($_GET[\"docEditar\"])) \n\t\t\t{\n\t\t\t\t$documento=strip_tags($_GET[\"docEditar\"]);\n\t\t\t\t$respuesta=CrudNovedades::consultaUsuariosModel($documento,\"usuario\");\n\n\t\t\t\t$tabla = Tabla::actualizarConsultarUsuarios($respuesta);\n\t\t\t\techo $tabla;\t\n\t\t\t}\n\t }", "public function actionModificar()\n {\n $model = Yii::$app->user->identity->usuariosDatos;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->localidad === null && $model->direccion === null) {\n $model->geoloc = null;\n }\n if ($model->save() && $model->upload()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Has actualizado tus datos correctamente'));\n }\n }\n\n return $this->render('/usuarios/update', [\n 'modelDatos' => $model,\n 'seccion' => 'personal',\n 'generos' => Utiles::translateArray(UsuariosGeneros::find()\n ->select('sexo')\n ->indexBy('id')\n ->column()),\n ]);\n }", "protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}", "public function editar_usuario($id_usuario, $nombre, $apellido, $cedula, $telefono, $email, $direccion, $cargo, $usuario, $password1, $password2, $estado, $permisos)\n {\n\n $conectar = parent::conexion();\n parent::set_names();\n require_once(\"Usuarios.php\");\n $usuarios = new Usuarios();\n //verifica si el id_usuario tiene registro asociado a compras\n $usuario_compras = $usuarios->get_usuario_por_id_compras($_POST[\"id_usuario\"]);\n //verifica si el id_usuario tiene registro asociado a ventas\n $usuario_ventas = $usuarios->get_usuario_por_id_ventas($_POST[\"id_usuario\"]);\n //si el id_usuario NO tiene registros asociados en las tablas compras y ventas entonces se puede editar todos los campos de la tabla usuarios\n if (is_array($usuario_compras) == true and count($usuario_compras) == 0 and is_array($usuario_ventas) == true and count($usuario_ventas) == 0) {\n $sql = \"update usuarios set \n nombres=?,\n apellidos=?,\n cedula=?,\n telefono=?,\n correo=?,\n direccion=?,\n cargo=?,\n usuario=?,\n password=?,\n password2=?,\n estado=?\n where \n id_usuario=?\n \";\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $_POST[\"nombre\"]);\n $sql->bindValue(2, $_POST[\"apellido\"]);\n $sql->bindValue(3, $_POST[\"cedula\"]);\n $sql->bindValue(4, $_POST[\"telefono\"]);\n $sql->bindValue(5, $_POST[\"email\"]);\n $sql->bindValue(6, $_POST[\"direccion\"]);\n $sql->bindValue(7, $_POST[\"cargo\"]);\n $sql->bindValue(8, $_POST[\"usuario\"]);\n $sql->bindValue(9, $_POST[\"password1\"]);\n $sql->bindValue(10, $_POST[\"password2\"]);\n $sql->bindValue(11, $_POST[\"estado\"]);\n $sql->bindValue(12, $_POST[\"id_usuario\"]);\n $sql->execute();\n //SE ELIMINAN LOS PERMISOS SOLO CUANDO SE ENVIE EL FORMULARIO CON SUBMIT\n //Eliminamos todos los permisos asignados para volverlos a registrar\n $sql_delete = \"delete from usuario_permiso where id_usuario=?\";\n $sql_delete = $conectar->prepare($sql_delete);\n $sql_delete->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_delete->execute();\n //$resultado=$sql_delete->fetchAll();\n //insertamos los permisos\n //almacena todos los checkbox que han sido marcados\n //este es un array tiene un name=permiso[]\n $permisos = $_POST[\"permiso\"];\n // print_r($_POST);\n $num_elementos = 0;\n while ($num_elementos < count($permisos)) {\n $sql_detalle = \"insert into usuario_permiso\n values(null,?,?)\";\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_detalle->bindValue(2, $permisos[$num_elementos]);\n $sql_detalle->execute();\n //recorremos los permisos con este contador\n $num_elementos = $num_elementos + 1;\n }\n } else {\n //si el usuario tiene registros asociados en compras y ventas entonces no se edita el nombre, apellido y cedula\n $sql = \"update usuarios set \n telefono=?,\n correo=?,\n direccion=?,\n cargo=?,\n usuario=?,\n password=?,\n password2=?,\n estado=?\n where \n id_usuario=?\n \";\n //echo $sql; exit();\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $_POST[\"telefono\"]);\n $sql->bindValue(2, $_POST[\"email\"]);\n $sql->bindValue(3, $_POST[\"direccion\"]);\n $sql->bindValue(4, $_POST[\"cargo\"]);\n $sql->bindValue(5, $_POST[\"usuario\"]);\n $sql->bindValue(6, $_POST[\"password1\"]);\n $sql->bindValue(7, $_POST[\"password2\"]);\n $sql->bindValue(8, $_POST[\"estado\"]);\n $sql->bindValue(9, $_POST[\"id_usuario\"]);\n $sql->execute();\n //SE ELIMINAN LOS PERMISOS SOLO CUANDO SE ENVIE EL FORMULARIO CON SUBMIT\n //Eliminamos todos los permisos asignados para volverlos a registrar\n $sql_delete = \"delete from usuario_permiso where id_usuario=?\";\n $sql_delete = $conectar->prepare($sql_delete);\n $sql_delete->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_delete->execute();\n //$resultado=$sql_delete->fetchAll();\n //insertamos los permisos\n //almacena todos los checkbox que han sido marcados\n //este es un array tiene un name=permiso[]\n if (isset($_POST[\"permiso\"])) {\n $permisos = $_POST[\"permiso\"];\n }\n //print_r($_POST);\n $num_elementos = 0;\n\n while ($num_elementos < count($permisos)) {\n\n $sql_detalle = \"insert into usuario_permiso\n values(null,?,?)\";\n\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_detalle->bindValue(2, $permisos[$num_elementos]);\n $sql_detalle->execute();\n\n\n //recorremos los permisos con este contador\n $num_elementos = $num_elementos + 1;\n } //fin while\n\n\n } // fin else\n\n\n }", "public function view_editar_usuario($id=''){\n\t\tif (is_numeric($id)) {\n\t\t$data['usuarios']=$this->musuario->select($id);\n\t\t$this->load->view('editar_usuarios',$data);\n\t\t}else{\n\t\tshow_404();\n\t\t}\n\t\t\n\t}", "public function getEditarPerfil()\n\t{\n\t\treturn view('usuario.actualizar');\n\t}", "private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}", "public function edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }", "public function vistaFormularioUsuarioAction(){\n $em = $this->getDoctrine()->getManager();\n $empresas = $em->getRepository('TheClickCmsAdminBundle:Empresa')->findAll();\n\n\t return $this->render('TheClickCmsAdminBundle:Default:agregarUsuarios.html.twig' , array('empresa' => $empresas));\n\t}", "public function edit($id)\n {\n return view ('seguridad.usuario.edit', ['usuario' => User::findOrFail($id)]);\n }", "public function edit()\n\t{\n\t\t\t$id = Auth::id();\n\t\t\n\t\t $userCardio = User::find($id)->UserCardio;\n\n\n // show the edit form and pass the userStat\n return View::make('userCardio.edit')\n ->with('userCardio', $userCardio);\n\t\t\n\t}", "public function mostrar_editar($datos) {\r\n\t\t\t $this -> pantalla_edicion('editar',$datos);\r\n\t\t }", "public function edit()\n {\n return view(config('const.template.user.edit'), ['user' => User::find($this->guard()->id())]);\n }", "public function edit($id) {\n // Se obtiene el aviso por su ID\n $aviso = Aviso::find($id);\n $categorias = Categoria::all();\n //$user = User::find($aviso->idUsuario);\n\n // Se muestra una vista con los datos del aviso\n return view('usuario.edit')->with('aviso', $aviso)->with('categorias', $categorias);\n }", "public function edit(User $usuario)\n {\n // $usuario = User::findOrFile($id);\n $roles = Role::all()->pluck('name','id');\n return view('auth.edit_user',compact('usuario','roles'));\n }", "public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }", "public function edit()\n {\n //$user =User::find($id);\n $user =\\Auth::user();\n return view('users.edit',[\n 'title' =>'プロフィール編集',\n 'user'=>$user,\n ]);\n }", "public function edit()\n {\n $user = Auth::user();\n $id = $user->id;\n $usuario = Usuario::find($id);\n\n // Conseguir id del estudiante\n $id_estudiante = $usuario->estudiante->id;\n $estudiante = Estudiante::find($id_estudiante);\n\n return view('estudiante.edit', [\n 'generos' => $this->generos,\n 'estudiante' => $estudiante\n ]);\n }", "public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function editarUsuario(){\n $usuario = Auth::user();\n $ads_carreras = Adscripcion::where('id',$usuario->adscripcion_id)->get();\n return view('auth.edit_usuario',compact('usuario','ads_carreras'))->with('encabezado','layouts.encabezadojefe');\n }", "public function edit(Usuario $usuario)\n {\n // $docentes=Docente::where('usuario_idUsuario','=',$docente->id)->first();\n $roles=Rol::all();\n $datos= array(\n 'usuarios' => $usuario,\n 'roles' => $roles\n );\n // return \"HOLAAAAAAA\";\n return view('usuarios.editar')->with($datos);\n }", "public function editarUsuarioController() {\n $datos = $_GET[\"action\"];\n $datos = explode('/', $datos);\n $respuesta = ingresoModels::editarUsuarioModel($datos, \"usuarios\");\n echo '<div class=\"form-group\">\n <input type=\"hidden\" name=\"idEditar\" value=\"'.$respuesta[\"IdUsuario\"].'\">\n <label for=\"editarNombre\">Editar nombre:</label>\n <input type=\"text\" class=\"form-control\" id=\"editarNombre\" name=\"editarNombre\" value=\"'.$respuesta[\"Nombre\"].'\">\n </div>\n <div class=\"form-group\">\n <label for=\"editarUsuario\">Editar usuario:</label>\n <input type=\"text\" class=\"form-control\" id=\"editarUsuario\" name=\"editarUsuario\" value=\"'.$respuesta[\"Usuario\"].'\">\n </div>\n <div class=\"form-group\">\n <label for=\"tipoEditar\">Editar tipo usuario:</label>\n <p class=\"text-muted\">Administrador = 1</p>\n <p class=\"text-muted\">Administrador de Laboratorio = 2</p>\n <p class=\"text-muted\">Estudiante = 3</p>\n <p class=\"text-muted\">Inhabilitar = 4</p>\n <input type=\"text\" class=\"form-control\" id=\"tipoEditar\" name=\"tipoEditar\" value=\"'.$respuesta[\"Tipo\"].'\">\n </div>\n </div>\n <!-- /.box-body -->\n <div class=\"box-footer\">\n <button type=\"submit\" class=\"btn btn-primary\">Actualizar</button>\n </div>';\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }", "protected function editar()\n {\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 edit()\n {\n $user = Auth::user();\n\n $data = [\n 'user' => $user,\n 'canEditSurname' => ($this->getGender($user->id_number) == 'F')\n ];\n\n return view('pages.user.edit', $data);\n }", "public function edit(CompteUtilisateur $compteUtilisateur)\n {\n //\n }", "public function edit(User $cuenta)\n\t{\n\t\t//$cuenta = $this->model->findOrFail($id);\n\n\t\tif(Auth::user()->tipo == 1) {\n\t\t\treturn view('cuentas.edit', compact('cuenta'));\n\t\t\t} \n\t\t\tif(Auth::user()->tipo == 3) {\n\t\t\t\treturn view('cuentas_asistente.edit', compact('cuenta'));\n\t\t\t} \n\t}", "public function editarUsuario($dadosNovos){\n\t\t\t\n\t\t\t$this->load->database();\n\t\t\t\n\t\t\t//print_r($dadosNovos);\n\t\t\t\n\t\t\t$this->db->where('id_user', $dadosNovos['id_user']);\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\tif( ! $this->db->update('user', $dadosNovos))\n\t\t\t\t{\n\t\t\t\t\treturn \"erro\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"sucesso\";\n\t\t\t\t}\n\t\t\t\n\t\t}", "public function editar(){\r\n\t\tif(!$this->_validarCampos())\r\n\t\t\t// levantando a excessao CamposObrigatorios //\r\n\t\t\tthrow new CamposObrigatorios();\r\n\t\t\r\n\t\tif($this->_testarServicoExisteEdicao($this->getId(), $this->getNome()))\r\n\t\t\t// levanto a excessao//\r\n\t\t\tthrow new Exception(\"Servico já cadastrado en nossa base de dados\");\r\n\t\t\r\n\t\t// recuperando a instancia da classe de acesso a dados //\r\n\t\t$instancia = ServicoDAO::getInstancia(); \r\n\t\t// retornando o Usuario //\r\n\t\treturn $servico = $instancia->editar($this);\r\n\t}", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit($id) //User $user\n {\n $usuarios = User::find($id);\n return view('formularios.modificarUsuario',compact('usuarios'));\n }", "public function edit(Usuari $usuari)\n {\n //\n }", "public function edit($username)\n {\n //\n }", "public function edit($id)\n {\n // busca regstro\n $this->repository->findOrFail($id);\n \n // autorizacao\n $this->repository->authorize('update');\n \n // breadcrumb\n $this->bc->addItem($this->repository->model->usuario, url('usuario', $this->repository->model->codusuario));\n $this->bc->header = $this->repository->model->usuario;\n $this->bc->addItem('Alterar');\n \n // retorna formulario edit\n return view('usuario.edit', ['bc'=>$this->bc, 'model'=>$this->repository->model]);\n }", "public function edit($id)\n {\n\n // GET THE USER\n $user = User::find($id);\n $userRole = $user->hasRole('usuario');\n $analystRole = $user->hasRole('analista');\n $supervisorRole = $user->hasRole('supervisor');\n $adminRole = $user->hasRole('super administrador');\n\n $access;\n\n if($userRole)\n {\n $access = 'User';\n } elseif ($analystRole) {\n $access = 'Analyst';\n } elseif ($supervisorRole) {\n $access = 'Supervisor';\n } elseif ($adminRole) {\n $access = 'Administrador';\n } else {\n $access = 'None';\n }\n\n return view('admin.edit-user', [\n 'user' => $user,\n 'access' => $access,\n ]\n )->with('status', 'Usuario actualizado éxitosamente!');\n\n }", "public function edit($id)\n {\n $propietario='empresa';\n $claves = User_Clave::clavesusuario($id,$propietario);\n $empresa = User::findOrFail($id);\n return view('asesor.empresa.info',['empresa'=>$empresa,'claves'=>$claves]);\n }", "function edit_portofolio() {\n $user = $this->ion_auth->user()->row();\n $data['profil'] = $this->model_portofolio->select_metadata($user->id, 1)->row();\n $data['pengajaran'] = $this->model_portofolio->select_metadata($user->id, 2)->row();\n $data['riset'] = $this->model_portofolio->select_metadata($user->id, 3)->row();\n $data['publikasi'] = $this->model_portofolio->select_metadata($user->id, 4)->row();\n $data['pengalaman'] = $this->model_portofolio->select_metadata($user->id, 5)->row();\n $data['pendidikan'] = $this->model_portofolio->select_metadata($user->id, 6)->row();\n $data['profic'] = $this->model_portofolio->select_profic_user($user->id)->row();\n $data['users'] = $this->model_portofolio->select_users($user->id)->row();\n //print_r($data['users']);\n $this->load->view('portofolio/form_edit', $data);\n }", "public function edit()\n\t{\n\t\treturn view('admin.users.edit')->with('user', $this->user);\n\t}", "function editarPerfil(){\n \t//Llamo a la vista editar perfil\n \trequire \"app/Views/EditarPerfil.php\";\n \t\t$usuario = new Usuario();\n\t\t//Paso datos\n \t\t$usuario->nombre=$_POST['nombre'];\n \t\t$usuario->apellidoPaterno=$_POST['apellido_p'];\n \t\t$usuario->apellidoMaterno=$_POST['apellido_m'];\n \t\t$usuario->nombreUsuario=$_POST['nom_usuario'];\n \t\t$usuario->correo=$_POST['correo'];\n \t\t$usuario->contrasenia=$_POST['contrasenia'];\n \t\t$usuario->sexo=$_POST['sexo'];\n \t\t$usuario->descripcion=$_POST['descripcion'];\n \t\t$usuario->id=$_POST['id'];\n \t\t$usuario->contrasenia['password'];\n \t\t$usuario->editarUsuario();\n header(\"Location:/Proyecto/index.php?controller=Publicaciones&action=home\");\t\n }", "public function actualizarInfoUsuario(){\n \n if(isset($_PUT[\"editFname\"])){\n \n $datos = array(\n \"id\" => $_PUT[\"\"],\n \"Fname\" => $_PUT[\"\"],\n \"Lname\" => $_PUT[\"\"],\n \"Pass\" => $_PUT[\"\"],\n \"Area\" => $_PUT[\"\"],\n );\n\n $actualizar = UsersModel::actualizarInfoUsuario($datos, \"usuario\");\n\n if($actualizar){\n header(\"location: \".URL_PAGE.\"viewUser/\".$_PUT[\"\"]);\n }; \n \n\n }\n\n }", "public function editar()\n {\n }", "function alterarUsuario($conexao){\n\t\tif(isset($_POST[\"idusuario\"])){\n\t\t\t/*preenche os dados com as informações vindas do formulário*/\n\t\t\t$nome = $_POST['txtNomeUsuario'];\n\t\t\t$telefone = $_POST['txtTelUsuario'];\n\t\t\t$email = $_POST['txtEmailUsuario'];\n\t\t\t$logradouro = $_POST['txtLograUsuario'];\n\t\t\t$numero = $_POST['txtNumUsuario'];\n\t\t\t$bairro = $_POST['txtBairroUsuario'];\n\t\t\t$cidade = $_POST['txtCidadeUsuario'];\n\t\t\t$estado = $_POST['txtEstadoUsuario'];\n\t\t\t$sexo = isset($_POST['txtSexoUsuario']);\n\t\t\t$dtNasc = $_POST['txtDtnascUsuario'];\n\t\t\t$id = $_POST['idusuario'];\n\n\t\t\t/*Chama a função para alterar no banco passando os novos valores*/\n\t\t\t$retorno = usuario_alterar($conexao,$nome,$telefone,$email,$logradouro,$numero,$bairro,\n\t\t\t\t$cidade,$estado,$sexo,$dtNasc,$id);\n\n\t\t\t/*Se existir algum retorno ele entra coloca uma mensagem de sucesso e chama a pagina para listar os dados*/\n\t\t\tif($retorno){\n\t\t\t\t$retornoExc = \"Contato Alterado com Sucesso!\";\n\t\t\t\t$dados = listarDados($conexao);\n\t\t\t\trequire(\"view_lista.php\");\n\t\t\t}else{\n\t\t\t\t/*retorna mensagem informando que a alteração não foi realizada*/\n\t\t\t\tif(!valida_email($email)){\n\t\t\t\t\t$retornoExc = \"A alteração falhou, digite um email valido!\";\n\t\t\t\t}\n\t\t\t\telse if($nome == \"\"){\n\t\t\t\t\t$retornoExc = \"A alteração falhou o campo nome é obrigatório, tente novamente!\";\n\t\t\t\t}\n\t\t\t\t$dados = listarDados($conexao);\n\t\t\t\trequire(\"view_lista.php\");\n\t\t\t}\n\t\t\t\n\t\t}else if(isset($_GET['codigo'])){\n\t\t\t/*Pega o id passado pela url do contato que deseja excluir*/\n\t\t\t$id = $_GET['codigo'];\n\t\t\t/*Pega os dados do usuário passando a conexão e id*/\n\t\t\t$retorno = usuario_porId($conexao,$id);\n\t\t\t/*Se não existir retorno informa que busca falhou e retorna falso*/\n\t\t\tif(!$retorno){\n\t\t\t\t$retornoExc = \"Falha em buscar o Contato \";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t/*Cria uma linha com os dados do contato passando para a variavel*/\n\t\t\t$dadosUsuario = mysqli_fetch_row($retorno);\n\t\t\t/*Passa para a variavel dados as informações do array com seus indices*/\n\t\t\t$dados = array(\"id\" => $dadosUsuario[0], \"nome\" => $dadosUsuario[1], \"logradouro\" => $dadosUsuario[2] , \"numero\" => $dadosUsuario[3], \"bairro\" => $dadosUsuario[4], \"cidade\" => $dadosUsuario[5], \"estado\" => $dadosUsuario[6], \"telefone\" => $dadosUsuario[7], \"email\" => $dadosUsuario[8], \"sexo\" => $dadosUsuario[9], \"dtNasc\" => $dadosUsuario[10]);\n\t\t\t/*Chama o formulario para alteração do usuário*/\n\t\t\trequire(\"view_form_cadastro_altera_usuario.php\");\n\t\t}else{\n\t\t\t$dados = listarDados($conexao);\n\t\t\trequire(\"view_lista.php\");\n\t\t}\n\t\t\n\t}", "public function edit($id)\n {\n\n $usuarios = User::select('users.id', 'users.rut', 'users.dv', 'users.nombre', 'users.apellido_paterno', 'users.email', 'users.estado', 'users.nombre_usuario', 'perfil_usuarios.perfil')->join('perfil_usuarios', 'users.perfil_id', '=', 'perfil_usuarios.id')->orderBy('users.id')\n ->paginate(17);\n $usuario_editar = User::find($id);\n $request = new Request;\n //dd($usuario_editar);\n return view('administrador_usuario.administrador_usuario', compact('usuario_editar', 'usuarios', 'request'));\n }", "public function edit($id)\n {\n $user = User::find($id);\n return view('automotores.usuarios.edit',['user'=>$user]);\n }", "public function edit(PagoUser $pagoUser)\n {\n //\n }", "function user_edit($user_info)\n {\n }", "public function edit($id)\n {\n // Consulta los datos de usuario por id y son enviados a la vista de editar usuario\n $usuarios = \\App\\Usuario::find($id);\n return view('user.editar', ['usuario'=>$usuarios]);\n }", "public function edit(User $usuario)\n {\n //\n $roles= Role::all();\n return view('dash.usuarios.editUsuarios',compact('usuario','roles'));\n }", "public function edit()\n {\n return view('user.edit', [\n 'user' => Auth::user()\n ]);\n }", "public function edit(){\n\n \treturn View::make('users.edit');\t\n }", "public function edit($id)\n {\n //\n return view(\"local.usuario.edit\",['usuario'=>User::findOrFail($id)]);\n }", "function editUsuario($usuario)\n{\n\t\t$con = getDBConnection();\n\t\t$sql = \"UPDATE usuarios SET nombre = :nombre, apellidos = :apellidos, user_name = :user_name, password = :password, email = :email WHERE id = :id\";\n\t\t$stmt = $con->prepare($sql);\n\t\t$stmt->bindParam(':id', $usuario->id);\n\t\t$stmt->bindParam(':nombre', $usuario->nombre);\n\t\t$stmt->bindParam(':apellidos', $usuario->apellidos);\n\t\t$stmt->bindParam(':user_name', $usuario->user_name);\n\t\t$stmt->bindParam(':password', $usuario->password);\n\t\t$stmt->bindParam(':email', $usuario->email);\n\t\t$stmt->execute();\n}", "public function editar(){\n $cedula = $_GET['cedula'];\n //2. usar el modelo para traer de la BD el estudiante\n $estudiante = $this->model->buscarEstudiante($cedula);\n //3. llamar a la vista de editar\n require_once 'view/include/header.php';\n require_once 'view/estudiante/editar.php';\n require_once 'view/include/footer.php';\n }", "public function edit($id)\n {\n $usuarios = persona::find($id);\n return view('admin_editarusuario', compact('usuarios'));\n }", "public function edit()\n {\n return view('profil.edit', ['user' => auth()->user(), 'page' => 0]);\n }", "public function edit($id)\n {\n $user = User::findOrFail($id);\n\n $universidades= Universidad::orderBy(\"nombre\", \"asc\")->get();\n\n return view('admin/admin_usuarios_edit')->withUser($user)->with(['pageName'=>\"Edita\"])->with(['universidades'=>$universidades]);\n }", "public function vistaUsuarioController() {\n $respuesta = ingresoModels::vistaUsuarioModel(\"usuarios\");\n foreach($respuesta as $row => $item) {\n echo '<tr>\n <td>'.$item[\"IdUsuario\"].'</td>\n <td>'.$item[\"Nombre\"].'</td>\n <td>'.$item[\"Usuario\"].'</td>\n <td>'.$item[\"Tipo\"].'</td>\n <td>'.$item[\"Id_CoP\"].'</td>\n <td style=\"text-align: center;\"><a href=\"editar_perfil/'.$item[\"IdUsuario\"].'\"><i class=\"fas fa-pencil-alt\"></i></a></td>\n </tr>';\n }\n }", "public function editar(){\n\n\t\tif( ! $this->session->has_userdata('logado'))\n\t\t\tredirect(base_url('webpedidos/'));\n\t\t\t\n\t\t$this->load->model('usuario/Usuario_model', 'usuario');\n\t\t\n\t\t$id = trim($this->input->post('id'));\n\t\t$novoNivel = trim($this->input->post('novoNivel'));\t\n\t\t$novoLogin = trim($this->input->post('novoLogin'));\t\n\n\t\t\n\t\t$editado = $this->usuario->editar($id, $novoNivel, $novoLogin );\n\t\n\t\t$this->output->set_content_type('application/json')->set_output(json_encode($editado));\n\t}", "function EDIT() {\n\t\t// se construye la sentencia de busqueda de la tupla en la bd\n\t\t$sql = \"SELECT * FROM ENTREGA WHERE (login = '$this->login' AND IdTrabajo = '$this->IdTrabajo')\";\n \n\t\t// Variable que almacena la sentencia sql\n\t\t$result = $this->mysqli->query( $sql );\n\t\t// si el numero de filas es igual a uno es que lo encuentra\n\t\tif ( $result->num_rows == 1 ) { // se construye la sentencia de modificacion en base a los atributos de la clase\n\t\t\t//Si la ruta no es vacia actualiza la entrega\n if($this->Ruta <> null){\n //Variable que almacena la sentencia sql\n\t\t\t\t$sql = \"UPDATE ENTREGA SET \n\t\t\t\t\tlogin = '$this->login',\n\t\t\t\t\t IdTrabajo='$this->IdTrabajo',\n Alias='$this->Alias',\n Horas='$this->Horas',\n Ruta='$this->Ruta'\n\t\t\t\tWHERE ( login = '$this->login' AND IdTrabajo = '$this->IdTrabajo'\n\t\t\t\t)\";//se construye la sentencia sql de modificacion\n\n }\n //Si la ruta es vacia\n else{\n //Variable que almacena la sentencia sql\n $sql = \"UPDATE ENTREGA SET \n\t\t\t\t\tlogin = '$this->login',\n\t\t\t\t\t IdTrabajo='$this->IdTrabajo',\n Alias='$this->Alias',\n Horas='$this->Horas'\n\t\t\t\tWHERE ( login = '$this->login' AND IdTrabajo = '$this->IdTrabajo'\n\t\t\t\t)\";//se construye la sentencia sql de modificacion\n \n }\n\t\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\n\t\t\tif ( !( $resultado = $this->mysqli->query( $sql ) ) ) {\n\t\t\t\treturn 'Error en la modificación';\n\t\t\t}\n \n // si no hay problemas con la modificación se indica que se ha modificado\n else { \n\t\t\t\treturn 'Modificado correctamente';\n\t\t\t}\n // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\n\t\t} else \n\t\t\treturn 'No existe en la base de datos';\n\t}", "function viewEditarUsuario($id){\n $usuari = User::find($id);\n \n return new UserCreate($usuari); \n }", "public function edit($id)\n {\n $user = User::find($id); //BUAT QUERY UTK PENGAMBILAN DATA\n //LALU ASSIGN KE DALAM MASING-MASING PROPERTI DATANYA\n $this->idz = $user->id;\n $this->name = $user->name;\n $this->username = $user->username;\n $this->email = $user->email;\n $this->password = $user->password;\n\n $this->openUser(); //LALU BUKA User\n }", "public function edit($id)\n {\n $registro = User::find($id);\n return view('admin.usuarios.editar', compact('registro'));\n }", "public function editAction()\n\t {\n\t \t$id \t\t\t= (int) $this->getRequest()->getParam('id');\n\t \t$userService \t= new User_Service_User();\n\t \t$user\t\t\t= $userService->read( $id );\n\t \tif( !$user instanceof User_Model_User){\n\t \t\t$this->addSystemError('L\\'utilisateur n\\'existe pas');\n\t \t\t$this->_redirect( '/User/index/list');\n\t \t}\n\t \t$form \t\t\t= new User_Form_Edituser();\n\t \t$form->setAction( '/User/index/edit/id/' . $id);\n\t \tif( $this->getRequest()->isPost() ){\n\t \t\tif( $form->isValid( $this->getRequest()->getPost() ) ){\n\t\t\t\tif( $userService->update( $id, $form->getValues() )){\n\t\t\t\t\t$this->addSystemSuccess('Utilisateur mis à jour');\n\t\t\t\t} else {\n\t\t\t\t\t$this->addSystemError('Echec de la mise à jour');\n\t\t\t\t}\n\t \t\t} else {\n\t \t\t\t$this->addSystemError('Le formulaire contient des erreurs');\n\t \t\t}\n\t \t} else {\n\t\t\t$userData \t\t= array( 'login' => $user->getLogin(),\n\t\t\t\t\t\t\t\t\t 'nom' => $user->getNom(),\n\t\t\t\t\t\t\t\t\t 'prenom' => $user->getPrenom(),\n\t\t\t\t\t\t\t\t\t 'email' => $user->getEmail(),\n\t\t\t\t\t\t\t\t\t 'telephone' => $user->geTtelephone(),\n\t\t\t\t\t\t\t\t\t 'civilite' => $user->getcivilite() \n\t\t\t\t\t\t\t\t\t);\n\t\t\t$form->populate( $userData );\n\t \t}\n\t\t$this->view->form = $form;\n\t }", "public function getModificar($id)\n\t{\n\t\t$sucursal = Sucursal::where('estado','=','1')->get();\n\t\t$select = array(0 => 'Seleccione...')+$sucursal->lists('nombre','id');\n\t\t$user = User::findOrFail($id);\t\t\n\t\t$suc = Sucursal::findOrFail($user->sucursal_id);\n\t\treturn View::make('user.form')->with(array('user'=>$user,'sucursal'=>$select));\n\t}", "public function edit($id)\n {\n $pagos = Pagos::findOrFail($id);\n $pacientes = User::where('type', '!=','Especialista')->orderBy('first_name', 'asc')->get(['first_name', 'last_name', 'id']);\n\n return view('admin.pagos.edit', compact('pagos', 'pacientes'));\n\n }", "public function edit(Usuario $usuario)\n {\n Gate::authorize('admin');\n $sucursals=Sucursal::pluck('nombre', 'id');\n return view('usuarios.usuariosForm', compact('usuario'), compact('sucursals'));\n }", "public function edit($user_id) {\n if ($_POST){\n #izmena vrednosti\n #redirekcija na listu\n \n $username = filter_input(INPUT_POST, 'username');\n $lastname = filter_input(INPUT_POST, 'lastname');\n $email = filter_input(INPUT_POST, 'email');\n \n if (!preg_match('/^[a-z0-9]{4,}$/', $username) or !preg_match('[A-z 0-9\\-]+', $fullname) or $email == '') {\n $this->setData('message', 'Izmene nisu tačno unete.');\n } else {\n $res = HomeModel::editById($user_id, $username, $lastname, $email);\n if ($res){\n Misc::redirect('homepage');\n } else {\n $this->setData('message', 'Došlo je do greške prilikom izmene.');\n }\n }\n \n }\n \n $user = HomeModel::getById($user_id);\n $this->setData('korisnik', $user);\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($id)\n {\n $user = Usuarios::getAtualiza($id);\n return view('usuario.edit-usuario')->with([\n 'usuario' => $user,\n ]);\n \n \n }", "public function edit($id)\n {\n //\n if ($this->security(10)) {\n $usuario = $this->usuario;\n $perfiles = Perfiles::lists('name', 'id')->toArray();\n $entidad = Entidades::all();\n $titulos = Cargos::lists('name', 'id')->toArray();\n $categorias = Usercategories::lists('name', 'id')->toArray();\n return view('administracion.usuarios.edit', compact('usuario', 'perfiles', 'entidad', 'titulos', 'categorias'));\n }\n }", "public function edit()\n {\n $user = Auth::user();\n $id = $user->id;\n $usuario = Usuario::find($id);\n\n // Conseguir id del docente\n $id_docente = $usuario->docente->id;\n $docente = Docente::find($id_docente);\n\n return view('docente.edit', [\n 'generos' => $this->generos,\n 'docente' => $docente\n ]);\n }", "public function edit(User $usuario)\n {\n \n if( $usuario->id != Auth::user()->id && Auth::user()->profile != 'admin' ){\n return redirect()->route('home')->with('info', 'Acesso não permitido a este usuário!');\n }\n\n return view('usuarios.edit', compact('usuario'));\n }", "static public function ctrEditUser(){\n\t\t\tif(isset($_POST[\"editarUsuario\"])){\n\t\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarNombre\"]) ){\n\n\t\t\t\t\t/*==========================================================\n\t\t\t\t\t\tV A L I D A R I M A G E N\n\t\t\t\t\t==========================================================*/\n\t\t\t\t\t$ruta = $_POST[\"fotoActual\"];\n\t\t\t\t\tif(isset($_FILES[\"editarFoto\"][\"tmp_name\"]) && $_FILES[\"editarFoto\"][\"tmp_name\"] != \"\"){\n\t\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tCREAR DIRECTORIO DONDE SE GUARDA LA FOTO\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$directorio = \"view/img/usuarios/\".$_POST[\"editarUsuario\"];\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*--------------------------------------------\n\t\t\t\t\t\t\tPREGUNTAR SI EXISTE FOTO EN LA DB\n\t\t\t\t\t\t--------------------------------------------*/\n\t\t\t\t\t\tif(!empty($_POST[\"fotoActual\"])){\n\t\t\t\t\t\t\tunlink($_POST[\"fotoActual\"]);\n\t\t\t\t\t\t}else{//Creamos Directorio\n\t\t\t\t\t\t\tmkdir($directorio, 0755);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/*---------------------------------------------\n\t\t\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN ACCIONES\n\t\t\t\t\t\t---------------------------------------------*/\n\t\t\t\t\t\t$rand = mt_rand(100, 999);\n\n\t\t\t\t\t\t//------------------ IMAGEN JPEG ------------------\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/jpeg\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".jpeg\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($_FILES[\"editarFoto\"][\"type\"] == \"image/png\"){\n\t\t\t\t\t\t\t//Guardamos Imagen en el Directorio\n\t\t\t\t\t\t\t$ruta = \"view/img/usuarios/\".$_POST[\"editarUsuario\"].\"/\".$rand.\".png\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editarFoto\"][\"tmp_name\"]);\n\t\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\t\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//Posible Cambio de Contraseña\n\t\t\t\t\t$crPassword = \"\";\n\t\t\t\t\tif($_POST[\"editarPassword\"] != \"\"){\n\t\t\t\t\t\tif(preg_match('/^[a-zA-Z0-9]+$/',$_POST[\"editarPassword\"])){\n\t\t\t\t\t\t\t$crPassword = crypt($_POST[\"editarPassword\"], '$2a$08$abb55asfrga85df8g42g8fDDAS58olf973adfacmY28n05$');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"La contraseña no puede llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\t//Editar Password viene vacio, no se modificara contraseña\n\t\t\t\t\t\t$crPassword = $_POST[\"passwordActual\"];\n\t\t\t\t\t}\n\t\t\t\t\t$tabla = \"usuarios\";\n\t\t\t\t\t$datos = array(\n\t\t\t\t\t\t\"nombre\"=>$_POST[\"editarNombre\"],\n\t\t\t\t\t\t\"usuario\" => $_POST[\"editarUsuario\"],\n\t\t\t\t\t\t\"password\" => $crPassword,\n\t\t\t\t\t\t\"perfil\" => $_POST[\"editarPerfil\"],\n\t\t\t\t\t\t\"foto\" => $ruta);\n\t\t\t\t\t\n\t\t\t\t\t$respuesta = ModelUsers::mdlEditarUsuario($tabla, $datos);\n\n\t\t\t\t\tif($respuesta){//Usuario guardado con exito\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Usuario guardado con exito\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}else{//Error al guardar usuario\n\t\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Error al guardar usuario '.$respuesta.'\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t\t}\n\t\t\t\t}else{//Nombre no valido\n\t\t\t\t\techo '<script>\n\t\t\t\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\t\t\t\t\t\ttitle: \"Nombre no puede ir vacio o llevar caracteres especiales\",\n\t\t\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t\t}).then((result=>{\n\t\t\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\t\t\twindow.location = \"users\"\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</script>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }", "public function edituserAction($id){\n\t\t$user = $this->getUser(); if ($user == '') { return $this->redirect($this->generateUrl('LIHotelBundle_homepage')); }\n\t\t$session = $this->get('session');\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$entity = $em->getRepository('LIHotelBundle:Reserva')->find($id);\n\n\t\tif (!$entity) {\n\t\t\t$session->getFlashBag()->add('usuario_malos', 'No existe esta reserva.');\n\t\t\treturn $this->redirect($this->generateUrl('_user'));\n\t\t}\n\n\t\tif ($entity->getCliente()->getId() != $user->getId()) {\n\t\t\t$session->getFlashBag()->add('usuario_malos', 'No tiene permisos para ver las reservas de otros usuarios. Este incidente será reportado.');\n\t\t\treturn $this->redirect($this->generateUrl('_user'));\n\t\t}\n\n\t\t/* VERIFICAR SI NO HA PASADO LA FECHA DE CULMINADO, PORQUE SI NO NO SE PUEDE EDITAR */\n\t\t$dias_reserva = $entity->getDiasReserva() - 1;\n\t\t$fecha_reserva = $entity->getFechaDesde();\n\t\t$fecha_inicio_ = new \\DateTime($fecha_reserva->format('Y-m-d'));\n\t\t$fecha_final_ = new \\DateTime($fecha_inicio_->format('Y-m-d'));\n\t\t$fecha_final_->add(new \\DateInterval('P'.$dias_reserva.'D'));\n\t\t$hoy = new \\DateTime('today');\n\n\t\tif ($hoy > $fecha_final_) {\n\t\t\t$session->getFlashBag()->add('reserva_malos', 'Esta reserva ya ha culminado y no se puede modificar.');\n\t\t\treturn $this->showuserAction($entity->getId());\n\t\t}else{\n\n\t\t\t$editForm = $this->createEditForm($entity);\n\t\t\t$deleteForm = $this->createDeleteForm($id);\n\t\t\t$user = $this->getUser();\n\n\t\t\treturn $this->render('LIHotelBundle:Reserva:edituser.html.twig', array(\n\t\t\t\t'entity' => $entity,\n\t\t\t\t'edit_form' => $editForm->createView(),\n\t\t\t\t'delete_form' => $deleteForm->createView(),\n\t\t\t\t'user' => $user,\n\t\t\t));\n\t\t}\n\t}", "public function edit(User $usuario) {\n return view('fuse.cadastros.usuarios.edit', compact('usuario'));\n }", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function edit($id)\n {\n $usuari = User::find($id);\n return view('layouts.usuaris.edita', compact('usuari', 'id'));\n }", "function edit($param) {\n extract($param);\n $sql = \"UPDATE operario SET fk_usuario='$id_usuario', nombres='$nombres', apellidos='$apellidos' WHERE fk_usuario='$id_usuario';\n UPDATE usuario SET id_usuario='$id_usuario', direccion='$direccion', telefonos='$telefonos', correos='$correos', contrasena='$contrasena' WHERE id_usuario = '$id_usuario'; \"; // <-- el ID de la fila asignado en el SELECT permite construir la condición de búsqueda del registro a modificar\n $conexion->getPDO()->exec($sql);\n echo $conexion->getEstado();\n }", "public function edit($id)\n {\n $usuario = User::find($id);\n $unidades = Unidad::orderby('numero')->get();\n\n return view('usuarios.edit')->with('user',$usuario)->with('unidades',$unidades);\n }", "public function edit() {\n\t\t$userId = $this->uri->segment(3);\n\t\t$name = 'Juan Saluminag';\n\n\t\t$this->breadcrumbs->set(['Edit: ' . $name => 'members/edit/' . $userId]);\n\n\t\t$this->render('register');\n\t}", "public function actionEdit() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$first_name = $user['first_name'];\n\t\t$last_name = $user['last_name'];\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$first_name = $_POST['first_name'];\n\t\t\t$last_name = $_POST['last_name'];\n\n\t\t\t$errors = array();\n\n\t\t\tif ($error = Validator::checkName($first_name)) $errors['first_name'] = $error;\n\t\t\tif ($error = Validator::checkName($last_name)) $errors['last_name'] = $error;\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::edit($userId, $first_name, $last_name);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Edit Details\";\n\t\trequire_once(ROOT . '/views/account/edit.php');\n\n\t\treturn true;\n\t}", "function get_user_to_edit($user_id)\n {\n }", "function EDIT(){\n if(($this->DNI == '')){\n return 'Deportista vacio, introduzca un DNI';\n }else{\n $sql = $this->mysqli->prepare(\"SELECT * FROM deportista WHERE DNI = ?\");\n $sql->bind_param(\"s\", $this->DNI);\n $sql->execute();\n \n $resultado = $sql->get_result();\n \n if(!$resultado){\n return 'No se ha podido conectar con la BD';\n }else if($resultado->num_rows == 1){\n $sql = $this->mysqli->prepare(\"UPDATE deportista SET Nombre = ?, Edad = ?, Apellidos = ?, Contrasenha = ?, Cuota_socio=?, rolAdmin = ?, rolEntrenador = ?, Sexo=? WHERE DNI = ?\");\n $sql->bind_param(\"sissiiiss\", $this->Nombre, $this->Edad, $this->Apellidos, $this->Contrasenha, $this->Cuota_socio,$this->rolAdmin,$this->rolEntrenador, $this->Sexo,$this->DNI);\n $resultado = $sql->execute();\n \n if(!$resultado){\n return 'Ha fallado la actualización de deportista';\n }else{\n return 'Modificación correcta';\n }\n }else{\n return 'Deportista no existe en la base de datos';\n }\n }\n }", "public function edit($id)\n {\n if(Auth::user()->hasPermission('edit_excluido')){\n $documento = Documento::find($id)->load('user');\n $user = User::select('compania_id as compania','id','name')->where('id',$documento->user->id)->first();\n return view('excluidos.edit', compact('documento','user'));\n }else{\n abort(403);\n }\n }", "public function agregarUsuario(){\n \n }" ]
[ "0.76425356", "0.75540113", "0.7550991", "0.7330872", "0.73250073", "0.7286139", "0.7274534", "0.71942294", "0.71796405", "0.71678483", "0.71620935", "0.7159783", "0.7148923", "0.7128875", "0.7116304", "0.7106425", "0.7100442", "0.7096946", "0.70763", "0.7057084", "0.70560426", "0.70532995", "0.705051", "0.703819", "0.7022514", "0.7010763", "0.7010366", "0.7008457", "0.69895864", "0.6975937", "0.69732827", "0.69687504", "0.69685876", "0.6966152", "0.69511604", "0.69377434", "0.6937367", "0.693385", "0.6933146", "0.6919641", "0.69071513", "0.6905732", "0.68883425", "0.6887673", "0.6887306", "0.6886408", "0.68850446", "0.6869159", "0.6867896", "0.68646425", "0.68585235", "0.68517053", "0.684813", "0.6844937", "0.68296784", "0.681495", "0.6809157", "0.6804684", "0.67994905", "0.67993605", "0.6798335", "0.6795745", "0.6788335", "0.6777074", "0.67689186", "0.67684335", "0.67677754", "0.6765119", "0.67644066", "0.6763697", "0.6762124", "0.67601866", "0.67528194", "0.67474866", "0.6744891", "0.67400926", "0.6740002", "0.6738399", "0.6736094", "0.67280895", "0.6727756", "0.67260194", "0.6725686", "0.6722197", "0.6720484", "0.671843", "0.67170376", "0.6708929", "0.6701416", "0.6700821", "0.6697231", "0.6693605", "0.6688121", "0.6685762", "0.6678661", "0.66748756", "0.6672958", "0.66716963", "0.6667117", "0.6666014", "0.6663763" ]
0.0
-1
Show the application dashboard.
public function getHotels() { if(! request('q')) return []; $hotels = Hotel::Search(request('q'))->get()->all(); return $hotels; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77862287", "0.7761407", "0.7563901", "0.75170934", "0.746699", "0.74665695", "0.7367683", "0.73534966", "0.7348662", "0.7343759", "0.7328216", "0.73182577", "0.73092335", "0.728953", "0.72847724", "0.7275449", "0.7275449", "0.7275449", "0.7275449", "0.7253329", "0.7253329", "0.7253329", "0.7253329", "0.7253329", "0.7242651", "0.7238307", "0.7237317", "0.7219582", "0.7199839", "0.71993226", "0.71928704", "0.71812886", "0.7167083", "0.7159392", "0.7148408", "0.7135078", "0.7134049", "0.7131566", "0.7125967", "0.71214664", "0.7119546", "0.7111876", "0.7109968", "0.71093625", "0.70989627", "0.7082487", "0.70770097", "0.70768017", "0.7065654", "0.7057395", "0.70552087", "0.7052588", "0.70494616", "0.70454663", "0.70416385", "0.7022026", "0.7019332", "0.7015568", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.7010608", "0.6993445", "0.69812995", "0.69754696", "0.69749504", "0.69699633", "0.6969114", "0.69688344", "0.6966357", "0.6959957", "0.6947264", "0.69448495", "0.69430286", "0.69427854", "0.69423646", "0.69407797", "0.69385755", "0.69385237", "0.69385237", "0.6928513", "0.69231254", "0.6908938", "0.69031125", "0.6884284", "0.6871347", "0.68683225", "0.6857883", "0.6848346", "0.68478656", "0.68420464", "0.68405044", "0.6835461", "0.6833515", "0.6833089", "0.68289226", "0.68144387" ]
0.0
-1
Display a listing of the resource.
public function index() { $user = auth()->user(); return view('modules.user.settings.index', compact('user')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // validation is done in the dedicated class. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "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 }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function 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 execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function 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\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function display() {\n echo $this->render();\n }", "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 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 abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233183", "0.81894475", "0.6830127", "0.6498529", "0.6496276", "0.6469191", "0.64627224", "0.63619924", "0.6308743", "0.62809277", "0.6218707", "0.61915004", "0.617914", "0.6172935", "0.6137578", "0.6118736", "0.6107122", "0.6106576", "0.60931313", "0.60798067", "0.6046669", "0.60386544", "0.60193497", "0.59882426", "0.5963477", "0.59618807", "0.5952755", "0.5929829", "0.59192723", "0.59065384", "0.59065384", "0.59065384", "0.590592", "0.58923435", "0.5870325", "0.5868533", "0.58685124", "0.5851443", "0.5815833", "0.58149886", "0.58143586", "0.580419", "0.58004224", "0.5793256", "0.57887405", "0.57840455", "0.5782294", "0.5760476", "0.5757928", "0.57578564", "0.57453394", "0.5745187", "0.5741311", "0.5738201", "0.5738201", "0.5730195", "0.5727921", "0.5727622", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5720258", "0.5714068", "0.57106924", "0.5709095", "0.57058644", "0.57057875", "0.5704414", "0.5704414", "0.57021624", "0.56991994", "0.5692151", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576" ]
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(UserSettingsRequest $request) { $input = $request->except(['_method', '_token']); foreach ($input as $key => $value) { setting()->set( $key, $value ); setting()->setExtraColumns(['user_id' => auth()->user()->id]); } setting()->save(); return redirect(route('settings.index'))->with('message', 'Settings have been saved!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Complete a word to known index (ex: lop => lopsem)
protected function completeWords() { $result = []; foreach ($this->words as $tokenizedWord) { $tokenizedWordAsObject = (object)$tokenizedWord; $word = $tokenizedWordAsObject->t; $wordLength = mb_strlen($word); if (!array_key_exists($word, $this->index) && $wordLength > 2) { // complete this word adding all words available in the index with same start letters foreach ($this->index as $wordIndex => $wordIndexTokenized) { $indexWordSubstring = substr($wordIndex, 0, $wordLength); if ($indexWordSubstring === $word) { $result[] = ['t' => $wordIndex, 'w' => 1]; } } } else { // keep existing word $result[] = $tokenizedWord; } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function manageWord($word, $index) {\n // normalize\n $word = mb_strtolower($word, $this->encoding);\n \n $termObj = new Term($word);\n\n // save the term\n if(!$this->uniqueMatchesStatus[$word]) {\n $termObj->save();\n $this->uniqueMatchesStatus[$word] = TRUE;\n }\n \n // add to term list\n if ($this->termsList->contains($termObj)) {\n // just add new occurrence\n $this->invertedIndex->addOccurrence($this->invertedIndex->getInvertedIndex($termObj, $this), $index);\n } else {\n $this->termsList->push($termObj);\n\n // save term-doc relation (inverted index) and position of occurrance\n $this->invertedIndex->addRelation($termObj, $this, $index);\n }\n }", "function _step_2( $word )\n {\n switch ( substr($word, -2, 1) ) {\n case 'a':\n if ( $this->_replace($word, 'ational', 'ate', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'tional', 'tion', 0) ) {\n return $word;\n }\n break;\n case 'c':\n if ( $this->_replace($word, 'enci', 'ence', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'anci', 'ance', 0) ) {\n return $word;\n }\n break;\n case 'e':\n if ( $this->_replace($word, 'izer', 'ize', 0) ) {\n return $word;\n }\n break;\n case 'l':\n // This condition is a departure from the original algorithm;\n // I adapted it from the departure in the ANSI-C version.\n\t\t\t\tif ( $this->_replace($word, 'bli', 'ble', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'alli', 'al', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'entli', 'ent', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'eli', 'e', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ousli', 'ous', 0) ) {\n return $word;\n }\n break;\n case 'o':\n if ( $this->_replace($word, 'ization', 'ize', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'isation', 'ize', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ation', 'ate', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ator', 'ate', 0) ) {\n return $word;\n }\n break;\n case 's':\n if ( $this->_replace($word, 'alism', 'al', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'iveness', 'ive', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'fulness', 'ful', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ousness', 'ous', 0) ) {\n return $word;\n }\n break;\n case 't':\n if ( $this->_replace($word, 'aliti', 'al', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'iviti', 'ive', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'biliti', 'ble', 0) ) {\n return $word;\n }\n break;\n case 'g':\n // This condition is a departure from the original algorithm;\n // I adapted it from the departure in the ANSI-C version.\n if ( $this->_replace($word, 'logi', 'log', 0) ) { //*****\n return $word;\n }\n break;\n }\n return $word;\n }", "abstract public function lookupWordRandomly();", "function _step_3( $word )\n {\n switch ( substr($word, -1) ) {\n case 'e':\n if ( $this->_replace($word, 'icate', 'ic', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ative', '', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'alize', 'al', 0) ) {\n return $word;\n }\n break;\n case 'i':\n if ( $this->_replace($word, 'iciti', 'ic', 0) ) {\n return $word;\n }\n break;\n case 'l':\n if ( $this->_replace($word, 'ical', 'ic', 0) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ful', '', 0) ) {\n return $word;\n }\n break;\n case 's':\n if ( $this->_replace($word, 'ness', '', 0) ) {\n return $word;\n }\n break;\n }\n return $word;\n }", "function _step_4( $word )\n {\n switch ( substr($word, -2, 1) ) {\n case 'a':\n if ( $this->_replace($word, 'al', '', 1) ) {\n return $word;\n }\n break;\n case 'c':\n if ( $this->_replace($word, 'ance', '', 1) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ence', '', 1) ) {\n return $word;\n }\n break;\n case 'e':\n if ( $this->_replace($word, 'er', '', 1) ) {\n return $word;\n }\n break;\n case 'i':\n if ( $this->_replace($word, 'ic', '', 1) ) {\n return $word;\n }\n break;\n case 'l':\n if ( $this->_replace($word, 'able', '', 1) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ible', '', 1) ) {\n return $word;\n }\n break;\n case 'n':\n if ( $this->_replace($word, 'ant', '', 1) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ement', '', 1) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ment', '', 1) ) {\n return $word;\n }\n if ( $this->_replace($word, 'ent', '', 1) ) {\n return $word;\n }\n break;\n case 'o':\n // special cases\n if ( substr($word, -4) == 'sion' || substr($word, -4) == 'tion' ) {\n if ( $this->_replace($word, 'ion', '', 1) ) {\n return $word;\n }\n }\n if ( $this->_replace($word, 'ou', '', 1) ) {\n return $word;\n }\n break;\n case 's':\n if ( $this->_replace($word, 'ism', '', 1) ) {\n return $word;\n }\n break;\n case 't':\n if ( $this->_replace($word, 'ate', '', 1) ) {\n return $word;\n }\n if ( $this->_replace($word, 'iti', '', 1) ) {\n return $word;\n }\n break;\n case 'u':\n if ( $this->_replace($word, 'ous', '', 1) ) {\n return $word;\n }\n break;\n case 'v':\n if ( $this->_replace($word, 'ive', '', 1) ) {\n return $word;\n }\n break;\n case 'z':\n if ( $this->_replace($word, 'ize', '', 1) ) {\n return $word;\n }\n break;\n }\n return $word;\n }", "protected function nextWord() {\n\t\t$this->word = strtolower($this->puzzleList[array_rand($this->puzzleList)]);\n\t\t$this->guesses = [];\n\t\t$this->roundNum ++;\n\n\t\techo(\"New word: {$this->word}\\n\");\n\t\t$this->sendResults();\n\t}", "function _step_1( $word )\n {\n\t\t// Step 1a\n\t\tif ( substr($word, -1) == 's' ) {\n if ( substr($word, -4) == 'sses' ) {\n $word = substr($word, 0, -2);\n } elseif ( substr($word, -3) == 'ies' ) {\n $word = substr($word, 0, -2);\n } elseif ( substr($word, -2, 1) != 's' ) {\n // If second-to-last character is not \"s\"\n $word = substr($word, 0, -1);\n }\n }\n\t\t// Step 1b\n if ( substr($word, -3) == 'eed' ) {\n\t\t\tif ($this->count_vc(substr($word, 0, -3)) > 0 ) {\n\t // Convert '-eed' to '-ee'\n\t $word = substr($word, 0, -1);\n\t\t\t}\n } else {\n if ( preg_match('/([aeiou]|[^aeiou]y).*(ed|ing)$/', $word) ) { // vowel in stem\n // Strip '-ed' or '-ing'\n if ( substr($word, -2) == 'ed' ) {\n $word = substr($word, 0, -2);\n } else {\n $word = substr($word, 0, -3);\n }\n if ( substr($word, -2) == 'at' || substr($word, -2) == 'bl' ||\n substr($word, -2) == 'iz' ) {\n $word .= 'e';\n } else {\n $last_char = substr($word, -1, 1);\n $next_to_last = substr($word, -2, 1);\n // Strip ending double consonants to single, unless \"l\", \"s\" or \"z\"\n if ( $this->is_consonant($word, -1) &&\n $last_char == $next_to_last &&\n $last_char != 'l' && $last_char != 's' && $last_char != 'z' ) {\n $word = substr($word, 0, -1);\n } else {\n // If VC, and cvc (but not w,x,y at end)\n if ( $this->count_vc($word) == 1 && $this->_o($word) ) {\n $word .= 'e';\n }\n }\n }\n }\n }\n // Step 1c\n // Turn y into i when another vowel in stem\n if ( preg_match('/([aeiou]|[^aeiou]y).*y$/', $word) ) { // vowel in stem\n $word = substr($word, 0, -1) . 'i';\n }\n return $word;\n }", "private function step3()\n {\n // leg eleg ig eig lig elig els lov elov slov hetslov\n if ( ($position = $this->searchIfInR1(array(\n 'hetslov', 'eleg', 'elov', 'slov', 'elig', 'eig', 'lig', 'els', 'lov', 'leg', 'ig'\n ))) !== false) {\n $this->word = UTF8::substr($this->word, 0, $position);\n }\n }", "abstract public function lookupWord($word);", "private function step2()\n {\n if ($this->searchIfInR1(array('dt', 'vt')) !== false) {\n $this->word = UTF8::substr($this->word, 0, -1);\n }\n }", "function censor_words($output)\n {\n foreach ($_SESSION['pgo_word_censor'] as $find => $replace)\n {\n $output = preg_replace(\"/\\b$find\\b/i\", $replace, $output);\n }\n return $output;\n }", "private function step1()\n {\n // erte ert\n // replace with er\n if ( ($position = $this->searchIfInR1(array('erte', 'ert'))) !== false) {\n $this->word = preg_replace('#(erte|ert)$#u', 'er', $this->word);\n return true;\n }\n\n // a e ede ande ende ane ene hetene en heten ar er heter as es edes endes enes hetenes ens hetens ers ets et het ast\n // delete\n if ( ($position = $this->searchIfInR1(array(\n 'hetenes', 'hetene', 'hetens', 'heten', 'endes', 'heter', 'ande', 'ende', 'enes', 'edes', 'ede', 'ane',\n 'ene', 'het', 'ers', 'ets', 'ast', 'ens', 'en', 'ar', 'er', 'as', 'es', 'et', 'a', 'e'\n ))) !== false) {\n $this->word = UTF8::substr($this->word, 0, $position);\n return true;\n }\n\n // s\n // delete if preceded by a valid s-ending\n if ( ($position = $this->searchIfInR1(array('s'))) !== false) {\n $word = UTF8::substr($this->word, 0, $position);\n if ($this->hasValidSEnding($word)) {\n $this->word = $word;\n }\n return true;\n }\n }", "function PrimeiraPalavra($param)\n{\n $output = '';\n $sigh = explode(' ', $param);\n foreach ($sigh as $i => $single_word) {\n if ($i == 0) {\n $output .= $single_word;\n } else {\n break;\n }\n }\n echo $output;\n\n}", "public function testShortValuableWord() : void\n {\n $word = 'zoo';\n $this->assertEquals(12, score($word));\n }", "function jib_word($length) {\n\t\t$vowels = array(\"a\", \"e\", \"i\", \"o\", \"u\");\n\t\t$cons = array(\"b\", \"c\", \"d\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"r\", \"s\", \"t\", \"v\", \"w\");#, \"tr\", \"cr\", \"br\", \"fr\", \"th\", \"dr\", \"ch\", \"ph\", \"wr\", \"st\", \"sp\", \"sw\", \"pr\", \"sl\", \"cl\", \"sh\"\n\n\t\t$num_vowels = count($vowels);\n\t\t$num_cons = count($cons);\n\t\t$word = '';\n\n\t\twhile (strlen($word) < $length) {\n\t\t$word .= $cons[mt_rand(0, $num_cons - 1)] . $vowels[mt_rand(0, $num_vowels - 1)];\n\t\t}\n\n\t\treturn substr($word, 0, $length);\n\t}", "public function soundex($word)\n {\n $soundex = mb_substr($word, 0, 1, 'UTF-8');\n $rest = mb_substr($word, 1, mb_strlen($word, 'UTF-8'), 'UTF-8');\n\n if ($this->_lang == 'en') {\n $soundex = $this->_transliteration[$soundex];\n }\n\n $encodedRest = $this->mapCode($rest);\n $cleanEncodedRest = $this->trimRep($encodedRest);\n\n $soundex .= $cleanEncodedRest;\n\n $soundex = str_replace('0', '', $soundex);\n\n $totalLen = mb_strlen($soundex, 'UTF-8');\n if ($totalLen > $this->_len) {\n $soundex = mb_substr($soundex, 0, $this->_len, 'UTF-8');\n } else {\n $soundex .= str_repeat('0', $this->_len - $totalLen);\n }\n\n return $soundex;\n }", "public function replaceWordWith($data, $replacement, $line = NULL, $index = NULL) {\r\n\t\tif ($this->exists && $data !== null) {\r\n\t\t\t$string = new iString ( $data );\r\n\t\t\t\r\n\t\t\tif ($line === null && $index === null) {\r\n\t\t\t\t$lineData = $this->readByLine ();\r\n\t\t\t\t$this->clearFile ();\r\n\t\t\t\tfor($i = 0; $i < sizeof ( $lineData ); $i ++) {\r\n\t\t\t\t\t$words = $lineData [$i];\r\n\t\t\t\t\t$listOfWords = explode ( \" \", $words );\r\n\t\t\t\t\tfor($y = 0; $y < sizeof ( $listOfWords ); $y ++) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($string->compare_NoCase ( trim ( $listOfWords [$y] ) )) {\r\n\t\t\t\t\t\t\t$listOfWords [$y] = $replacement;\r\n\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$listOfWords = array_values ( $listOfWords );\r\n\t\t\t\t\t$words = implode ( \" \", $listOfWords );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->writeToFile ( trim ( $words ) . \"\\n\" );\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t\r\n\t\t\t} else if ($line !== null && $index === null) {\r\n\t\t\t\t$lineData = $this->readByLine ();\r\n\t\t\t\t$this->clearFile ();\r\n\t\t\t\t$words = $lineData [$line];\r\n\t\t\t\t$listOfWords = explode ( \" \", $words );\r\n\t\t\t\tfor($y = 0; $y < sizeof ( $listOfWords ); $y ++) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($string->compare_NoCase ( trim ( $listOfWords [$y] ) )) {\r\n\t\t\t\t\t\t$listOfWords [$y] = $replacement;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$listOfWords = array_values ( $listOfWords );\r\n\t\t\t\t$words = implode ( \" \", $listOfWords );\r\n\t\t\t\t$lineData [$line] = trim ( $words ) . \"\\n\";\r\n\t\t\t\t\r\n\t\t\t\tfor($y = 0; $y < sizeof ( $lineData ); $y ++) {\r\n\t\t\t\t\t$this->writeToFile ( $lineData [$y] );\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t\r\n\t\t\t} else if ($line !== null && $index !== null) {\r\n\t\t\t\t$wordToMove = $this->getWordByLineIndex ( $line, $index );\r\n\t\t\t\t$this->replaceWordWith ( $wordToMove, $replacement, $line );\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function putWordInTheMiddle(array $array, string $word);", "function mapWord(&$word_map, $word, $offset, $f)\r\n{\r\n if (isset($word_map[$word])) {\r\n if (isset($word_map[$word][$f])){\r\n $term_count = $word_map[$word]['term_count']+1;\r\n $word_map[$word]['term_count'] = $term_count;\r\n array_push($word_map[$word][$f], $offset);\r\n } else {\r\n $doc_count = $word_map[$word]['doc_count']+1;\r\n $word_map[$word]['doc_count'] = $doc_count;\r\n $word_map[$word][$f] = array();\r\n $term_count = $word_map[$word]['term_count']+1;\r\n $word_map[$word]['term_count'] = $term_count;\r\n array_push($word_map[$word][$f],$offset);\r\n }\r\n }\r\n else {\r\n $word_map[$word] = array();\r\n $word_map[$word]['doc_count'] = 1;\r\n $word_map[$word]['term_count'] = 1;\r\n $word_map[$word][$f] = array();\r\n array_push($word_map[$word][$f], $offset);\r\n }\r\n}", "function cut_word(string $word)\n{\n// \"u\", \"v\", \"w\", \"x\", \"y\", \"z\");\n $save_word = \"\";\n $answer_word = array();\n $count_array = 0;\n $word = strtolower($word) . \" \";\n for ($i = 0; $i < strlen($word); $i++) {\n if ($word[$i] != \" \") {\n $save_word = $save_word . $word[$i];\n } else {\n $answer_word[$count_array] = $save_word;\n $count_array++;\n $save_word = \"\";\n }\n }\n return $answer_word;\n}", "function _step_5( $word )\n {\n if ( substr($word, -1) == 'e' ) {\n $short = substr($word, 0, -1);\n // Only remove in vcvc context...\n if ( $this->count_vc($short) > 1 ) {\n $word = $short;\n } elseif ( $this->count_vc($short) == 1 && !$this->_o($short) ) {\n $word = $short;\n }\n }\n if ( substr($word, -2) == 'll' ) {\n // Only remove in vcvc context...\n if ( $this->count_vc($word) > 1 ) {\n $word = substr($word, 0, -1);\n }\n }\n return $word;\n }", "function swapBadWords($string) \n{\n global $gbBadWords;\n\n // Count the number of array element of the bad word array\n $nBadWords = sizeof($gbBadWords);\n\n for ($i = 0; $i < $nBadWords; $i++) {\n\n // Grab the first letter of bad word\n $banned = substr($gbBadWords[$i], 0, 1);\n // Replace remaining letters of bad word\n for ($j = 1; $j < strlen($gbBadWords[$i]); $j++) {\n $banned .= \"*\";\n }\n // chars replaced with *.\n $string = str_replace($gbBadWords[$i], $banned, $string);\n }\n return $string;\n}", "function check_for_word($letters_hashmap,$word){\n /// found letters\n $found_letters=0;\n ///visited cordinates\n $visited=[];\n //iterate in the word letters searching for them on the hash table\n $words_count=strlen($word);\n ///\n $stop=false;\n ///start from first letter \n $the_temp_letter=$word[0];\n \n while($found_letters<$words_count && !$stop){\n//serch for the letter on the hash table\n $the_letter=$the_temp_letter;\n \n \n\n if(array_key_exists($the_letter,$letters_hashmap)\n && count(array_diff(str_split($letters_hashmap[$the_letter],2),$visited))>=1\n ){\n \n //the letter is found on the hsah table\n //let us get how many times\n ///the last number was making error in the last letter to add to hash table\n $cordenates=$letters_hashmap[$the_letter];\n $cordenates = str_replace(' ', '', $cordenates);\n \n \n \n \n\n \n ///lets iterate throw the cordenates and check if it's available\n\n \n for($j=0;$j<strlen($cordenates);$j+=2){\n ///assign the first cordinates to start the search\n \n \n \n \n if($found_letters==0 && !in_array($cordenates[$j].$cordenates[$j+1],$visited)){\n $x_cord=$cordenates[$j];\n $y_cord=$cordenates[$j+1];\n array_push($visited,$x_cord.$y_cord);\n $found_letters++;\n $the_temp_letter=$word[$found_letters];\n break;\n \n\n }\n\n\n \n ///we are not on the first letter so we need compare the second letter cord with our cords\n else{\n \n $nexX=$cordenates[$j];\n $newY=$cordenates[$j+1];\n\n\n \n \n\n\n if(($x_cord-$newY+$y_cord-$nexX)<=1 && !in_array($j.$j+1,$visited)){\n \n\n ///the new position\n $x_cord=$cordenates[$j];\n $y_cord=$cordenates[$j+1];\n array_push($visited,$x_cord.$y_cord);\n\n \n \n $found_letters++;\n ///if we reached the last letter and found it then we should stop the loop\n if($found_letters==$words_count){\n \n $stop= true;\n \n break;\n \n }\n \n \n $the_temp_letter=$word[$found_letters];\n \n break;\n \n \n \n\n\n }else{\n\n if($j==strlen($cordenates)-1){\n $found_letters--;\n\n $the_temp_letter=$word[$found_letters];\n //\n \n array_push($visited,$cordenates[$j].$cordenates[$j+1]);\n $stop=true;\n break;\n }\n \n \n $the_temp_letter=$word[$found_letters];\n //array_push($visited,$cordenates[$j].$cordenates[$j+1]);\n \n // break;\n\n \n\n \n \n\n }\n }\n\n\n }\n \n \n }\n //so the letter is not found on the matrix so the word cant be formated\n else{\n $stop= true;\n \n \n }\n \n\n }\n \n //return $found_letters;\n if($found_letters==$words_count){\n return $found_letters;\n }else{\n return false;\n }\n\n}", "public function testWordFlipRandomWord()\n {\n $service = new WordService();\n\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $string = $stringFlipped = '';\n for ($i = 0; $i < 10; $i++) {\n $char = $characters[rand(0, strlen($characters)-1)];\n $string = $string.$char;\n $stringFlipped = $char.$stringFlipped;\n }\n\n $this->assertEquals($stringFlipped, $service->wordFlip($string));\n }", "public function disambiguate($word)\n {\n if (preg_match('/^kau(.*)$/', $word, $matches)) {\n return $matches[1];\n }\n }", "function swap_bad_words($string)\n{\n global $gbBadWords;\n\n foreach ($gbBadWords as $bad_word)\n {\n $pattern = '/(\\W|^)(' . $bad_word . ')(\\W|$)/iu';\n\n //just get the first letter of bad_word into good_word\n $good_word = substr($bad_word, 0, 1);\n\n //fill out good_word with *s\n for ($i = 1; $i < strlen($bad_word); $i++)\n {\n $good_word .= '*';\n }\n //we replace the bad_word with good word including anything immediately adjacent\n //such as a comma, space, period or start/end of string.\n $replacement = '$1' . $good_word . '$3';\n $string = preg_replace($pattern, $replacement, $string);\n }\n\n //convert back to UTF-8\n return $string;\n\n}", "public function execIndexFulltext() {\n\t\t$pdf = escapeshellarg($this->getPdfPath());\n\t\t$len = 0;\n\n\t\tfor($p=1; $p<=$this->pocet_stran; $p++)\n\t\t{\n\t\t\t$outputarr = array();\n\t\t\texec(\"pdftotext -f $p -l $p $pdf -\", $outputarr, $returnval);\n\t\t\t$output = implode(\"\\n\", $outputarr);\n\n\t\t\t//save only meaningful content AND title page for note=already indexed\n\t\t\tif(trim($output) OR $p==1){\n\t\t\t\tdibi::query('REPLACE INTO `fulltext`', array('cislo_id' => $this->id, 'strana'=>$p, 'text'=>trim($output)));\n\t\t\t\t$len += strlen($output);\n\t\t\t}\n\t\t}\n\t\treturn $len;\n\t}", "private function wordToLink($word)\n {\n\n $word = $word[0];\n $word_search = strtolower($this->removeAccent($word));\n //$word_search = $word;\n $this->psreplace->execute(array(':word' => $word_search));\n\n if ($this->psreplace->rowcount() > 0) {\n $req = $this->psreplace->fetch();\n $str = \"\";\n $str .= '<a title=\"';\n $str .= $req[\"def\"];\n $str .= '\" href=\"?word=';\n $str .= $word;\n $str .= '\"';\n if ($word_search == strtolower($this->search_term))\n $str .= ' class=\"fluo\"';\n $str .= '>';\n $str .= $word;\n $str .= \"</a>\";\n return $str;\n } else {\n return $word;\n }\n }", "public function stem($word)\n {\n if(empty(trim($word))) { \n return null;\n }\n \n $this->originalToken = $word;\n \n //only iterate out loop if a rule is applied \n do {\n $ruleApplied = false;\n $lookupChar = $word[strlen($word)-1];\n\n //check that the last character is in the index, if not return the origin token\n if(!array_key_exists($lookupChar, $this->indexedRules)){\n return $word;\n }\n foreach($this->indexedRules[$lookupChar] as $rule)\n {\n if(strrpos($word, substr($rule[self::ENDING_STRING],-1)) === \n (strlen($word)-strlen($rule[self::ENDING_STRING]))){\n\n \n if(!empty($rule[self::INTACT_FLAG])){ \n \n if($this->originalToken == $word && \n $this->isAcceptable($word, (int)$rule[self::REMOVE_TOTAL])){\n\n $word = $this->applyRule($word, $rule);\n $ruleApplied = true;\n if($rule[self::CONTINUE_FLAG] === '.'){\n return $word;\n } \n break;\n }\n } elseif($this->isAcceptable($word, (int)$rule[self::REMOVE_TOTAL])){\n $word = $this->applyRule($word, $rule);\n $ruleApplied = true;\n if($rule[self::CONTINUE_FLAG] === '.'){\n return $word;\n }\n break;\n }\n } else {\n $ruleApplied = false;\n }\n }\n } while($ruleApplied);\n \n return $word;\n \n }", "function parse_words()\n\t{\n\t\t//list of commonly used words\n\t\t// this can be edited to suit your needs\n\t\t$common = array(\"able\", \"about\", \"above\", \"act\", \"add\", \"afraid\", \"after\", \"again\", \"against\", \"age\", \"ago\", \"agree\", \"all\", \"almost\", \"alone\", \"along\", \"already\", \"also\", \"although\", \"always\", \"am\", \"amount\", \"an\", \"and\", \"anger\", \"angry\", \"animal\", \"another\", \"answer\", \"any\", \"appear\", \"apple\", \"are\", \"arrive\", \"arm\", \"arms\", \"around\", \"arrive\", \"as\", \"ask\", \"at\", \"attempt\", \"aunt\", \"away\", \"back\", \"bad\", \"bag\", \"bay\", \"be\", \"became\", \"because\", \"become\", \"been\", \"before\", \"began\", \"begin\", \"behind\", \"being\", \"bell\", \"belong\", \"below\", \"beside\", \"best\", \"better\", \"between\", \"beyond\", \"big\", \"body\", \"bone\", \"born\", \"borrow\", \"both\", \"bottom\", \"box\", \"boy\", \"break\", \"bring\", \"brought\", \"bug\", \"built\", \"busy\", \"but\", \"buy\", \"by\", \"call\", \"came\", \"can\", \"cause\", \"choose\", \"close\", \"close\", \"consider\", \"come\", \"consider\", \"considerable\", \"contain\", \"continue\", \"could\", \"cry\", \"cut\", \"dare\", \"dark\", \"deal\", \"dear\", \"decide\", \"deep\", \"did\", \"die\", \"do\", \"does\", \"dog\", \"done\", \"doubt\", \"down\", \"during\", \"each\", \"ear\", \"early\", \"eat\", \"effort\", \"either\", \"else\", \"end\", \"enjoy\", \"enough\", \"enter\", \"even\", \"ever\", \"every\", \"except\", \"expect\", \"explain\", \"fail\", \"fall\", \"far\", \"fat\", \"favor\", \"fear\", \"feel\", \"feet\", \"fell\", \"felt\", \"few\", \"fill\", \"find\", \"fit\", \"fly\", \"follow\", \"for\", \"forever\", \"forget\", \"from\", \"front\", \"gave\", \"get\", \"gives\", \"goes\", \"gone\", \"good\", \"got\", \"gray\", \"great\", \"green\", \"grew\", \"grow\", \"guess\", \"had\", \"half\", \"hang\", \"happen\", \"has\", \"hat\", \"have\", \"he\", \"hear\", \"heard\", \"held\", \"hello\", \"help\", \"her\", \"here\", \"hers\", \"high\", \"hill\", \"him\", \"his\", \"hit\", \"hold\", \"hot\", \"how\", \"however\", \"I\", \"if\", \"ill\", \"in\", \"indeed\", \"instead\", \"into\", \"iron\", \"is\", \"it\", \"its\", \"just\", \"keep\", \"kept\", \"knew\", \"know\", \"known\", \"late\", \"least\", \"led\", \"left\", \"lend\", \"less\", \"let\", \"like\", \"likely\", \"likr\", \"lone\", \"long\", \"look\", \"lot\", \"make\", \"many\", \"may\", \"me\", \"mean\", \"met\", \"might\", \"mile\", \"mine\", \"moon\", \"more\", \"most\", \"move\", \"much\", \"must\", \"my\", \"near\", \"nearly\", \"necessary\", \"neither\", \"never\", \"next\", \"no\", \"none\", \"nor\", \"not\", \"note\", \"nothing\", \"now\", \"number\", \"of\", \"off\", \"often\", \"oh\", \"on\", \"once\", \"only\", \"or\", \"other\", \"ought\", \"our\", \"out\", \"please\", \"prepare\", \"probable\", \"pull\", \"pure\", \"push\", \"put\", \"raise\", \"ran\", \"rather\", \"reach\", \"realize\", \"reply\", \"require\", \"rest\", \"run\", \"said\", \"same\", \"sat\", \"saw\", \"say\", \"see\", \"seem\", \"seen\", \"self\", \"sell\", \"sent\", \"separate\", \"set\", \"shall\", \"she\", \"should\", \"side\", \"sign\", \"since\", \"so\", \"sold\", \"some\", \"soon\", \"sorry\", \"stay\", \"step\", \"stick\", \"still\", \"stood\", \"such\", \"sudden\", \"suppose\", \"take\", \"taken\", \"talk\", \"tall\", \"tell\", \"ten\", \"than\", \"thank\", \"that\", \"the\", \"their\", \"them\", \"then\", \"there\", \"therefore\", \"these\", \"they\", \"this\", \"those\", \"though\", \"through\", \"till\", \"to\", \"today\", \"told\", \"tomorrow\", \"too\", \"took\", \"tore\", \"tought\", \"toward\", \"tried\", \"tries\", \"trust\", \"try\", \"turn\", \"two\", \"under\", \"until\", \"up\", \"upon\", \"us\", \"use\", \"usual\", \"various\", \"verb\", \"very\", \"visit\", \"want\", \"was\", \"we\", \"well\", \"went\", \"were\", \"what\", \"when\", \"where\", \"whether\", \"which\", \"while\", \"white\", \"who\", \"whom\", \"whose\", \"why\", \"will\", \"with\", \"within\", \"without\", \"would\", \"yes\", \"yet\", \"you\", \"young\", \"your\", \"br\", \"img\", \"p\",\"lt\", \"gt\", \"quot\", \"copy\");\n\t\t//create an array out of the site contents\n\t\t$s = split(\" \", $this->contents);\n\t\t//initialize array\n\t\t$k = array();\n\t\t//iterate inside the array\n\t\tforeach( $s as $key=>$val ) {\n\t\t\t//delete single or two letter words and\n\t\t\t//Add it to the list if the word is not\n\t\t\t//contained in the common words list.\n\t\t\tif(mb_strlen(trim($val)) >= $this->wordLengthMin && !in_array(trim($val), $common) && !is_numeric(trim($val))) {\n\t\t\t\t$k[] = trim($val);\n\t\t\t}\n\t\t}\n\t\t//count the words\n\t\t$k = array_count_values($k);\n\t\t//sort the words from\n\t\t//highest count to the\n\t\t//lowest.\n\t\t$occur_filtered = $this->occure_filter($k, $this->wordOccuredMin);\n\t\tarsort($occur_filtered);\n\n\t\t$imploded = $this->implode(\", \", $occur_filtered);\n\t\t//release unused variables\n\t\tunset($k);\n\t\tunset($s);\n\n\t\treturn $imploded;\n\t}", "public function testLongMixedCaseWord() : void\n {\n $word = 'OxyphenButazone';\n $this->assertEquals(41, score($word));\n }", "function insert($word) {\n $p = $this->root;\n for ($i=0; $i < strlen($word); $i++) { \n $index = (int)(ord($word[$i]) - ord('a'));\n if ($p->children[$index] == null) {\n $p->children[$index] = new TrieNode();\n }\n $p = $p->children[$index]; // 移动到子节点\n }\n $p->is_word = true; // 当前单词走完一遍,标记is_word为真\n }", "function stem($word) {\n $word = mb_strtolower($word,\"UTF-8\");\n // $word = strtr($word, 'ё', 'е');\n # Check against cache of stemmed words\n if ($this->Stem_Caching && isset($this->Stem_Cache[$word])) {\n return $this->Stem_Cache[$word];\n }\n $stem = $word;\n do {\n if (!preg_match($this->RVRE, $word, $p))\n break;\n $start = $p[1];\n $RV = $p[2];\n if (!$RV)\n break;\n\n # Step 1\n if (!$this->s($RV, $this->PERFECTIVEGROUND, '')) {\n $this->s($RV, $this->REFLEXIVE, '');\n\n if ($this->s($RV, $this->ADJECTIVE, '')) {\n $this->s($RV, $this->PARTICIPLE, '');\n } else {\n if (!$this->s($RV, $this->VERB, ''))\n $this->s($RV, $this->NOUN, '');\n }\n }\n\n # Step 2\n $this->s($RV, '/и$/', '');\n\n # Step 3\n if ($this->m($RV, $this->DERIVATIONAL))\n $this->s($RV, '/ость?$/', '');\n\n # Step 4\n if (!$this->s($RV, '/ь$/', '')) {\n $this->s($RV, '/ейше?/', '');\n $this->s($RV, '/нн$/', 'н');\n }\n\n $stem = $start . $RV;\n } while (false);\n if ($this->Stem_Caching)\n $this->Stem_Cache[$word] = $stem;\n return $stem;\n }", "function insert($word) {\n if (strlen($word) == 0) return;\n\n $cur = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $c = substr($word, $i, 1);\n if (!isset($cur->next[$c])) {\n $cur->next[$c] = new TrieNode();\n }\n $cur = $cur->next[$c];\n }\n\n if (!$cur->$isWord) {\n $cur->$isWord = true;\n $this->size++;\n }\n }", "function bad_words($text)\n\t\t\t{\n\t\t\t\t$swearWords = array('motherfucking', 'motherfucker', 'fucker', 'fuck', 'bitch', 'shit', 'pussy', 'nigger', 'slut', 'cunt');\n\n\t\t\t\t$replaceWith = array('m****rf*****g', 'm****rf***r', 'f****r', 'f**k', 'b***h', 's**t', 'p***y', 'n****r', 's**t', 'c**t');\n\n\t\t\t\t$text = str_ireplace($swearWords, $replaceWith, $text);\n\n\t\t\t\treturn $text;\n\t\t\t}", "function stemWord($w) {\n $numberOfRulesExamined = 0; //this is the number of rules examined. for deubugging and testing purposes\n\n//it is better to convert the input into iso-8859-7 in case it is in utf-8\n// this way we dont have any problems with length counting etc\n\n $encoding_changed = FALSE;\n if (mb_check_encoding($w, \"UTF-8\")) {\n $encoding_changed = TRUE;\n $w = mb_convert_encoding($w, \"ISO-8859-7\", \"UTF-8\");\n }\n $w_CASE = array(strlen($w));//1 for changed case in that position, 2 especially for ς\n\n\n//first we must find all letters that are not in Upper case and store their position\n $unacceptedLetters = array(\"α\", \"β\", \"γ\", \"δ\", \"ε\", \"ζ\", \"η\", \"θ\", \"ι\", \"κ\", \"λ\", \"μ\", \"ν\", \"ξ\", \"ο\", \"π\", \"ρ\", \"σ\", \"τ\", \"υ\", \"φ\", \"χ\", \"ψ\", \"ω\", \"ά\", \"έ\", \"ή\", \"ί\", \"ό\", \"ύ\", \"ς\", \"ώ\", \"ϊ\");\n $acceptedLetters = array(\"Α\", \"Β\", \"Γ\", \"Δ\", \"Ε\", \"Ζ\", \"Η\", \"Θ\", \"Ι\", \"Κ\", \"Λ\", \"Μ\", \"Ν\", \"Ξ\", \"Ο\", \"Π\", \"Ρ\", \"Σ\", \"Τ\", \"Υ\", \"Φ\", \"Χ\", \"Ψ\", \"Ω\", \"Α\", \"Ε\", \"Η\", \"Ι\", \"Ο\", \"Υ\", \"Σ\", \"Ω\", \"Ι\");\n\n for ($k = 0; $k <= 32; $k = $k + 1) {\n for ($i = 0; $i <= strlen($w); $i++) {\n if ($w[$i] == $unacceptedLetters[$k]) {\n if ($w[$i] == \"ς\") {\n $w[$i] = \"Σ\";\n $w_CASE[$i] = 2;\n } else {\n $w[$i] = $acceptedLetters[$k];\n $w_CASE[$i] = \"1\";\n }\n }\n }\n }\n//stop-word removal\n $numberOfRulesExamined++;\n $stop_words = '/^(ΕΚΟ|ΑΒΑ|ΑΓΑ|ΑΓΗ|ΑΓΩ|ΑΔΗ|ΑΔΩ|ΑΕ|ΑΕΙ|ΑΘΩ|ΑΙ|ΑΙΚ|ΑΚΗ|ΑΚΟΜΑ|ΑΚΟΜΗ|ΑΚΡΙΒΩΣ|ΑΛΑ|ΑΛΗΘΕΙΑ|ΑΛΗΘΙΝΑ|ΑΛΛΑΧΟΥ|ΑΛΛΙΩΣ|ΑΛΛΙΩΤΙΚΑ|ΑΛΛΟΙΩΣ|ΑΛΛΟΙΩΤΙΚΑ|ΑΛΛΟΤΕ|ΑΛΤ|ΑΛΩ|ΑΜΑ|ΑΜΕ|ΑΜΕΣΑ|ΑΜΕΣΩΣ|ΑΜΩ|ΑΝ|ΑΝΑ|ΑΝΑΜΕΣΑ|ΑΝΑΜΕΤΑΞΥ|ΑΝΕΥ|ΑΝΤΙ|ΑΝΤΙΠΕΡΑ|ΑΝΤΙΣ|ΑΝΩ|ΑΝΩΤΕΡΩ|ΑΞΑΦΝΑ|ΑΠ|ΑΠΕΝΑΝΤΙ|ΑΠΟ|ΑΠΟΨΕ|ΑΠΩ|ΑΡΑ|ΑΡΑΓΕ|ΑΡΕ|ΑΡΚ|ΑΡΚΕΤΑ|ΑΡΛ|ΑΡΜ|ΑΡΤ|ΑΡΥ|ΑΡΩ|ΑΣ|ΑΣΑ|ΑΣΟ|ΑΤΑ|ΑΤΕ|ΑΤΗ|ΑΤΙ|ΑΤΜ|ΑΤΟ|ΑΥΡΙΟ|ΑΦΗ|ΑΦΟΤΟΥ|ΑΦΟΥ|ΑΧ|ΑΧΕ|ΑΧΟ|ΑΨΑ|ΑΨΕ|ΑΨΗ|ΑΨΥ|ΑΩΕ|ΑΩΟ|ΒΑΝ|ΒΑΤ|ΒΑΧ|ΒΕΑ|ΒΕΒΑΙΟΤΑΤΑ|ΒΗΞ|ΒΙΑ|ΒΙΕ|ΒΙΗ|ΒΙΟ|ΒΟΗ|ΒΟΩ|ΒΡΕ|ΓΑ|ΓΑΒ|ΓΑΡ|ΓΕΝ|ΓΕΣ||ΓΗ|ΓΗΝ|ΓΙ|ΓΙΑ|ΓΙΕ|ΓΙΝ|ΓΙΟ|ΓΚΙ|ΓΙΑΤΙ|ΓΚΥ|ΓΟΗ|ΓΟΟ|ΓΡΗΓΟΡΑ|ΓΡΙ|ΓΡΥ|ΓΥΗ|ΓΥΡΩ|ΔΑ|ΔΕ|ΔΕΗ|ΔΕΙ|ΔΕΝ|ΔΕΣ|ΔΗ|ΔΗΘΕΝ|ΔΗΛΑΔΗ|ΔΗΩ|ΔΙ|ΔΙΑ|ΔΙΑΡΚΩΣ|ΔΙΟΛΟΥ|ΔΙΣ|ΔΙΧΩΣ|ΔΟΛ|ΔΟΝ|ΔΡΑ|ΔΡΥ|ΔΡΧ|ΔΥΕ|ΔΥΟ|ΔΩ|ΕΑΜ|ΕΑΝ|ΕΑΡ|ΕΘΗ|ΕΙ|ΕΙΔΕΜΗ|ΕΙΘΕ|ΕΙΜΑΙ|ΕΙΜΑΣΤΕ|ΕΙΝΑΙ|ΕΙΣ|ΕΙΣΑΙ|ΕΙΣΑΣΤΕ|ΕΙΣΤΕ|ΕΙΤΕ|ΕΙΧΑ|ΕΙΧΑΜΕ|ΕΙΧΑΝ|ΕΙΧΑΤΕ|ΕΙΧΕ|ΕΙΧΕΣ|ΕΚ|ΕΚΕΙ|ΕΛΑ|ΕΛΙ|ΕΜΠ|ΕΝ|ΕΝΤΕΛΩΣ|ΕΝΤΟΣ|ΕΝΤΩΜΕΤΑΞΥ|ΕΝΩ|ΕΞ|ΕΞΑΦΝΑ|ΕΞΙ|ΕΞΙΣΟΥ|ΕΞΩ|ΕΟΚ|ΕΠΑΝΩ|ΕΠΕΙΔΗ|ΕΠΕΙΤΑ|ΕΠΗ|ΕΠΙ|ΕΠΙΣΗΣ|ΕΠΟΜΕΝΩΣ|ΕΡΑ|ΕΣ|ΕΣΑΣ|ΕΣΕ|ΕΣΕΙΣ|ΕΣΕΝΑ|ΕΣΗ|ΕΣΤΩ|ΕΣΥ|ΕΣΩ|ΕΤΙ|ΕΤΣΙ|ΕΥ|ΕΥΑ|ΕΥΓΕ|ΕΥΘΥΣ|ΕΥΤΥΧΩΣ|ΕΦΕ|ΕΦΕΞΗΣ|ΕΦΤ|ΕΧΕ|ΕΧΕΙ|ΕΧΕΙΣ|ΕΧΕΤΕ|ΕΧΘΕΣ|ΕΧΟΜΕ|ΕΧΟΥΜΕ|ΕΧΟΥΝ|ΕΧΤΕΣ|ΕΧΩ|ΕΩΣ|ΖΕΑ|ΖΕΗ|ΖΕΙ|ΖΕΝ|ΖΗΝ|ΖΩ|Η|ΗΔΗ|ΗΔΥ|ΗΘΗ|ΗΛΟ|ΗΜΙ|ΗΠΑ|ΗΣΑΣΤΕ|ΗΣΟΥΝ|ΗΤΑ|ΗΤΑΝ|ΗΤΑΝΕ|ΗΤΟΙ|ΗΤΤΟΝ|ΗΩ|ΘΑ|ΘΥΕ|ΘΩΡ|Ι|ΙΑ|ΙΒΟ|ΙΔΗ|ΙΔΙΩΣ|ΙΕ|ΙΙ|ΙΙΙ|ΙΚΑ|ΙΛΟ|ΙΜΑ|ΙΝΑ|ΙΝΩ|ΙΞΕ|ΙΞΟ|ΙΟ|ΙΟΙ|ΙΣΑ|ΙΣΑΜΕ|ΙΣΕ|ΙΣΗ|ΙΣΙΑ|ΙΣΟ|ΙΣΩΣ|ΙΩΒ|ΙΩΝ|ΙΩΣ|ΙΑΝ|ΚΑΘ|ΚΑΘΕ|ΚΑΘΕΤΙ|ΚΑΘΟΛΟΥ|ΚΑΘΩΣ|ΚΑΙ|ΚΑΝ|ΚΑΠΟΤΕ|ΚΑΠΟΥ|ΚΑΠΩΣ|ΚΑΤ|ΚΑΤΑ|ΚΑΤΙ|ΚΑΤΙΤΙ|ΚΑΤΟΠΙΝ|ΚΑΤΩ|ΚΑΩ|ΚΒΟ|ΚΕΑ|ΚΕΙ|ΚΕΝ|ΚΙ|ΚΙΜ|ΚΙΟΛΑΣ|ΚΙΤ|ΚΙΧ|ΚΚΕ|ΚΛΙΣΕ|ΚΛΠ|ΚΟΚ|ΚΟΝΤΑ|ΚΟΧ|ΚΤΛ|ΚΥΡ|ΚΥΡΙΩΣ|ΚΩ|ΚΩΝ|ΛΑ|ΛΕΑ|ΛΕΝ|ΛΕΟ|ΛΙΑ|ΛΙΓΑΚΙ|ΛΙΓΟΥΛΑΚΙ|ΛΙΓΟ|ΛΙΓΩΤΕΡΟ|ΛΙΟ|ΛΙΡ|ΛΟΓΩ|ΛΟΙΠΑ|ΛΟΙΠΟΝ|ΛΟΣ|ΛΣ|ΛΥΩ|ΜΑ|ΜΑΖΙ|ΜΑΚΑΡΙ|ΜΑΛΙΣΤΑ|ΜΑΛΛΟΝ|ΜΑΝ|ΜΑΞ|ΜΑΣ|ΜΑΤ|ΜΕ|ΜΕΘΑΥΡΙΟ|ΜΕΙ|ΜΕΙΟΝ|ΜΕΛ|ΜΕΛΕΙ|ΜΕΛΛΕΤΑΙ|ΜΕΜΙΑΣ|ΜΕΝ|ΜΕΣ|ΜΕΣΑ|ΜΕΤ|ΜΕΤΑ|ΜΕΤΑΞΥ|ΜΕΧΡΙ|ΜΗ|ΜΗΔΕ|ΜΗΝ|ΜΗΠΩΣ|ΜΗΤΕ|ΜΙ|ΜΙΞ|ΜΙΣ|ΜΜΕ|ΜΝΑ|ΜΟΒ|ΜΟΛΙΣ|ΜΟΛΟΝΟΤΙ|ΜΟΝΑΧΑ|ΜΟΝΟΜΙΑΣ|ΜΙΑ|ΜΟΥ|ΜΠΑ|ΜΠΟΡΕΙ|ΜΠΟΡΟΥΝ|ΜΠΡΑΒΟ|ΜΠΡΟΣ|ΜΠΩ|ΜΥ|ΜΥΑ|ΜΥΝ|ΝΑ|ΝΑΕ|ΝΑΙ|ΝΑΟ|ΝΔ|ΝΕΐ|ΝΕΑ|ΝΕΕ|ΝΕΟ|ΝΙ|ΝΙΑ|ΝΙΚ|ΝΙΛ|ΝΙΝ|ΝΙΟ|ΝΤΑ|ΝΤΕ|ΝΤΙ|ΝΤΟ|ΝΥΝ|ΝΩΕ|ΝΩΡΙΣ|ΞΑΝΑ|ΞΑΦΝΙΚΑ|ΞΕΩ|ΞΙ|Ο|ΟΑ|ΟΑΠ|ΟΔΟ|ΟΕ|ΟΖΟ|ΟΗΕ|ΟΙ|ΟΙΑ|ΟΙΗ|ΟΚΑ|ΟΛΟΓΥΡΑ|ΟΛΟΝΕΝ|ΟΛΟΤΕΛΑ|ΟΛΩΣΔΙΟΛΟΥ|ΟΜΩΣ|ΟΝ|ΟΝΕ|ΟΝΟ|ΟΠΑ|ΟΠΕ|ΟΠΗ|ΟΠΟ|ΟΠΟΙΑΔΗΠΟΤΕ|ΟΠΟΙΑΝΔΗΠΟΤΕ|ΟΠΟΙΑΣΔΗΠΟΤΕ|ΟΠΟΙΔΗΠΟΤΕ|ΟΠΟΙΕΣΔΗΠΟΤΕ|ΟΠΟΙΟΔΗΠΟΤΕ|ΟΠΟΙΟΝΔΗΠΟΤΕ|ΟΠΟΙΟΣΔΗΠΟΤΕ|ΟΠΟΙΟΥΔΗΠΟΤΕ|ΟΠΟΙΟΥΣΔΗΠΟΤΕ|ΟΠΟΙΩΝΔΗΠΟΤΕ|ΟΠΟΤΕΔΗΠΟΤΕ|ΟΠΟΥ|ΟΠΟΥΔΗΠΟΤΕ|ΟΠΩΣ|ΟΡΑ|ΟΡΕ|ΟΡΗ|ΟΡΟ|ΟΡΦ|ΟΡΩ|ΟΣΑ|ΟΣΑΔΗΠΟΤΕ|ΟΣΕ|ΟΣΕΣΔΗΠΟΤΕ|ΟΣΗΔΗΠΟΤΕ|ΟΣΗΝΔΗΠΟΤΕ|ΟΣΗΣΔΗΠΟΤΕ|ΟΣΟΔΗΠΟΤΕ|ΟΣΟΙΔΗΠΟΤΕ|ΟΣΟΝΔΗΠΟΤΕ|ΟΣΟΣΔΗΠΟΤΕ|ΟΣΟΥΔΗΠΟΤΕ|ΟΣΟΥΣΔΗΠΟΤΕ|ΟΣΩΝΔΗΠΟΤΕ|ΟΤΑΝ|ΟΤΕ|ΟΤΙ|ΟΤΙΔΗΠΟΤΕ|ΟΥ|ΟΥΔΕ|ΟΥΚ|ΟΥΣ|ΟΥΤΕ|ΟΥΦ|ΟΧΙ|ΟΨΑ|ΟΨΕ|ΟΨΗ|ΟΨΙ|ΟΨΟ|ΠΑ|ΠΑΛΙ|ΠΑΝ|ΠΑΝΤΟΤΕ|ΠΑΝΤΟΥ|ΠΑΝΤΩΣ|ΠΑΠ|ΠΑΡ|ΠΑΡΑ|ΠΕΙ|ΠΕΡ|ΠΕΡΑ|ΠΕΡΙ|ΠΕΡΙΠΟΥ|ΠΕΡΣΙ|ΠΕΡΥΣΙ|ΠΕΣ|ΠΙ|ΠΙΑ|ΠΙΘΑΝΟΝ|ΠΙΚ|ΠΙΟ|ΠΙΣΩ|ΠΙΤ|ΠΙΩ|ΠΛΑΙ|ΠΛΕΟΝ|ΠΛΗΝ|ΠΛΩ|ΠΜ|ΠΟΑ|ΠΟΕ|ΠΟΛ|ΠΟΛΥ|ΠΟΠ|ΠΟΤΕ|ΠΟΥ|ΠΟΥΘΕ|ΠΟΥΘΕΝΑ|ΠΡΕΠΕΙ|ΠΡΙ|ΠΡΙΝ|ΠΡΟ|ΠΡΟΚΕΙΜΕΝΟΥ|ΠΡΟΚΕΙΤΑΙ|ΠΡΟΠΕΡΣΙ|ΠΡΟΣ|ΠΡΟΤΟΥ|ΠΡΟΧΘΕΣ|ΠΡΟΧΤΕΣ|ΠΡΩΤΥΤΕΡΑ|ΠΥΑ|ΠΥΞ|ΠΥΟ|ΠΥΡ|ΠΧ|ΠΩ|ΠΩΛ|ΠΩΣ|ΡΑ|ΡΑΙ|ΡΑΠ|ΡΑΣ|ΡΕ|ΡΕΑ|ΡΕΕ|ΡΕΙ|ΡΗΣ|ΡΘΩ|ΡΙΟ|ΡΟ|ΡΟΐ|ΡΟΕ|ΡΟΖ|ΡΟΗ|ΡΟΘ|ΡΟΙ|ΡΟΚ|ΡΟΛ|ΡΟΝ|ΡΟΣ|ΡΟΥ|ΣΑΙ|ΣΑΝ|ΣΑΟ|ΣΑΣ|ΣΕ|ΣΕΙΣ|ΣΕΚ|ΣΕΞ|ΣΕΡ|ΣΕΤ|ΣΕΦ|ΣΗΜΕΡΑ|ΣΙ|ΣΙΑ|ΣΙΓΑ|ΣΙΚ|ΣΙΧ|ΣΚΙ|ΣΟΙ|ΣΟΚ|ΣΟΛ|ΣΟΝ|ΣΟΣ|ΣΟΥ|ΣΡΙ|ΣΤΑ|ΣΤΗ|ΣΤΗΝ|ΣΤΗΣ|ΣΤΙΣ|ΣΤΟ|ΣΤΟΝ|ΣΤΟΥ|ΣΤΟΥΣ|ΣΤΩΝ|ΣΥ|ΣΥΓΧΡΟΝΩΣ|ΣΥΝ|ΣΥΝΑΜΑ|ΣΥΝΕΠΩΣ|ΣΥΝΗΘΩΣ|ΣΧΕΔΟΝ|ΣΩΣΤΑ|ΤΑ|ΤΑΔΕ|ΤΑΚ|ΤΑΝ|ΤΑΟ|ΤΑΥ|ΤΑΧΑ|ΤΑΧΑΤΕ|ΤΕ|ΤΕΙ|ΤΕΛ|ΤΕΛΙΚΑ|ΤΕΛΙΚΩΣ|ΤΕΣ|ΤΕΤ|ΤΖΟ|ΤΗ|ΤΗΛ|ΤΗΝ|ΤΗΣ|ΤΙ|ΤΙΚ|ΤΙΜ|ΤΙΠΟΤΑ|ΤΙΠΟΤΕ|ΤΙΣ|ΤΝΤ|ΤΟ|ΤΟΙ|ΤΟΚ|ΤΟΜ|ΤΟΝ|ΤΟΠ|ΤΟΣ|ΤΟΣ?Ν|ΤΟΣΑ|ΤΟΣΕΣ|ΤΟΣΗ|ΤΟΣΗΝ|ΤΟΣΗΣ|ΤΟΣΟ|ΤΟΣΟΙ|ΤΟΣΟΝ|ΤΟΣΟΣ|ΤΟΣΟΥ|ΤΟΣΟΥΣ|ΤΟΤΕ|ΤΟΥ|ΤΟΥΛΑΧΙΣΤΟ|ΤΟΥΛΑΧΙΣΤΟΝ|ΤΟΥΣ|ΤΣ|ΤΣΑ|ΤΣΕ|ΤΥΧΟΝ|ΤΩ|ΤΩΝ|ΤΩΡΑ|ΥΑΣ|ΥΒΑ|ΥΒΟ|ΥΙΕ|ΥΙΟ|ΥΛΑ|ΥΛΗ|ΥΝΙ|ΥΠ|ΥΠΕΡ|ΥΠΟ|ΥΠΟΨΗ|ΥΠΟΨΙΝ|ΥΣΤΕΡΑ|ΥΦΗ|ΥΨΗ|ΦΑ|ΦΑΐ|ΦΑΕ|ΦΑΝ|ΦΑΞ|ΦΑΣ|ΦΑΩ|ΦΕΖ|ΦΕΙ|ΦΕΤΟΣ|ΦΕΥ|ΦΙ|ΦΙΛ|ΦΙΣ|ΦΟΞ|ΦΠΑ|ΦΡΙ|ΧΑ|ΧΑΗ|ΧΑΛ|ΧΑΝ|ΧΑΦ|ΧΕ|ΧΕΙ|ΧΘΕΣ|ΧΙ|ΧΙΑ|ΧΙΛ|ΧΙΟ|ΧΛΜ|ΧΜ|ΧΟΗ|ΧΟΛ|ΧΡΩ|ΧΤΕΣ|ΧΩΡΙΣ|ΧΩΡΙΣΤΑ|ΨΕΣ|ΨΗΛΑ|ΨΙ|ΨΙΤ|Ω|ΩΑ|ΩΑΣ|ΩΔΕ|ΩΕΣ|ΩΘΩ|ΩΜΑ|ΩΜΕ|ΩΝ|ΩΟ|ΩΟΝ|ΩΟΥ|ΩΣ|ΩΣΑΝ|ΩΣΗ|ΩΣΟΤΟΥ|ΩΣΠΟΥ|ΩΣΤΕ|ΩΣΤΟΣΟ|ΩΤΑ|ΩΧ|ΩΩΝ)$/';\n\n if (preg_match($stop_words, $w)) {\n //return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n // Remove stop words\n return returnStem('', '', $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n// step1list is used in Step 1. 41 stems\n $step1list = Array();\n $step1list[\"ΦΑΓΙΑ\"] = \"ΦΑ\";\n $step1list[\"ΦΑΓΙΟΥ\"] = \"ΦΑ\";\n $step1list[\"ΦΑΓΙΩΝ\"] = \"ΦΑ\";\n $step1list[\"ΣΚΑΓΙΑ\"] = \"ΣΚΑ\";\n $step1list[\"ΣΚΑΓΙΟΥ\"] = \"ΣΚΑ\";\n $step1list[\"ΣΚΑΓΙΩΝ\"] = \"ΣΚΑ\";\n $step1list[\"ΟΛΟΓΙΟΥ\"] = \"ΟΛΟ\";\n $step1list[\"ΟΛΟΓΙΑ\"] = \"ΟΛΟ\";\n $step1list[\"ΟΛΟΓΙΩΝ\"] = \"ΟΛΟ\";\n $step1list[\"ΣΟΓΙΟΥ\"] = \"ΣΟ\";\n $step1list[\"ΣΟΓΙΑ\"] = \"ΣΟ\";\n $step1list[\"ΣΟΓΙΩΝ\"] = \"ΣΟ\";\n $step1list[\"ΤΑΤΟΓΙΑ\"] = \"ΤΑΤΟ\";\n $step1list[\"ΤΑΤΟΓΙΟΥ\"] = \"ΤΑΤΟ\";\n $step1list[\"ΤΑΤΟΓΙΩΝ\"] = \"ΤΑΤΟ\";\n $step1list[\"ΚΡΕΑΣ\"] = \"ΚΡΕ\";\n $step1list[\"ΚΡΕΑΤΟΣ\"] = \"ΚΡΕ\";\n $step1list[\"ΚΡΕΑΤΑ\"] = \"ΚΡΕ\";\n $step1list[\"ΚΡΕΑΤΩΝ\"] = \"ΚΡΕ\";\n $step1list[\"ΠΕΡΑΣ\"] = \"ΠΕΡ\";\n $step1list[\"ΠΕΡΑΤΟΣ\"] = \"ΠΕΡ\";\n $step1list[\"ΠΕΡΑΤΗ\"] = \"ΠΕΡ\"; //Added by Spyros . also at $re in step1\n $step1list[\"ΠΕΡΑΤΑ\"] = \"ΠΕΡ\";\n $step1list[\"ΠΕΡΑΤΩΝ\"] = \"ΠΕΡ\";\n $step1list[\"ΤΕΡΑΣ\"] = \"ΤΕΡ\";\n $step1list[\"ΤΕΡΑΤΟΣ\"] = \"ΤΕΡ\";\n $step1list[\"ΤΕΡΑΤΑ\"] = \"ΤΕΡ\";\n $step1list[\"ΤΕΡΑΤΩΝ\"] = \"ΤΕΡ\";\n $step1list[\"ΦΩΣ\"] = \"ΦΩ\";\n $step1list[\"ΦΩΤΟΣ\"] = \"ΦΩ\";\n $step1list[\"ΦΩΤΑ\"] = \"ΦΩ\";\n $step1list[\"ΦΩΤΩΝ\"] = \"ΦΩ\";\n $step1list[\"ΚΑΘΕΣΤΩΣ\"] = \"ΚΑΘΕΣΤ\";\n $step1list[\"ΚΑΘΕΣΤΩΤΟΣ\"] = \"ΚΑΘΕΣΤ\";\n $step1list[\"ΚΑΘΕΣΤΩΤΑ\"] = \"ΚΑΘΕΣΤ\";\n $step1list[\"ΚΑΘΕΣΤΩΤΩΝ\"] = \"ΚΑΘΕΣΤ\";\n $step1list[\"ΓΕΓΟΝΟΣ\"] = \"ΓΕΓΟΝ\";\n $step1list[\"ΓΕΓΟΝΟΤΟΣ\"] = \"ΓΕΓΟΝ\";\n $step1list[\"ΓΕΓΟΝΟΤΑ\"] = \"ΓΕΓΟΝ\";\n $step1list[\"ΓΕΓΟΝΟΤΩΝ\"] = \"ΓΕΓΟΝ\";\n\n $v = '(Α|Ε|Η|Ι|Ο|Υ|Ω)'; // vowel\n $v2 = '(Α|Ε|Η|Ι|Ο|Ω)'; //vowel without Y\n\n $test1 = true;\n\n\n//Step S1. 14 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΖΑ|ΙΖΕΣ|ΙΖΕ|ΙΖΑΜΕ|ΙΖΑΤΕ|ΙΖΑΝ|ΙΖΑΝΕ|ΙΖΩ|ΙΖΕΙΣ|ΙΖΕΙ|ΙΖΟΥΜΕ|ΙΖΕΤΕ|ΙΖΟΥΝ|ΙΖΟΥΝΕ)$/';\n $exceptS1 = '/^(ΑΝΑΜΠΑ|ΕΜΠΑ|ΕΠΑ|ΞΑΝΑΠΑ|ΠΑ|ΠΕΡΙΠΑ|ΑΘΡΟ|ΣΥΝΑΘΡΟ|ΔΑΝΕ)$/';\n $exceptS2 = '/^(ΜΑΡΚ|ΚΟΡΝ|ΑΜΠΑΡ|ΑΡΡ|ΒΑΘΥΡΙ|ΒΑΡΚ|Β|ΒΟΛΒΟΡ|ΓΚΡ|ΓΛΥΚΟΡ|ΓΛΥΚΥΡ|ΙΜΠ|Λ|ΛΟΥ|ΜΑΡ|Μ|ΠΡ|ΜΠΡ|ΠΟΛΥΡ|Π|Ρ|ΠΙΠΕΡΟΡ)$/';\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem . $step1list[$suffix];\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . 'I';\n }\n if (preg_match($exceptS2, $w)) {\n $w = $w . 'IΖ';\n }\n\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n//Step S2. 7 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΩΘΗΚΑ|ΩΘΗΚΕΣ|ΩΘΗΚΕ|ΩΘΗΚΑΜΕ|ΩΘΗΚΑΤΕ|ΩΘΗΚΑΝ|ΩΘΗΚΑΝΕ)$/';\n $exceptS1 = '/^(ΑΛ|ΒΙ|ΕΝ|ΥΨ|ΛΙ|ΖΩ|Σ|Χ)$/';\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem . $step1list[$suffix];\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . 'ΩΝ';\n }\n\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n//Step S3. 7 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΣΑ|ΙΣΕΣ|ΙΣΕ|ΙΣΑΜΕ|ΙΣΑΤΕ|ΙΣΑΝ|ΙΣΑΝΕ)$/';\n $exceptS1 = '/^(ΑΝΑΜΠΑ|ΑΘΡΟ|ΕΜΠΑ|ΕΣΕ|ΕΣΩΚΛΕ|ΕΠΑ|ΞΑΝΑΠΑ|ΕΠΕ|ΠΕΡΙΠΑ|ΑΘΡΟ|ΣΥΝΑΘΡΟ|ΔΑΝΕ|ΚΛΕ|ΧΑΡΤΟΠΑ|ΕΞΑΡΧΑ|ΜΕΤΕΠΕ|ΑΠΟΚΛΕ|ΑΠΕΚΛΕ|ΕΚΛΕ|ΠΕ|ΠΕΡΙΠΑ)$/';\n $exceptS2 = '/^(ΑΝ|ΑΦ|ΓΕ|ΓΙΓΑΝΤΟΑΦ|ΓΚΕ|ΔΗΜΟΚΡΑΤ|ΚΟΜ|ΓΚ|Μ|Π|ΠΟΥΚΑΜ|ΟΛΟ|ΛΑΡ)$/';\n\n if ($w == \"ΙΣΑ\") {\n $w = \"ΙΣ\";\n return $w;\n }\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem . $step1list[$suffix];\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . 'Ι';\n }\n\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n\n//Step S4. 7 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΣΩ|ΙΣΕΙΣ|ΙΣΕΙ|ΙΣΟΥΜΕ|ΙΣΕΤΕ|ΙΣΟΥΝ|ΙΣΟΥΝΕ)$/';\n $exceptS1 = '/^(ΑΝΑΜΠΑ|ΕΜΠΑ|ΕΣΕ|ΕΣΩΚΛΕ|ΕΠΑ|ΞΑΝΑΠΑ|ΕΠΕ|ΠΕΡΙΠΑ|ΑΘΡΟ|ΣΥΝΑΘΡΟ|ΔΑΝΕ|ΚΛΕ|ΧΑΡΤΟΠΑ|ΕΞΑΡΧΑ|ΜΕΤΕΠΕ|ΑΠΟΚΛΕ|ΑΠΕΚΛΕ|ΕΚΛΕ|ΠΕ|ΠΕΡΙΠΑ)$/';\n\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem . $step1list[$suffix];\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . 'Ι';\n }\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n//Step S5. 11 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΣΤΟΣ|ΙΣΤΟΥ|ΙΣΤΟ|ΙΣΤΕ|ΙΣΤΟΙ|ΙΣΤΩΝ|ΙΣΤΟΥΣ|ΙΣΤΗ|ΙΣΤΗΣ|ΙΣΤΑ|ΙΣΤΕΣ)$/';\n $exceptS1 = '/^(Μ|Π|ΑΠ|ΑΡ|ΗΔ|ΚΤ|ΣΚ|ΣΧ|ΥΨ|ΦΑ|ΧΡ|ΧΤ|ΑΚΤ|ΑΟΡ|ΑΣΧ|ΑΤΑ|ΑΧΝ|ΑΧΤ|ΓΕΜ|ΓΥΡ|ΕΜΠ|ΕΥΠ|ΕΧΘ|ΗΦΑ|ΉΦΑ|ΚΑΘ|ΚΑΚ|ΚΥΛ|ΛΥΓ|ΜΑΚ|ΜΕΓ|ΤΑΧ|ΦΙΛ|ΧΩΡ)$/';\n $exceptS2 = '/^(ΔΑΝΕ|ΣΥΝΑΘΡΟ|ΚΛΕ|ΣΕ|ΕΣΩΚΛΕ|ΑΣΕ|ΠΛΕ)$/';\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem . $step1list[$suffix];\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . 'ΙΣΤ';\n }\n if (preg_match($exceptS2, $w)) {\n $w = $w . 'Ι';\n }\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n//Step S6. 6 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΣΜΟ|ΙΣΜΟΙ|ΙΣΜΟΣ|ΙΣΜΟΥ|ΙΣΜΟΥΣ|ΙΣΜΩΝ)$/';\n $exceptS1 = '/^(ΑΓΝΩΣΤΙΚ|ΑΤΟΜΙΚ|ΓΝΩΣΤΙΚ|ΕΘΝΙΚ|ΕΚΛΕΚΤΙΚ|ΣΚΕΠΤΙΚ|ΤΟΠΙΚ)$/';\n $exceptS2 = '/^(ΣΕ|ΜΕΤΑΣΕ|ΜΙΚΡΟΣΕ|ΕΓΚΛΕ|ΑΠΟΚΛΕ)$/';\n $exceptS3 = '/^(ΔΑΝΕ|ΑΝΤΙΔΑΝΕ)$/';\n $exceptS4 = '/^(ΑΛΕΞΑΝΔΡΙΝ|ΒΥΖΑΝΤΙΝ|ΘΕΑΤΡΙΝ)$/';\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem;\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = str_replace('ΙΚ', \"\", $w);\n }\n if (preg_match($exceptS2, $w)) {\n $w = $w . \"ΙΣΜ\";\n }\n if (preg_match($exceptS3, $w)) {\n $w = $w . \"Ι\";\n }\n if (preg_match($exceptS4, $w)) {\n $w = str_replace('ΙΝ', \"\", $w);\n }\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n//Step S7. 4 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΑΡΑΚΙ|ΑΡΑΚΙΑ|ΟΥΔΑΚΙ|ΟΥΔΑΚΙΑ)$/';\n $exceptS1 = '/^(Σ|Χ)$/';\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem;\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . \"AΡΑΚ\";\n }\n\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n\n//Step S8. 8 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΑΚΙ|ΑΚΙΑ|ΙΤΣΑ|ΙΤΣΑΣ|ΙΤΣΕΣ|ΙΤΣΩΝ|ΑΡΑΚΙ|ΑΡΑΚΙΑ)$/';\n $exceptS1 = '/^(ΑΝΘΡ|ΒΑΜΒ|ΒΡ|ΚΑΙΜ|ΚΟΝ|ΚΟΡ|ΛΑΒΡ|ΛΟΥΛ|ΜΕΡ|ΜΟΥΣΤ|ΝΑΓΚΑΣ|ΠΛ|Ρ|ΡΥ|Σ|ΣΚ|ΣΟΚ|ΣΠΑΝ|ΤΖ|ΦΑΡΜ|Χ|ΚΑΠΑΚ|ΑΛΙΣΦ|ΑΜΒΡ|ΑΝΘΡ|Κ|ΦΥΛ|ΚΑΤΡΑΠ|ΚΛΙΜ|ΜΑΛ|ΣΛΟΒ|Φ|ΣΦ|ΤΣΕΧΟΣΛΟΒ)$/';\n $exceptS2 = '/^(Β|ΒΑΛ|ΓΙΑΝ|ΓΛ|Ζ|ΗΓΟΥΜΕΝ|ΚΑΡΔ|ΚΟΝ|ΜΑΚΡΥΝ|ΝΥΦ|ΠΑΤΕΡ|Π|ΣΚ|ΤΟΣ|ΤΡΙΠΟΛ)$/';\n $exceptS3 = '/(ΚΟΡ)$/';// for words like ΠΛΟΥΣΙΟΚΟΡΙΤΣΑ, ΠΑΛΙΟΚΟΡΙΤΣΑ etc\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem;\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . \"ΑΚ\";\n }\n if (preg_match($exceptS2, $w)) {\n $w = $w . \"ΙΤΣ\";\n }\n if (preg_match($exceptS3, $w)) {\n $w = $w . \"ΙΤΣ\";\n }\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n//Step S9. 3 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΔΙΟ|ΙΔΙΑ|ΙΔΙΩΝ)$/';\n $exceptS1 = '/^(ΑΙΦΝ|ΙΡ|ΟΛΟ|ΨΑΛ)$/';\n $exceptS2 = '/(Ε|ΠΑΙΧΝ)$/';\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem;\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . \"ΙΔ\";\n }\n if (preg_match($exceptS2, $w)) {\n $w = $w . \"ΙΔ\";\n }\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n\n//Step S10. 4 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΣΚΟΣ|ΙΣΚΟΥ|ΙΣΚΟ|ΙΣΚΕ)$/';\n $exceptS1 = '/^(Δ|ΙΒ|ΜΗΝ|Ρ|ΦΡΑΓΚ|ΛΥΚ|ΟΒΕΛ)$/';\n if (preg_match($re, $w, $match)) {\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem;\n $test1 = false;\n if (preg_match($exceptS1, $w)) {\n $w = $w . \"ΙΣΚ\";\n }\n\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n }\n\n\n//Step1\n $numberOfRulesExamined++;\n $re = '/(.*)(ΦΑΓΙΑ|ΦΑΓΙΟΥ|ΦΑΓΙΩΝ|ΣΚΑΓΙΑ|ΣΚΑΓΙΟΥ|ΣΚΑΓΙΩΝ|ΟΛΟΓΙΟΥ|ΟΛΟΓΙΑ|ΟΛΟΓΙΩΝ|ΣΟΓΙΟΥ|ΣΟΓΙΑ|ΣΟΓΙΩΝ|ΤΑΤΟΓΙΑ|ΤΑΤΟΓΙΟΥ|ΤΑΤΟΓΙΩΝ|ΚΡΕΑΣ|ΚΡΕΑΤΟΣ|ΚΡΕΑΤΑ|ΚΡΕΑΤΩΝ|ΠΕΡΑΣ|ΠΕΡΑΤΟΣ|ΠΕΡΑΤΗ|ΠΕΡΑΤΑ|ΠΕΡΑΤΩΝ|ΤΕΡΑΣ|ΤΕΡΑΤΟΣ|ΤΕΡΑΤΑ|ΤΕΡΑΤΩΝ|ΦΩΣ|ΦΩΤΟΣ|ΦΩΤΑ|ΦΩΤΩΝ|ΚΑΘΕΣΤΩΣ|ΚΑΘΕΣΤΩΤΟΣ|ΚΑΘΕΣΤΩΤΑ|ΚΑΘΕΣΤΩΤΩΝ|ΓΕΓΟΝΟΣ|ΓΕΓΟΝΟΤΟΣ|ΓΕΓΟΝΟΤΑ|ΓΕΓΟΝΟΤΩΝ)$/';\n\n\n if (preg_match($re, $w, $match)) {\n //debug($w,1);\n $stem = $match[1];\n $suffix = $match[2];\n $w = $stem . $step1list[$suffix];\n $test1 = false;\n\n }\n\n\n // Step 2a. 2 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΑΔΕΣ|ΑΔΩΝ)$/';\n if (preg_match($re, $w, $match)) {\n //debug($w,\"2a\");\n $stem = $match[1];\n $w = $stem;\n $re = '/(ΟΚ|ΜΑΜ|ΜΑΝ|ΜΠΑΜΠ|ΠΑΤΕΡ|ΓΙΑΓΙ|ΝΤΑΝΤ|ΚΥΡ|ΘΕΙ|ΠΕΘΕΡ)$/';\n if (!preg_match($re, $w)) {\n $w = $w . \"ΑΔ\";\n }\n\n\n }\n\n //Step 2b. 2 stems\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΕΔΕΣ|ΕΔΩΝ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $exept2 = '/(ΟΠ|ΙΠ|ΕΜΠ|ΥΠ|ΓΗΠ|ΔΑΠ|ΚΡΑΣΠ|ΜΙΛ)$/';\n if (preg_match($exept2, $w)) {\n $w = $w . 'ΕΔ';\n }\n\n }\n\n //Step 2c\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΟΥΔΕΣ|ΟΥΔΩΝ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n\n $exept3 = '/(ΑΡΚ|ΚΑΛΙΑΚ|ΠΕΤΑΛ|ΛΙΧ|ΠΛΕΞ|ΣΚ|Σ|ΦΛ|ΦΡ|ΒΕΛ|ΛΟΥΛ|ΧΝ|ΣΠ|ΤΡΑΓ|ΦΕ)$/';\n if (preg_match($exept3, $w)) {\n $w = $w . 'ΟΥΔ';\n }\n\n }\n\n //Step 2d\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΕΩΣ|ΕΩΝ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept4 = '/^(Θ|Δ|ΕΛ|ΓΑΛ|Ν|Π|ΙΔ|ΠΑΡ)$/';\n if (preg_match($exept4, $w)) {\n $w = $w . 'Ε';\n }\n\n }\n\n //Step 3\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΑ|ΙΟΥ|ΙΩΝ)$/';\n if (preg_match($re, $w, $fp)) {\n $stem = $fp[1];\n $w = $stem;\n $re = '/' . $v . '$/';\n $test1 = false;\n if (preg_match($re, $w)) {\n $w = $stem . 'Ι';\n }\n }\n\n //Step 4\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΙΚΑ|ΙΚΟ|ΙΚΟΥ|ΙΚΩΝ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n\n $test1 = false;\n $re = '/' . $v . '$/';\n $exept5 = '/^(ΑΛ|ΑΔ|ΕΝΔ|ΑΜΑΝ|ΑΜΜΟΧΑΛ|ΗΘ|ΑΝΗΘ|ΑΝΤΙΔ|ΦΥΣ|ΒΡΩΜ|ΓΕΡ|ΕΞΩΔ|ΚΑΛΠ|ΚΑΛΛΙΝ|ΚΑΤΑΔ|ΜΟΥΛ|ΜΠΑΝ|ΜΠΑΓΙΑΤ|ΜΠΟΛ|ΜΠΟΣ|ΝΙΤ|ΞΙΚ|ΣΥΝΟΜΗΛ|ΠΕΤΣ|ΠΙΤΣ|ΠΙΚΑΝΤ|ΠΛΙΑΤΣ|ΠΟΣΤΕΛΝ|ΠΡΩΤΟΔ|ΣΕΡΤ|ΣΥΝΑΔ|ΤΣΑΜ|ΥΠΟΔ|ΦΙΛΟΝ|ΦΥΛΟΔ|ΧΑΣ)$/';\n if (preg_match($re, $w) || preg_match($exept5, $w)) {\n $w = $w . 'ΙΚ';\n }\n }\n\n //step 5a\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΑΜΕ)$/';\n $re2 = '/^(.+?)(ΑΓΑΜΕ|ΗΣΑΜΕ|ΟΥΣΑΜΕ|ΗΚΑΜΕ|ΗΘΗΚΑΜΕ)$/';\n if ($w == \"ΑΓΑΜΕ\") {\n $w = \"ΑΓΑΜ\";\n\n }\n\n if (preg_match($re2, $w)) {\n preg_match($re2, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n }\n $numberOfRulesExamined++;\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept6 = '/^(ΑΝΑΠ|ΑΠΟΘ|ΑΠΟΚ|ΑΠΟΣΤ|ΒΟΥΒ|ΞΕΘ|ΟΥΛ|ΠΕΘ|ΠΙΚΡ|ΠΟΤ|ΣΙΧ|Χ)$/';\n if (preg_match($exept6, $w)) {\n $w = $w . \"ΑΜ\";\n }\n }\n\n //Step 5b\n $numberOfRulesExamined++;\n $re2 = '/^(.+?)(ΑΝΕ)$/';\n $re3 = '/^(.+?)(ΑΓΑΝΕ|ΗΣΑΝΕ|ΟΥΣΑΝΕ|ΙΟΝΤΑΝΕ|ΙΟΤΑΝΕ|ΙΟΥΝΤΑΝΕ|ΟΝΤΑΝΕ|ΟΤΑΝΕ|ΟΥΝΤΑΝΕ|ΗΚΑΝΕ|ΗΘΗΚΑΝΕ)$/';\n\n if (preg_match($re3, $w)) {\n preg_match($re3, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $re3 = '/^(ΤΡ|ΤΣ)$/';\n if (preg_match($re3, $w)) {\n $w = $w . \"ΑΓΑΝ\";\n }\n }\n $numberOfRulesExamined++;\n if (preg_match($re2, $w)) {\n preg_match($re2, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $re2 = '/' . $v2 . '$/';\n $exept7 = '/^(ΒΕΤΕΡ|ΒΟΥΛΚ|ΒΡΑΧΜ|Γ|ΔΡΑΔΟΥΜ|Θ|ΚΑΛΠΟΥΖ|ΚΑΣΤΕΛ|ΚΟΡΜΟΡ|ΛΑΟΠΛ|ΜΩΑΜΕΘ|Μ|ΜΟΥΣΟΥΛΜ|Ν|ΟΥΛ|Π|ΠΕΛΕΚ|ΠΛ|ΠΟΛΙΣ|ΠΟΡΤΟΛ|ΣΑΡΑΚΑΤΣ|ΣΟΥΛΤ|ΤΣΑΡΛΑΤ|ΟΡΦ|ΤΣΙΓΓ|ΤΣΟΠ|ΦΩΤΟΣΤΕΦ|Χ|ΨΥΧΟΠΛ|ΑΓ|ΟΡΦ|ΓΑΛ|ΓΕΡ|ΔΕΚ|ΔΙΠΛ|ΑΜΕΡΙΚΑΝ|ΟΥΡ|ΠΙΘ|ΠΟΥΡΙΤ|Σ|ΖΩΝΤ|ΙΚ|ΚΑΣΤ|ΚΟΠ|ΛΙΧ|ΛΟΥΘΗΡ|ΜΑΙΝΤ|ΜΕΛ|ΣΙΓ|ΣΠ|ΣΤΕΓ|ΤΡΑΓ|ΤΣΑΓ|Φ|ΕΡ|ΑΔΑΠ|ΑΘΙΓΓ|ΑΜΗΧ|ΑΝΙΚ|ΑΝΟΡΓ|ΑΠΗΓ|ΑΠΙΘ|ΑΤΣΙΓΓ|ΒΑΣ|ΒΑΣΚ|ΒΑΘΥΓΑΛ|ΒΙΟΜΗΧ|ΒΡΑΧΥΚ|ΔΙΑΤ|ΔΙΑΦ|ΕΝΟΡΓ|ΘΥΣ|ΚΑΠΝΟΒΙΟΜΗΧ|ΚΑΤΑΓΑΛ|ΚΛΙΒ|ΚΟΙΛΑΡΦ|ΛΙΒ|ΜΕΓΛΟΒΙΟΜΗΧ|ΜΙΚΡΟΒΙΟΜΗΧ|ΝΤΑΒ|ΞΗΡΟΚΛΙΒ|ΟΛΙΓΟΔΑΜ|ΟΛΟΓΑΛ|ΠΕΝΤΑΡΦ|ΠΕΡΗΦ|ΠΕΡΙΤΡ|ΠΛΑΤ|ΠΟΛΥΔΑΠ|ΠΟΛΥΜΗΧ|ΣΤΕΦ|ΤΑΒ|ΤΕΤ|ΥΠΕΡΗΦ|ΥΠΟΚΟΠ|ΧΑΜΗΛΟΔΑΠ|ΨΗΛΟΤΑΒ)$/';\n if (preg_match($re2, $w) || preg_match($exept7, $w)) {\n $w = $w . \"ΑΝ\";\n }\n }\n\n //Step 5c\n $numberOfRulesExamined++;\n $re3 = '/^(.+?)(ΕΤΕ)$/';\n $re4 = '/^(.+?)(ΗΣΕΤΕ)$/';\n\n if (preg_match($re4, $w)) {\n preg_match($re4, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n }\n $numberOfRulesExamined++;\n if (preg_match($re3, $w)) {\n preg_match($re3, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $re3 = '/' . $v2 . '$/';\n $exept8 = '/(ΟΔ|ΑΙΡ|ΦΟΡ|ΤΑΘ|ΔΙΑΘ|ΣΧ|ΕΝΔ|ΕΥΡ|ΤΙΘ|ΥΠΕΡΘ|ΡΑΘ|ΕΝΘ|ΡΟΘ|ΣΘ|ΠΥΡ|ΑΙΝ|ΣΥΝΔ|ΣΥΝ|ΣΥΝΘ|ΧΩΡ|ΠΟΝ|ΒΡ|ΚΑΘ|ΕΥΘ|ΕΚΘ|ΝΕΤ|ΡΟΝ|ΑΡΚ|ΒΑΡ|ΒΟΛ|ΩΦΕΛ)$/';\n $exept9 = '/^(ΑΒΑΡ|ΒΕΝ|ΕΝΑΡ|ΑΒΡ|ΑΔ|ΑΘ|ΑΝ|ΑΠΛ|ΒΑΡΟΝ|ΝΤΡ|ΣΚ|ΚΟΠ|ΜΠΟΡ|ΝΙΦ|ΠΑΓ|ΠΑΡΑΚΑΛ|ΣΕΡΠ|ΣΚΕΛ|ΣΥΡΦ|ΤΟΚ|Υ|Δ|ΕΜ|ΘΑΡΡ|Θ)$/';\n\n if (preg_match($re3, $w) || preg_match($exept8, $w) || preg_match($exept9, $w)) {\n $w = $w . \"ΕΤ\";\n }\n }\n\n //Step 5d\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΟΝΤΑΣ|ΩΝΤΑΣ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept10 = '/^(ΑΡΧ)$/';\n $exept11 = '/(ΚΡΕ)$/';\n if (preg_match($exept10, $w)) {\n $w = $w . \"ΟΝΤ\";\n }\n if (preg_match($exept11, $w)) {\n $w = $w . \"ΩΝΤ\";\n }\n }\n\n //Step 5e\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΟΜΑΣΤΕ|ΙΟΜΑΣΤΕ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept11 = '/^(ΟΝ)$/';\n if (preg_match($exept11, $w)) {\n $w = $w . \"ΟΜΑΣΤ\";\n }\n }\n\n //Step 5f\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΕΣΤΕ)$/';\n $re2 = '/^(.+?)(ΙΕΣΤΕ)$/';\n\n if (preg_match($re2, $w)) {\n preg_match($re2, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $re2 = '/^(Π|ΑΠ|ΣΥΜΠ|ΑΣΥΜΠ|ΑΚΑΤΑΠ|ΑΜΕΤΑΜΦ)$/';\n if (preg_match($re2, $w)) {\n $w = $w . \"ΙΕΣΤ\";\n }\n }\n $numberOfRulesExamined++;\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept12 = '/^(ΑΛ|ΑΡ|ΕΚΤΕΛ|Ζ|Μ|Ξ|ΠΑΡΑΚΑΛ|ΑΡ|ΠΡΟ|ΝΙΣ)$/';\n if (preg_match($exept12, $w)) {\n $w = $w . \"ΕΣΤ\";\n }\n }\n\n //Step 5g\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΗΚΑ|ΗΚΕΣ|ΗΚΕ)$/';\n $re2 = '/^(.+?)(ΗΘΗΚΑ|ΗΘΗΚΕΣ|ΗΘΗΚΕ)$/';\n\n if (preg_match($re2, $w)) {\n preg_match($re2, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n }\n $numberOfRulesExamined++;\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept13 = '/(ΣΚΩΛ|ΣΚΟΥΛ|ΝΑΡΘ|ΣΦ|ΟΘ|ΠΙΘ)$/';\n $exept14 = '/^(ΔΙΑΘ|Θ|ΠΑΡΑΚΑΤΑΘ|ΠΡΟΣΘ|ΣΥΝΘ|)$/';\n if (preg_match($exept13, $w) || preg_match($exept14, $w)) {\n $w = $w . \"ΗΚ\";\n }\n }\n\n\n //Step 5h\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΟΥΣΑ|ΟΥΣΕΣ|ΟΥΣΕ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept15 = '/^(ΦΑΡΜΑΚ|ΧΑΔ|ΑΓΚ|ΑΝΑΡΡ|ΒΡΟΜ|ΕΚΛΙΠ|ΛΑΜΠΙΔ|ΛΕΧ|Μ|ΠΑΤ|Ρ|Λ|ΜΕΔ|ΜΕΣΑΖ|ΥΠΟΤΕΙΝ|ΑΜ|ΑΙΘ|ΑΝΗΚ|ΔΕΣΠΟΖ|ΕΝΔΙΑΦΕΡ|ΔΕ|ΔΕΥΤΕΡΕΥ|ΚΑΘΑΡΕΥ|ΠΛΕ|ΤΣΑ)$/';\n $exept16 = '/(ΠΟΔΑΡ|ΒΛΕΠ|ΠΑΝΤΑΧ|ΦΡΥΔ|ΜΑΝΤΙΛ|ΜΑΛΛ|ΚΥΜΑΤ|ΛΑΧ|ΛΗΓ|ΦΑΓ|ΟΜ|ΠΡΩΤ)$/';\n if (preg_match($exept15, $w) || preg_match($exept16, $w)) {\n $w = $w . \"ΟΥΣ\";\n }\n }\n\n //Step 5i\n $re = '/^(.+?)(ΑΓΑ|ΑΓΕΣ|ΑΓΕ)$/';\n $numberOfRulesExamined++;\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept17 = '/^(ΨΟΦ|ΝΑΥΛΟΧ)$/';\n $exept20 = '/(ΚΟΛΛ)$/';\n $exept18 = '/^(ΑΒΑΣΤ|ΠΟΛΥΦ|ΑΔΗΦ|ΠΑΜΦ|Ρ|ΑΣΠ|ΑΦ|ΑΜΑΛ|ΑΜΑΛΛΙ|ΑΝΥΣΤ|ΑΠΕΡ|ΑΣΠΑΡ|ΑΧΑΡ|ΔΕΡΒΕΝ|ΔΡΟΣΟΠ|ΞΕΦ|ΝΕΟΠ|ΝΟΜΟΤ|ΟΛΟΠ|ΟΜΟΤ|ΠΡΟΣΤ|ΠΡΟΣΩΠΟΠ|ΣΥΜΠ|ΣΥΝΤ|Τ|ΥΠΟΤ|ΧΑΡ|ΑΕΙΠ|ΑΙΜΟΣΤ|ΑΝΥΠ|ΑΠΟΤ|ΑΡΤΙΠ|ΔΙΑΤ|ΕΝ|ΕΠΙΤ|ΚΡΟΚΑΛΟΠ|ΣΙΔΗΡΟΠ|Λ|ΝΑΥ|ΟΥΛΑΜ|ΟΥΡ|Π|ΤΡ|Μ)$/';\n $exept19 = '/(ΟΦ|ΠΕΛ|ΧΟΡΤ|ΛΛ|ΣΦ|ΡΠ|ΦΡ|ΠΡ|ΛΟΧ|ΣΜΗΝ)$/';\n\n if ((preg_match($exept18, $w) || preg_match($exept19, $w))\n && !(preg_match($exept17, $w) || preg_match($exept20, $w))\n ) {\n $w = $w . \"ΑΓ\";\n }\n }\n\n\n //Step 5j\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΗΣΕ|ΗΣΟΥ|ΗΣΑ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept21 = '/^(Ν|ΧΕΡΣΟΝ|ΔΩΔΕΚΑΝ|ΕΡΗΜΟΝ|ΜΕΓΑΛΟΝ|ΕΠΤΑΝ)$/';\n if (preg_match($exept21, $w)) {\n $w = $w . \"ΗΣ\";\n }\n }\n\n //Step 5k\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΗΣΤΕ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept22 = '/^(ΑΣΒ|ΣΒ|ΑΧΡ|ΧΡ|ΑΠΛ|ΑΕΙΜΝ|ΔΥΣΧΡ|ΕΥΧΡ|ΚΟΙΝΟΧΡ|ΠΑΛΙΜΨ)$/';\n if (preg_match($exept22, $w)) {\n $w = $w . \"ΗΣΤ\";\n }\n }\n\n //Step 5l\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΟΥΝΕ|ΗΣΟΥΝΕ|ΗΘΟΥΝΕ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept23 = '/^(Ν|Ρ|ΣΠΙ|ΣΤΡΑΒΟΜΟΥΤΣ|ΚΑΚΟΜΟΥΤΣ|ΕΞΩΝ)$/';\n if (preg_match($exept23, $w)) {\n $w = $w . \"ΟΥΝ\";\n }\n }\n\n //Step 5l\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΟΥΜΕ|ΗΣΟΥΜΕ|ΗΘΟΥΜΕ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n $test1 = false;\n\n $exept24 = '/^(ΠΑΡΑΣΟΥΣ|Φ|Χ|ΩΡΙΟΠΛ|ΑΖ|ΑΛΛΟΣΟΥΣ|ΑΣΟΥΣ)$/';\n if (preg_match($exept24, $w)) {\n $w = $w . \"ΟΥΜ\";\n }\n }\n\n // Step 6\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΜΑΤΑ|ΜΑΤΩΝ|ΜΑΤΟΣ)$/';\n $re2 = '/^(.+?)(Α|ΑΓΑΤΕ|ΑΓΑΝ|ΑΕΙ|ΑΜΑΙ|ΑΝ|ΑΣ|ΑΣΑΙ|ΑΤΑΙ|ΑΩ|Ε|ΕΙ|ΕΙΣ|ΕΙΤΕ|ΕΣΑΙ|ΕΣ|ΕΤΑΙ|Ι|ΙΕΜΑΙ|ΙΕΜΑΣΤΕ|ΙΕΤΑΙ|ΙΕΣΑΙ|ΙΕΣΑΣΤΕ|ΙΟΜΑΣΤΑΝ|ΙΟΜΟΥΝ|ΙΟΜΟΥΝΑ|ΙΟΝΤΑΝ|ΙΟΝΤΟΥΣΑΝ|ΙΟΣΑΣΤΑΝ|ΙΟΣΑΣΤΕ|ΙΟΣΟΥΝ|ΙΟΣΟΥΝΑ|ΙΟΤΑΝ|ΙΟΥΜΑ|ΙΟΥΜΑΣΤΕ|ΙΟΥΝΤΑΙ|ΙΟΥΝΤΑΝ|Η|ΗΔΕΣ|ΗΔΩΝ|ΗΘΕΙ|ΗΘΕΙΣ|ΗΘΕΙΤΕ|ΗΘΗΚΑΤΕ|ΗΘΗΚΑΝ|ΗΘΟΥΝ|ΗΘΩ|ΗΚΑΤΕ|ΗΚΑΝ|ΗΣ|ΗΣΑΝ|ΗΣΑΤΕ|ΗΣΕΙ|ΗΣΕΣ|ΗΣΟΥΝ|ΗΣΩ|Ο|ΟΙ|ΟΜΑΙ|ΟΜΑΣΤΑΝ|ΟΜΟΥΝ|ΟΜΟΥΝΑ|ΟΝΤΑΙ|ΟΝΤΑΝ|ΟΝΤΟΥΣΑΝ|ΟΣ|ΟΣΑΣΤΑΝ|ΟΣΑΣΤΕ|ΟΣΟΥΝ|ΟΣΟΥΝΑ|ΟΤΑΝ|ΟΥ|ΟΥΜΑΙ|ΟΥΜΑΣΤΕ|ΟΥΝ|ΟΥΝΤΑΙ|ΟΥΝΤΑΝ|ΟΥΣ|ΟΥΣΑΝ|ΟΥΣΑΤΕ|Υ|ΥΣ|Ω|ΩΝ)$/';\n if (preg_match($re, $w, $match)) {\n //debug($w,6);\n $stem = $match[1];\n $w = $stem . \"ΜΑ\";\n }\n $numberOfRulesExamined++;\n if (preg_match($re2, $w) && $test1) {\n //debug($w,\"6-re2\");\n preg_match($re2, $w, $match);\n $stem = $match[1];\n $w = $stem;\n }\n\n // Step 7 (ΠΑΡΑΘΕΤΙΚΑ)\n $numberOfRulesExamined++;\n $re = '/^(.+?)(ΕΣΤΕΡ|ΕΣΤΑΤ|ΟΤΕΡ|ΟΤΑΤ|ΥΤΕΡ|ΥΤΑΤ|ΩΤΕΡ|ΩΤΑΤ)$/';\n if (preg_match($re, $w)) {\n preg_match($re, $w, $match);\n $stem = $match[1];\n $w = $stem;\n }\n\n\n return returnStem($w, $w_CASE, $encoding_changed, $numberOfRulesExamined);\n exit;\n}", "function MoveWord($word,&$wordlocs,$blockfrom,$sfrom,$wfrom,$blockto,$sto,$wto)\n{\n\t$word=TrimWord($word);\n\tif (!isset($wordlocs[$word])) return;\n\t\n\tfor ($loc=0; $loc<count($wordlocs[$word]); $loc++)\n\t{\n\t\t$loci=$wordlocs[$word][$loc];\n\t\tif ($loci[0]==$blockfrom // same block\n\t\t\t&& $loci[1]==$sfrom // same sentence\n\t\t\t&& $loci[2]==$wfrom) // same word\n\t\t{\n\t\t\t// Store new location\n\t\t\t$wordlocs[$word][$loc]=array($blockto,$sto,$wto);\n\t\t}\n\t}\n}", "private function lookup($word) {\n\n $query = $this->dm->getRepository('\\FYP\\Database\\Documents\\Lexicon');\n $result = $query->findOneBy(array('phrase' => $word));\n if (empty($result)) {\n $result = $query->findOneBy(array('phrase' => strtolower($word)));\n }\n\n if (empty($result)) {\n return self::DEFAULT_TAG;\n } else {\n return $result->getTags()[0];\n }\n\n }", "function strposa($string, $words=array(), $offset=0) {\n $chr = array();\n //check by simlarity\n foreach($words as $word) {\n $res = checkExistanceBySimilarity($string,$word);\n if ($res !== false) $chr[$word] = $res;\n }\n // check exist\n /*foreach($words as $word) {\n $res = strpos($string, $word, $offset);\n if ($res !== false) $chr[$word] = $res;\n }*/\n if(empty($chr)) return false;\n return min($chr);\n}", "private function addWord($word) {\n // - En las cajas de cuadrícula\n // - A la lista de palabras que se encuentran\n\n if($word->getLabel()=='') {return;}\n\n // Agregar a cuadros de cuadrícula\n $j=0;\n switch($word->getOrientation()) {\n\n case Word::HORIZONTAL:\n for ($i=$word->getStart(); $j<strlen($word->getLabel()); $i++) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::VERTICAL:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::DIAGONAL_LEFT_TO_RIGHT:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size+1) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n case Word::DIAGONAL_RIGHT_TO_LEFT:\n for($i=$word->getStart(); $j<strlen($word->getLabel()); $i+=$this->_size-1) {\n $this->_cells[$i]=substr($word->getLabel(),$j,1);\n $j++;\n }\n break;\n\n } // switch\n\n // Agregar la palabra a la lista\n $this->_wordsList[]=$word;\n\n }", "public function getRandomWord() {\n return $this->_index[array_rand($this->_index)];\n }", "public function findLongestWord() {\n\n }", "public function pluralize($word)\n\t{\n\t\t$plural = array(\n\t\t\t'/(quiz)$/i' => '1zes',\n\t\t\t'/^(ox)$/i' => '1en',\n\t\t\t'/([m|l])ouse$/i' => '1ice',\n\t\t\t'/(matr|vert|ind)ix|ex$/i' => '1ices',\n\t\t\t'/(x|ch|ss|sh)$/i' => '1es',\n\t\t\t'/([^aeiouy]|qu)ies$/i' => '1y',\n\t\t\t'/([^aeiouy]|qu)y$/i' => '1ies',\n\t\t\t'/(hive)$/i' => '1s',\n\t\t\t'/(?:([^f])fe|([lr])f)$/i' => '12ves',\n\t\t\t'/sis$/i' => 'ses',\n\t\t\t'/([ti])um$/i' => '1a',\n\t\t\t'/(buffal|tomat)o$/i' => '1oes',\n\t\t\t'/(bu)s$/i' => '1ses',\n\t\t\t'/(alias|status)/i'=> '1es',\n\t\t\t'/(octop|vir)us$/i'=> '1i',\n\t\t\t'/(ax|test)is$/i'=> '1es',\n\t\t\t'/s$/i'=> 's',\n\t\t\t'/$/'=> 's');\n\n\t\t$uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep');\n\n\t\t$irregular = array(\n\t\t\t'person' => 'people',\n\t\t\t'man' => 'men',\n\t\t\t'child' => 'children',\n\t\t\t'sex' => 'sexes',\n\t\t\t'move' => 'moves');\n\n\t\t$lowercased_word = strtolower($word);\n\n\t\tforeach ($uncountable as $_uncountable){\n\t\t\tif(substr($lowercased_word,(-1*strlen($_uncountable))) == $_uncountable){\n\t\t\t\treturn $word;\n\t\t\t}\n\t\t}\n\n\t\tforeach ($irregular as $_plural=> $_singular){\n\t\t\tif (preg_match('/('.$_plural.')$/i', $word, $arr)) {\n\t\t\t\treturn preg_replace('/('.$_plural.')$/i', substr($arr[0],0,1).substr($_singular,1), $word);\n\t\t\t}\n\t\t}\n\n\t\tforeach ($plural as $rule => $replacement) {\n\t\t\tif (preg_match($rule, $word)) {\n\t\t\t\treturn preg_replace($rule, $replacement, $word);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}", "public static function fix_case($word) {\n # Fix case for words split by periods (J.P.)\n if (strpos($word, '.') !== false) {\n $word = self::safe_ucfirst(\".\", $word);;\n }\n # Fix case for words split by hyphens (Kimura-Fay)\n if (strpos($word, '-') !== false) {\n $word = self::safe_ucfirst(\"-\", $word);\n }\n # Special case for single letters\n if (strlen($word) == 1) {\n $word = strtoupper($word);\n }\n # Special case for 2-letter words\n if (strlen($word) == 2) {\n # Both letters vowels (uppercase both)\n if (in_array(strtolower($word{0}), self::$dict['vowels']) && in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = strtoupper($word);\n }\n # Both letters consonants (uppercase both)\n if (!in_array(strtolower($word{0}), self::$dict['vowels']) && !in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = strtoupper($word);\n }\n # First letter is vowel, second letter consonant (uppercase first)\n if (in_array(strtolower($word{0}), self::$dict['vowels']) && !in_array(strtolower($word{1}), self::$dict['vowels'])) {\n $word = ucfirst(strtolower($word));\n }\n # First letter consonant, second letter vowel or \"y\" (uppercase first)\n if (!in_array(strtolower($word{0}), self::$dict['vowels']) && (in_array(strtolower($word{1}), self::$dict['vowels']) || strtolower($word{1}) == 'y')) {\n $word = ucfirst(strtolower($word));\n }\n }\n # Fix case for words which aren't initials, but are all upercase or lowercase\n if ( (strlen($word) >= 3) && (ctype_upper($word) || ctype_lower($word)) ) {\n $word = ucfirst(strtolower($word));\n }\n return $word;\n }", "public static function excludefromSearch($string)\r\n {\r\n $exploded= explode(\" \",$string);\r\n\r\n $indice= DiccionarioIndexacion::pivotsForSearch();\r\n // ldd($indice);\r\n $words=DiccionarioIndexacion::excludedWordsForSearch();\r\n foreach ($exploded as $pos=>$value)\r\n {\r\n\r\n $value=lcfirst($value);\r\n if(strlen($value)==0)\r\n continue;\r\n $exploded[$pos]=DiccionarioIndexacion::normalizeString($value);\r\n $val = $value[0];\r\n if (is_numeric($val)) {\r\n // ld($value[0]);\r\n continue;\r\n }\r\n $numericValue = ord($value{0});\r\n $iterator= $numericValue;\r\n if (!isset($indice[$iterator]))\r\n continue;\r\n $end=$indice[$iterator];\r\n if ($iterator==\"97\")\r\n $start=0;\r\n else\r\n {\r\n while (!isset($indice[$iterator-1]))\r\n $iterator--;\r\n $start=$indice[$iterator-1];\r\n }\r\n\r\n // $letter = chr(98);\r\n for ($i=$start;$i<$end;$i++)\r\n {\r\n\r\n if ($value == $words[$i])\r\n {\r\n unset($exploded[$pos]);\r\n }\r\n }\r\n }\r\n return $exploded;\r\n\r\n }", "function idx_getPageWords($page){\n global $conf;\n $word_idx = file($conf['cachedir'].'/word.idx');\n $swfile = DOKU_INC.'inc/lang/'.$conf['lang'].'/stopwords.txt';\n if(@file_exists($swfile)){\n $stopwords = file($swfile);\n }else{\n $stopwords = array();\n }\n\n $body = rawWiki($page);\n $body = strtr($body, \"\\r\\n\\t\", ' ');\n $tokens = explode(' ', $body);\n $tokens = array_count_values($tokens); // count the frequency of each token\n\n $words = array();\n foreach ($tokens as $word => $count) {\n $word = utf8_strtolower($word);\n\n // simple filter to restrict use of utf8_stripspecials\n if (preg_match('/\\W/', $word)) {\n $arr = explode(' ', utf8_stripspecials($word,' ','._\\-:'));\n $arr = array_count_values($arr);\n\n foreach ($arr as $w => $c) {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$w] = $c + (isset($words[$w]) ? $words[$w] : 0);\n }\n } else {\n if (!is_numeric($w) && strlen($w) < 3) continue;\n $words[$word] = $count + (isset($words[$word]) ? $words[$word] : 0);\n }\n }\n\n // arrive here with $words = array(word => frequency)\n\n $index = array(); //resulting index\n foreach ($words as $word => $freq) {\n\tif (is_int(array_search(\"$word\\n\",$stopwords))) continue;\n $wid = array_search(\"$word\\n\",$word_idx);\n if(!is_int($wid)){\n $word_idx[] = \"$word\\n\";\n $wid = count($word_idx)-1;\n }\n $index[$wid] = $freq;\n }\n\n // save back word index\n $fh = fopen($conf['cachedir'].'/word.idx','w');\n if(!$fh){\n trigger_error(\"Failed to write word.idx\", E_USER_ERROR);\n return false;\n }\n fwrite($fh,join('',$word_idx));\n fclose($fh);\n\n return $index;\n}", "public function snake($word);", "public function camel($word);", "function queryword()\n\t{\n\t\t$sql=\"select id_word, frequency, word from $this->lang_frequency where word >= '$this->word' LIMIT 1\";\n\t\t$fs = mysql_query($sql,$this->db);\n\t\t$rs=mysql_fetch_row($fs);\n\t\t//dumpa ($rs);\n\t\t$err=mysql_error($this->db);\n\t\tif ($err)\n\t\t{\n\t\t\techo \"<br>$sql <br> $err<hr>\";\n\t\t}\n\n\t\t$id=$rs[0];\n\t\t$feq=$rs[1];\n\t\t//echo \"<span>$word con id = $id e freq di $feq<br>$sql<br></span>\";\n\t\tif ($id<=25)\n\t\t{\n\t\t $idn=0;\n\t\t $pos=$id-1;\n\t\t}\n\t\telse\n\t\t{\n\t\t $idn=$id-26;\n\t\t $pos=25;\n\t\t}\n\t\t$this->wordfreq=$feq;\n\t\t$this->id=$id;\n\t\t$this->idn=$idn;\n\t\t$this->pos=$pos;\n\t\t$this->wordfound=$rs[2];\n\t}", "public static function UpdateUniCountOfWords() {\r\n $conn = ModMetocHelper::coToDa();\r\n $cont = ModMetocHelper::conTab();\r\n $sql = \"SELECT `id`, `introtext`, `fulltext` FROM $cont\";\r\n $result = $conn->query($sql);\r\n\r\n\r\n if ($result->num_rows > 0) {\r\n ini_set('max_execution_time', 100); // extend max time of processing\r\n while ($row = $result->fetch_assoc()) {\r\n $ucow = count(array_unique(str_word_count(($row['introtext'] . ' ' . $row['fulltext']), 1))); //upravit\r\n $id = $row['id'];\r\n $sqlUpdate = \"UPDATE $cont SET $cont.uni_count_of_words=($ucow) WHERE $cont.uni_count_of_words IS NULL AND $cont.id=$id\";\r\n\r\n $conn->query($sqlUpdate);\r\n }\r\n }\r\n ini_set('max_execution_time', 30); // set max time to 30 second\r\n }", "public function train($sentence)\n {\n\n //connectionecting to database\n require 'koneksi.php';\n\n // ekstraksi keyword\n mysqli_query($connection, \"TRUNCATE tbtoken\");\n $keywordsArray = $this->tokenize($sentence);\n // update tabel frekuensi kata\n foreach ($keywordsArray as $word) {\n\n // if this word is already present with given category then update count else insert\n $sql = mysqli_query($connection, \"SELECT count(*) as total FROM tbtoken WHERE term = '$word' \");\n $count = mysqli_fetch_assoc($sql);\n\n //rumus bobot\n\n if ($count['total'] == 0) {\n $sql = mysqli_query($connection, \"INSERT into tbtoken (term,count) values('$word',1)\");\n } else {\n $sql = mysqli_query($connection, \"UPDATE tbtoken set count = count + 1 where term = '$word'\");\n }\n }\n\n //closing connectionection\n $connection->close();\n }", "public function singularize($word);", "function obtain_word_list(&$orig_word, &$replacement_word)\n{\n\tglobal $db;\n\n\t//\n\t// Define censored word matches\n\t//\n\t$sql = \"SELECT word, replacement\n\t\tFROM \" . WORDS_TABLE;\n\tif( !($result = $db->sql_query($sql)) )\n\t{\n\t\tmessage_die(GENERAL_ERROR, 'Could not get censored words from database', '', __LINE__, __FILE__, $sql);\n\t}\n\n\tif ( $row = $db->sql_fetchrow($result) )\n\t{\n\t\tdo \n\t\t{\n\t\t\t$orig_word[] = '#\\b(' . str_replace('\\*', '\\w*?', preg_quote($row['word'], '#')) . ')\\b#i';\n\t\t\t$replacement_word[] = $row['replacement'];\n\t\t}\n\t\twhile ( $row = $db->sql_fetchrow($result) );\n\t}\n\n\treturn true;\n}", "public static function pluralize($word)\n {\n $plural = array(\n '/(quiz)$/i' => '1zes',\n '/^(ox)$/i' => '1en',\n '/([m|l])ouse$/i' => '1ice',\n '/(matr|vert|ind)ix|ex$/i' => '1ices',\n '/(x|ch|ss|sh)$/i' => '1es',\n '/([^aeiouy]|qu)ies$/i' => '1y',\n '/([^aeiouy]|qu)y$/i' => '1ies',\n '/(hive)$/i' => '1s',\n '/(?:([^f])fe|([lr])f)$/i' => '12ves',\n '/sis$/i' => 'ses',\n '/([ti])um$/i' => '1a',\n '/(buffal|tomat)o$/i' => '1oes',\n '/(bu)s$/i' => '1ses',\n '/(alias|status)/i'=> '1es',\n '/(octop|vir)us$/i'=> '1i',\n '/(ax|test)is$/i'=> '1es',\n '/s$/i'=> 's',\n '/$/'=> 's');\n\n $uncountable = array('equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep');\n\n $irregular = array(\n 'person' => 'people',\n 'man' => 'men',\n 'child' => 'children',\n 'sex' => 'sexes',\n 'move' => 'moves');\n\n $lowercased_word = strtolower($word);\n\n foreach ($uncountable as $_uncountable){\n if(substr($lowercased_word,(-1*strlen($_uncountable))) == $_uncountable){\n return $word;\n }\n }\n\n foreach ($irregular as $_plural=> $_singular){\n if (preg_match('/('.$_plural.')$/i', $word, $arr)) {\n return preg_replace('/('.$_plural.')$/i', substr($arr[0],0,1).substr($_singular,1), $word);\n }\n }\n\n foreach ($plural as $rule => $replacement) {\n if (preg_match($rule, $word)) {\n return preg_replace($rule, $replacement, $word);\n }\n }\n return false;\n\n }", "public function _replaceAccented($word){\n\t\t$accentedVowels = $this->_locale->getAccentedVowels();\n\t\tforeach($accentedVowels as $vowel => $accentedVowel){\n\t\t\t$word = str_replace($accentedVowel, $vowel, $word);\n\t\t}\n\t\treturn $word;\n\t}", "function rervertWord ($tekst){\n \n $revertTekst = \"\";\n // we gebruiken een fot omdat we een rangwomvang kennen.\n for ($index = strlen($tekst) -1 ; $index > -1 ;$index --){\n echo $tekst[index];\n $reverttekst = $revertTekst + $tekst[$index];\n }\n \n \n return $revertTekst;\n}", "function _o( $word )\n {\n if ( strlen($word) >= 3 ) {\n if ( $this->is_consonant($word, -1) && !$this->is_consonant($word, -2) &&\n $this->is_consonant($word, -3) ) {\n\t\t $last_char = substr($word, -1);\n\t\t if ( $last_char == 'w' || $last_char == 'x' || $last_char == 'y' ) {\n\t\t return false;\n\t\t }\n return true;\n }\n }\n return false;\n }", "public static function indefinite_article($word)\n\t{\n\t\t// Lowercase version of the word\n\t\t$word_lower = strtolower($word);\n\n\t\t// An 'an' word (specific start of words that should be preceeded by 'an')\n\t\t$an_words = array('euler', 'heir', 'honest', 'hono');\n\t\tforeach ($an_words as $an_word)\n\t\t{\n\t\t\tif (substr($word_lower, 0, strlen($an_word)) == $an_word)\n\t\t\t\treturn \"an\";\n\t\t}\n\t\tif (substr($word_lower, 0, 4) == \"hour\" and substr($word_lower, 0, 5) != \"houri\")\n\t\t\treturn \"an\";\n\n\t\t// An 'an' letter (single letter word which should be preceeded by 'an')\n\t\t$an_letters = array('a', 'e', 'f', 'h', 'i', 'l', 'm', 'n', 'o', 'r', 's', 'x');\n\t\tif (strlen($word) == 1)\n\t\t{\n\t\t\tif (in_array($word_lower, $an_letters))\n\t\t\t\treturn \"an\";\n\t\t\telse\n\t\t\t\treturn \"a\";\n\t\t}\n\n\t\t// Capital words which should likely by preceeded by 'an'\n\t\tif (preg_match('/(?!FJO|[HLMNS]Y.|RY[EO]|SQU|(F[LR]?|[HL]|MN?|N|RH?|S[CHKLMNPTVW]?|X(YL)?)[AEIOU])[FHLMNRSX][A-Z]/', $word))\n\t\t\treturn \"an\";\n\n\t\t// Special cases where a word that begins with a vowel should be preceeded by 'a'\n\t\t$regex_array = array('^e[uw]', '^onc?e\\b', '^uni([^nmd]|mo)', '^u[bcfhjkqrst][aeiou]');\n\t\tforeach ($regex_array as $regex)\n\t\t{\n\t\t\tif (preg_match('/' . $regex . '/', $word_lower))\n\t\t\t\treturn \"a\";\n\t\t}\n\n\t\t// Special capital words\n\t\tif (preg_match('/^U[NK][AIEO]/', $word))\n\t\t\treturn \"a\";\n\t\t// Not sure what this does\n\t\telse if ($word == strtoupper($word))\n\t\t{\n\t\t\t$array = array('a', 'e', 'd', 'h', 'i', 'l', 'm', 'n', 'o', 'r', 's', 'x');\n\t\t\tif (in_array($word_lower[0], $array))\n\t\t\t\treturn \"an\";\n\t\t\telse\n\t\t\t\treturn \"a\";\n\t\t}\n\n\t\t// Basic method of words that begin with a vowel being preceeded by 'an'\n\t\t$vowels = array('a', 'e', 'i', 'o', 'u');\n\t\tif (in_array($word_lower[0], $vowels))\n\t\t\treturn \"an\";\n\n\t\t// Instances where y follwed by specific letters is preceeded by 'an'\n\t\tif (preg_match('/^y(b[lor]|cl[ea]|fere|gg|p[ios]|rou|tt)/', $word_lower))\n\t\t\treturn \"an\";\n\n\t\t// Default to 'a'\n\t\treturn \"a\";\n\t}", "private function internal_translate_words() {\n global $DB;\n $this->translated = false;\n\n // Get list of all words used.\n $allwords = array();\n foreach (array_merge($this->terms, $this->negativeterms) as $term) {\n $allwords = array_merge($allwords, $term->words);\n }\n $allwords = array_unique($allwords);\n if (count($allwords) === 0) {\n return array(false, null);\n }\n\n // OK, great, now let's build a query for all those words.\n list ($wordlistwhere, $wordlistwherearray) =\n $DB->get_in_or_equal($allwords);\n $words = $DB->get_records_select('local_ousearch_words',\n 'word ' . $wordlistwhere, $wordlistwherearray, '', 'word,id');\n\n // Convert words to IDs.\n $newterms = array();\n $lastmissed = '';\n foreach ($this->terms as $term) {\n $missed = false;\n $term->ids = array();\n foreach ($term->words as $word) {\n if (!array_key_exists($word, $words)) {\n $missed = true;\n $lastmissed = $word;\n break;\n } else {\n $term->ids[] = $words[$word]->id;\n }\n }\n // If we didn't have some words in the term...\n if ($missed) {\n // Required term? Not going to find anything then.\n if ($term->required || !self::SUPPORTS_OR) {\n return array(false, $lastmissed);\n }\n // If not required, just dump that term.\n } else {\n $newterms[] = $term;\n }\n }\n // Must have some (positive) terms.\n if (count($newterms) == 0) {\n return array(false, $lastmissed);\n }\n $this->terms = $newterms;\n\n $newterms = array();\n foreach ($this->negativeterms as $term) {\n $missed = false;\n $term->ids = array();\n foreach ($term->words as $word) {\n if (!array_key_exists($word, $words)) {\n $missed = $word;\n break;\n } else {\n $term->ids[] = $words[$word]->id;\n }\n }\n // If we didn't have some words in the term, dump it.\n if (!$missed) {\n $newterms[] = $term;\n }\n }\n $this->negativeterms = $newterms;\n $this->translated = true;\n return array(true, true);\n }", "public function disambiguate($word)\n {\n if (preg_match('/^penge(.*)$/', $word, $matches)) {\n return $matches[1];\n }\n }", "function shorten_words($string, $wordsreturned)\r\n\t\t\t{\r\n\t\t\t\t$retval = $string; // Just in case of a problem\r\n\t\t\t\t$array = explode(\" \", $string);\r\n\t\t\t\tif (count($array)<=$wordsreturned)\r\n\t\t\t\t{\r\n\t\t\t\t\t$retval = $string;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tarray_splice($array, $wordsreturned);\r\n\t\t\t\t\t$retval = implode(\" \", $array);\r\n\t\t\t\t}\r\n\t\t\t\treturn $retval;\r\n\t\t\t}", "function contains_bad_words($string)\r\n{\r\n // This array contains words which trigger the \"meep\" feature of this function\r\n // (ie. if one of the array elements is found in the string, the function will\r\n // return true). Please note that these words do not constitute a rating of their\r\n // meanings - they're used for a first indication if the string might contain\r\n // inapropiate language.\r\n $bad_words = array(\r\n 'anal', 'ass', 'bastard', 'puta',\r\n 'bitch', 'blow', 'butt', 'trolo',\r\n 'cock', 'clit', 'cock', 'pija',\r\n 'cornh', 'cum', 'cunnil', 'verga',\r\n 'cunt', 'dago', 'defecat', 'cajeta',\r\n 'dick', 'dildo', 'douche', 'choto',\r\n 'erotic', 'fag', 'fart', 'trola',\r\n 'felch', 'fellat', 'fuck', 'puto',\r\n 'gay', 'genital', 'gosh', 'pajero',\r\n 'hate', 'homo', 'honkey', 'pajera',\r\n 'horny', 'vibrador', 'jew', 'lesbiana',\r\n 'jiz', 'kike', 'kill', 'eyaculacion',\r\n 'lesbian', 'masoc', 'masturba', 'anal',\r\n 'nazi', 'nigger', 'nude', 'mamada',\r\n 'nudity', 'oral', 'pecker', 'teta',\r\n 'penis', 'potty', 'pussy', 'culo',\r\n 'rape', 'rimjob', 'satan', 'mierda',\r\n 'screw', 'semen', 'sex', 'bastardo',\r\n 'shit', 'slut', 'snot', 'sorete',\r\n 'spew', 'suck', 'tit',\r\n 'twat', 'urinat', 'vagina',\r\n 'viag', 'vibrator', 'whore',\r\n 'xxx'\r\n );\r\n\r\n // Check for bad words\r\n for($i=0; $i<count($bad_words); $i++)\r\n {\r\n if(strstr(strtoupper($string), strtoupper($bad_words[$i])))\r\n {\r\n return(true);\r\n }\r\n }\r\n\r\n // Passed the test\r\n return(false);\r\n}", "public function build($word, $content);", "function __construct() {\n \t$this->stopwords = explode(\",\", \"1,2,3,4,5,6,7,8,9,2x,3x,4x,5x,6x,x2,x3,x4,x5,x6,?,!,+,-,@,#,$,%,^,&,*,(,),=,able,about,above,according,accordingly,across,actually,after,afterwards,again,against,ain't,all,allow,allows,almost,alone,along,already,also,although,always,am,among,amongst,an,and,another,any,anybody,anyhow,anyone,anything,anyway,anyways,anywhere,apart,appear,appreciate,appropriate,are,aren't,around,as,aside,ask,asking,associated,at,available,away,awfully,be,became,because,become,becomes,becoming,been,before,beforehand,behind,being,believe,below,beside,besides,best,better,between,beyond,both,brief,but,by,c'mon,c's,came,can,can't,cannot,cant,cause,causes,certain,certainly,changes,clearly,co,com,come,comes,concerning,consequently,consider,considering,contain,containing,contains,corresponding,could,couldn't,course,currently,definitely,described,despite,did,didn't,different,do,does,doesn't,doing,don't,done,down,downwards,during,each,edu,eg,eight,either,else,elsewhere,enough,entirely,especially,et,etc,even,ever,every,everybody,everyone,everything,everywhere,ex,exactly,example,except,far,few,fifth,first,five,followed,following,follows,for,former,formerly,forth,four,from,further,furthermore,get,gets,getting,given,gives,go,goes,going,gone,got,gotten,greetings,had,hadn't,happens,hardly,has,hasn't,have,haven't,having,he,he's,hello,help,hence,her,here,here's,hereafter,hereby,herein,hereupon,hers,herself,hi,him,himself,his,hither,hopefully,how,howbeit,however,i'd,i'll,i'm,i've,ie,if,ignored,immediate,in,inasmuch,inc,indeed,indicate,indicated,indicates,inner,insofar,instead,into,inward,is,isn't,it,it'd,it'll,it's,its,itself,just,keep,keeps,kept,know,knows,known,last,lately,later,latter,latterly,least,less,lest,let,let's,like,liked,likely,little,look,looking,looks,ltd,mainly,many,may,maybe,me,mean,meanwhile,merely,might,more,moreover,most,mostly,much,must,my,myself,name,namely,nd,near,nearly,necessary,need,needs,neither,never,nevertheless,new,next,nine,no,nobody,non,none,noone,nor,normally,not,nothing,novel,now,nowhere,obviously,of,off,often,oh,ok,okay,old,on,once,one,ones,only,onto,or,other,others,otherwise,ought,our,ours,ourselves,out,outside,over,overall,own,particular,particularly,per,perhaps,placed,please,plus,possible,presumably,probably,provides,que,quite,qv,rather,rd,re,really,reasonably,regarding,regardless,regards,relatively,respectively,right,said,same,saw,say,saying,says,second,secondly,see,seeing,seem,seemed,seeming,seems,seen,self,selves,sensible,sent,serious,seriously,seven,several,shall,she,should,shouldn't,since,six,so,some,somebody,somehow,someone,something,sometime,sometimes,somewhat,somewhere,soon,sorry,specified,specify,specifying,still,sub,such,sup,sure,t's,take,taken,tell,tends,th,than,thank,thanks,thanx,that,that's,thats,the,their,theirs,them,themselves,then,thence,there,there's,thereafter,thereby,therefore,therein,theres,thereupon,these,they,they'd,they'll,they're,they've,think,third,this,thorough,thoroughly,those,though,three,through,throughout,thru,thus,to,together,too,took,toward,towards,tried,tries,truly,try,trying,twice,two,un,under,unfortunately,unless,unlikely,until,unto,up,upon,us,use,used,useful,uses,using,usually,value,various,very,via,viz,vs,want,wants,was,wasn't,way,we,we'd,we'll,we're,we've,welcome,well,went,were,weren't,what,what's,whatever,when,whence,whenever,where,where's,whereafter,whereas,whereby,wherein,whereupon,wherever,whether,which,while,whither,who,who's,whoever,whole,whom,whose,why,will,willing,wish,with,within,without,won't,wonder,would,would've,wouldn't,yes,yet,you,you'd,you'll,you're,you've,your,yours,yourself,yourselves,zero,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\");\n }", "function createVector(&$docVector, &$word){\r\n if(isset($docVector[$word]) == false){\r\n $docVector[$word] = 1;\r\n }\r\n $docVector[$word] = $docVector[$word]+1;\r\n}", "function all_words_wellknown_full($txid, $status) \n{\n if ($status == 98) {\n pagestart(\"Setting all blue words to Ignore\", false); \n } else {\n pagestart(\"Setting all blue words to Well-known\", false); \n }\n all_words_wellknown_content($txid, $status);\n pageend();\n}", "static function ProcessHindiPhonetic($word)\n\t\t{\n\t\t\t$word=strtolower($word);\n\t\t\t$k=1;\n\t\t\t$word1=\"D\";\t\n\t\t\t$n=strlen($word);\n\t\t\t$word1[0]=$word[0];\n\t\t\tfor($i=1;$i<=($n-1);$i++)\n\t\t\t{\n\t\t\t\tif($word[$i]!='e' && $word[$i]!='o')\n\t\t\t\t{\n\t\t\t\t\tif($word[$i]==$word[$i-1]);\n\t\t\t\t\telse $word1[$k++]=$word[$i];\n\t\t\t\t}\n\t\t\t\telse $word1[$k++]=$word[$i];\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/* Process the word */\n\t\t\t\n\t\t\t$word=$word1;\n\t\t\t$n=strlen($word);\n\t\t\t$result=\"S\";\n\t\t\t$k=0;\n\t\t\t//if($word[0]=='e') $word[0]='i';\n\t\t\tif($word==\"mein\" || $word==\"main\")\n\t\t\t{\n\t\t\t\t$result=\"me\";\n\t\t\t}\n\t\t\telse if($word==\"hain\" || $word==\"hai\")\n\t\t\t{\n\t\t\t\t$result=\"he\";\n\t\t\t}\n\t\t\telse if ($word==\"hun\" || $word==\"hoon\")\n\t\t\t{\n\t\t\t\t$result=\"hu\";\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\tfor($i=0;$i<(strlen($word)+1);$i++)\n\t\t\t{\n switch($word[$i])\n {\n case 'a' :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($i==0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($word[$i+1]=='e')\n {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo Hello;\n $result[$k++]='e';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($word[$i+1]=='i')\n {\n if($i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n else \n {\n $result[$k++]='e';\n $i++;\n }\n }\n else if($word[$i+1]=='y' && $i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n \n else if($word[$i+1]=='u')\n {\n $result[$k++]='o';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($i+1==$n)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($word[$i+1]=='e')\n {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo Hello;\n $result[$k++]='e';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($word[$i+1]=='i')\n {\n if($i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n else \n {\n $result[$k++]='e';\n $i++;\n }\n }\n else if($word[$i+1]=='y' && $i+2==$n)\n {\n $result[$k++]='a';\n $result[$k++]='i';\n $i++;\n }\n \n else if($word[$i+1]=='u')\n {\n $result[$k++]='o';\n $i++;\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse if($i+1==$n)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='a';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n break;\n \n case 'b' : $result[$k++]='b'; break;\n case 'c' : $result[$k++]='c'; break;\n case 'd' : $result[$k++]='d'; break;\n case 'e' : if($i==0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='i';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n else if($word[$i+1]=='e')\n {\n if($word[$i+2]=='y');\n else $result[$k++]='i';\n $i++;\n }\n else if($word[$i+1]=='i' && $word[$i+2]=='n')\n {\n $result[$k++]='e';\n $i=$i+2;\n }\n else if($word[$i+1]=='i')\n {\n $result[$k++]='i';\n $i++;\n }\n else $result[$k++]='e'; \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n break;\n \n case 'f' : $result[$k++]='f'; break;\n case 'g' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='g';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='g'; break;\n case 'h' : \n \n if($i+1==$n && ($word[$i-1]=='a' || $word[$i-1]=='e' || $word[$i-1]=='g' || $word[$i-1]=='j' || $word[$i-1]=='u'));\n else $result[$k++]='h';\n break;\n \n case 'i' : if($word[$i+1]=='y') ;\n \n else $result[$k++]='i'; break;\n case 'j' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='j';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='j'; break;\n case 'k' : $result[$k++]='k'; break;\n case 'l' : $result[$k++]= 'l'; break;\n case 'm' : $result[$k++]='m'; break;\n case 'n' : $result[$k++]='n'; break;\n case 'o' :if($word[$i+1]=='n' && $i==$n-2)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='o';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n else if($word[$i+1]=='w' || $word[$i+1]=='v' || $word[$i+1]=='u')\n {\n \n $result[$k++]='o';\n $i++;\n }\n else if($word[$i+1]=='o')\n {\n if($word[$i-1]=='r' && ($word[$i-2]=='m' || $word[$i-2]=='n' || $word[$i-2]=='v' || $word[$i-2]=='b' || $word[$i-2]=='g' || $word[$i-2]=='k'))\n {\n $result[$k++]='i';\n }\n else $result[$k++]='u';\n $i++;\n } \n else $result[$k++]='o'; break;\n case 'p' : \n if ($word[$i+1]=='h')\n {\n $result[$k++]='f';\n $i++;\n }\n else $result[$k++]='p';\n break;\n \n case 'q' : $result[$k++]='k'; break;\n case 'r' : $result[$k++]='r'; break;\n case 's' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='s';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='s'; break;\n case 't' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='t';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='t'; break;\n case 'u' : \n if($word[$i-1]=='r' && ($word[$i-2]=='m' || $word[$i-2]=='n' || $word[$i-2]=='v' || $word[$i-2]=='b' || $word[$i-2]=='g' || $word[$i-2]=='k'))\n {\n $result[$k++]='i';\n }\n else $result[$k++]='u'; break; \n case 'v' : $result[$k++]='v'; break;\n case 'w' : $result[$k++]='v'; break;\n case 'x' : \n $result[$k++]='k';\n $result[$k++]='s';\n break;\n \n case 'y' : \n if($i==strlen($word)-1)\n $result[$k++]='i';\n else $result[$k++]='y';\n break;\n case 'z' : if($word[$i+1]=='h')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$result[$k++]='g';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse $result[$k++]='j'; break;\n case '1' : $result[$k++]='1'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '2' : $result[$k++]='2'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '3' : $result[$k++]='3'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '4' : $result[$k++]='4'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '5' : $result[$k++]='5'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '6' : $result[$k++]='6'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '7' : $result[$k++]='7'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '8' : $result[$k++]='8'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '9' : $result[$k++]='9'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t case '0' : $result[$k++]='0'; break;\n\t\t\t\t\t\t\t\t\t\t\t\t default : ;\n }\n }\n\t\t\t}\n return $result;\n\t\t}", "public function spellcheck($txt)\r\n\t{\r\n\t\t$o = '';\r\n\t\tif(function_exists('pspell_new'))\r\n\t\t{\r\n\t\t\t$pspell_link = pspell_new(\"en\");\r\n\t\t\tforeach($words as $k => $v)\r\n\t\t\t{\r\n\t\t\t\tif (!pspell_check($pspell_link, $v))\r\n\t\t\t\t{\r\n\t\t\t\t\t$o .= pspell_suggest($pspell_link, $v).' ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$txt = $o;\r\n\t\t}\r\n\t\treturn $txt;\r\n\t}", "public function depluralize($word)\n {\n // Add the plural ending as the key and the singular\n // ending as the value for that key. This could be\n // turned into a preg_replace and probably will be\n // eventually, but for now, this is what it is.\n //\n // Note: The first rule has a value of false since\n // we don't want to mess with words that end with\n // double 's'. We normally wouldn't have to create\n // rules for words we don't want to mess with, but\n // the last rule (s) would catch double (ss) words\n // if we didn't stop before it got to that rule.\n $rules = array(\n 'ss' => false,\n 'os' => 'o',\n 'ies' => 'y',\n 'xes' => 'x',\n 'oes' => 'o',\n 'ies' => 'y',\n 'ves' => 'f',\n 's' => '');\n // Loop through all the rules and do the replacement.\n foreach(array_keys($rules) as $key)\n {\n // If the end of the word doesn't match the key,\n // it's not a candidate for replacement. Move on\n // to the next plural ending.\n if(substr($word, (strlen($key) * -1)) != $key)\n continue;\n // If the value of the key is false, stop looping\n // and return the original version of the word.\n if($key === false)\n return $word;\n // We've made it this far, so we can do the\n // replacement.\n return substr($word, 0, strlen($word) - strlen($key)) . $rules[$key];\n }\n\n return $word;\n }", "protected function _generateWord()\n {\n $word = '';\n $wordLen = $this->getWordlen();\n $vowels = $this->_useNumbers ? self::$VN : self::$V;\n $consonants = $this->_useNumbers ? self::$CN : self::$C;\n\n $totIndexCon = count($consonants) - 1;\n $totIndexVow = count($vowels) - 1;\n for ($i=0; $i < $wordLen; $i = $i + 2) {\n // generate word with mix of vowels and consonants\n $consonant = $consonants[Zend_Crypt_Math::randInteger(0, $totIndexCon, true)];\n $vowel = $vowels[Zend_Crypt_Math::randInteger(0, $totIndexVow, true)];\n $word .= $consonant . $vowel;\n }\n\n if (strlen($word) > $wordLen) {\n $word = substr($word, 0, $wordLen);\n }\n\n return $word;\n }", "public function stopwords()\n {\n //return array(' a ',' about ',' above ',' above ',' across ',' after ',' afterwards ',' again ',' against ',' all ',' almost ',' alone ',' along ',' already ',' also ',' although ',' always ',' am ',' among ',' amongst ',' amoungst ',' amount ',' an ',' and ',' another ',' any ',' anyhow ',' anyone ',' anything ',' anyway ',' anywhere ',' are ',' around ',' as ',' at ',' back ',' be ',' became ',' because ',' become ',' becomes ',' becoming ',' been ',' before ',' beforehand ',' behind ',' being ',' below ',' beside ',' besides ',' between ',' beyond ',' bill ',' both ',' bottom ',' but ',' by ',' call ',' can ',' cannot ',' cant ',' co ',' con ',' could ',' couldnt ',' cry ',' de ',' describe ',' detail ',' do ',' done ',' down ',' due ',' during ',' each ',' eg ',' eight ',' either ',' eleven ',' else ',' elsewhere ',' empty ',' enough ',' etc ',' even ',' ever ',' every ',' everyone ',' everything ',' everywhere ',' except ',' few ',' fifteen ',' fify ',' fill ',' find ',' fire ',' first ',' five ',' for ',' former ',' formerly ',' forty ',' found ',' four ',' from ',' front ',' full ',' further ',' get ',' give ',' go ',' had ',' has ',' hasnt ',' have ',' he ',' hence ',' her ',' here ',' hereafter ',' hereby ',' herein ',' hereupon ',' hers ',' herself ',' him ',' himself ',' his ',' how ',' however ',' hundred ',' ie ',' if ',' in ',' inc ',' indeed ',' interest ',' into ',' is ',' it ',' its ',' itself ',' keep ',' last ',' latter ',' latterly ',' least ',' less ',' ltd ',' made ',' many ',' may ',' me ',' meanwhile ',' might ',' mill ',' mine ',' more ',' moreover ',' most ',' mostly ',' move ',' much ',' must ',' my ',' myself ',' name ',' namely ',' neither ',' never ',' nevertheless ',' next ',' nine ',' no ',' nobody ',' none ',' noone ',' nor ',' not ',' nothing ',' now ',' nowhere ',' of ',' off ',' often ',' on ',' once ',' one ',' only ',' onto ',' or ',' other ',' others ',' otherwise ',' our ',' ours ',' ourselves ',' out ',' over ',' own ',' part ',' per ',' perhaps ',' please ',' put ',' rather ',' re ',' same ',' see ',' seem ',' seemed ',' seeming ',' seems ',' serious ',' several ',' she ',' should ',' show ',' side ',' since ',' sincere ',' six ',' sixty ',' so ',' some ',' somehow ',' someone ',' something ',' sometime ',' sometimes ',' somewhere ',' still ',' such ',' system ',' take ',' ten ',' than ',' that ',' the ',' their ',' them ',' themselves ',' then ',' thence ',' there ',' thereafter ',' thereby ',' therefore ',' therein ',' thereupon ',' these ',' they ',' thickv ',' thin ',' third ',' this ',' those ',' though ',' three ',' through ',' throughout ',' thru ',' thus ',' to ',' together ',' too ',' top ',' toward ',' towards ',' twelve ',' twenty ',' two ',' un ',' under ',' until ',' up ',' upon ',' us ',' very ',' via ',' was ',' we ',' well ',' were ',' what ',' whatever ',' when ',' whence ',' whenever ',' where ',' whereafter ',' whereas ',' whereby ',' wherein ',' whereupon ',' wherever ',' whether ',' which ',' while ',' whither ',' who ',' whoever ',' whole ',' whom ',' whose ',' why ',' will ',' with ',' within ',' without ',' would ',' yet ',' you ',' your ',' yours ',' yourself ',' yourselves ',' the ');\n\t\tif($this->user->option('language') == 0)\n\t\t{\n\t\t\treturn array();\n\t\t}\n $stopword = ORM::factory('Stopword', $this->user->option('language'));\n\t\t$words = explode($stopword->delimiter,$stopword->words);\n\t\treturn $words;\n }", "public function run()\n {\n StopWord::insert([\n [\n 'ugc' => '{MOD}',\n 'find' => '测试'\n ],\n [\n 'ugc' => '{BANNED}',\n 'find' => '代孕'\n ],\n ]);\n }", "function updateWord($word, $count, $category_id) {\r\n\t\tApp::import('Model', 'LilBlogs.NbWordfreq'); $this->NbWordfreq = new NbWordfreq();\r\n\t\t$oldword = $this->getWord($word, $category_id);\r\n\t\tif (0 == $oldword['count']) {\r\n\t\t\t$this->NbWordfreq->create();\r\n\t\t}\r\n\t\treturn $this->NbWordfreq->save(array(\r\n\t\t\t'id' => $this->NbWordfreq->field('id', array('word'=>$word, 'category_id'=>$category_id)),\r\n\t\t\t'word' => $word,\r\n\t\t\t'category_id' => $category_id,\r\n\t\t\t'count' => $count+$oldword['count']\r\n\t\t));\r\n\t}", "function difundir() {\n\n // La funcion obtener_frase esta heredado del pariente Orador\n $frase = $this->obtener_frase();\n\n // Convirtir a mayusculos\n $frase_mayusculas = strtoupper($frase);\n\n echo $frase_mayusculas;\n\n }", "public function testEntireAlphabetWord() : void\n {\n $word = 'abcdefghijklmnopqrstuvwxyz';\n $this->assertEquals(87, score($word));\n }", "public function testMediumValuableWord() : void\n {\n $word = 'quirky';\n $this->assertEquals(22, score($word));\n }", "function DoSwap($word,$num,&$blocks,&$wordlocs)\n{\n\t// Generate a list of the location keys (eg 0,1,2,3,4)\n\t$loclist=array_keys($wordlocs[$word]);\n\t\n\t// Randomise the order (eg 3,1,0,4,2)\n\tshuffle($loclist);\n\t\n\t$swapped=array();\n\tfor ($locidx=0; $locidx<$num; $locidx++)\n\t{\n\t\t$li1=$locidx;\n\t\t$li2=$loclist[$locidx];\n\t\t\n\t\tif ($li1==$li2) continue; // nothing being swapped\n\t\n\t\t// First part of sentence comes from $li1, second from $li2\n\t\t$loc1=$wordlocs[$word][$li1];\n\t\t$loc2=$wordlocs[$word][$li2];\n\n\t\tif (isset($swapped[$li2]) && $swapped[$li2]==$li1) continue; // already swapped these two\n\t\t$swapped[$li1]=$li2;\n\t\t\n\t\t$block_num1=$loc1[0];\n\t\t$snum1=$loc1[1];\n\t\t$wordnum1=$loc1[2];\n\t\t\n\t\t$block_num2=$loc2[0];\n\t\t$snum2=$loc2[1];\n\t\t$wordnum2=$loc2[2];\n\t\t\n\t\tif ($block_num1==$block_num2 && $snum1==$snum2) continue; // no swapping within same sentence\n\t\t\n\t\t$s1=$blocks[$block_num1][$snum1];\n\t\t$s2=$blocks[$block_num2][$snum2];\n\t\t\n\t\t// New s1 is everything up to, but not including wordnum1 from s1 + everything from wordnum2 from s2\n\t\t$ns1=array_merge(array_slice($s1,0,$wordnum1),array_slice($s2,$wordnum2));\n\t\t// Opposite for s2\n\t\t$ns2=array_merge(array_slice($s2,0,$wordnum2),array_slice($s1,$wordnum1));\n\t\t\n\t\t// If there are any indexed words in the second half of each sentence,\n\t\t// they need re-indexing\n\t\t\n\t\t// Second half of s2, which is going to s1\n\t\tfor ($wnum2=$wordnum2; $wnum2<count($s2); $wnum2++)\n\t\t{\n\t\t\t$wordw=$s2[$wnum2];\n\t\t\t$new_wordnum=$wnum2-$wordnum2+$wordnum1;\n\t\t\t// Move to a negative block, to avoid the situation where a word is moved\n\t\t\t// to a sentence which already has the same word in the same location\n\t\t\t// (which always happens for the word being handled, but may happen to others)\n\t\t\tMoveWord($wordw,$wordlocs,$block_num2,$snum2,$wnum2,-$block_num1,$snum1,$new_wordnum);\n\t\t}\n\t\t// Second half of s1, which is going to s2\n\t\tfor ($wnum1=$wordnum1; $wnum1<count($s1); $wnum1++)\n\t\t{\n\t\t\t$wordw=$s1[$wnum1];\n\t\t\t$new_wordnum=$wnum1-$wordnum1+$wordnum2;\n\t\t\tMoveWord($wordw,$wordlocs,$block_num1,$snum1,$wnum1,$block_num2,$snum2,$new_wordnum);\n\t\t}\n\t\t// Fix up words from second half of s2 with negative block numbers\n\t\tfor ($wnum2=$wordnum2; $wnum2<count($s2); $wnum2++)\n\t\t{\n\t\t\t$wordw=$s2[$wnum2];\n\t\t\tFixNegBlock($wordw,$wordlocs);\n\t\t}\n\t\t\n\t\t// Store the updates back\n\t\t$blocks[$block_num1][$snum1]=$ns1;\n\t\t$blocks[$block_num2][$snum2]=$ns2;\n\t}\n}", "public function singularize($word)\n {\n $result = array_search($word, $this->specials, true);\n if ($result !== false) {\n return $result;\n }\n foreach ($this->singulars as $rule => $replacement) {\n if (preg_match($rule, $word)) {\n return preg_replace($rule, $replacement, $word);\n }\n }\n\n return $word;\n }", "public function canSetFulltextIndexed();", "function str_oracion($cadena)\n{\n $palabras = explode('_', $cadena);\n $oracion = '';\n for($i=0; $i < count($palabras) ; $i++){\n if($i == 0){\n $palabras[$i] = ucfirst($palabras[$i]);\n }\n $oracion = $oracion.' '.$palabras[$i];\n }\n return $oracion;\n}", "public static function singularize($word) {\n $original = $word;\n foreach(self::$singular_rules as $rule => $replacement) {\n $word = preg_replace($rule,$replacement,$word);\n if($original != $word) break;\n }\n return $word;\n }", "function darLetras($solucion){ \r\n $azar = rand(0,strlen($solucion)-1);\r\n $dLetra = $solucion[$azar];\r\n $posicionLetra = $azar.strtoupper($dLetra);\r\n return $posicionLetra;\r\n }", "function _vaxia_dice_roller_small_label($string) {\n $small_label = strtolower($string);\n $small_label = substr($small_label, 0, 3);\n if ($small_label == 'ref') {\n $small_label = 'fin';\n }\n return $small_label;\n}", "function threeLetterWord() {\n\t$consonants = array(\"b\", \"c\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \"m\", \"n\", \"p\", \"q\", \"r\", \"s\", \"t\", \"v\", \"w\", \"x\", \"y\", \"z\");\n\t$vowels = array('a', 'e', 'i', 'o', 'u');\n\t$str = $consonants[array_rand($consonants)].$vowels[array_rand($vowels)].$consonants[array_rand($consonants)];\n\t$badWords = array(\"bum\", \"tit\", \"cum\", \"dic\", \"dik\", \"pot\", \"fap\", \"fat\", \"coc\", \"cok\", \"jew\",\n\t \"fuk\", \"fuc\", \"jiz\", \"fag\", \"git\", \"nut\", \"vag\", \"sex\", \"nob\", \"cox\", \"kok\", \"gay\", \"sob\", \"sux\");\n\tif (in_array($str, $badWords)) {\n $str = threeLetterWord();\n\t}\n\treturn $str;\n}", "public function speak($word = '')\n\t{\n\t\tif (empty($word)) {\n\t\t\t$word = 'woof';\n\t\t}\n\t\treturn parent::speak($word);\n\t}", "private function installWords()\n {\n $data = file(__DIR__ . '/../bad_words_pl.txt');\n\n $bom = pack('H*', 'EFBBBF');\n\n $rows = [];\n foreach ($data as $row) {\n $rows[] = [trim(preg_replace(\"/^$bom/\", '', $row))];\n }\n\n Yii::$app\n ->db\n ->createCommand()\n ->batchInsert($this->table, ['word'], $rows)\n ->execute();\n }", "function initialise_censor($bot_id)\n {\n global $con, $dbn; //set in global config file\n $sql = \"SELECT * FROM `$dbn`.`wordcensor` WHERE `bot_exclude` NOT LIKE '%[$bot_id]%'\";\n $result = db_query($sql, $con);\n while ($row = mysql_fetch_assoc($result))\n {\n $index = \"/\\b{$row['word_to_censor']}\\b/i\";\n $index = $row['word_to_censor'];\n $value = $row['replace_with'];\n $_SESSION['pgo_word_censor'][$index] = $value;\n }\n mysql_free_result($result);\n }", "static function segword($str) {\n\t\t$segObj = new Segmentation();\n\t\t$sc = $segObj->_getSegClient();\n $sc->SetLimits(0, 1, 1);\n\t\t$searchRes = $segObj->queryViaValidConnection($str, 'goods_id_dist');\n\t\tif( $searchRes == false ) {\n\t\t\treturn false;\n\t\t}\n\t\t//var_dump($searchRes['words']);\n\t\t//return array_keys( $searchRes['words'] );\n\t\tif (!empty($searchRes['words'])) {\n\t\t\treturn array_keys($searchRes['words']);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t} \n\t}", "static public function getConjugationsSearch($words)\n {\n\t\t$rc = null;\n\n\t\tif (!is_array($words))\n\t\t{\n\t\t\t// make the words array first\n\t\t\t// raw conjugation looks like: |;mato;mata;matas;|mate;mate;matamos;|\n\t\t\t$tenses = [];\n\t\t\t$lines = explode('|', $words);\n\t\t\tforeach($lines as $line)\n\t\t\t{\n\t\t\t\t$parts = explode(';', $line);\n\t\t\t\tif (count($parts) > 0)\n\t\t\t\t{\n\t\t\t\t\tforeach($parts as $part)\n\t\t\t\t\t{\n\t\t\t\t\t\t// fix the reflexives\n\t\t\t\t\t\tif (Tools::startsWithAny($part, ['me ', 'te ', 'se ', 'nos ', 'os ', 'no te ', 'no se ', 'no nos ', 'no os ', 'no se ']))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// chop off the reflexive prefix words, like 'me acuerdo', 'no se acuerden'\n\t\t\t\t\t\t\t$pieces = explode(' ', $part);\n\t\t\t\t\t\t\tif (count($pieces) > 2)\n\t\t\t\t\t\t\t\t$part = $pieces[2];\n\t\t\t\t\t\t\telse if (count($pieces) > 1)\n\t\t\t\t\t\t\t\t$part = $pieces[1];\n\t\t\t\t\t\t\telse if (count($pieces) > 0)\n\t\t\t\t\t\t\t\t$part = $pieces[0];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$tenses[] = $part;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$words = $tenses;\n\t\t}\n\n\t\tif (isset($words) && is_array($words))\n\t\t{\n\t\t\t$unique = [];\n\t\t\tforeach($words as $word)\n\t\t\t{\n\t\t\t\tif (strlen($word) > 0)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($word, $unique))\n\t\t\t\t\t{\n\t\t\t\t\t\t$unique[] = $word;\n\t\t\t\t\t\t$rc .= $word . ';';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$rc = ';' . $rc; // make it mysql searchable for exact match, like: \";voy;vea;veamos;ven;vamos;\n\t\t}\n\n\t\treturn $rc;\n\t}", "public function pluralize($word){\n\t\t$length = i18n::strlen($word);\n\t\t$last = i18n::substr($word, $length-1);\n\t\tif(!in_array($last, $this->_locale->getAllVowels())){\n\t\t\tif($last!='s'&$last!='x'){\n\t\t\t\tswitch($last){\n\t\t\t\t\tcase 'z':\n\t\t\t\t\t\treturn $this->_replaceAccented(i18n::substr($word, 0, $length-1)).'ces';\n\t\t\t\t\tcase 'k':\n\t\t\t\t\tcase 'c':\n\t\t\t\t\t\treturn $this->_replaceAccented(i18n::substr($word, 0, $length-1)).'ques';\n\t\t\t\t\tcase 'g':\n\t\t\t\t\t\treturn $this->_replaceAccented($word).'ues';\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn $this->_replaceAccented($word).'es';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $word;\n\t\t\t}\n\t\t} else {\n\t\t\treturn $word.'s';\n\t\t}\n\t}", "function get_random_word($min_length, $max_length) {\n// and return it\n\n // generate a random word\n $word = '';\n // remember to change this path to suit your system\n $dictionary = '/usr/dict/words'; // the ispell dictionary\n $fp = @fopen($dictionary, 'r');\n if(!$fp) {\n return false;\n }\n $size = filesize($dictionary);\n\n // go to a random location in dictionary\n $rand_location = rand(0, $size);\n fseek($fp, $rand_location);\n\n // get the next whole word of the right length in the file\n while ((strlen($word) < $min_length) || (strlen($word)>$max_length) || (strstr($word, \"'\"))) {\n if (feof($fp)) {\n fseek($fp, 0); // if at end, go to start\n }\n $word = fgets($fp, 80); // skip first word as it could be partial\n $word = fgets($fp, 80); // the potential password\n }\n $word = trim($word); // trim the trailing \\n from fgets\n return $word;\n}", "public function toFemale($word){\n\t\t$words = explode(' ', $word);\n\t\tif(isset($words[0])){\n\t\t\tif(count($words)>1){\n\t\t\t\t$otherWords = ' '.join(' ', array_splice($words, 1));\n\t\t\t} else {\n\t\t\t\t$otherWords = '';\n\t\t\t}\n\t\t\t$vowels = $this->_locale->getAllVowels();\n\t\t\t$length = i18n::strlen($words[0]);\n\t\t\t$last = i18n::substr($words[0], $length-1);\n\t\t\t$penultimate = i18n::substr($words[0], $length-2, 1);\n\t\t\tforeach($this->_locale->getWordRules('male') as $wordEnd){\n\t\t\t\tif(i18n::substr($words[0], $length-i18n::strlen($wordEnd))===$wordEnd){\n\t\t\t\t\tif(in_array($last, $vowels)){\n\t\t\t\t\t\tif($last=='e'){\n\t\t\t\t\t\t\treturn $words[0].$otherWords;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn i18n::substr($words[0], 0, $length-1).'a'.$otherWords;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$penultimate = i18n::substr($words[0], $length-2, 1);\n\t\t\t\t\t\tif(!in_array($penultimate, $vowels)){\n\t\t\t\t\t\t\treturn $words[0].'a'.$otherWords;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn $this->_replaceAccented($words[0]).'a'.$otherWords;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $word;\n\t}", "function find_non_repeat($word) {\n $chr = null;\n for ($n = 0; $n <= strlen($word); $n++) {\n if (substr_count($word, substr($word, $n, 1)) == 1) {\n $char = substr($word, $n, 1);\n return \"La primera letra encontrada que no se repite es \".$char;\n }\n }\n}", "function mots_indexation_ext($texte, $min_long = 3) {\n\tinclude_spip('inc/charsets');\n\tinclude_spip('inc/texte');\n\n\t// Point d'entree pour traiter le texte avant indexation\n\t$texte = pipeline('pre_indexation', $texte);\n\n\t// Recuperer les parametres des modeles\n\t$texte = traiter_modeles($texte, true);\n\t\n\t// Supprimer les tags HTML\n\t$texte = preg_replace(',<.*>,Ums',' ',$texte);\n\n\t// Translitterer (supprimer les accents, recuperer les &eacute; etc)\n\t// la translitteration complexe (vietnamien, allemand) duplique\n\t// le texte, en mettant bout a bout une translitteration simple +\n\t// une translitteration riche\n\tif ($GLOBALS['translitteration_complexe'])\n\t\t$texte_c = ' '.translitteration_complexe ($texte, 'AUTO', true);\n\telse\n\t\t$texte_c = '';\n\t$texte = translitteration($texte);\n\tif($texte!=trim($texte_c)) $texte .= $texte_c;\n\t# NB. tous les caracteres non translitteres sont retournes en utf-8\n\n\t// OPTIONNEL // Gestion du tiret '-' :\n\t// \"vice-president\" => \"vice\"+\"president\"+\"vicepresident\"\n#\t$texte = preg_replace(',(\\w+)-(\\w+),', '\\1 \\2 \\1\\2', $texte);\n\n\t// Supprimer les caracteres de ponctuation, les guillemets...\n\t$e = \"],:;*\\\"!\\r\\n\\t\\\\/)}{[|@<>$%'`?\\~.^(\";\n\t$texte = strtr($texte, $e, ereg_replace('.', ' ', $e));\n\n\t//eliminare +\\- non all'inizio di una parola\n\t$texte = preg_replace(\",(?:\\S)[\\-+],\",\" \",$texte);\n\t// Cas particulier : sigles d'au moins deux lettres\n\t$texte = preg_replace(\"/ ([A-Z][0-9A-Z]{1,\".($min_long - 1).\"}) /\",\n\t\t' \\\\1___ ', $texte.' ');\n\n\t// Tout passer en bas de casse\n\t$texte = strtolower($texte);\n\n\t// Retourner sous forme de table\n\treturn preg_split(\"/ +/\", trim($texte));\n}", "function str_complete_replace($find, $replace, $string)\n{\n\tif (is_array($find))\n\t{\n\t\t$noredo = array(); // array to store which keys don't need re-replacing (used to prevent stupidity with some repeating replacements)\n\t\t$perfect = 0; // the number of finds that need no replacing\n\t\twhile ($perfect < count($find))\n\t\t{\n\t\t\t$perfect = 0;\n\t\t\tfor ($i = 0; $i < count($find); $i++)\n\t\t\t{\n\t\t\t\t$findl = $find[$i];\n\t\t\t\tif ($findl == \"\") { $findl = \" \"; }\n\t\t\t\tif (is_array($replace))\n\t\t\t\t{\n\t\t\t\t\t$replacel = $replace[$i];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$replacel = $replace;\n\t\t\t\t}\n\t\t\t\tif (strpos($string,$findl) !== false)\n\t\t\t\t{\n\t\t\t\t\tif (strpos($replacel,$findl) === false)\n\t\t\t\t\t{\n\t\t\t\t\t\tdo\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$string = str_replace($findl,$replacel,$string);\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (strpos($string,$findl) !== false);\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 ($noredo[$i] != true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$string = str_replace($findl,$replacel,$string);\n\t\t\t\t\t\t\t$noredo[$i] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$perfect++; // The amount of unreplaced finds must go up; otherwise it starts\n\t\t\t\t\t\t\t // an indefinitely loop with the search string\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// No replacing needed, increment the unreplaced finds\n\t\t\t\t\t$perfect++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tif ($find == \"\") { $find = \" \"; }\n\t\tif (strpos($replace,$find) === false)\n\t\t{\n\t\t\techo strpos($string,$findl);\n\t\t\twhile (strpos($string,$find) !== false)\n\t\t\t{\n\t\t\t\t$string = str_replace($find,$replace,$string);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// What it finds is in what it replaces things as; hence, it will create\n\t\t\t// an infinite loop under normal circumstances. Just replace it once to avoid\n\t\t\t// this.\n\t\t\t$string = str_replace($find,$replace,$string);\n\t\t}\n\t}\n\treturn $string;\n}", "function aturan9($word = '')\n {\n if (substr($word, 0, 2) == 'te' and preg_match('/^[aiueo]/', substr($word, 2, 1)) == 0) {\n if (substr($word, 2, 1) != 'r' and substr($word, 3, 2) == 'er' and preg_match('/^[aiueo]/', substr($word, 5, 1)) == 0) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "function get_random_word($min_length, $max_length)\n// grab a random word from dictionary between the two lengths// and return it\n{\n $word = \"\";\n // remember to change this path to suit your system\n $dictionary = '/usr/dict/words';\n // the ispell dictionary\n $fp = @fopen($dictionary, 'r');\n if (!$fp)\n return false;\n $size = filesize($dictionary);\n // go to a random location in dictionary\n srand((float) microtime() * 1000000);\n $rand_location = rand(0, $size);\n fseek($fp, $rand_location);\n // get the next whole word of the right length in the file\n while (strlen($word) < $min_length || strlen($word) > $max_length || strstr($word, \"'\")) {\n if (feof($fp))\n fseek($fp, 0);\n // if at end, go to start\n $word = fgets($fp, 80);\n // skip first word as it could be partial\n $word = fgets($fp, 80);\n // the potential password\n };\n $word = trim($word);\n // trim the trailing \\n from fgets\n return $word;\n}", "function depluralize($word){\n // Add the plural ending as the key and the singular\n // ending as the value for that key. This could be\n // turned into a preg_replace and probably will be\n // eventually, but for now, this is what it is.\n //\n // Note: The first rule has a value of false since\n // we don't want to mess with words that end with\n // double 's'. We normally wouldn't have to create\n // rules for words we don't want to mess with, but\n // the last rule (s) would catch double (ss) words\n // if we didn't stop before it got to that rule.\n $rules = array(\n 'ss' => false,\n 'os' => 'o',\n 'ies' => 'y',\n 'xes' => 'x',\n 'oes' => 'o',\n 'ies' => 'y',\n 'ves' => 'f',\n 'ses' => 's',\n 's' => '');\n // Loop through all the rules and do the replacement.\n foreach(array_keys($rules) as $key){\n // If the end of the word doesn't match the key,\n // it's not a candidate for replacement. Move on\n // to the next plural ending.\n if(substr($word, (strlen($key) * -1)) != $key)\n continue;\n // If the value of the key is false, stop looping\n // and return the original version of the word.\n if($key === false)\n return $word;\n // We've made it this far, so we can do the\n // replacement.\n return substr($word, 0, strlen($word) - strlen($key)) . $rules[$key];\n }\n return $word;\n}", "function stem( $word )\n {\n if ( empty($word) ) {\n return false;\n }\n\n $result = '';\n\n $word = strtolower($word);\n\n // Strip punctuation, etc. Keep ' and . for URLs and contractions.\n if ( substr($word, -2) == \"'s\" ) {\n $word = substr($word, 0, -2);\n }\n $word = preg_replace(\"/[^a-z0-9'.-]/\", '', $word);\n\n $first = '';\n if ( strpos($word, '-') !== false ) {\n //list($first, $word) = explode('-', $word);\n //$first .= '-';\n $first = substr($word, 0, strrpos($word, '-') + 1); // Grabs hyphen too\n $word = substr($word, strrpos($word, '-') + 1);\n }\n if ( strlen($word) > 2 ) {\n $word = $this->_step_1($word);\n $word = $this->_step_2($word);\n $word = $this->_step_3($word);\n $word = $this->_step_4($word);\n $word = $this->_step_5($word);\n }\n\n $result = $first . $word;\n\n return $result;\n }", "public function generateWord()\n {\n $word = '';\n $wordLen = $this->getWordLen();\n $vowels = $this->_useNumbers ? self::$VN : self::$V;\n $consonants = $this->_useNumbers ? self::$CN : self::$C;\n\n $totIndexCon = count($consonants) - 1;\n $totIndexVow = count($vowels) - 1;\n for ($i=0; $i < $wordLen; $i = $i + 2) {\n // generate word with mix of vowels and consonants\n $consonant = $consonants[mt_rand(0, $totIndexCon)];\n $vowel = $vowels[mt_rand(0, $totIndexVow)];\n $word .= $consonant . $vowel;\n }\n\n if (strlen($word) > $wordLen) {\n $word = substr($word, 0, $wordLen);\n }\n\n return $word;\n }" ]
[ "0.643471", "0.6247159", "0.6227434", "0.61774457", "0.61544365", "0.6124186", "0.60231775", "0.59879076", "0.5985807", "0.58367556", "0.56520677", "0.55810475", "0.5469587", "0.53566486", "0.533086", "0.5315547", "0.5313057", "0.53021646", "0.52767545", "0.52670574", "0.52625185", "0.525737", "0.5250531", "0.5245607", "0.52362883", "0.5230196", "0.5218261", "0.52033895", "0.5189977", "0.5180094", "0.5173221", "0.5166703", "0.5138981", "0.513705", "0.51342344", "0.5133927", "0.511918", "0.5095588", "0.5088702", "0.5074133", "0.5068529", "0.5030943", "0.5023625", "0.50226474", "0.50166225", "0.500945", "0.50065976", "0.5004755", "0.49954167", "0.49926183", "0.49861", "0.49829578", "0.49669158", "0.49666926", "0.4955557", "0.49402085", "0.4937574", "0.49369", "0.49349523", "0.4929641", "0.49205354", "0.4910704", "0.49094522", "0.4904088", "0.49028638", "0.4900068", "0.488868", "0.48806787", "0.488055", "0.48772383", "0.4875077", "0.48717588", "0.4867545", "0.48628986", "0.48618588", "0.48614335", "0.4860022", "0.48588997", "0.4854299", "0.48339468", "0.48337758", "0.48268154", "0.4825164", "0.4821421", "0.48184967", "0.48138836", "0.48111457", "0.48097977", "0.48071018", "0.48027116", "0.47976333", "0.47962016", "0.4796173", "0.4787407", "0.477641", "0.4769116", "0.47668403", "0.47620595", "0.47596967", "0.47578698" ]
0.60038966
7
Look for exact exact word in our index
protected function searchForWords() { $result = []; foreach ($this->words as $tokenizedWord) { $tokenizedWordAsObject = (object)$tokenizedWord; $tokenizedWord = $tokenizedWordAsObject->t; if (array_key_exists($tokenizedWord, $this->index)) { foreach ($this->index[$tokenizedWord] as $file) { $key = strval($file->f); if (array_key_exists($key, $result)) { $result[$key]['weight'] *= $file->w * $tokenizedWordAsObject->w; } else { $result[$key] = [ 'file' => $this->files->{$key}, 'weight' => $file->w * $tokenizedWordAsObject->w ]; } } } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function lookupWord($word);", "function strposa($string, $words=array(), $offset=0) {\n $chr = array();\n //check by simlarity\n foreach($words as $word) {\n $res = checkExistanceBySimilarity($string,$word);\n if ($res !== false) $chr[$word] = $res;\n }\n // check exist\n /*foreach($words as $word) {\n $res = strpos($string, $word, $offset);\n if ($res !== false) $chr[$word] = $res;\n }*/\n if(empty($chr)) return false;\n return min($chr);\n}", "function search($word) {\n $node = $this->find($word);\n return $node != null && $node->is_word; // 查找单词比较严格,必须is_word为真\n }", "function findKeyword() {\n \n }", "abstract public function lookupWordRandomly();", "function test_general_entries_search_on_frm_item_metas_single_word() {\n\t\t$form_id = FrmForm::getIdByKey( 'all_field_types' );\n\t\t$where_clause = array( 'it.form_id' => $form_id );\n\n\t\t// Single word is searched, matching entries should be returned\n\t\t$search_string = 'Wahlin';\n\t\t$items = self::run_search_query( $where_clause, $form_id, $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// Single word is searched. Three matching entries should be found.\n\t\t$search_string = 'Ventura';\n\t\t$items = self::run_search_query( $where_clause, $form_id, $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_found_tests( $msg, $items, 3, array( 'steve_entry_key', 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// Single word is searched, no matching entry should be found\n\t\t$search_string = 'StringThatWillNotBeFound';\n\t\t$items = self::run_search_query( $where_clause, $form_id, $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "static public function searchPartial($word)\n {\n\t\t$word = Tools::alpha($word);\n\t\t$records = null;\n\n\t\tif (!isset($word))\n\t\t{\n\t\t\t// show full list\n\t\t\treturn Definition::getIndex();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$records = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', 'LIKE', $word . '%')\t\t\t\t\t\t\t// exact match of title\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%;' . $word . ';%')\t\t\t\t\t// exact match of \";word;\"\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%;' . $word . '%;%') \t// exact match of \";word;\"\n\t\t\t\t\t;})\n\t\t\t\t->orderBy('title')\n\t\t\t\t->get();\n\n\t\t\tif (false && !isset($record)) // not yet\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($records);\n\n\t\treturn $records;\n\t}", "public function canSetFulltextIndexed();", "function simulated_wildcard_match($context, $word, $full_cover = false)\n{\n $rexp = str_replace('%', '.*', str_replace('_', '.', str_replace('\\\\?', '.', str_replace('\\\\*', '.*', preg_quote($word)))));\n if ($full_cover) {\n $rexp = '^' . $rexp . '$';\n }\n\n return preg_match('#' . str_replace('#', '\\#', $rexp) . '#i', $context) != 0;\n}", "public function checkKeyWord(){\n if(trim($this->keyword) == '') return false;\n return 1;\n }", "function test_field_specific_search_on_post_title() {\n\n\t\t// Single word. Two matching entries should be found.\n\t\t$search_string = \"Jamie's\";\n\t\t$field_key = 'yi6yvm';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\n\t\t// Single word. No entries should be found.\n\t\t$search_string = 'TextThatShouldNotBeFound';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, ' ', $term);\n\n $words = explode(' ', $term);\n\n foreach($words as $key => $word){\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if(strlen($word) >= 3) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode( ' ', $words);\n\n return $searchTerm;\n }", "function check($word){\n\t \t$count = count($this->bwl);\n\t\tfor($i = 0;$i < $count;$i++){\n\t\t\tif( strpos($word, $this->bwl[$i]) !== FALSE) return true;\n\t\t}\n\t\treturn false;\n\t}", "function search($word) {\n $cur = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $c = substr($word, $i, 1);\n if (!isset($cur->next[$c])) {\n return false;\n }\n $cur = $cur->next[$c];\n }\n return $cur->$isWord;\n }", "function searchForAny($source,$search)(\n if(strpos($source,$search) !== FALSE){\n return true;\n }", "function like_match($searchParam, $subject) {\n $preg = preg_grep(\"/(.*)\" . strtolower($searchParam) . \"(.*)/\", [strtolower($subject)]);\n if(!empty($preg)){\n return true;\n }\n return false;\n}", "public static function contains($word)\n {\n return '%' . str_replace(' ', '%', $word) . '%';\n }", "private function isIndexable($term)\n {\n return (strlen($term) < 30 && strlen($term) > 2);\n }", "protected function isExist($word)\n {\n return (boolean) preg_match( \"/{$word}/i\", $this->excelRow->model_description);\n }", "function findWord($String){\n\t\tforeach($vertexList as $v){\n\t\t\tif($v->word === $String)\n\t\t\t\treturn $v;\n\t\t}\n\t\treturn NULL;\n\t}", "function word_exists($word)\n {\n $tbl = 'babl_words_' . $this->lan;\n $word = addslashes( ( trim( $word ) ) );\n $query = \"select `word` AS word from `$tbl` where `word`=?\";\n $result = $this->mDb->query($query,array($word));\n return $result->numRows();\n }", "function check_searchword($string){\n\t\t//white list\n\t\tif(\t$GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] !== 'utf-8'){\n\t\t\t$searchword_pattern = utf8_decode('/^[A-Za-z0-9äöüÄÖÜß\\- ]*$/');\n\t\t}else{\n\t\t\t$searchword_pattern = '/^[A-Za-z0-9äöüÄÖÜß\\- ]*$/';\n\t\t}\n\n\t\tif(!preg_match($searchword_pattern, $string)){\n\t\t\t//collect all occurring illegal characters\n\t\t\t#$arr_bad_chars=array();\n\t\t\tforeach (count_chars($string, 1) as $i => $val) {\n\t\t\t\tif(!preg_match($searchword_pattern, chr($i))){\n\t\t\t\t\t#$arr_bad_chars[]=chr($i);\n\t\t\t\t\t$string = str_replace(chr($i),\"\",$string);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $string;\n\t}", "function routeContain($wordForSearch)\n {\n $routeName = Request::route()->getName();\n $contains = Str::contains($routeName, $wordForSearch);\n return $contains;\n }", "public function testShortValuableWord() : void\n {\n $word = 'zoo';\n $this->assertEquals(12, score($word));\n }", "function like($str, $searchTerm)\n {\n $searchTerm = strtolower($searchTerm);\n $str = strtolower($_SESSION['username']);\n $pos = strpos($str, $searchTerm);\n if ($pos === false)\n return false;\n else\n return true;\n }", "protected function fullTextWildcards($term)\n {\n // removing symbols used by MySQL\n $reservedSymbols = ['-', '+', '<', '>', '@', '(', ')', '~'];\n $term = str_replace($reservedSymbols, '', $term);\n\n $words = explode(' ', $term);\n\n foreach ($words as $key => $word) {\n /*\n * applying + operator (required word) only big words\n * because smaller ones are not indexed by mysql\n */\n if (strlen($word) >= 1) {\n $words[$key] = '+' . $word . '*';\n }\n }\n\n $searchTerm = implode(' ', $words);\n\n return $searchTerm;\n }", "static public function search($word)\n {\n\t\t$word = Tools::alphanum($word, /* strict = */ true);\n\t\t$record = null;\n\n\t\ttry\n\t\t{\n\t\t\t$record = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', $word)\t\t\t\t\t\t\t\t\t\t\t// exact match of title\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%;' . $word . ';%')\t\t\t\t\t// exact match of \";word;\"\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%;' . $word . ';%') \t// exact match of \";word;\"\n\t\t\t\t\t;})\n\t\t\t\t->first();\n\n\t\t\tif (!isset($record))\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($record);\n\n\t\treturn $record;\n\t}", "public function testExactMatch()\n {\n $word = $this->randomString(10);\n\n $percent1 = 0;\n $percent2 = 0;\n $percent3 = 0;\n\n //Verify that we produce the same result for an exact match\n //as the core levenshtein function\n $this->assertEquals(\n similar_text($word, $word, $percent1),\n mb_similar_text($word, $word, $percent2)\n );\n\n $this->assertEquals($percent1, $percent2);\n\n //Verify that we produce an exact match result for strings\n //with multibyte characters.\n $this->assertEquals(5, mb_similar_text('nôtre', 'nôtre', $percent3));\n $this->assertEquals(100.0, $percent3);\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}", "private function checkExactMatchIncluded($searchText,$resultText){\n \tif (stripos($resultText, $searchText) === false) return false;\n \treturn true;\n }", "public function search($value, $strict = false);", "function search() {}", "protected function fulltext_index_exists( $table, $column ) {\n\t\t\tglobal $wpdb;\n\t\t\t$query = \"SELECT COUNT(*) FROM information_schema.STATISTICS WHERE TABLE_NAME='{$wpdb->prefix}posts' AND COLUMN_NAME='$column' AND INDEX_TYPE='FULLTEXT';\";\n\t\t\t$indexes = $wpdb->get_var( $wpdb->prepare( $query ) );\n\t\t\tif ( intval( $indexes ) > 1 ) {\n\t\t\t\ttrigger_error( sprintf( __( 'Warning: Multiple fulltext indexes found for %s', 'better-related' ), \"{$wpdb->prefix}$table.$column\" ) );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telseif ( $indexes === '0' )\n\t\t\t\treturn false;\n\t\t\telseif ( $indexes === '1' )\n\t\t\t\treturn true;\n\t\t\ttrigger_error( sprintf( __( 'Warning: Unknown mysql result from %s', 'better-related' ), $query ) );\n\t\t\treturn false;\n\t\t}", "public function StringSearchForAllWords()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_search_string_all_words;\n }", "function smart_search($filename, $search_term) {\n $last = tail($filename, NUM_LINES);\n $line_num = -sizeof($last);\n $match_count = 0;\n foreach($last as $line) {\n if (strstr($line, $search_term)) {\n echo \"Match on line \".$line_num.\": \".$line;\n ++$match_count;\n }\n ++$line_num;\n }\n echo \"Found $match_count \".(($match_count > 1)? \"matches\" : \"match\").\"\\n\";\n}", "function filterMatch($filter,$searchArray) {\n\t$filterwords = explode(\" \",$filter);\n\tforeach ( $filterwords as $testfilter) {\n\t\tforeach ($searchArray as $search) {\n\t\t\tif ( preg_match(\"#$testfilter#i\",str_replace(\" \",\"\",$search)) ) {\n\t\t\t\t$foundword++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn ($foundword == count($filterwords));\n}", "function search($word)\n {\n if (empty($word)) {\n return false;\n }\n $endNode = $this->searchEndNode($word);\n return $endNode !== null && $endNode['is_end'];\n }", "public function searchWord($dataset = array(), $datalatih = array()){\n\n\t$data = array();\n\t$term = array_unique($datalatih);// menghilangkan array yg duplikat\n\n\tfor($i=0; $i<count($dataset); $i++){\n\t\t$key[$i] = 0;\n\t\tforeach($dataset[$i]['stopword'] AS $keys => $value){\n\t\t\t$data[$i][$key[$i]] = array($key[$i] => $value);\n\t\t\t$key[$i] ++;\n\t\t}\n\t}\n\n\tforeach ($term as $keys => $val) {\n\t\tfor($x = 0; $x < count($data); $x++) {\n\t\t\t$sum[$x] = 0;\n\t\t\tfor($y = 0; $y < count($data[$x]); $y++) {\n\t\t\t\tforeach ($data[$x][$y] as $key => $value) {\n\t\t\t\t\tif($val == $value) {\n\t\t\t\t\t\t$nilai = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t \t$nilai = 0; \n\t\t\t\t\t}\n\t\t\t\t\t$sum[$x] += $nilai;\n\t\t\t\t} \n\t\t\t}\n\n\t\t\t$params[$x] = array($val, $sum[$x]);\n\t\t}\n\n\t\t$df[$keys] = $params;\n\n\t}\n\n\treturn $df;\n\n}", "function badwords($str){\r\n\r\n $query = mysql_query(\"SELECT word FROM naughtywords\");\r\n \r\n while ($info = mysql_fetch_array($query)){\r\n if (strstr(strtolower($str), strtolower($info[\"word\"])) == TRUE){\r\n $bad = 1;\r\n }\r\n }\r\n \r\n if ($bad == 1){\r\n return TRUE;\r\n }else{\r\n return FALSE;\r\n } \r\n}", "function simpleSearch($letter){\n\t\n\t\tglobal $sql;\n\n\t\t// Préparation de la requête\n\t\t$teste = $sql->prepare(\"SET NAMES 'utf8'\");\n\t\t$teste ->execute();\n\t\t\n\t\tif($letter == 'others'){\n\t\t\t$result = $sql->prepare(\"SELECT * FROM coogle.movie inner join coogle.region on movie.region_idregion=region.idregion order by coogle.movie.originalTitle desc limit 100\");\t\t\t\n\t\t} elseif($letter == 'num'){\n\t\t\t$result = $sql->prepare(\"SELECT * FROM coogle.movie inner join coogle.region on movie.region_idregion=region.idregion WHERE coogle.movie.enTitle REGEXP '^[0-9]'\");\n\t\t} else {\t\t\n\t\t\t$result = $sql->prepare(\"SELECT * FROM coogle.movie inner join coogle.region on movie.region_idregion=region.idregion where coogle.movie.originalTitle like ('\".$letter.\"%')\") ;\n\t\t}\n\t\t\n\t\t// Envoi de la requête\n\t\t$result->execute();\n\n\t\treturn $result;\t\n\t}", "function check($paragraph, $word)\n{\n if (stripos($paragraph, $word) !== false)\n //if word exists return '1'\n return 1;\n else\n //word doesnt exist - return '0'\n return 0;\n}", "public function getSearchText();", "private function _getSearchStringQuery()\n {\n $words = [];\n //split string depend on quote\n preg_match_all('/\"(?:\\\\\\\\.|[^\\\\\\\\\"])*\"|\\S+/', Input::get('search.value'), $matches);\n if (!empty($matches[0])) {\n //remove quote in each part\n foreach ($matches[0] as $key => $word) {\n $words[$key] = preg_replace('/\"|\\'/', '', $word);\n if (empty($words[$key])) {\n unset($words[$key]);\n }\n }\n //create query with each search column\n foreach ($this->column_search as $item) {\n // create query with each part of search string\n $this->query->where( function($q) use($item, $words) {\n $q->where($item, 'like', '%'.$words[0].'%');\n $wordNumb = count($words);\n for ($i = 1; $i < $wordNumb; $i++) {\n $q->orWhere($item, 'like', '%'.$words[$i].'%');\n }\n });\n }\n }\n // store to hightligh matching word in title of document\n $this->sSearch = $words;\n }", "public function singularize($word)\n {\n $result = array_search($word, $this->specials, true);\n if ($result !== false) {\n return $result;\n }\n foreach ($this->singulars as $rule => $replacement) {\n if (preg_match($rule, $word)) {\n return preg_replace($rule, $replacement, $word);\n }\n }\n\n return $word;\n }", "function acf_str_exists($needle, $haystack)\n{\n}", "public function indexOfByWords($value) {\r\n\t\t$words = $this->readFileByWord ();\r\n\t\t$count = 0;\r\n\t\t$found = false;\r\n\t\tfor($i = 0; $i < $this->wordCount (); $i ++) {\r\n\t\t\t$word = $words [$i];\r\n\t\t\tif (trim ( $value ) == ($word)) {\r\n\t\t\t\t$found = true;\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t$count ++;\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn ($found == true ? $count : - 1);\r\n\t\r\n\t}", "private function wordMatch($words, $input, $sensitivity){ \r\n $shortest = -1; \r\n foreach ($words as $word) { \r\n //verifica a similaridade entre palavras\r\n $lev = levenshtein($input, $word); \r\n if ($lev == 0) { \r\n $closest = $word; \r\n $shortest = 0; \r\n break; \r\n } \r\n if ($lev <= $shortest || $shortest < 0) { \r\n $closest = $word; \r\n $shortest = $lev; \r\n } \r\n } \r\n if($shortest <= $sensitivity){ \r\n return $closest; \r\n } else { \r\n return 0; \r\n } \r\n }", "public function testMediumValuableWord() : void\n {\n $word = 'quirky';\n $this->assertEquals(22, score($word));\n }", "function contains_word($haystack, array $needles)\n {\n foreach($needles as $a) {\n if (stripos($haystack,$a) !== false) return true;\n }\n return false;\n }", "public function checkFulltextSupport();", "public function testLongMixedCaseWord() : void\n {\n $word = 'OxyphenButazone';\n $this->assertEquals(41, score($word));\n }", "public function searchFor($text)\n {\n return true;\n }", "protected function manageWord($word, $index) {\n // normalize\n $word = mb_strtolower($word, $this->encoding);\n \n $termObj = new Term($word);\n\n // save the term\n if(!$this->uniqueMatchesStatus[$word]) {\n $termObj->save();\n $this->uniqueMatchesStatus[$word] = TRUE;\n }\n \n // add to term list\n if ($this->termsList->contains($termObj)) {\n // just add new occurrence\n $this->invertedIndex->addOccurrence($this->invertedIndex->getInvertedIndex($termObj, $this), $index);\n } else {\n $this->termsList->push($termObj);\n\n // save term-doc relation (inverted index) and position of occurrance\n $this->invertedIndex->addRelation($termObj, $this, $index);\n }\n }", "static public function searchGeneral($word)\n {\n\t\t$word = Tools::alpha($word);\n\t\t$records = null;\n\n\t\tif (!isset($word))\n\t\t{\n\t\t\t// show full list\n\t\t\treturn Definition::getIndex();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$records = Definition::select()\n\t\t\t\t->where('deleted_at', null)\n \t\t\t->where('type_flag', DEFTYPE_DICTIONARY)\n\t\t\t\t->where(function ($query) use ($word){$query\n\t\t\t\t\t->where('title', 'LIKE', $word . '%')\n\t\t\t\t\t->orWhere('forms', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t->orWhere('conjugations_search', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t->orWhere('translation_en', 'LIKE', '%' . $word . '%')\n\t\t\t\t\t;})\n\t\t\t\t->orderBy('title')\n\t\t\t\t->get();\n\n\t\t\tif (false && !isset($record)) // not yet\n\t\t\t{\n\t\t\t\t$record = self::searchDeeper($word);\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\t$msg = 'Error getting word: ' . $word;\n\t\t\tEvent::logException(LOG_MODEL, LOG_ACTION_SELECT, $word, null, $msg . ': ' . $e->getMessage());\n\t\t\tTools::flash('danger', $msg);\n\t\t}\n\n\t\t//dd($records);\n\n\t\treturn $records;\n\t}", "private function lookup($word) {\n\n $query = $this->dm->getRepository('\\FYP\\Database\\Documents\\Lexicon');\n $result = $query->findOneBy(array('phrase' => $word));\n if (empty($result)) {\n $result = $query->findOneBy(array('phrase' => strtolower($word)));\n }\n\n if (empty($result)) {\n return self::DEFAULT_TAG;\n } else {\n return $result->getTags()[0];\n }\n\n }", "function _search($field, $key)\n\t{\n\t\tswitch ($field)\n\t\t{\n\t\t\tcase 'name':\n\t\t\t{\n\t\t\t\t$this->db->where('MATCH(tag.name) AGAINST(\\'\"'.$this->db->escape_str($key).'\"\\' IN BOOLEAN MODE)');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "public function actionCheckWords()\n {\n\t\t$strWords = $_GET['q'];\n\t\t$queryResulqt='SELECT words FROM badwords';\n\t\t$wordsValue1 =Yii::app()->db->createCommand($queryResulqt)->queryAll();\n\t\t\n\t\tforeach($wordsValue1 as $value)\n\t\t{\n\t\t\t$words[] = trim($value['words']);\n\n\t\t}\n\t\t\n\t\tif(in_array(trim($strWords), $words))\n\t\t{\n\t\t\techo 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 1;\n\t\t}\n\t }", "public function search();", "public function search();", "public function testStringIsFoundIfCaseSensitive()\n {\n $needle = \"Foo\";\n $haystack = $needle . \" Bar\";\n $this->assertTrue(Strings::contains($haystack, $needle, true));\n }", "protected function matched(): array\n {\n $s = mb_strtolower($this->searchKey);\n $foundRecords = [];\n foreach ($this->source->getRecords() as $index => $word) {\n $found = mb_strpos($s, mb_strtolower($word));\n if (false !== $found) {\n $foundRecords[$index] = intval($found);\n }\n }\n return $foundRecords;\n }", "function containsWord($haystack, $needle) {\n\t\treturn strpos($haystack, $needle) !== false;\n\t}", "function wordExists($word) {\r\n\t\tApp::import('Model', 'LilBlogs.NbWordfreq'); $this->NbWordfreq = new NbWordfreq();\r\n\t\treturn $this->NbWordfreq->find('count', array('conditions' => array('word' => $word)))>0;\r\n\t}", "public function wordFilter($text = '', $exact = TRUE) {\n\t\tif (!isset($this->bad_words)) {\n\t\t\t$this->fetchBadWords();\n\t\t} // end if\n\n\t\tif ($exact === TRUE) {\n\t\t\treturn strtr($text, $this->bad_words);\n\t\t} // end if\n\n reset($this->bad_words);\n while(list($word, $replace) = each($this->bad_words)) {\n $text = mb_ereg_replace('/(^|\\b)' . $word . '(\\b|!|\\?|\\.|,|$)/i', $replace, $text);\n } // end while\n\t\treturn $text;\n\t}", "static function searchCaseInsensitive($query, $column, $searchTerm) {\n $query->orWhere($column['name'], 'ILIKE', '%'.$searchTerm.'%');\n }", "function checkWordsOposite($input, $wanted_words) {\n foreach ($wanted_words as $value) {\n if(strpos($input, $value) !== false){ return true; }\n }\n return false;\n }", "public function testIndexText()\n {\n\n // Add a page with text.\n $page = $this->_simplePage(true);\n $page->text = 'text';\n $page->save();\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Get the name of the `text` Solr key.\n $indexKey = $this->_getAddonKey($page, 'text');\n\n // Should index the text field.\n $this->assertEquals('text', $document->$indexKey);\n\n }", "static function segword($str) {\n\t\t$segObj = new Segmentation();\n\t\t$sc = $segObj->_getSegClient();\n $sc->SetLimits(0, 1, 1);\n\t\t$searchRes = $segObj->queryViaValidConnection($str, 'goods_id_dist');\n\t\tif( $searchRes == false ) {\n\t\t\treturn false;\n\t\t}\n\t\t//var_dump($searchRes['words']);\n\t\t//return array_keys( $searchRes['words'] );\n\t\tif (!empty($searchRes['words'])) {\n\t\t\treturn array_keys($searchRes['words']);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t} \n\t}", "function bb_search_wp($q ) {\r\n\t\r\n\tglobal $wp_posts,$bbdb, $bb;\r\n\t\r\n\tif ($bb->wp_table_prefix)\t$wp_posts = $bbdb->get_results(\"SELECT * FROM \" . $bb->wp_table_prefix . \"posts WHERE (post_title LIKE '%$q%') OR (post_content LIKE '%$q%')\");\r\n\t\t\r\n}", "public function search($str) {\n\t\t//sql\n\t\t$sql = \"SELECT * \";\n\t\t$sql .= \"FROM b_post \";\n\t\t$sql .= \"WHERE b_post.title LIKE CONCAT('%', ?, '%') \";\n\t\t$sql .= \"ORDER BY b_post.post_id \";\n\t\t$stmt = $this->dbManager->prepareQuery ( $sql );\n\t\t$this->dbManager->bindValue ( $stmt, 1, $str, $this->dbManager->STRING_TYPE );\n\t\t$this->dbManager->executeQuery ( $stmt );\n\t\t$rows = $this->dbManager->fetchResults ( $stmt );\n\t\t\n\t\treturn ($rows);\n\t}", "public function searchByWord($word){\n\n try\n {\n $query = \"SELECT * FROM movies \n WHERE movies.title LIKE '%$word%'\";\n\n\n $this->connection = Connection::getInstance();\n\n $result = $this->connection->execute($query);\n \n if($result){\n \n $mapping = $this->map($result); \n\n return $mapping;\n }\n else{\n return null;\n }\n }\n catch(\\PDOException $ex)\n {\n throw $ex;\n }\n }", "public function search(){}", "function matchStrings($userValue, $label)\n{\n// debug(\"matchStrings $label\", $userValue);\n\n if(!strcasecmp($userValue, $label)) return true;\n \n $firstWord = substringBefore($label, \" \");\n return startsWith($userValue, $firstWord);\n}", "public function searchArticle(Request $request){\n// $sqlResult = DB::select('SELECT * FROM articles WHERE title LIKE ?',['%'.$request->input('search_article').'%']);\n $sqlResult = DB::select('SELECT * FROM articles WHERE MATCH(title) AGAINST (?)',[$request->input('search_article')]);\n dd($sqlResult);\n }", "function strposa( $haystack, $needles = array( ), $offset = 0 ) {\n$chr = array( );\nforeach ( $needles as $needle )\n {\n $res = strpos( $haystack, $needle, $offset );\n if ( $res !== false )\n return $needle;\n }\nreturn 'no';\n}", "function test_general_entries_search_on_frm_item_metas_multiple_words() {\n\t\t$form_id = FrmForm::getIdByKey( 'all_field_types' );\n\t\t$where_clause = array( 'it.form_id' => $form_id );\n\n\t\t// Multiple words are searched. Two matching entries should be found.\n\t\t$search_string = 'Wahlin http://www.stephtest.com';\n\t\t$items = self::run_search_query( $where_clause, $form_id, $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_found_tests( $msg, $items, 3, array( 'jamie_entry_key', 'steph_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// Multiple words are searched. One matching entry should be found.\n\t\t$search_string = 'Rebecca Wahlin';\n\t\t$items = self::run_search_query( $where_clause, $form_id, $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// Multiple words are searched. No matching entries should be found.\n\t\t$search_string = 'StringOne StringTwo';\n\t\t$items = self::run_search_query( $where_clause, $form_id, $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entry metas table';\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "function is_keyword($type){\n global $keywords;\n global $token;\n\n foreach ($keywords as $key => $value) { //searching for keyword\n $match_pattern = \"/\\b\" . \"$value\" . \"\\b/i\";\n if(preg_match($match_pattern, strtolower($token->data))){\n $token->type = $type;\n return True;\n }\n }\n return False;\n }", "function search($word)\n {\n $node = $this->root;\n for ($i = 0; $i < strlen($word); $i++) {\n $index = ord($word[$i]) - ord('a');\n if (isset($node->children[$index])) {\n $node = $node->children[$index];\n } else {\n return false;\n }\n }\n return $node->isEnd;\n }", "function strinarray($searchtext, $dataarray)\r\n{\r\n$i=0;\r\nforeach($dataarray as $linedata) {\r\n if(strstr($linedata,$searchtext)) break;\r\n $i++;\r\n };\r\nreturn $i;\r\n}", "private function _match($keyword, $string) {\n\t\t//sanitize\n\t\tforeach (array(' ', '-', '_') AS $key => $val) {\n\t\t\t$keyword = str_replace($val, '', $keyword);\n\t\t\t$string = str_replace($val, '', $string);\n\t\t}\n\t\t\n\t\t$keyword = strtolower($keyword);\n\t\t$string = ' '.strtolower($string);\n\t\tif (!$keyword || !$string) return false;\n\t\t\n\t\tif (strpos($string, $keyword) >= 1) return true;\n\t}", "function seachString($name,$str)\n\t{\n\t\t$result='';\n\t\t$result = strpos($name,$str);\n\t\tif ($result != '') {\n\t\t\techo \"True\";\n\t\t}\n\t\telse{\n\t\t\techo\"Flase\";\n\t\t}\n\n\t}", "function checkWords($input, $unwanted_words) {\n foreach ($unwanted_words as $value) {\n if(strpos($input, $value) !== false){ return false; }\n }\n return true;\n }", "public function anyString() {\n\t\treturn new LikeMatch( '%' );\n\t}", "function sql_search_relative_titles($mastertitle,$field2check) {\n $db = GetGlobal('db');\t\n\t $lan = $lang?$lang:getlocal();\n\t $itmname = $lan?'itmname':'itmfname';\n\t $itmdescr = $lan?'itmdescr':'itmfdescr';\n\t\t$remarks = 'itmremark';\t\n\t\t$sqlout = null;\t\t\n\t\n\t $mt = explode(' ',trim($mastertitle));\n //print_r($mt);\n $sSQL = \"select \".$this->getmapf('code').\" from products where \"; //whole words...\n\t\t \t\t\n\t foreach ($mt as $i=>$lex) {\n\t\t\n\t\t if (($la = trim($lex)) && (strlen($la)>4)) {//words max than 4 chars\n\t\t\n\t\t $ulex = strtoupper($lex);\n\t\t $dlex = strtolower($lex);\n \n\t\t $sqlout[$lex] = \"$itmname like '%$lex%' \";// or $itmdescr like '%$lex%' or $remarks like '%$lex%'\";// or \"; //as is\n\t\t //$sSQL .= \"$itmname like '% $ulex %' or $itmdescr like '% $ulex %' or $remarks like '% $ulex %' or \"; //upper case\t\t\n\t\t //$sSQL .= \"$itmname like '% $dlex %' or $itmdescr like '% $dlex %' or $remarks like '% $dlex %'\"; //lower case\t\t\n\t\t \n\t\t }//if lex\n\t\t} \n\t\t\n //print_r($sqlout); \n\t\tif ($sqlout) {\n\t\t $sSQL .= implode(' or ',$sqlout);\t\t \n\t\t return ($sSQL);\n\t\t}\n\t\telse\n\t\t return null;\n\t}", "function _strDetect ($needles, $offset) {\r\n foreach ($needles as $needle) {\r\n $l = strlen ($needle);\r\n if (substr ($this->_text, $offset, $l) == $needle) {\r\n return $needle;\r\n }\r\n }\r\n return false;\r\n }", "function is_obscene($str)\n{\n $str = strtolower($str);\n $bad_array = [\n 'fuck',\n 'shit',\n 'nigger',\n 'nigga',\n 'whore',\n 'bitch',\n 'slut',\n 'cunt',\n 'cock',\n 'dick',\n 'penis',\n 'damn',\n 'spic'\n ];\n $obsene = false;\n foreach ($bad_array as $bad) {\n if (strpos($str, $bad) !== false) {\n $obsene = true;\n break;\n }\n }\n return $obsene;\n}", "function is_obscene($str)\n{\n $str = strtolower($str);\n $bad_array = [\n 'fuck',\n 'shit',\n 'nigger',\n 'nigga',\n 'whore',\n 'bitch',\n 'slut',\n 'cunt',\n 'cock',\n 'dick',\n 'penis',\n 'damn',\n 'spic'\n ];\n $obsene = false;\n foreach ($bad_array as $bad) {\n if (strpos($str, $bad) !== false) {\n $obsene = true;\n break;\n }\n }\n return $obsene;\n}", "public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }", "public function search($keyword)\n {\n }", "function judge($str) {\r\n\t\tforeach ($this->allergicWord as $key) {\r\n\t\t\tif (is_int(strpos($str, $key))) {\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 test_general_entries_search_on_post_title() {\n\t\t$search_string = \"Jamie's\";\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\t}", "function search()\n\t{}", "function search()\n\t{}", "private function has_spa(){\n // so we search for exact world with regular expression\n // spa or spas (case insensitive)\n $_search = 'spas';\n return preg_match(\"/\\b$_search\\b/i\", $this->m_recreation) == 1;\n }", "private function _highlightMatchingWord($datas)\n {\n $numResult = count($datas);\n for ($i = 0; $i < $numResult; $i++) {\n //store how much word matching\n $match = 0;\n //searching each word in title\n foreach ($this->sSearch as $word) {\n $pos = mb_stripos($datas[$i]->title, $word);\n if (is_numeric($pos) && (strlen($word) > 1)) {\n $word = mb_strtolower($word);\n $datas[$i]->title = mb_strtolower($datas[$i]->title);\n $datas[$i]->title = str_ireplace(\n $word,\n \"<b style='background-color:#ffc107;'>$word</b>\",\n $datas[$i]->title\n );\n $match++;\n }\n }\n //push to each array depend on how much word matching\n if ($match) {\n $part[$match][] = $datas[$i];\n }\n }\n //merge all document ordered by matching number form hight to low\n $wordNumb = count($this->sSearch);\n $partTmp = [];\n for ($j = $wordNumb; $j > 0; $j--) {\n if (isset($part[$j])) {\n foreach ($part[$j] as $value) {\n $partTmp[] = $value;\n }\n }\n }\n // store total of matching title\n $this->count_filtered = count($partTmp);\n // paging by cutting array\n $end = Input::get('start') + Input::get('length');\n $tmp = [];\n for ($i = Input::get('start'); $i < $end; $i++) {\n if (isset($partTmp[$i])) {\n $tmp[] = $partTmp[$i];\n }\n }\n return $tmp;\n }", "function test_field_specific_search_on_dynamic_field_utah() {\n\n\t\t// Single word. One matching entry should be found\n\t\t$search_string = 'Utah';\n\t\t$field_key = 'dynamic-state';\n\t\t$items = self::generate_and_run_field_specific_query( 'all_field_types', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in Dynamic field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'steph_entry_key' ) );\n\n\t}", "public function contains_($searchResult,$request, $string = false,$explode = true)\n {\n\n if($explode)\n {\n $terms = explode(\" \",$request);\n $test = true;\n //print_r($terms);\n\n //check if the header/title of the result contains the keywords of the search query\n foreach ($terms as $term)\n {\n if($test)\n {\n if(!$string)\n {\n if(strpos(strtolower($searchResult->title) ,strtolower($term)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n else\n {\n if(strpos(strtolower($searchResult) ,strtolower($term)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n }\n }\n if(!$string)\n {\n if(!$test)\n {\n //check if the link of the result contains the keywords of the search query\n $test = true;\n foreach ($terms as $term)\n {\n if($test)\n {\n if(strpos(strtolower($searchResult->link) ,strtolower($term)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n }\n if(!$test)\n {\n //check if the body of the result contains the keywords of the search query\n $test = true;\n foreach ($terms as $term)\n {\n if($test)\n {\n // echo strtolower($searchResult->preview);\n if(strpos(strtolower($searchResult->preview) ,strtolower($term)) !== false)\n {\n $test = true;\n // echo \"<br/>\";\n }\n else\n {\n $test = false;\n }\n }\n }\n }\n }\n }\n }\n else{\n if(strpos(strtolower($searchResult) ,strtolower($request)) !== false)\n {\n $test = true;\n }\n else\n {\n $test = false;\n }\n }\n\n\n return $test;\n\n }", "public static function excludefromSearch($string)\r\n {\r\n $exploded= explode(\" \",$string);\r\n\r\n $indice= DiccionarioIndexacion::pivotsForSearch();\r\n // ldd($indice);\r\n $words=DiccionarioIndexacion::excludedWordsForSearch();\r\n foreach ($exploded as $pos=>$value)\r\n {\r\n\r\n $value=lcfirst($value);\r\n if(strlen($value)==0)\r\n continue;\r\n $exploded[$pos]=DiccionarioIndexacion::normalizeString($value);\r\n $val = $value[0];\r\n if (is_numeric($val)) {\r\n // ld($value[0]);\r\n continue;\r\n }\r\n $numericValue = ord($value{0});\r\n $iterator= $numericValue;\r\n if (!isset($indice[$iterator]))\r\n continue;\r\n $end=$indice[$iterator];\r\n if ($iterator==\"97\")\r\n $start=0;\r\n else\r\n {\r\n while (!isset($indice[$iterator-1]))\r\n $iterator--;\r\n $start=$indice[$iterator-1];\r\n }\r\n\r\n // $letter = chr(98);\r\n for ($i=$start;$i<$end;$i++)\r\n {\r\n\r\n if ($value == $words[$i])\r\n {\r\n unset($exploded[$pos]);\r\n }\r\n }\r\n }\r\n return $exploded;\r\n\r\n }", "function test_general_entries_search_on_post_content() {\n\t\t$search_string = 'Different';\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'post-entry-2' ) );\n\t}", "public function search($term = null);", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }" ]
[ "0.63369864", "0.62130415", "0.61996126", "0.6197496", "0.6181371", "0.6107627", "0.6095621", "0.60738146", "0.5880577", "0.5861435", "0.58369577", "0.5780188", "0.5767193", "0.57507014", "0.5737497", "0.5727895", "0.57134825", "0.57112896", "0.57068783", "0.5703456", "0.5695762", "0.56727016", "0.5669925", "0.5668019", "0.56437856", "0.5627969", "0.5620157", "0.5605405", "0.5595039", "0.5580926", "0.55734825", "0.55608416", "0.5553426", "0.5546508", "0.5543308", "0.55222625", "0.5516672", "0.54691815", "0.54663503", "0.5465099", "0.5463457", "0.54613537", "0.54463106", "0.54445916", "0.5438555", "0.54305756", "0.5422552", "0.5420903", "0.5419627", "0.54117525", "0.540958", "0.53989077", "0.5396544", "0.53742725", "0.5369106", "0.5362178", "0.5351852", "0.5351168", "0.5351168", "0.5331824", "0.53281736", "0.5315741", "0.5315016", "0.5314984", "0.5294744", "0.52838767", "0.52669525", "0.526504", "0.52520156", "0.5251484", "0.5250264", "0.5242039", "0.52411056", "0.52355546", "0.52343124", "0.52328557", "0.5227987", "0.522616", "0.5217358", "0.5202124", "0.51993126", "0.5194977", "0.5192074", "0.5183363", "0.51822364", "0.51766974", "0.51766974", "0.51744556", "0.5174344", "0.5173809", "0.51735437", "0.5169765", "0.5169765", "0.5167501", "0.51642", "0.51635516", "0.5154329", "0.51412016", "0.5139328", "0.5130185", "0.51301014" ]
0.0
-1
Member/Volunteer membership number retrieval method
public function myaction() { $this->viewBuilder()->disableAutoLayout(); $this->viewBuilder()->setTemplate('take_action'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMemberInfo() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get the member by the membership number\n $GLOBALS[\"member\"] = $memberModel->getOneByMemberNumber($_SESSION[\"MembershipNumber\"]);\n }", "public function getTotalMemberNo()\n\t{\n\t\t$sql = \"SELECT count(id) AS totalMember FROM member_info\";\n\t\t$query = $this->db->pdo->prepare($sql);\n\t\t$query->execute();\n\t\t$result = $query->fetch(PDO::FETCH_OBJ);\n\t\tif ($result) {\n\t\t\treturn $result->totalMember;\n\t\t}\n\t}", "public function GetNextMemberNumber()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetNextMemberNumber() ?: 0;\n }", "public function getMemberid()\r\n {\r\n return $this->_memberid;\r\n }", "public function create_member_number()\n\t{\n\t\t//select product code\n\t\t$preffix = \"MIoD\";\n\t\t$this->db->from('member');\n\t\t$this->db->where(\"member_number LIKE '\".$preffix.\"%'\");\n\t\t$this->db->select('MAX(member_number) AS number');\n\t\t$query = $this->db->get();//echo $query->num_rows();\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result();\n\t\t\t$number = $result[0]->number;\n\t\t\t$real_number = str_replace($preffix, \"\", $number);\n\t\t\t$real_number++;//go to the next number\n\t\t\t$number = $preffix.sprintf('%03d', $real_number);\n\t\t}\n\t\telse{//start generating receipt numbers\n\t\t\t$number = $preffix.sprintf('%03d', 1);\n\t\t}\n\t\t\n\t\treturn $number;\n\t}", "function getMembershipId() {\r\n\t\t$db = JFactory::getDbo() ;\r\n\t\t$sql = 'SELECT MAX(membership_id) FROM #__osmembership_subscribers';\r\n\t\t$db->setQuery($sql);\r\n\t\t$membershipId = (int) $db->loadResult() ;\r\n\t\tif (!$membershipId) {\r\n\t\t\t$membershipId = (int) OSMembershipHelper::getConfigValue('membership_id_start_number');\r\n\t\t\tif (!$membershipId)\r\n\t\t\t\t$membershipId = 1000 ;\r\n\t\t} else {\r\n\t\t\t$membershipId++ ;\r\n\t\t}\t\r\n\t\t\r\n\t\treturn $membershipId ;\r\n\t}", "function howsu_generate_member_number($user_id)\n{\n\t$member_number = get_user_meta($user_id, \"member_number\", true);\n\n\t//if no member number, create one\n\tif(empty($member_number))\n\t{\n\t\tglobal $wpdb;\n\n\t\tif ( class_exists( 'e20rTextitIntegration' ) ) {\n\t\t\t$class = e20rTextitIntegration::get_instance();\n\t\t\t$user_data = $class->getUserRecord( $user_id );\n\t\t\t$member_number = isset( $user_data->service_number ) && !empty( $user_data->service_number ) ? $user_data->service_number : null;\n\t\t}\n\n\t\t//this code generates a string 10 characters long of numbers and letters\n\t\twhile(empty($member_number))\n\t\t{\n\t\t\t$scramble = md5(AUTH_KEY . current_time('timestamp') . $user_id . SECURE_AUTH_KEY);\n\t\t\t$member_number = substr($scramble, 0, 10);\n\t\t\t$check = $wpdb->get_var(\n\t\t\t\t$wpdb->prepare( \"SELECT meta_value FROM {$wpdb->usermeta} WHERE meta_value = %s LIMIT 1\", $member_number )\n\t\t\t);\n\n\t\t\tif($check || is_numeric($member_number)) {\n\t\t\t\t$member_number = null;\n\t\t\t}\n\t\t}\n\n\t\t//save to user meta\n\t\tupdate_user_meta($user_id, \"member_number\", $member_number);\n\n\t}\n\n\treturn $member_number;\n}", "public function getMemberCnt()\n {\n return $this->get(self::_MEMBER_CNT);\n }", "public function getTheLastSevenDigitsOfThisMemberMembershipNumber($member_id){\n \n $model = new Members;\n \n return $model->getTheLastFourDigitsOfThisMemberMembershipNumber($member_id);\n \n }", "public function getThisMemberCityNumber($member_id){\n \n $model = new Members;\n \n return $model->getThisMemberCityNumber($member_id);\n \n }", "public function getMemberCode()\n {\n return $this->memberCode;\n }", "function getUserNbParticipation(){\n try{\n $bdd = dbConnect();\n $stmt = $bdd->prepare(\"SELECT COUNT(*) FROM project_member WHERE user_id=:id\");\n $stmt->execute(array(\n 'id' => $_SESSION['id']\n ));\n $result = $stmt->fetch(PDO::FETCH_NUM);\n return $result;\n }\n catch(PDOException $e){\n echo \"<br>\" . $e->getMessage();\n }\n }", "function pull_member_cnt() {\n $query = $this->db->get('members_tbl');\n return $query->num_rows();\n }", "function getSumNumberMember($node){\n\t\t$result = 0;\n\t\treturn $result;\t\n\t}", "public function get_next_member($member)\n {\n $tempid = $this->connection->query_value_if_there('SELECT uid FROM ' . $this->connection->get_table_prefix() . 'users WHERE uid>' . strval($member) . ' ORDER BY uid');\n return $tempid;\n }", "public function getMember()\n {\n return $this->member;\n }", "public function getMemberCount()\n {\n return $this->get('members');\n }", "function getNumberOfMembers(){\n\t\t$number = 0;\n\t\tforeach ($this->members as $obj){\n\t\t\t$number++;\n\t\t}\n\t\treturn $number;\n\t}", "function getNumMembers(){\r\n if($this->num_members < 0){\r\n $q = \"SELECT * FROM \".TBL_USERS;\r\n $result = mysql_query($q, $this->connection);\r\n $this->num_members = mysql_numrows($result);\r\n }\r\n return $this->num_members;\r\n }", "function getNumMembers(){\r\n if($this->num_members < 0){\r\n $q = \"SELECT * FROM \".TBL_USERS;\r\n $result = mysql_query($q, $this->connection);\r\n $this->num_members = mysql_numrows($result);\r\n }\r\n return $this->num_members;\r\n }", "function get_member( $member )\n {\n // TODO Determine role.is_admin in a better way\n\n $get_member_query = <<<SQL\n select m.first_name,\n m.last_name,\n m.gatech_email_address,\n m.display_email_address,\n to_char( m.paid_dues_date, 'MM/DD/YYYY' ) as paid_dues_date,\n to_char( m.paid_locker_date, 'MM/DD/YYYY' ) as paid_locker_date,\n to_char( m.paid_practice_date, 'MM/DD/YYYY' ) as paid_practice_date,\n to_char(\n m.paid_locker_date + ( m.locker_months * interval '1 month' ),\n 'MM/DD/YYYY'\n ) as locker_end_date,\n m.locker_number,\n m.profile_photo_path,\n m.personal_website,\n m.is_available_for_collaboration,\n m.biography,\n m.first_name || ' ' || m.last_name as name,\n r.is_admin\n from tb_member m\n join tb_member_role mr\n on m.member = mr.member\n join tb_role r\n on mr.role = r.role\n where m.member = ?member?\norder by r.rank\n limit 1\nSQL;\n\n $params = [ 'member' => $member ];\n $result = query_execute( $get_member_query, $params );\n\n return query_success( $result ) ? query_fetch_one( $result ) : false;\n }", "protected function MEMBER_getLastMember()\n\t{\n\t\t$query = $this->db->select(\n\t\t\t\tself::MEMBER_TABLE,\n\t\t\t\t'collab_member_id',\n\t\t\t\t'',\n\t\t\t\t__LINE__,\n\t\t\t\t__FILE__,\n\t\t\t\tfalse,\n\t\t\t\t\"ORDER BY `collab_member_id` DESC LIMIT 1;\"\n\t\t);\n\t\t$last_row = $query->fetchRow();\n\t\treturn is_array($last_row)? $last_row['collab_member_id']: 0;\n\t}", "function getNumMembers(){\r\n if($this->num_members < 0){\r\n $result = $this->connection->query(\"SELECT username FROM \".TBL_USERS);\r\n $this->num_members = $result->rowCount(); \r\n }\r\n return $this->num_members;\r\n }", "public function _getStudentNumber()\n {\n $user = \"\";\n if ($this->has('user'))\n $user = $this->user;\n else\n $user = TableRegistry::get('Users')->get($this->user_id);\n\n return substr($user->login, 2);\n }", "public function getMember()\n\t{\n\t\treturn $this->memberID ? Member::getMember($this->memberID) : NULL;\n\t}", "public function getMemberId()\n {\n return $this->member_id;\n }", "public function getMemberId()\n {\n return $this->member_id;\n }", "public function getMemberId()\n {\n return $this->member_id;\n }", "public function getMemberId()\n {\n return $this->member_id;\n }", "public function getMemberId()\n {\n return $this->member_id;\n }", "public function getMemberId()\n {\n return $this->member_id;\n }", "public function getMemberId()\n {\n return $this->member_id;\n }", "function getVotingMember() {\n\t\treturn Member::get()->byID($this->MemberID);\n\t}", "public function getMemberId()\n {\n return $this->memberId;\n }", "public function getMemberId()\n {\n return $this->memberId;\n }", "function &_getMember($mid){\n\t\tif (!isset($this->memberdata[$mid])) {\n\t\t\t$this->memberdata[$mid]=mysql_fetch_assoc($res=sql_query('SELECT * FROM '.sql_table('member').' WHERE mnumber='.(int)$mid.' LIMIT 1'));\n\t\t\tmysql_free_result($res);\n\t\t}\n\t\treturn $this->memberdata[$mid];\n\t}", "public function get_member()\n {\n //get cookie information if available\n $cookie_raw_info = (array_key_exists(get_member_cookie(), $_COOKIE)) ? $_COOKIE[get_member_cookie()] : '';\n\n $cookie_info = array();\n $cookie_info = explode('_', $cookie_raw_info);\n $cookie_member = (array_key_exists(0, $cookie_info)) ? $cookie_info[0] : '';\n $cookie_loginkey = (array_key_exists(1, $cookie_info)) ? $cookie_info[1] : '';\n\n if ($cookie_member != '') {\n $row = $this->get_member_row(intval($cookie_member));\n //is the cookie info correct\n if ($cookie_loginkey == $row['loginkey']) {\n //if it is correct then return the cookie member\n return $cookie_member;\n } else {\n //return the default guest ID, because the login key is not correct\n return $this->get_guest_id();\n }\n } else {\n //return the default guest ID, because there is no member cookie information\n return $this->get_guest_id();\n }\n }", "function getNumMembers(){\n\t\tif($this->num_members < 0){\n\t\t\t$q = \"SELECT * FROM \".TBL_USERS;\n\t\t\t$result = mysql_query($q, $this->connection);\n\t\t\t$this->num_members = mysql_numrows($result);\n\t\t}\n\t\treturn $this->num_members;\n\t}", "function Member() {\n \t\t$member = null;\n\t\tif(is_numeric($this->urlParams['ID'])) {\n\t\t\t$member = DataObject::get_by_id('Member', $this->urlParams['ID']);\n\t\t} else {\n\t\t\t$member = Member::currentUser();\n\t\t}\n\n\t\treturn $member;\n\t}", "public function getMemberUpdate() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n $Membership_number = filter_input(INPUT_POST, \"Membership_number\");\n\n // Get the member by the membership number\n $member = $memberModel->getOneByMemberNumber($Membership_number);\n\n $data = array(\"member\" => $member);\n return $this->render(\"updateMember\", $data);\n }", "function get_number($course)\n{\n return $course->number;\n}", "public function getMemberId($userid)\n {\n $member_id = DB::table('user')\n ->join('member', 'user.member_id', '=', 'member.id')\n ->select('member.id')\n ->where('user.id', $userid)\n ->first(); \n\n //return memberid\n return $member_id->id;\n }", "public function memberIdCheck ()\r\n {\r\n $member_id = $this->getMember_id(true);\r\n return $this->getMapper()->memberIdCheck($member_id);\r\n }", "protected function _getLoggedInMemberId() {\n\t\tController::loadModel('Member');\n\t\treturn $this->Member->getIdForMember($this->Auth->user());\n\t}", "public function get_members()\n {\n return $this->connection->query_select_value('users', 'COUNT(*)') - 1;\n }", "function getMember()\n {\n $member = $_SESSION['active_user'];\n $conn = db_connect();\n $query = \"SELECT u.fName, u.lName, u.userEmail, SUM(logD.distance) AS totalDistance, COUNT(DISTINCT log.logID) AS totalWorkouts FROM tblUsers AS u, tblWorkoutLog AS log, tblWorkoutLogDetails AS logD WHERE u.userID = log.userID AND log.logID = logD.logID AND u.userID = \".$member.\" GROUP BY u.fName, u.lName, u.userEmail;\";\n \n $data = mysqli_query($conn, $query);\n $num_rows = mysqli_num_rows($data);\n \n $item = mysqli_fetch_array($data, MYSQLI_ASSOC);\n db_disconnect($conn);\n return $item; \n }", "function ObtenerNumeroPStudent($numeroPS)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT personal_number FROM students WHERE id_student = %s \",\n\t\t GetSQLValueString($numeroPS, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"personal_number\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function getMember()\n {\n if (array_key_exists('member', $this->_params)) {\n return $this->_params['member'];\n } else {\n return null;\n }\n }", "function member_id_from_username($username){\n $memberID=\"\";\n $username = trim($username);\n $con=mysqli_connect(DB_SERVER,DBASE_USER,DBASE_PASS,DBASE_NAME);\n $sql=\"SELECT * FROM member WHERE username= '$username'\";\n $results = mysqli_query($con,$sql); \n while($row = mysqli_fetch_assoc($results)) {\n $memberID = $row['member_id'];\n }\n return $memberID;\n \n}", "function getMember($member_id)\r\n {\r\n //gives access to the variable in index\r\n //global $dbh;\r\n\r\n //1. Define the query\r\n $sql = \"SELECT * FROM Members WHERE member_id =:member_id\";\r\n\r\n //2. Prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n //3. Bind parameters\r\n $statement->bindParam(':member_id', $member_id, PDO::PARAM_STR);\r\n\r\n //4.Execute statement\r\n $statement->execute();\r\n\r\n //5. Return the results\r\n $result = $statement->fetch();\r\n //print_r($result);\r\n\r\n return $result;\r\n }", "private function get_pinn_number() {\r\n\t\treturn $this->pinn_number; \r\n\t}", "function _gen_uniquememberid()\r\n\t{\r\n\t\t$lastmem_id = $this->_get_config_param('LAST_MEMBERID_ALLOTED');\r\n\t\t$member_id = $lastmem_id+1;\r\n\t\t$this->_set_config_param('LAST_MEMBERID_ALLOTED',$member_id);\r\n\t\t// check if member id is already alloted \r\n\t\tif($this->db->query(\"select count(*) as t from pnh_member_info where pnh_member_id = ? \",$member_id)->row()->t)\r\n\t\t\treturn $this->_gen_uniquememberid();\r\n\t\telse\r\n\t\t\treturn $member_id;\r\n\t}", "public function getUserNumber() {\n $this->rnd_users_number = $this->recordNumber(self::RNDUSERSC_NAME);\n return $this->rnd_users_number;\n }", "public function membershipNumberLookupAction(Request $request)\n {\n $em = $this->get('doctrine')->getManager();\n\n $form = $this->createMembershipNumberLookupForm();\n $form->handleRequest($request);\n\n $results = null;\n\n if ($form->isSubmitted() && $form->isValid()) {\n $data = $form->getData();\n\n $results = $em->getRepository('AppBundle:Person')->findMembersByEmailAndDob($data['email'], $data['dob']);\n /*if (!$results) {\n throw $this->createNotFoundException('No such user');\n }*/\n\n if (sizeof($results) == 0) {\n $this->addFlash('warning', 'Sorry, we couldn\\'t find a member with the details supplied.');\n }\n }\n\n\n return $this->render(\n 'login/lookupMembershipNumber.html.twig',\n [\n 'form' => $form->createView(),\n 'results' => $results\n ]\n );\n }", "function getMember($member_id)\r\n {\r\n $sql = \"SELECT * \r\n FROM member, member_interest\r\n WHERE member.member_id = member_interest.member_id\r\n AND member_id = :member_id\";\r\n\r\n //2. Prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n //3. Bind the parameter\r\n $statement->bindParam(':member_id', $member_id);\r\n //4. Execute the statement\r\n $statement->execute();\r\n\r\n //5. Get the result\r\n $result = $statement->fetch(PDO::FETCH_ASSOC);\r\n return $result;\r\n }", "public function getMemberIDFromToken($memberToken) {\n $conditions = array();\n $conditions['token'] = $memberToken;\n\n $dbResult = $this->select(\"members\", array('id'), $conditions);\n $result = -1;\n if (count($dbResult) > 0) {\n $result = $dbResult[0]['id'];\n }\n return $result;\n }", "public function getMemberId()\n {\n return $this->member->getId();\n }", "function getProfileInfo($member)\n\t\t{\n\t\n\t\t $query = \"SELECT * FROM tbl_member WHERE `user_name` = '\".$member.\"'\";\n\t\t $rs\t\t=\t$this->Execute($query);\n\t\t return $this->_getPageArray($rs, 'Subscriber');\n\t\t}", "public function getSoMemberByMemberNr($memberNr){\r\n\t\treturn $this->_backend->getSoMemberByNumber($memberNr, 'member_nr');\r\n\t}", "public static function getmemberData()\n {\n\n $get=DB::table('users')->where('user_type','=','vendor')->where('drop_status','=','no')->orderBy('id', 'desc')->get();\n\t$value = $get->count(); \n return $value;\n\t\n }", "public static function getMemberIdByName($member_name){\n\t\t\n\t\tglobal $db; \n\t\t\n\t\t//set query\n\t\t$query_text = \"SELECT member_id FROM login WHERE member_name = :member_name\";\n\t\t\t\t\n\t\ttry {\n\t\t\t//prepare query\n\t\t\t$query_statement = $db->prepare($query_text);\n\t\t\t//bind\n\t\t\t$query_statement->bindValue(':member_name', $member_name); \n\t\t\t//execute query\n\t\t\t$query_statement->execute();\n\t\t\t//fetch results\n\t\t\t$result = $query_statement->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\t\n\t\tcatch (PDOException $ex) {\n\t\t\t$error_message = $ex->getMessage();\n\t\t\t$result = array('error_message' => $error_message);\n\t\t\treturn $result;\n\t\t} \n\t\t\n\t\treturn $result; \n\t}", "public function getTeamMemberId(): string\n {\n return $this->teamMemberId;\n }", "public function getMember()\n {\n return $this->match;\n }", "public function getPersonn()\n {\n return $this->_personn;\n }", "public function getPersonalNo(): ?int {\n return $this->personalNo;\n }", "public function getPothinvcnbr()\n {\n return $this->pothinvcnbr;\n }", "public function getUserNumber(): ?int {\n return $this->userNumber;\n }", "public function getMembership()\n {\n return Member::getByID($this->site_members_id);\n }", "public function getMember()\n {\n return $this->member ?: Member::currentUser();\n }", "function getMember($member_id)\r\n {\r\n $sql = \"SELECT * FROM member WHERE member_id = $member_id\";\r\n // prepare statement\r\n $statement = $this->_dbh->prepare($sql);\r\n // bind parameters\r\n $statement->bindParam(':member_id', $member_id);\r\n // execute statement\r\n $statement->execute();\r\n return $statement->fetch();\r\n }", "public function getMemberCount() {\r\n if(is_null($this->cached_member_count )) {\r\n $this->reloadMemberCount();\r\n }\r\n return $this->cached_member_count;\r\n }", "function getNum()\n {\n return $this->num;\n }", "public function getUNPNumber()\n {\n return $this->unp_number;\n }", "function member_username($data)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT username FROM gv_members WHERE member_id = ' . $data;\r\n\t\t$result = mysql_query($query, $db) or die(mysql_error($db));\r\n\t\t$row = mysql_fetch_assoc($result);\r\n\t\textract($row);\r\n\t\treturn ucfirst($username);\r\n\t}", "public function memberId()\n {\n return $this->belongsTo(User::class, 'member_id');\n }", "function countMembers() {\n\t\t$result = $this->MySQL->query(\"SELECT * FROM \".$this->MySQL->get_tablePrefix().\"members WHERE \".$this->strTableKey.\" = '\".$this->intTableKeyValue.\"'\");\n\t\t$num_rows = $result->num_rows;\n\t\t\n\t\t\n\t\treturn $num_rows;\n\t}", "public function getOneMemberUpdate() {\n\n // Get the member by the membership number\n $this->getMemberInfo();\n return $this->render(\"updateInformation\");\n }", "public function get_guest_id($mobile_number) { \n $map_guest_query = $this->find('first', array(\n 'conditions' => array(\n 'mobile_number' => $mobile_number,\n 'activated'=>1,\n 'guest_flag'=>1,\n 'deleted_flag'=>0,\n ),\n 'fields' => array('id'),\n )\n ); \n $member_guest_id=$map_guest_query['GenieGuest']['id'];\n return $member_guest_id;\n}", "public function getMemberId()\n {\n return $this->iMemberDatabaseId;\n }", "public function get_previous_member($member)\n {\n $tempid = $this->connection->query_value_if_there('SELECT uid FROM ' . $this->connection->get_table_prefix() . 'users WHERE uid<' . strval($member) . ' AND uid>0 ORDER BY uid DESC');\n return $tempid;\n }", "public function invoiceNumberGet(){\n\t\t$query = $this->db->get(__TBL_INVOICE_NUMBER);\n\t\tif(sizeof($query->row())>0) {\n\t\t\treturn (int)$query->row()->number;\n\t\t} else return false;\n\t}", "public function get_number()\n\t{\n\t\treturn $this->number;\n\t}", "function getTotalMembers() {\n if(\n is_object(\n $oStmt = DB::$PDO->query(\n 'SELECT\n COUNT(1)\n FROM\n users'\n )\n )\n &&\n is_array(\n $aTotalMems = $oStmt->fetch(PDO::FETCH_NUM)\n )\n ){\n return $aTotalMems[0];\n } return 0;\n}", "function getRegistrationTypeMembership($typeId) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT membership FROM registration_types WHERE type_id = ?', $typeId\n\t\t);\n\n\t\t$returner = isset($result->fields[0]) ? $result->fields[0] : 0;\n\n\t\t$result->Close();\n\t\tunset($result);\n\n\t\treturn $returner;\n\t}", "public function getNumber() {}", "public function getNumber();", "public function getStaffNumber()\n {\n return $this->StaffNumber;\n }", "function get_member_name($member_id ='') {\n\t\t $member_name = '';\n\t\t $this->db->select('name');\n\t\t $this->db->from('users');\n\t\t echo $this->db->where('users_id', $member_id);\n\t\t $query = $this->db->get();\n\t\t if($query->num_rows() > 0) {\n\t\t \t$member_name = $query->row()->name;\n\t\t \treturn $member_name;\n\t\t } \n\t\t //log_message('debug',print_r($query,TRUE));\n\t\t return $member_name;\n\t}", "public static function getMemberId($first,$last){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT id\n FROM member\n WHERE first_name = :first\n\t\t\tAND last_name = :last\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":first\", $first);\n $stmt->bindValue(\":last\", $last);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }\n\t}", "public function getRegistration_no()\n {\n return $this->registration_no;\n }", "public abstract function getObjectMemberId(object $oRow):string;", "public function getBillableMemberCount();", "function get_num_students($classid){\r\n\t\r\n}", "public function getMemberByBookNo($bookNo){\n\t\t$sql = \"SELECT * FROM book WHERE book_no = :bookNo\";\n\t\t$query = $this->db->pdo->prepare($sql);\n\t\t$query->bindValue(':bookNo', $bookNo);\n\t\t$query->execute();\n\t\t$result = $query->fetch(PDO::FETCH_OBJ);\n\t\t$member_id = $result->member_id;\n\t\t$member = $this->getMemberData($member_id);\n\t\treturn $member;\n\t}", "function getMember($member_id)\n {\n $sql = \"SELECT * FROM member WHERE member_id = :member_id\";\n\n // prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n // bind the parameters\n $statement->bindParam(':member_id', $member_id);\n\n // execute statement\n $statement->execute();\n\n return $statement->fetch();\n }", "public function getNum()\n {\n return $this->num;\n }", "public function getNum()\n {\n return $this->num;\n }", "function getProjectNumber($facultyId){\n\t\t$query = $this->db->where('faculty_id',$facultyId)\n\t\t\t\t\t\t\t->get('projects');\n\t\treturn $query->num_rows();\n\t}", "function getMembersCount(){\n $this->db->select('*');\n $this->db->from('users'); \n $query = $this->db->get();\n\n return $query->num_rows();\n }", "public function getNumber()\n {\n return $this->number;\n }", "public function viewMember($memberid)\n {\n if($memberid == \"\"){\n return false;\n }\n else{\n \n $sql = \"SELECT * FROM churchmembers WHERE memberID='\".db::escapechars($memberid).\"'\";\n $result = db::returnrow($sql);\n \n return $result;\n }\n \n \n }" ]
[ "0.6867492", "0.6695405", "0.64711136", "0.64017874", "0.63812137", "0.63737786", "0.6300274", "0.6293497", "0.62851024", "0.6279738", "0.6233364", "0.61578727", "0.6136937", "0.6102325", "0.6046405", "0.5986256", "0.59737307", "0.594728", "0.59347445", "0.59347445", "0.5919643", "0.5918838", "0.5917258", "0.5914301", "0.5908765", "0.59069216", "0.59069216", "0.59069216", "0.59069216", "0.59069216", "0.59069216", "0.59069216", "0.59062195", "0.5874121", "0.5874121", "0.5859579", "0.5841315", "0.5839008", "0.583044", "0.58114076", "0.58006024", "0.5759908", "0.5758995", "0.57400537", "0.5738641", "0.57205105", "0.5708488", "0.5695003", "0.5694041", "0.5660461", "0.564926", "0.5625306", "0.56007785", "0.5598762", "0.5587487", "0.55781716", "0.557452", "0.55619043", "0.554401", "0.5538881", "0.55239475", "0.55121", "0.54977417", "0.549544", "0.54953194", "0.5493059", "0.5491742", "0.5486224", "0.54818463", "0.5478773", "0.54781693", "0.54691344", "0.5443168", "0.5432234", "0.54243195", "0.54181546", "0.54008657", "0.5398537", "0.5393396", "0.53730196", "0.53660786", "0.5362448", "0.5361929", "0.5359929", "0.5348812", "0.5347268", "0.53423285", "0.53365743", "0.53254867", "0.5320721", "0.5319306", "0.53173804", "0.53173316", "0.5303546", "0.52972454", "0.5291498", "0.5291498", "0.52692044", "0.52613616", "0.5249521", "0.5246692" ]
0.0
-1
Member/Volunteer membership card retrieval method
public function myMembershipCard() { $this->viewBuilder()->disableAutoLayout(); $this->viewBuilder()->setTemplate('membership_card'); if ($this->getRequest()->is(['patch', 'post', 'put'])) { $data = $this->getRequest()->getData(); if (false === $this->Users->validateIdNumber($data['id_number'])) { $this->Flash->error(__('Invalid ID number. Please, try again.')); return; } $data['phone'] = trim($data['phone']); $data['phone'] = preg_replace('/\D/', '', $data['phone']); $user = $this->Users->find('all', [ 'contain' => [], 'fields' => ['id', 'first_name', 'last_name', 'membership_number', 'created_at', 'user_status'], 'conditions' => [ 'Users.id_number' => $data['id_number'], 'Users.membership_number' => $data['membership_number'], 'Users.phone' => $data['phone'], ], 'limit' => 1 ]); if (1 === $user->count()){ $user = $user->first(); if (1 & $user->user_status){ $this->set(compact('user')); $this->viewBuilder()->setTemplate('my_membership_card'); return; } $this->Flash->error(__('Your membership is currently not active. You cannot access the card.')); return; } $this->Flash->error(__('Invalid membership credentials. Please, try again or email [email protected] for support.')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_card(){ return $this->_card;}", "public function getAllMemberCards()\n {\n \n $query = \"SELECT MID, LoyaltyCardNumber FROM transactionsummary ORDER BY LoyaltyCardNumber ASC\";\n \n return parent::RunQuery($query);\n }", "public function getMemberInfo() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get the member by the membership number\n $GLOBALS[\"member\"] = $memberModel->getOneByMemberNumber($_SESSION[\"MembershipNumber\"]);\n }", "public function getCard() {\n return $this->card;\n }", "public function MemberCardAction($member_id)\n {\n \t$repository_member= $this->getDoctrine()->getRepository('KmcAdminBundle:Member');\n \t$member = $repository_member->find($member_id);\n \t\n \treturn $this->render('KmcAdminBundle:Admin:MemberCard.html.twig',array('member'=>$member));\n }", "public function getCard()\n {\n return $this->card;\n }", "public function getCard(): bool {\n $result = $this->mysqli->query(\"SELECT * FROM cards WHERE id='{$this->id}'\");\n if($result->num_rows == 1) { # Card exists in database\n $card = $result->fetch_assoc();\n $this->cardNum = $card['card_num'];\n $this->name = $card['name'];\n $this->billingAddress = $card['billing_address'];\n $this->exp = $card['exp'];\n $this->securityCode = $card['security_code'];\n return true;\n } else { # Card doesn't exist yet\n return false;\n }\n }", "function card_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}", "function searchIS4C($member) {\n\n\tglobal $dbConn2;\n\n\t$is4cMembers = array();\n\t$sel = \"SELECT CardNo, personNum, FirstName, LastName FROM custdata where CardNo = ${member};\";\n\t$rslt = $dbConn2->query(\"$sel\");\n\tif ( $dbConn2->errno ) {\n\t\t$msg = sprintf(\"Error: DQL failed: %s\\n\", $dbConn2->error);\n\t\t$is4cMembers[] = array($msg);\n\t\treturn($is4cMembers);\n\t}\n\t// What is $rslt if 0 rows? Does it exist?\n\t//$n = 0;\n\twhile ( $row = $dbConn2->fetch_row($rslt) ) {\n\t\t//$n++;\n\t\t$is4cMembers[] = array($row[CardNo], $row[personNum], $row[FirstName], $row[LastName]);\n\t}\n\treturn($is4cMembers);\n\n// searchIS4C\n}", "function op_api_member($member)\n{\n if (!$member)\n {\n return null;\n }\n\n $viewMemberId = sfContext::getInstance()->getUser()->getMemberId();\n\n $memberImageFileName = $member->getImageFileName();\n if (!$memberImageFileName)\n {\n $memberImage = op_image_path('no_image.gif', true);\n }\n else\n {\n $memberImage = sf_image_path($memberImageFileName, array('size' => '48x48'), true);\n }\n\n $relation = null;\n if ((string)$viewMemberId !== (string)$member->getId())\n {\n $relation = Doctrine::getTable('MemberRelationship')->retrieveByFromAndTo($viewMemberId, $member->getId());\n }\n\n $selfIntroduction = $member->getProfile('op_preset_self_introduction', true);\n\n return array(\n 'id' => $member->getId(),\n 'profile_image' => $memberImage,\n 'screen_name' => $member->getConfig('op_screen_name', $member->getName()),\n 'name' => $member->getName(),\n 'profile_url' => op_api_member_profile_url($member->getId()),\n 'friend' => $relation ? $relation->isFriend() : false,\n 'blocking' => $relation ? $relation->isAccessBlocked() : false,\n 'self' => $viewMemberId === $member->getId(),\n 'friends_count' => $member->countFriends(),\n 'self_introduction' => $selfIntroduction ? (string)$selfIntroduction : null,\n );\n}", "public function cardList()\n {\n // $pageIndex = 0;\n // $pageSize = 20;\n $pageIndex = I('get.pageIndex');\n $pageSize = I('get.pageSize');\n $where = I('get.where');\n $orderBy = I('get.orderBy');\n\n $where = htmlspecialchars_decode($where);\n\n $data = array(\n \"userAccount\" => self::USERACCOUNT,\n \"pageIndex\" => $pageIndex,\n \"pageSize\" => $pageSize,\n \"where\" => $where,\n \"orderBy\" => $orderBy,\n );\n $response_data = $this->client->CallHttpPost(\"Get_MembersPagedV2\", $data);\n $this->ajaxReturn($response_data);\n }", "public function getCardholder()\n {\n return $this->cardholder;\n }", "public function billing_card_info_details() {\n\n $option = [\n 'projection' => [\n '_id' => 1,\n 'cardnumber' => 1,\n 'cvv' => 1,\n 'expiry_month' => 1,\n 'expiry_year' => 1,\n 'firstname' => 1,\n 'lastname' => 1,\n 'email'=>1,\n 'customer_id'=>1,\n 'address' => 1,\n 'city' => 1,\n 'state' => 1,\n 'country' => 1,\n 'postal_code' => 1,\n 'subscription_id'=>1,\n 'customer_id'=>1\n ]\n ];\n $result = $this->mongo_db->find(MDB_BILLING_REG_INFO, array('_id' => 1), $option);\n return (!empty($result)) ? $result : '';\n }", "function get_member( $member )\n {\n // TODO Determine role.is_admin in a better way\n\n $get_member_query = <<<SQL\n select m.first_name,\n m.last_name,\n m.gatech_email_address,\n m.display_email_address,\n to_char( m.paid_dues_date, 'MM/DD/YYYY' ) as paid_dues_date,\n to_char( m.paid_locker_date, 'MM/DD/YYYY' ) as paid_locker_date,\n to_char( m.paid_practice_date, 'MM/DD/YYYY' ) as paid_practice_date,\n to_char(\n m.paid_locker_date + ( m.locker_months * interval '1 month' ),\n 'MM/DD/YYYY'\n ) as locker_end_date,\n m.locker_number,\n m.profile_photo_path,\n m.personal_website,\n m.is_available_for_collaboration,\n m.biography,\n m.first_name || ' ' || m.last_name as name,\n r.is_admin\n from tb_member m\n join tb_member_role mr\n on m.member = mr.member\n join tb_role r\n on mr.role = r.role\n where m.member = ?member?\norder by r.rank\n limit 1\nSQL;\n\n $params = [ 'member' => $member ];\n $result = query_execute( $get_member_query, $params );\n\n return query_success( $result ) ? query_fetch_one( $result ) : false;\n }", "public function membersCard()\n {\n return $this->belongsToMany('App\\Models\\User', 'card_user', 'cards_id', 'users_id');\n }", "function &_getMember($mid){\n\t\tif (!isset($this->memberdata[$mid])) {\n\t\t\t$this->memberdata[$mid]=mysql_fetch_assoc($res=sql_query('SELECT * FROM '.sql_table('member').' WHERE mnumber='.(int)$mid.' LIMIT 1'));\n\t\t\tmysql_free_result($res);\n\t\t}\n\t\treturn $this->memberdata[$mid];\n\t}", "function getChamberSpecificDetail($memberID, $dataID, $column, $table) {\r\n $queryString = \"SELECT $table.answer FROM $table JOIN BUSINESS ON $table.BUSINESSID=BUSINESS.businessID JOIN USER ON USER.businessID=BUSINESS.businessID WHERE USER.UserID='$memberID' AND $table.DataID=$dataID\";\r\n $sql = $this->db->prepare($queryString);\r\n if ($sql->execute()) {\r\n return $sql->fetch();\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\n }", "function get_credit_card_info($user_id)\r\r\n {\r\r\n $CI =& get_instance();\r\r\n $CI->load->library(\"session\");\r\r\n\t\t$CI->load->model('user_model');\r\r\n $user_type_query = array(\r\r\n 'select' => array('credit_card_info.*'),\r\r\n 'where' => array('credit_card_info.user_id' => $user_id),\r\r\n ); \r\r\n $credit_card_info = $CI->user_model->get_rows($user_type_query,'credit_card_info');\r\r\n return $credit_card_info;\r\r\n }", "function CardInfo(){\r\n }", "public function getStoredCardData() {\n\t $tokenId = (int) $this->getInfoInstance()->getAdditionalInformation('token_id');\n\t \n\t if($tokenId && ($tokenId > 0)){\n\t return Mage::getModel('hostedpayments/storedcard')->load($tokenId);\n\t }\n\t \n\t return false;\n\t}", "public function getCard(): ?string\n {\n return $this->card;\n }", "final public static function awaitingForCustomerCardDetails()\n {\n return self::get(820);\n }", "public function getMember(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->email = $row['email'];\n $this->username = $row['username'];\n }", "public function card();", "function get_card_info($file){\n $template_data = get_file_data( $file , array( 'Card' => 'Card' ) );\n if (!empty($template_data['Card'])) {\n return $template_data['Card'];\n }\n }", "function fyxt_getCharCardData ( $charID ) {\n\tif ( !empty( $charID ) ){\n\t\tglobal $wpdb;\n\t\t$charCardInfoSQL = \"\n\t\tSelect\n\t\t fyxt_character_cards.*\n\t\tFrom\n\t\t fyxt_character_cards\n\t\tWhere\n\t\t fyxt_character_cards.fyxt_cc_charID = $charID\"; \n\t\t$charCardInfoResults = $wpdb->get_row( $charCardInfoSQL );\n\t\treturn $charCardInfoResults;\n\t} else {\n\t\treturn;\n\t}\n}", "function getCardDetail()\n {\n $disabled = array();\n $required = array();\n \n if ($this->vars[\"card_id\"]) {\n $action = 2; // modify\n // find all the disabled fields for current action\n foreach ($this->fieldData[\"detailview\"] as $dkey => $dval) {\n if (in_array($action, $dval[\"disabled\"])) {\n $disabled[] = $dkey;\n }\n }\n // find all the required fields for current action\n foreach ($this->fieldData[\"detailview\"] as $rkey => $rval) {\n if (in_array($action, $rval[\"required\"])) {\n $required[] = $rkey;\n }\n }\n\n $res =& $this->db->query(\"SELECT * FROM `module_isic_card` WHERE `id` = !\", $this->vars[\"card_id\"]);\n $result = array();\n if ($data = $res->fetch_assoc()) {\n $t_pic = str_replace(\"_thumb.jpg\", \".jpg\", $data[\"pic\"]);\n if (file_exists(SITE_PATH . $t_pic)) {\n $data[\"pic\"] = $t_pic;\n } else {\n $data[\"pic\"] = \"\";\n }\n $data[\"person_birthday\"] = date(\"d/m/Y\", strtotime($data[\"person_birthday\"]));\n $data[\"expiration_date\"] = date(\"d/m/Y\", strtotime($data[\"expiration_date\"]));\n $data[\"status_id\"] = $data[\"status_id\"] ? $data[\"status_id\"] : '';\n $data[\"bank_id\"] = $data[\"bank_id\"] ? $data[\"bank_id\"] : '';\n $result[] = $data;\n echo JsonEncoder::encode(array('success' => true, 'data' => $result, 'disable' => $disabled, 'require' => $required));\n } else {\n echo JsonEncoder::encode(array('error' => 'cold not load data'));\n }\n } else {\n $action = 1; // add\n // find all the disabled fields for current action\n foreach ($this->fieldData[\"detailview\"] as $dkey => $dval) {\n if (in_array($action, $dval[\"disabled\"])) {\n $disabled[] = $dkey;\n }\n }\n // find all the required fields for current action\n foreach ($this->fieldData[\"detailview\"] as $rkey => $rval) {\n if (in_array($action, $rval[\"required\"])) {\n $required[] = $rkey;\n }\n }\n $result[] = array(\"pic\" => \"\");\n echo JsonEncoder::encode(array('success' => true, 'data' => $result, 'disable' => $disabled, 'require' => $required));\n }\n exit();\n }", "function getChamberMembers($chamberID) {\r\n $sql = $this->db->prepare(\"SELECT UserID, firstname, lastname, email, businessname, expiry, archived, type\r\n FROM USER LEFT OUTER JOIN BUSINESS ON USER.businessID=BUSINESS.businessID WHERE USER.chamberID=:chamber_id\r\n ORDER BY lastname;\");\r\n if ($sql->execute(array(\r\n 'chamber_id' => $chamberID,\r\n ))) {\r\n return $sql->fetchall(PDO::FETCH_ASSOC);\r\n }\r\n return $chamberID;\r\n }", "function getCardList(){\n global $con;\n\n $PersonId = getPersonId();\n // return mysql object\n $query = \"SELECT CardId, CreditCard, CreditExpDate\n FROM CreditCard WHERE PersonId=$PersonId\";\n\n $obj = mysqli_query($con, $query);\n\n return $obj;\n}", "public function user_card()\n {\n return $this -> belongsTo( UserCard :: class ); \n }", "function flashcard_get_participants($flashcardid) {\n global $DB;\n\n $sql = \"\n SELECT DISTINCT\n userid,\n userid\n FROM\n {flashcard_card}\n WHERE\n flashcardid = ?\n \";\n $userids = $DB->get_records_sql_menu($sql, array('flashcardid' => $flashcardid));\n if ($userids) {\n $users = $DB->get_records_list('user', 'id', array_keys($userids));\n }\n\n if (!empty($users)) {\n return $users;\n }\n\n return false;\n}", "public function inCard()\n {\n return $this->inCard;\n }", "public function inCard()\n {\n return $this->inCard;\n }", "public function creditCardProvider()\n\t{\n\t\treturn [\n\t\t\t'null_test' => [\n\t\t\t\t'amex',\n\t\t\t\tnull,\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'random_test' => [\n\t\t\t\t'amex',\n\t\t\t\t$this->generateCardNum('37', 16),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'invalid_type' => [\n\t\t\t\t'shorty',\n\t\t\t\t'1111 1111 1111 1111',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'invalid_length' => [\n\t\t\t\t'amex',\n\t\t\t\t'',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'not_numeric' => [\n\t\t\t\t'amex',\n\t\t\t\t'abcd efgh ijkl mnop',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'bad_length' => [\n\t\t\t\t'amex',\n\t\t\t\t'3782 8224 6310 0051',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'bad_prefix' => [\n\t\t\t\t'amex',\n\t\t\t\t'3582 8224 6310 0051',\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'amex1' => [\n\t\t\t\t'amex',\n\t\t\t\t'3782 8224 6310 005',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'amex2' => [\n\t\t\t\t'amex',\n\t\t\t\t'3714 4963 5398 431',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub1' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t'3056 9309 0259 04',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersculb2' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t'3852 0000 0232 37',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover1' => [\n\t\t\t\t'discover',\n\t\t\t\t'6011 1111 1111 1117',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover2' => [\n\t\t\t\t'discover',\n\t\t\t\t'6011 0009 9013 9424',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb1' => [\n\t\t\t\t'jcb',\n\t\t\t\t'3530 1113 3330 0000',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb2' => [\n\t\t\t\t'jcb',\n\t\t\t\t'3566 0020 2036 0505',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard1' => [\n\t\t\t\t'mastercard',\n\t\t\t\t'5555 5555 5555 4444',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard2' => [\n\t\t\t\t'mastercard',\n\t\t\t\t'5105 1051 0510 5100',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa1' => [\n\t\t\t\t'visa',\n\t\t\t\t'4111 1111 1111 1111',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa2' => [\n\t\t\t\t'visa',\n\t\t\t\t'4012 8888 8888 1881',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa3' => [\n\t\t\t\t'visa',\n\t\t\t\t'4222 2222 2222 2',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort1' => [\n\t\t\t\t'dankort',\n\t\t\t\t'5019 7170 1010 3742',\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay1' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay2' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 17),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay3' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay4' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(62, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'unionpay5' => [\n\t\t\t\t'unionpay',\n\t\t\t\t$this->generateCardNum(63, 19),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'carteblanche1' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(300, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche2' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(301, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche3' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(302, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche4' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(303, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche5' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(304, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche6' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(305, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'carteblanche7' => [\n\t\t\t\t'carteblanche',\n\t\t\t\t$this->generateCardNum(306, 14),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t\t'dinersclub3' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(300, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub4' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(301, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub5' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(302, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub6' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(303, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub7' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(304, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub8' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(305, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub9' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(309, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub10' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(36, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub11' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(38, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub12' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(39, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub13' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(54, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub14' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(55, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub15' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(300, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub16' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(301, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub17' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(302, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub18' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(303, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub19' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(304, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub20' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(305, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub21' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(309, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub22' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(36, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub23' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(38, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub24' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(39, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub25' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(54, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dinersclub26' => [\n\t\t\t\t'dinersclub',\n\t\t\t\t$this->generateCardNum(55, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover3' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(6011, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover4' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(622, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover5' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(644, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover6' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(645, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover7' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(656, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover8' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(647, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover9' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(648, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover10' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(649, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover11' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(65, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover12' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(6011, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover13' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(622, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover14' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(644, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover15' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(645, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover16' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(656, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover17' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(647, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover18' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(648, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover19' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(649, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'discover20' => [\n\t\t\t\t'discover',\n\t\t\t\t$this->generateCardNum(65, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment1' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment2' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 17),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment3' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'interpayment4' => [\n\t\t\t\t'interpayment',\n\t\t\t\t$this->generateCardNum(4, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb1' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(352, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb2' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(353, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb3' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(354, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb4' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(355, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb5' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(356, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb6' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(357, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'jcb7' => [\n\t\t\t\t'jcb',\n\t\t\t\t$this->generateCardNum(358, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro1' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro2' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro3' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro4' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro5' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro6' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro7' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro8' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro9' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro10' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro11' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro12' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro13' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro14' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro15' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 12),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro16' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro17' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro18' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro19' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro20' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro21' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro22' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro23' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro24' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro25' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro26' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro27' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro28' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro29' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro30' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro31' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro32' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro33' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro34' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro35' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro36' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro37' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro38' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro39' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro40' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro41' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro42' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro43' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro44' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro45' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 14),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro46' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro47' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro48' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro49' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro50' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro51' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro52' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro53' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro54' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro55' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro56' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro57' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro58' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro59' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro60' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro61' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro62' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro63' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro64' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro65' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro66' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro67' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro68' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro69' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro70' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro71' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro72' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro73' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro74' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro75' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro91' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro92' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro93' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro94' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro95' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro96' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro97' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro98' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro99' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro100' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro101' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro102' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro103' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro104' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro105' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 18),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro106' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(50, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro107' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(56, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro108' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(57, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro109' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(58, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro110' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(59, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro111' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(60, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro112' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(61, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro113' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(62, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro114' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(63, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro115' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(64, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro116' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(65, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro117' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(66, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro118' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(67, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro119' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(68, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'maestro120' => [\n\t\t\t\t'maestro',\n\t\t\t\t$this->generateCardNum(69, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort1' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(5019, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort2' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(4175, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort3' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(4571, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'dankort4' => [\n\t\t\t\t'dankort',\n\t\t\t\t$this->generateCardNum(4, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir1' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2200, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir2' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2201, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir3' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2202, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir4' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2203, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mir5' => [\n\t\t\t\t'mir',\n\t\t\t\t$this->generateCardNum(2204, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard1' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(51, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard2' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(52, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard3' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(53, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard4' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(54, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard5' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(55, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard6' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(22, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard7' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(23, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard8' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(24, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard9' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(25, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard10' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(26, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'mastercard11' => [\n\t\t\t\t'mastercard',\n\t\t\t\t$this->generateCardNum(27, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa1' => [\n\t\t\t\t'visa',\n\t\t\t\t$this->generateCardNum(4, 13),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa2' => [\n\t\t\t\t'visa',\n\t\t\t\t$this->generateCardNum(4, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'visa3' => [\n\t\t\t\t'visa',\n\t\t\t\t$this->generateCardNum(4, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'uatp' => [\n\t\t\t\t'uatp',\n\t\t\t\t$this->generateCardNum(1, 15),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve1' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(506, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve2' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(650, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve3' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(506, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'verve4' => [\n\t\t\t\t'verve',\n\t\t\t\t$this->generateCardNum(650, 19),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'cibc1' => [\n\t\t\t\t'cibc',\n\t\t\t\t$this->generateCardNum(4506, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'rbc1' => [\n\t\t\t\t'rbc',\n\t\t\t\t$this->generateCardNum(45, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'tdtrust' => [\n\t\t\t\t'tdtrust',\n\t\t\t\t$this->generateCardNum(589297, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'scotia1' => [\n\t\t\t\t'scotia',\n\t\t\t\t$this->generateCardNum(4536, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'bmoabm1' => [\n\t\t\t\t'bmoabm',\n\t\t\t\t$this->generateCardNum(500, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'hsbc' => [\n\t\t\t\t'hsbc',\n\t\t\t\t$this->generateCardNum(56, 16),\n\t\t\t\ttrue,\n\t\t\t],\n\t\t\t'hsbc' => [\n\t\t\t\t'hsbc',\n\t\t\t\t$this->generateCardNum(57, 16),\n\t\t\t\tfalse,\n\t\t\t],\n\t\t];\n\t}", "public function getCard(): Model\\CardSetting\n {\n return $this->card;\n }", "protected function getCardData()\n {\n $this->getCard()->validate();\n\n $card = array();\n $card['name'] = $this->getCard()->getName();\n $card['number'] = $this->getCard()->getNumber();\n $card['expiry_month'] = $this->getCard()->getExpiryDate('m');\n $card['expiry_year'] = $this->getCard()->getExpiryDate('y');\n $card['cvd'] = $this->getCard()->getCvv();\n\n return $card;\n }", "public function getCard()\n {\n return $this->vaultHelper->getQuoteCard($this->getSubscription()->getQuote());\n }", "function getMember($member_id)\r\n {\r\n $sql = \"SELECT * \r\n FROM member, member_interest\r\n WHERE member.member_id = member_interest.member_id\r\n AND member_id = :member_id\";\r\n\r\n //2. Prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n //3. Bind the parameter\r\n $statement->bindParam(':member_id', $member_id);\r\n //4. Execute the statement\r\n $statement->execute();\r\n\r\n //5. Get the result\r\n $result = $statement->fetch(PDO::FETCH_ASSOC);\r\n return $result;\r\n }", "public function get_profile($uid){\r\n $query = \"SELECT members.mem_id, users.uid\r\n FROM members\r\n INNER JOIN users ON members.fk_users_id = users.uid\r\n WHERE uid = $uid\";\r\n \r\n $result = $this->db->query($query) or die($this->db->error); \r\n $user_data = $result->fetch_array(MYSQLI_ASSOC);\r\n \r\n }", "public function getIdCard()\n {\n return $this->id_card;\n }", "public function get_provider_based_card_list($token) {\n\n return $this->db->get_where('stripe_provider_card_details', array('status' => 1, 'user_token' => $token))->result_array();\n }", "static function toMembership($obj) {\n $obj = json_decode($obj, true);\n $membership = [];\n if ($obj) {\n\n // The field ptype can get a different value that the one set on the Membership module,\n // ie: in Alma alumininew is commu.\n // the same goes with ID (external_id)\n // so to avoid any overwriting in the Membership app\n // (which could potentially break the integration),\n // Im not bring these fields back\n\n $fields = [\n \"uid\" => \"primary_id\",\n// \"id\" => \"external_id\",\n \"atype\" => \"user_group\",\n \"userPassword\" => \"password\",\n \"title\" => \"user_title\",\n \"name\" => \"full_name\",\n \"firstName\" => \"first_name\",\n \"sn\" => \"last_name\",\n \"dateOfBirth\" => \"birth_date\",\n \"expiresOn\" => \"expiry_date\",\n \"url\" => \"web_site_url\"\n ];\n foreach($fields as $dynamo => $alma) {\n $value = self::getField($obj, $alma);\n if ($value) {\n $membership[$dynamo] = $value;\n }\n }\n\n // Dates\n $dates = [\n \"dateOfBirth\" => \"birth_date\",\n \"expiresOn\" => \"expiry_date\"\n ];\n foreach($dates as $dynamo => $alma) {\n $value = self::fixMembershipDate(self::getField($obj, $alma));\n if ($value) {\n $membership[$dynamo] = $value;\n }\n }\n\n $barcode = self::getAlmaBarCode($obj);\n if ($barcode) {\n $membership['barcode'] = $barcode;\n }\n\n $status = self::getAlmaStatus($obj);\n if ($status) {\n $membership['status'] = $status;\n }\n\n if (isset($obj['user_note']) and $obj['user_note']) {\n $ptype = self::getAlmaPtype($obj['user_note']);\n if ($ptype) {\n $membership['ptype'] = $ptype;\n }\n $mtype = self::getAlmaMembershipPtype($obj['user_note']);\n if ($mtype) {\n $membership['type'] = $mtype;\n }\n $payment = self::popAlmaMembershipPayment($obj['user_note']);\n if ($payment) {\n $membership = array_merge($membership, $payment);\n }\n }\n\n if (isset($obj[\"user_statistic\"]) and $obj[\"user_statistic\"] and isset($obj[\"user_statistic\"][0])) {\n $value = self::getField($obj[\"user_statistic\"][0], \"statistic_category\");\n if ($value) {\n $membership[\"statClass\"] = $value;\n }\n }\n\n if (isset($obj['contact_info']) and $obj['contact_info']) {\n if (isset($membership['atype']) and isset($obj['contact_info']['address']) and $obj['contact_info']['address']) {\n $addresses = self::popAlmaAddresses($membership['atype'], $obj['contact_info']['address']);\n if ($addresses) {\n $membership = array_merge($membership, $addresses);\n }\n }\n if (isset($obj['contact_info']['email']) and $obj['contact_info']['email']) {\n $email = self::popAlmaEmails($obj['contact_info']['email']);\n if ($email) {\n $membership = array_merge($membership, $email);\n }\n }\n if (isset($obj['contact_info']['phone']) and $obj['contact_info']['phone']) {\n $phone = self::popAlmaPhones($obj['contact_info']['phone']);\n if ($phone) {\n $membership = array_merge($membership, $phone);\n }\n }\n }\n }\n\n return $membership;\n }", "function InfGetCreditCard($inf_contact_id, $inf_card_id) {\n\t$object_type = \"CreditCard\";\n\t$class_name = \"Infusionsoft_\" . $object_type;\n\t$object = new $class_name();\n\t$object->removeRestrictedFields(); // Remove CreditCard and CVV\n\t$objects = Infusionsoft_DataService::query(new $class_name(), array('Id' => $inf_card_id, 'ContactId' => $inf_contact_id, 'Status' => 3));\n\n $cards_array = array();\n foreach ($objects as $i => $object) {\n $cards_array = $object->toArray();\n }\n\treturn $cards_array; // Should only be one card\n}", "public function get()\n {\n // Siapkan sintak untuk query satu member\n $sql = \"SELECT * FROM member WHERE id = $this->id\";\n // Jalankan query\n $res = mysqli_query($this->db, $sql);\n // Return data yang sudah di fetch\n return mysqli_fetch_assoc($res);\n }", "private function printMemberInHtml($member) {\r\n\t\t//print_r($member);\r\n\t\t$surname = $member['surname'];\r\n\t\t$other_name = $member['other_name'];\r\n\t\t$contact_method = $member['contact_method'];\r\n\t\t$email = $member['email'];\r\n\t\t$mobile = $member['mobile'];\r\n\t\t$landline = $member['landline'];\r\n\t\t$magazine = $member['magazine'];\r\n\t\t$street = $member['street'];\r\n\t\t$suburb = $member['suburb'];\r\n\t\t$postcode = $member['postcode'];\r\n\t\t$password = $member['password'];\r\n\t\t$occupation = $member['occupation'];\r\n\t\t$member_id = $member['member_id'];\r\n\t\t//\r\n\t\t$checked = ''; //check the movie checkbox if the member is previously selected\r\n\t\tif (!empty($_SESSION['checked_members'])) {\r\n\t\t\t$checked_members = $_SESSION['checked_members'];\r\n\t\t\tif (isset($checked_members[$member_id]))\r\n\t\t\t$checked = 'checked';\r\n\t\t}\r\n\t\tprint \"\r\n\t\t<div class='member_card'>\r\n\t\t<div class='surname'>\r\n\t\t$surname\r\n\t\t<input type='submit' value='Edit' onclick='editMemberClick($member_id);'>\r\n\t\t<input type='submit' value='Delete' onclick='deleteMemberClick($member_id);'>\r\n\t\t<input type='checkbox' id='id_check' value='$member_id' onclick='memberCheckClick(this);' $checked>\r\n\t\t</div>\r\n\t\t<div class='content'>\r\n\t\t<b>Other_name: \\$$other_name</b><br>\r\n\t\tContact_method: $contact_method<br>\r\n\t\tEmail: $email<br>\r\n\t\tLandline: $landline<br>\r\n\t\tMagazine: $magazine<br>\r\n\t\tStreet: $street<br>\r\n\t\tSuburb: $suburb<br>\r\n\t\tPostcode: $postcode<br>\r\n\t\tPassword: $password<br>\r\n\t\tOccupation: $occupation<br>\r\n\t\t</div>\r\n\t\t</div>\r\n\t\t\";\r\n\t}", "public function getCards();", "public function postGetmembership(Request $request)\n\t{\n\t\t$headers = $request->header();\n\n\t\t$estat=0;\n\n\t\tif(!isset($headers['access-token']))\n\t\t{\n\t\t\t\t$data['status'] = 0;\n\t\t\t\t$data['msg'] = 'No Access Token Sent';\n\t\t\t\t$estat=1;\n\t\t\t\t\n\t\t}\n\t\tif($estat==0)\n\t\t{\n\t\t\t$access_token = $headers['access-token'][0];\n\t\t\t$tokenStatus = $this->checktoken($access_token);\n\t\t\t$status = $tokenStatus['status'];\n\t\t\t$input = $request->all();\n\t\t\tif($status == 1)\n\t\t\t{\n\n\t\t\t\t$customer_id = $tokenStatus['customer_id'];\n\t\t\t\t\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$customer = Customers::find($customer_id);\n\t\t\t\t\t$customerDetail = $customer->toArray();\n\t\t\t\t}\n\t\t\t\tcatch(exception $e)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = 0;\n\t\t\t\t\t$data['msg'] = $e->getMessage();\n\t\t\t\t\t$estat=1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($estat==0)\n\t\t\t\t{\n\t\t\t\t\t$current_membership_details = Memberships::where('id',$customerDetail['memberships_id'])->get()->toArray();\n\n\t\t\t\t\t$duration_of_current_membership = $current_membership_details[0]['duration']; \n\n\t\t\t\t\t$data['status'] = 1;\n\t\t\t\t\t$data['msg'] = 'Memebership successfully fetched';\n\n\t\t\t\t\t$data['current_membership_id']=$customerDetail['memberships_id'];\n\t\t\t\t\t$data['current_status'] = $customerDetail['status'];\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t}\n\t\t\telse if($status == 0)\n\t\t\t{\n\t\t\t\t$data['status'] = 0;\n\t\t\t\t$data['msg'] = 'Invalid Token.';\n\t\t\t}\n\t\t}\n\t\t\n\t\techo json_encode($data);\n\t\t\n\t}", "function getProfileInfo($member)\n\t\t{\n\t\n\t\t $query = \"SELECT * FROM tbl_member WHERE `user_name` = '\".$member.\"'\";\n\t\t $rs\t\t=\t$this->Execute($query);\n\t\t return $this->_getPageArray($rs, 'Subscriber');\n\t\t}", "public function getMember()\n\t{\n\t\treturn $this->memberID ? Member::getMember($this->memberID) : NULL;\n\t}", "public function getCidCard()\n {\n return $this->cid_card;\n }", "private function showPremiumMembers() {\n $query = \"SELECT DISTINCT u.id, n.nhc_pin, u.user_login, um1.meta_value AS first_name, um2.meta_value AS last_name, u.user_email\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um ON um.user_id = u.id AND um.meta_key = 'member_level' AND um.meta_value IN ('paid-75', 'paid-95')\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n JOIN {$this->db->prefix}usermeta um7 ON um7.user_id = u.id AND um7.meta_key = 'expiration_date' AND um7.meta_value {$this->expireDateClause}\n ORDER BY um.meta_value\";\n \n $membersArr = $this->db->get_results($query, ARRAY_A);\n \n foreach($membersArr as $key => $m) {\n $tmp = get_user_meta($m['id']);\n $membersArr[$key]['addr1'] = $tmp['addr1'][0];\n $membersArr[$key]['addr2'] = $tmp['addr2'][0];\n $membersArr[$key]['city'] = $tmp['city'][0];\n $membersArr[$key]['thestate'] = $tmp['thestate'][0];\n $membersArr[$key]['zip'] = $tmp['zip'][0];\n $membersArr[$key]['country'] = $tmp['country'][0];\n $membersArr[$key]['level'] = $tmp['member_level'][0];\n }\n \n $this->showResults($membersArr, 'premium', true);\n }", "public function getMember()\n {\n return $this->member;\n }", "public function getNameCard()\n {\n return $this->get(self::_NAME_CARD);\n }", "function getMembers() {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.status = '\" . KontakteData::$STATUS_MEMBER . \"'\";\n\t\t$query .= \" OR c2.status = '\" . KontakteData::$STATUS_ADMIN . \"' \";\n\t\t$query .= \"ORDER BY c2.name ASC\";\n\t\treturn $this->database->getSelection($query);\n\t}", "function getMember($member_id)\r\n {\r\n //gives access to the variable in index\r\n //global $dbh;\r\n\r\n //1. Define the query\r\n $sql = \"SELECT * FROM Members WHERE member_id =:member_id\";\r\n\r\n //2. Prepare the statement\r\n $statement = $this->_dbh->prepare($sql);\r\n\r\n //3. Bind parameters\r\n $statement->bindParam(':member_id', $member_id, PDO::PARAM_STR);\r\n\r\n //4.Execute statement\r\n $statement->execute();\r\n\r\n //5. Return the results\r\n $result = $statement->fetch();\r\n //print_r($result);\r\n\r\n return $result;\r\n }", "public function getCardReference()\n {\n return $this->data->creditCard->token;\n }", "function getMember($member_id)\r\n {\r\n $sql = \"SELECT * FROM member WHERE member_id = $member_id\";\r\n // prepare statement\r\n $statement = $this->_dbh->prepare($sql);\r\n // bind parameters\r\n $statement->bindParam(':member_id', $member_id);\r\n // execute statement\r\n $statement->execute();\r\n return $statement->fetch();\r\n }", "public function getStoredCards()\n {\n if (!$this->getData('stored_cards')) {\n $cards = array(); // Array to hold card objects\n \n $customer = $this->getCustomer();\n $cimGatewayId = $customer->getCimGatewayId();\n\n if (!$cimGatewayId) {\n if($this->isAdmin() && Mage::getModel('authorizenetcim/profile')->isAllowGuestCimProfile()) {\n $orderId = Mage::getSingleton('adminhtml/session_quote')->getOrderId();\n if (!$orderId) $orderId = Mage::getSingleton('adminhtml/session_quote')->getReordered();\n if (!$orderId) return false;\n $order = Mage::getModel('sales/order')->load($orderId);\n $payment = $order->getPayment();\n if ($payment) {\n $cimCustomerId = $payment->getData('authorizenetcim_customer_id');\n $cimPaymentId = $payment->getData('authorizenetcim_payment_id');\n }\n } else {\n return false;\n }\n }\n\n if ($cimGatewayId) {\n $cim_profile = Mage::getModel('authorizenetcim/profile')->getCustomerProfile($cimGatewayId);\n if ($cim_profile) {\n if (isset($cim_profile->paymentProfiles) && is_object($cim_profile->paymentProfiles)) {\n /**\n * The Soap XML response may be a single stdClass or it may be an\n * array. We need to adjust it to make it uniform.\n */\n if (is_array($cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType)) {\n $payment_profiles = $cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType;\n } else {\n $payment_profiles = array($cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType);\n }\n }\n }\n } else {\n if ($cimCustomerId && $cimPaymentId) {\n $payment_profiles = array(Mage::getModel('authorizenetcim/profile')->getCustomerPaymentProfile($cimCustomerId, $cimPaymentId));\n } else {\n return false;\n }\n }\n\n if (isset($payment_profiles) && $payment_profiles) {\n // Assign card objects to array\n foreach ($payment_profiles as $payment_profile) {\n $card = new Varien_Object();\n $card->setCcNumber($payment_profile->payment->creditCard->cardNumber)\n ->setGatewayId($payment_profile->customerPaymentProfileId)\n ->setFirstname($payment_profile->billTo->firstName)\n ->setLastname($payment_profile->billTo->lastName)\n ->setAddress($payment_profile->billTo->address)\n ->setCity($payment_profile->billTo->city)\n ->setState($payment_profile->billTo->state)\n ->setZip($payment_profile->billTo->zip)\n ->setCountry($payment_profile->billTo->country);\n $cards[] = $card;\n }\n }\n \n if (!empty($cards)) {\n $this->setData('stored_cards', $cards);\n } else { \n $this->setData('stored_cards',false);\n }\n }\n \n return $this->getData('stored_cards');\n }", "public function memberships_get()\n {\n\n $em = $this->doctrine->em;\n\n $maembershipRepo = $em->getRepository('Entities\\Membership');\n $memberships = $maembershipRepo->findAll();\n $result[\"desc\"] = \"Listado de membresias\";\n $result[\"data\"] = $memberships;\n $this->set_response($result, REST_Controller::HTTP_OK);\n }", "function make_team_member_html_card($name, $job_title, $phone_number, $email, $picture_url, $underline_color) {\n\t?>\n\t<div class=\"team-member\">\n\t\t<div class=\"profile-picture\" style=\"background-image: url(<?php echo $picture_url; ?>)\"></div>\n\t\t<div class=\"profile-details\">\n\t\t\t<span class=\"profile-name\"><?php echo $name; ?></span>\n\t\t\t<div class=\"profile-underline <?php echo $underline_color; ?>\"></div>\n\t\t\t<span class=\"profile-job-position\"><?php echo $job_title; ?></span>\n\t\t\t<span class=\"profile-phone-number\"><?php echo $phone_number; ?></span>\n\t\t\t<a class=\"profile-email\" href=\"mailto:<?php echo $email; ?>\"><?php echo $email; ?></a>\n\t\t</div>\n\t</div>\n\t<?php\n}", "public function getCard(): ?bool\n {\n return $this->card;\n }", "public function get_member()\n {\n //get cookie information if available\n $cookie_raw_info = (array_key_exists(get_member_cookie(), $_COOKIE)) ? $_COOKIE[get_member_cookie()] : '';\n\n $cookie_info = array();\n $cookie_info = explode('_', $cookie_raw_info);\n $cookie_member = (array_key_exists(0, $cookie_info)) ? $cookie_info[0] : '';\n $cookie_loginkey = (array_key_exists(1, $cookie_info)) ? $cookie_info[1] : '';\n\n if ($cookie_member != '') {\n $row = $this->get_member_row(intval($cookie_member));\n //is the cookie info correct\n if ($cookie_loginkey == $row['loginkey']) {\n //if it is correct then return the cookie member\n return $cookie_member;\n } else {\n //return the default guest ID, because the login key is not correct\n return $this->get_guest_id();\n }\n } else {\n //return the default guest ID, because there is no member cookie information\n return $this->get_guest_id();\n }\n }", "public function memberList($eid = 1) {\n $config = $this->config('simple_conreg.settings.'.$eid);\n $countryOptions = SimpleConregOptions::memberCountries($eid, $config);\n $types = SimpleConregOptions::badgeTypes($eid, $config);\n $digits = $config->get('member_no_digits');\n\n switch(isset($_GET['sort']) ? $_GET['sort'] : '') {\n case 'desc':\n $direction = 'DESC';\n break;\n default:\n $direction = 'ASC';\n break;\n }\n switch(isset($_GET['order']) ? $_GET['order'] : '') {\n case 'Name':\n $order = 'name';\n break;\n case 'Country':\n $order = 'country';\n break;\n case 'Type':\n $order = 'badge_type';\n break;\n default:\n $order = 'member_no';\n break;\n }\n\n $content = array();\n\n //$content['#markup'] = $this->t('Unpaid Members');\n\n $content['message'] = array(\n '#cache' => ['tags' => ['simple-conreg-member-list'], '#max-age' => 600],\n '#markup' => $this->t('Members\\' public details are listed below.'),\n );\n\n $rows = [];\n $headers = [\n 'member_no' => ['data' => t('Member No'), 'field' => 'm.member_no', 'sort' => 'asc'],\n 'member_name' => ['data' => t('Name'), 'field' => 'name'],\n 'badge_type' => ['data' => t('Type'), 'field' => 'm.badge_type', 'class' => [RESPONSIVE_PRIORITY_LOW]],\n 'member_country' => ['data' => t('Country'), 'field' => 'm.country', 'class' => [RESPONSIVE_PRIORITY_MEDIUM]],\n ];\n $total = 0;\n\n foreach ($entries = SimpleConregStorage::adminPublicListLoad($eid) as $entry) {\n // Sanitize each entry.\n $badge_type = trim($entry['badge_type']);\n $member_no = sprintf(\"%0\".$digits.\"d\", $entry['member_no']);\n $member = ['member_no' => $badge_type . $member_no];\n switch ($entry['display']) {\n case 'F':\n $fullname = trim(trim($entry['first_name']) . ' ' . trim($entry['last_name']));\n if ($fullname != trim($entry['badge_name']))\n $fullname .= ' (' . trim($entry['badge_name']) . ')';\n $member['name'] = $fullname;\n break;\n case 'B':\n $member['name'] = trim($entry['badge_name']);\n break;\n case 'N':\n $member['name'] = t('Name withheld');\n break;\n }\n $member['badge_type'] = trim(isset($types[$badge_type]) ? $types[$badge_type] : $badge_type);\n $member['country'] = trim(isset($countryOptions[$entry['country']]) ? $countryOptions[$entry['country']] : $entry['country']);\n\n // Set key to field to be sorted by.\n if ($order == 'member_no')\n $key = $member_no;\n else\n $key = $member[$order] . $member_no; // Append member number to ensure uniqueness.\n if (!empty($entry['display']) && $entry['display'] != 'N' && !empty($entry['country'])) {\n $rows[$key] = $member;\n }\n $total++;\n }\n\n // Sort array by key.\n if ($direction == 'DESC')\n krsort($rows);\n else\n ksort($rows);\n\n $content['table'] = array(\n '#type' => 'table',\n '#header' => $headers,\n //'#footer' => array(t(\"Total\")),\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n\n $content['summary_heading'] = [\n '#markup' => $this->t('Country Breakdown'),\n '#prefix' => '<h2>',\n '#suffix' => '</h2>',\n ];\n\n $rows = array();\n $headers = array(\n t('Country'),\n t('Number of members'),\n );\n $total = 0;\n foreach ($entries = SimpleConregStorage::adminMemberCountrySummaryLoad($eid) as $entry) {\n if (!empty($entry['country'])) {\n // Sanitize each entry.\n $entry['country'] = trim($countryOptions[$entry['country']]);\n $rows[] = $entry;\n $total += $entry['num'];\n }\n }\n //Add a row for the total.\n $rows[] = array(t(\"Total\"), $total);\n $content['summary'] = array(\n '#type' => 'table',\n '#header' => $headers,\n '#rows' => $rows,\n '#empty' => t('No entries available.'),\n );\n // Don't cache this page.\n //$content['#cache']['max-age'] = 0;\n\n return $content;\n }", "public function get_customer_based_card_list($token) {\n\n return $this->db->get_where('stripe_customer_card_details', array('status' => 1, 'user_token' => $token))->result_array();\n }", "public function askForCard()\n {\n }", "function Member() {\n \t\t$member = null;\n\t\tif(is_numeric($this->urlParams['ID'])) {\n\t\t\t$member = DataObject::get_by_id('Member', $this->urlParams['ID']);\n\t\t} else {\n\t\t\t$member = Member::currentUser();\n\t\t}\n\n\t\treturn $member;\n\t}", "public function getCardNumber() : ?string ;", "public function selectData() {\n $database = \\Drupal::database();\n $query = $database->select('bank_account_cards', 'ac');\n $query->fields('ac', ['rid','uid','type','card_number','expiry_date','cvv','card_name','debit','default']);\n $query->condition('ac.uid', $this->getUserId());\n $query->orderBy('default', 'DESC');\n\n return $query->execute()->fetchAll();\n }", "public function prepareCard()\r\n\t\t{\r\n\t\t\t$mysqli = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);\r\n\t\t\t$query = 'SELECT * FROM card WHERE id_votes =\"'.$this->voteId.'\" and gtv=\"'.$this->cardId.'\" ORDER BY id_option ASC ';\r\n\t\t\t\r\n\t\t\tif ($result = $mysqli->query($query))\r\n\t\t\t{\r\n\t\t\t\twhile($obj = $result->fetch_object())\r\n\t\t\t\t{\r\n\t\t\t\t\t$card = new Card($obj->id,$this->voteId,$obj->id_option,$obj->gtv,$obj->Pog,$obj->gyv,$obj->sig);\r\n\t\t\t\t\tarray_push($this->cardList,$card);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t$mysqli->close(); \r\n\t\t}", "public function getMonthCard()\n {\n return $this->get(self::_MONTH_CARD);\n }", "function getPayBussinesCard($idUser=''){\n\treturn campo('users','id',($idUser?$idUser:$_SESSION['ws-tags']['ws-user']['id']),'pay_bussines_card');\n}", "function getPayBussinesCard($idUser=''){\n\treturn campo('users','id',($idUser?$idUser:$_SESSION['ws-tags']['ws-user']['id']),'pay_bussines_card');\n}", "function memberById($id)\r\n {\r\n\n $select = 'SELECT member_id, username, firstname, lastname, email, password, image FROM atlas_members WHERE member_id=:id';\n \r\n $statement = $this->_pdo->prepare($select);\r\n $statement->bindValue(':id', $id, PDO::PARAM_INT);\r\n $statement->execute();\r\n \r\n return $statement->fetch(PDO::FETCH_ASSOC);\r\n }", "public function card(){\n return $this->hasMany('App\\Modules\\SubscriberManagement\\Models\\Card', 'users_id');\n }", "public function getUserCards()\n {\n // Get the customer id\n $customerId = $this->adminQuote->getQuote()->getCustomer()->getId();\n\n // Return the cards list\n return $this->vaultHandler->getUserCards($customerId);\n }", "function vads_payment_cards($data) {\n\n switch ($data) {\n case 0:\n return(\"VISA\");\n break;\n case 1:\n return(\"MASTERCARD\");\n break;\n case 2:\n return(\"CB\");\n break;\n }\n\n }", "public function getmemberAction() {\n\n $data = array();\n\n $usersTable = Engine_Api::_()->getDbtable('users', 'user');\n $usersTableName = $usersTable->info('name');\n\n $select = $usersTable->select();\n\n $select->where('displayname LIKE ? ', '%' . $this->_getParam('text') . '%')\n ->order('displayname ASC')->limit('40');\n $users = $usersTable->fetchAll($select);\n\n foreach ($users as $user) {\n $user_photo = $this->view->itemPhoto($user, 'thumb.icon');\n $data[] = array(\n 'id' => $user->user_id,\n 'label' => $user->displayname,\n 'photo' => $user_photo\n );\n }\n\n return $this->_helper->json($data);\n }", "public function getCardcode()\n {\n return $this->cardcode;\n }", "public function getCardnumber()\n {\n return $this->cardnumber;\n }", "public function getCardData()\n {\n $cardData = $this->dashboardHelper->getFormattedCardData(request()->all());\n\n return response()->json($cardData);\n }", "function getMemberList() {\n return getAll(\"SELECT * FROM member \");\n}", "function getMemberContractList() {\n $sql = \"SELECT b.* \n FROM user_contract a INNER JOIN contract b ON a.contract_id = b.id \n WHERE a.user_type = 'member' AND a.uid = ? \n ORDER BY b.id DESC\";\n return getAll($sql, [getLogin()['mid']]);\n}", "public function show(Member $member)\n {\n //\n }", "public function show(Member $member)\n {\n //\n }", "public function show(Member $member)\n {\n //\n }", "public function getBillingProfile();", "function get_Gender($member){\r\n\tglobal $table_prefix , $pm,$db;\r\n\tstatic $gender_member = array();\r\n\r\n\t$ret = '';\r\n\tif (isset($member)){\r\n\t\tif (empty($gender_member)){\r\n\t\t\t$sql =' SELECT m.member_id, m.member_name, ma.gender\r\n\t\t\t\t\t\t\tFROM __member_additions ma\r\n\t\t\t \t\t\tINNER JOIN __members m\r\n\t\t\t \t\t\tON ma.member_id = m.member_id';\r\n\t\t\t$result = $db->query($sql);\r\n\t\t\twhile($row = $db->fetch_record($result)){\r\n\t\t\t\t$gender_member[$row['member_name']] = $row['gender'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$ret = $gender_member[$member];\r\n\t}\r\n\treturn $ret ;\r\n}", "abstract public function getCard(int $card_id): ?array;", "public function rechargeCardList(){\n\n }", "function getVotingMember() {\n\t\treturn Member::get()->byID($this->MemberID);\n\t}", "function getAllMembers() {\r\n $api = new wlmapiclass($api_adres, $api_m);\r\n $api->return_format = 'php'; // <- value can also be xml or json\r\n\r\n $data = array();\r\n// $data['user_login'] = $name;\r\n// $data['user_email'] = $email;\r\n// // $data['custom_exp_date']=$expDate;\r\n $response = $api->get('/members');\r\n $response = unserialize($response);\r\n\r\n // $response = $api->post('/levels',$data)\r\n\r\n if (secssesResponce($response)) {\r\n\r\n $mem = $response['members']['member']; //hold array of all members \r\n\r\n return($mem);\r\n }\r\n}", "public function show(Member $member)\n {\n return $member;\n }", "public function show(Members $member)\n {\n return $member;\n }", "private static function showMembers(SR_Player $player, $page)\n\t{\n\t\tif ($page < 1)\n\t\t{\n\t\t\t$player->message(Shadowhelp::getHelp($player, 'clan'));\n\t\t\treturn false;\n\t\t}\n\t\tif (false === ($clan = SR_Clan::getByPlayer($player)))\n\t\t{\n\t\t\tself::rply($player, '1019', array($player->getName()));\n// \t\t\t$player->message('You are not in a clan, chummer.');\n\t\t\treturn false;\n\t\t}\n\t\t$ipp = 10;\n\t\t$nItems = $clan->getMembercount();\n\t\t$nPages = GWF_PageMenu::getPagecount($ipp, $nItems);\n\t\tif ($page > $nPages)\n\t\t{\n\t\t\t$player->msg('1009');\n// \t\t\t$player->message('This page is empty.');\n\t\t\treturn false;\n\t\t}\n\t\t$from = GWF_PageMenu::getFrom($page, $ipp);\n\t\t$where = 'sr4cm_cid='.$clan->getID();\n\t\t$orderby = 'sr4cm_jointime ASC';\n\t\tif (false === ($members = GDO::table('SR_ClanMembers')->selectAll('sr4pl_name, sr4pl_sid, sr4pl_level', $where, $orderby, array('players'), $ipp, $from, GDO::ARRAY_N)))\n\t\t{\n\t\t\t$player->message('DB ERROR 1');\n\t\t\treturn false;\n\t\t}\n\t\tif (count($members) === 0)\n\t\t{\n\t\t\t$player->msg('1009');\n// \t\t\t$player->message('This page is empty.');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$back = '';\n\t\t$format = $player->lang('fmt_sumlist');\n\t\tforeach ($members as $row)\n\t\t{\n\t\t\t$from++;\n\t\t\t$back .= sprintf($format, $from, \"{$row[0]}{{$row[1]}}\", \"L{$row[2]}\");\n// \t\t\t$back .= sprintf(', %d-%s{%s}(L%s)', $from, $row[0], $row[1], $row[2]);\n\t\t}\n\t\t\n\t\treturn self::rply($player, '5040', array($nItems, $page, $nPages, ltrim($back, ',; ')));\n// \t\treturn Shadowrap::instance($player)->reply(sprintf('%d ClanMembers page %d/%d: %s.', $nItems, $page, $nPages, substr($back, 2)));\n\t}", "function get_data($conn, $tempMemberID){\n\t $sql=\"SELECT * FROM `board_games` WHERE `board_games`.`MemberID`=$tempMemberID\";\n\t $result= $conn -> query($sql);\n\t return $result;\n }", "public function show(Membership $membership)\n {\n //\n }", "public function show(Membership $membership)\n {\n //\n }", "static function SamDesplayInfoMember()\n\t\t{\n\t\t\n\t\t self::$UID = UID;\n\t\t\t\n\t\t\t// filed user\n\t\t\t\n\t\t\t$User_Sam_Filed = implode(',',parent::$FILED['USER']);\n\t\t\t\n\t\t\t// user in object\n\t\t\t\n\t\t\t$User_Object = parent::SamSetObject($User_Sam_Filed,'users','WHERE `user_id` = \"'.self::$UID.'\"');\n\t\t\t\n\t\t\t/* user level */\n\t\t\t\n\t\t\t$Sam_Memb_JS = vJs('user_level',$User_Object->u_level);\n\t\t\n\t\t/*\n\t\t\t\t\t\t'`user_id`',' `u_name`', '`u_login_name`', '`u_pass`', '`u_def_pass`', '`u_email`',' `u_country`', '`u_level`', '`u_posts`',\n\t\t\t\t'`u_points`',' `u_reg_date`', '`u_lh_date`', '`u_lp_date`',' `u_last_ip`', '`u_ip`', '`u_occupation`', '`u_sex`',' `u_age`',\n\t\t\t\t'`u_online`', '`u_bio`', '`u_sig`', '`u_marstatus`', '`u_city`', '`u_state`', '`u_photo_url`', '`u_title`', '`view`', '`u_color`', '`u_browse`',\n\t\t\t\t'`u_face`', '`u_allowmsg`', '`u_last_level`', '`u_status`', '`u_color_choise`', '`u_skin`',' `u_opacity`','`u_template`' \n\t\t\t\t\n\t\t*/\n\t\t\n\t\t /* user home page */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_homepage',$User_Object->u_home_page);\n\t\n\t\t\t/* user home user_link1 */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_link1',$User_Object->u_link1);\n\t\n\t\t /* user home user_link2 */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_link2',$User_Object->u_link2);\n\t\n\t /* user home user_quote */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_quote',$User_Object->u_quote);\n\t\n\t\t /* user home user_hobbies */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_hobbies',$User_Object->u_hobbies);\n\t\n\t\t /* user home user_lnews */\n\t\t\t\n\t\t\t$Sam_Memb_JS .= vJs('user_lnews',$User_Object->u_lnews);\n\t\n\t /* user home user_skin */\n $Sam_Memb_JS .= vJs('user_skin',$User_Object->u_skin);\n\t\n\t // get user skin\n\t\t $font = self::SamGetAutrInfo();\n\t\t \n\t\t/* user home user_font */\n $Sam_Memb_JS .= vJs('user_font',$font['user_font_face']);\n\t \n\t\t/* user home user_font */\n $Sam_Memb_JS .= vJs('user_fontsize',$font['user_fontsize']);\n\t \n\t\t/* user home user_fontcolor */\n $Sam_Memb_JS .= vJs('user_fontcolor',$font['user_fontcolor']);\n\t\n /* user home user_fontalign */\n $Sam_Memb_JS .= vJs('user_fontalign',$font['user_fontalign']);\n\t\n /* user home user_opacity */\n $Sam_Memb_JS .= vJs('user_opacity',$User_Object->u_opacity);\n\t\n /* user home user_title */\n $Sam_Memb_JS .= vJs('user_title',$User_Object->u_title);\n\t \n \t /* user home user_country */\n $Sam_Memb_JS .= vJs('user_country',$User_Object->u_country);\n\t \n\t /* user home user_gender */\n $Sam_Memb_JS .= vJs('user_gender',$User_Object->u_sex);\n\t\n /* user home user_photo_url */\n $Sam_Memb_JS .= vJs('user_photo_url',$User_Object->u_photo_url);\n\t\n /* user home sira datia */\n $Sam_Memb_JS .= vJs('user_bio',$User_Object->u_bio);\n\t\n /* user home user_age */\n $Sam_Memb_JS .= vJs('user_age',$User_Object->u_age);\n\t\n /* user home user_city */\n $Sam_Memb_JS .= vJs('user_city',$User_Object->u_city);\n\t\n \n\t /* user home sitiation */\n $Sam_Memb_JS .= vJs('user_marstatus',$User_Object->u_marstatus);\n\t\n \n\t /* user home job */\n $Sam_Memb_JS .= vJs('user_occupation',$User_Object->u_occupation);\n\t\n \n\t /* user home zon mecheria */\n $Sam_Memb_JS .= vJs('user_state',$User_Object->u_status);\n\t\n return $Sam_Memb_JS;\n\t\t}", "public function getMember()\n {\n return $this->match;\n }" ]
[ "0.6617146", "0.62462723", "0.6178876", "0.61483717", "0.61405957", "0.6075132", "0.6068445", "0.59874344", "0.59529984", "0.5936946", "0.5876473", "0.5847491", "0.584175", "0.5836236", "0.5801842", "0.57736886", "0.5764251", "0.56586176", "0.5656583", "0.5639343", "0.563605", "0.5634413", "0.56259966", "0.5614521", "0.55848664", "0.55803645", "0.557151", "0.55640227", "0.55585766", "0.55215037", "0.5513312", "0.55051243", "0.5504291", "0.5504291", "0.5480362", "0.5468092", "0.544583", "0.54447806", "0.54418373", "0.5441092", "0.54375714", "0.5432477", "0.54290843", "0.54276365", "0.5425185", "0.542219", "0.5417229", "0.5410623", "0.5402369", "0.5396885", "0.5389935", "0.5389478", "0.53718853", "0.53675026", "0.5367195", "0.5348009", "0.53310734", "0.5322804", "0.53069115", "0.53006977", "0.529179", "0.52899295", "0.5283529", "0.528317", "0.52792937", "0.52624375", "0.525488", "0.5253865", "0.52465254", "0.52439713", "0.52390677", "0.5231787", "0.5231787", "0.52265847", "0.5224607", "0.5221657", "0.52213573", "0.52117604", "0.5211572", "0.5207742", "0.5197496", "0.51897514", "0.51818913", "0.5172097", "0.5172097", "0.5172097", "0.5170698", "0.5166259", "0.51645786", "0.515656", "0.5154701", "0.5152525", "0.5147477", "0.5143506", "0.514174", "0.51360065", "0.51352733", "0.51352733", "0.5133098", "0.5129756" ]
0.66569173
0
Get Users By Id This function Get All Groups
function get_user_by_id($user_id) { // echo $user_id; die; $this->db->select("*", false); $this->db->where("id", $user_id); $query = $this->db->get($this->user_table); $result = $query->row_array(); // pr($result); die; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listUsersOfGroup( $id)\n {\n\t\t$data = $this->call(array(), \"GET\", \"groups/\".$id.\"/users.json\");\n\t\t$data = $data->{'users'};\n\t\t$userArray = new ArrayObject();\n\t\tfor($i = 0; $i<count($data);$i++){\n\t\t\t$userArray->append(new User($data[$i], $this));\n\t\t}\n\t\treturn $userArray;\n }", "function ListUsersGroup($id = null)\n {\n if ($id != null) {\n $this->db->where('id', $id);\n }\n $this->db->order_by('name','asc');\n $query = $this->db->get('users');\n return $query;\n }", "function get_userGroup($id){\n $result = array();\n $user = selectRecord(TAB_USERS, \"id = $id\");\n\n $result['id'] = $user['id'];\n $result['username'] = $user['username'];\n $result['password'] = \"\";\n $result['email'] = $user['email'];\n\n $role = selectJoin(TAB_USR_ROLE, TAB_GROUPS, \"groupId = id\", \"userId = $id\")[0]['role'];\n $groups = selectQuery(TAB_GROUPS, \"role <> '$role'\", \"role ASC\");\n\n foreach($groups as $group){\n $gr_elem[] = $group['role'];\n }\n array_unshift($gr_elem, $role);\n $result['group'] = $gr_elem;\n\n return $result;\n}", "public function getUsersGroups($token, $id)\n {\n return $this->getQuery($this->getFullUrl('/users/' . $id . '/memberships'), $token);\n }", "public function groupsUsersGet($group_id) {\n\t\t$url = 'groups';\n\t\tif (!empty($group_id)) {\n\t\t\t$url .= '/';\n\t\t\tif (is_string($group_id)) {\n\t\t\t\t$url .= '=';\n\t\t\t\t$group_id = urlencode(urlencode($group_id));\n\t\t\t}\n\t\t\t$url .= $group_id . '/users';\n\t\t}\n\t\t$output = $this->get($url);\n\t\treturn $this->parseOutput($output);\n\t}", "function getUsers() {\n\n\tglobal $db;\n\treturn $db->getUsersByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function getUsers()\n {\n\t\treturn $this->api->listUsersOfGroup($this->getID());\n }", "public function SeeOneUserGroups($id) {\n\n try{\n $select5 = $this->connexion->prepare(\"SELECT *, \n (SELECT SUM(donate_amount) \n FROM cp_donate E \n WHERE E.group_group_id = A.group_id) \n AS helped\n FROM cp_group A, cp_event B, cp_event_has_group C, cp_user_has_group D\n WHERE C.group_group_id = A.group_id\n AND D.group_group_id = A.group_id\n AND C.event_event_id = B.event_id\n AND D.user_user_id = :userID\");\n \n $select5->bindValue(':userID', $id, PDO::PARAM_INT);\n $select5->execute();\n $select5->setFetchMode(PDO::FETCH_ASSOC);\n $array = $select5->FetchAll();\n $select5->closeCursor(); \n\n\n return $array;\n } catch (Exception $e) {\n echo 'Message:' . $e->getMessage();\n }\n\n }", "function get_user_groups($id)\r\n\t{\r\n\t\t$this->db->select(\"groups.id, groups_descriptions_language.name, groups_year.start_year, groups_year.stop_year, groups_year_members.*\");\r\n\t\t$this->db->from(\"groups_year_members\");\r\n\t\t$this->db->join(\"groups_year\", \"groups_year_members.groups_year_id = groups_year.id\", \"\");\r\n\t\t$this->db->join(\"groups_descriptions_language\", \"groups_year.groups_id = groups_descriptions_language.groups_id\", \"\");\r\n\t\t$this->db->join(\"groups\", \"groups_year.groups_id = groups.id\", \"\");\r\n\t\t$this->db->where(\"groups_year_members.user_id\", $id);\r\n\t\t$this->db->order_by(\"groups_year.stop_year\", \"asc\");\r\n\r\n\t\t$query = $this->db->get();\r\n\t\t$result = $query->result();\r\n\r\n\t\treturn $result;\r\n\t}", "public function getMembers($group_id);", "public function groups_get($id=0)\n {\n $sutil = new CILServiceUtil();\n $result = $sutil->getGroupInfo($id);\n $this->response($result);\n\n }", "function users($group_id)\n\t{\n\t\tif(!is_numeric($group_id) || $group_id < 1)\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Invalid group id.');\n\t\t}\n\n\t\treturn $this->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t$this->name . '.group_id' => $group_id,\n\t\t\t),\n\t\t\t'contain' => array(\n\t\t\t\t'User',\n\t\t\t\t'Group',\n\t\t\t\t'Role',\n\t\t\t),\n\t\t\t'order' => 'User.name',\n\t\t));\n\t}", "public function getGroupUsersFromDatabase() {\n $db = \\Helper::getDB();\n $db->where('g.groupId', $db->escape($this->getId()));\n $db->join('users u', 'u.id = g.userId', 'LEFT');\n $results = $db->get('group_users g', NULL, 'u.*');\n // Process all users\n foreach($results as $user) {\n $user = new \\Models\\User($user['id'], $user['username'], $user['email'], $user['firstName'], $user['lastName'], $user['lastLogin']);\n $this->addUser($user);\n }\n }", "public function getGroups($userId)\n {\n $query = \" SELECT G.id , G.date AS CreatedDate,\n G.name AS GroupName ,\n G.image AS GroupImage\n FROM prefix_users U,prefix_groups G,prefix_group_members GM\n WHERE \n CASE\n WHEN GM.userID = U.id\n THEN GM.userID = {$userId} \n END\n AND GM.groupID = G.id\n AND U.is_activated = '1'\n AND (GM.role = 'admin' OR GM.role = 'member')\n GROUP BY G.id ORDER BY G.id ASC \";\n $query = $this->_GB->_DB->MySQL_Query($query);\n\n if ($this->_GB->_DB->numRows($query) != 0) {\n $conversations = array();\n while ($fetch = $this->_GB->_DB->fetchAssoc($query)) {\n $fetch['id'] = (empty($fetch['id'])) ? null : $fetch['id'];\n $fetch['GroupImage'] = $this->_GB->getSafeImage($fetch['GroupImage']);\n $fetch['CreatorID'] = $this->getUserIDByGroupID($fetch['id']);\n $fetch['Creator'] = $this->getCreatorName($fetch['id']);\n $fetch['Members'] = $this->GetFirstGroupMembers($fetch['id']);\n $conversations[] = $fetch;\n }\n $this->_GB->Json($conversations);\n } else {\n $this->_GB->Json(array('groups' => null));\n }\n }", "function fetchUserGroups($user_id) {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"SELECT \".$db_table_prefix.\"groups.id as id, name\n FROM \".$db_table_prefix.\"user_group_matches,\".$db_table_prefix.\"groups\n WHERE user_id = :user_id and \".$db_table_prefix.\"user_group_matches.group_id = \".$db_table_prefix.\"groups.id\n \";\n\n $stmt = $db->prepare($query);\n\n $sqlVars[':user_id'] = $user_id;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $id = $r['id'];\n $results[$id] = $r;\n }\n $stmt = null;\n\n return $results;\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 getUsers()\n\t{\n\t\t$groupUsers = new ArrayObject();\n\t\t$group = $this->getGroup();\n\t\tif ($group != null) {\n\t\t\t$users = $this->groupService->getUsersInGroup($this->getGroup(), true);\n\t\t\t\n\t\n\t foreach ($users as $user) {\n\t $groupUsers[$user->id] = $user;\n\t }\t\n\t\t}\n \n return $groupUsers;\n\t}", "static function getUserGroups(){\n \n }", "public static function getAll(){\n $conn = DataManager::getInstance()->getConnection();\n if(!$conn || $conn->connect_error) exit();\n $statement = $conn->prepare('SELECT `id` FROM `groups` WHERE 1');\n if(!$statement || !$statement->execute()) exit();\n $result_set = $statement->get_result();\n $group_ids = array();\n while($row = $result_set->fetch_assoc()){\n array_push($group_ids, $row['id']);\n }\n $output = array();\n foreach($group_ids as $id){\n array_push($output, self::fromId($id));\n }\n return $output;\n }", "function getGroupList() {\n return getAll(\"SELECT * FROM `group` WHERE admin_id = ?\", [getLogin()['uid']]);\n}", "public function getAllUserById($id);", "public function getUsersInGroup()\n\t{\n\t\tself::authenticate();\n\n\t\t$group = FormUtil::getPassedValue('group', null, 'GETPOST');\n\n\t\tif($group == null) {\n\t\t\treturn self::retError('ERROR: No group passed!');\n\t\t}\n\n\t\t$group = UserUtil::getGroups('name = \\'' . mysql_escape_string($group) . '\\'');\n\t\t$return = array();\n\t\tif(count($group) == 1) {\n\t\t\tforeach($group as $item) {\n\t\t\t\t$users = UserUtil::getUsersForGroup($item['gid']);\n\t\t\t\tforeach($users as $uid) {\n\t\t\t\t\t$return[] = UserUtil::getVar('uname', $uid);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return = array();\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "public function get( $id ){\n $result = array(\"records\"=>array());\n\n $platformuser = new PlatformUserGroupCollection();\n $model = $platformuser->getById( $id );\n $result['records']['userGroup'] = $model->toRecord();\n\n $collection = new PlatformUserGroupHasPermissionSetCollection();\n $user = PlatformUser::instanceBySession();\n $collection->setActor($user);\n $attributes = array( \"pugid\"=>$id );\n $collectionResult = $collection->getRecords($attributes);\n $ids = array();\n foreach ($collectionResult['records'] as $key => $record) {\n array_push($ids, $record['psid']);\n }\n $result['records']['permissionSetIds'] = $ids;\n\n return $result;\n }", "public static function getGroups($idUser){ \r\n $user = self::findUser($idUser); \r\n $groups = $user->groups;\r\n foreach ($groups as $key => &$value) {\r\n $value['role_id'] = $value->pivot->role_id;\r\n $value['role'] = Role::find($value->pivot->role_id)->name;\r\n unset($value->pivot);\r\n }\r\n return $groups;\r\n }", "public function getUserGroups()\n\t{\n\t\t\n\t\t$groups = array();\n\t\t$db \t= $this->getUserDbTable();\n\t\t$id \t= $this->getUserId();\n\t\t\n\t\tif ($id)\n\t\t{\t\n\t\t\t$groups \t= $db->getAdapter()->select()->from(array('gmt'=>'groups_members_table'))\n\t\t\t\t\t\t\t\t\t\t ->joinInner(array('gt'=>'groups_table'), 'gmt.group_id = gt.group_id')\n\t\t\t\t\t\t\t\t\t\t ->where('gmt.user_id = ? ', $id)\n\t\t\t\t\t\t\t\t\t\t ->query()->fetchAll();\n\t\t}\t\n\t\t/* Automatically append group 0===Public group */\n\t\t$public \t\t= $db->getAdapter()->select()->from(array('gmt'=>'groups_table'))->where('group_privacy_level = ? ', 0)\n\t\t\t\t\t\t\t\t\t ->query()->fetch();\n\t\t$groups[] = $public;\n\t\t\n\t\treturn $groups;\n\t}", "public function getGroupById($id) {\n\t\t$groups = $this->group->findById($id);\n\t\treturn $groups;\n\t}", "public function getAllUsers($id)\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('u.*')\n ->from('users', 'u')\n ->where('gamerID = ?')\n ->setParameter(0, $id);\n $statement = $queryBuilder->execute();\n $usersData = $statement->fetchAll(); \n foreach ($usersData as $userData) {\n $userEntityList[$userData['id']] = new user($userData['id'], $userData['nom'], $userData['prenom'],$userData['gamerID']);\n }\n return $userEntityList;\n }", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.clave,u.nivel_usuario,u.status,u.ultimo_login,u.name,u.IdDepartamento,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.nivel_usuario ORDER BY u.clave ASC\";\n $result = find_by_sql($sql);\n return $result;\n}", "public function getUserGroups()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\n\t\t$uid = UserUtil::getIdFromName($uname);\n\t\tif($uid == false) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\t$groups = UserUtil::getGroupsForUser($uid);\n\t\t$return = array();\n\t\tforeach($groups as $item) {\n\t\t\t$group = UserUtil::getGroup($item);\n\t\t\t$return[] = $group['name'];\n\t\t}\n\t\tif(SecurityUtil::checkPermission('Owncloud::Admin', '::', ACCESS_MODERATE, $uid)) {\n\t\t\t$return[] = 'admin';\n\t\t}\n\t\treturn self::ret($return);\n\t}", "function fetchGroupUsers($group_id) {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $sqlVars = array();\n\n $query = \"SELECT {$db_table_prefix}users.id as user_id, user_name, display_name, email, title, sign_up_stamp,\n last_sign_in_stamp, active, enabled, primary_group_id\n FROM \".$db_table_prefix.\"user_group_matches,\".$db_table_prefix.\"users\n WHERE group_id = :group_id and \".$db_table_prefix.\"user_group_matches.user_id = \".$db_table_prefix.\"users.id\n \";\n\n $stmt = $db->prepare($query);\n\n $sqlVars[':group_id'] = $group_id;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $id = $r['user_id'];\n $results[$id] = $r;\n }\n $stmt = null;\n\n return $results;\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}", "function find_all_user(){\n global $db;\n $results = array();\n $sql = \"SELECT u.id,u.name,u.username,u.user_level,u.status,u.last_login,email,\";\n $sql .=\"g.group_name \";\n $sql .=\"FROM users u \";\n $sql .=\"LEFT JOIN user_groups g \";\n $sql .=\"ON g.group_level=u.user_level ORDER BY u.name ASC\";\n $result = find_by_sql($sql);\n return $result;\n }", "private function getGroups()\n {\n $where = '';\n if ($this->userGroups)\n {\n $groups = explode(',', $this->userGroups);\n $where .= \" uid IN ('\" . implode(\"','\", $groups) . \"') \";\n }\n $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'fe_groups', $where);\n $res = array();\n while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)))\n {\n $res[$row['uid']] = $row;\n }\n\n $this->loadGroupIcons($res);\n\n return $res;\n }", "public function getAllGroups(){\n // Get list\n $lists = array(); \n $data = Group::where('account_id', $this->getAccountId()) \n ->where('user_id', $this->user_id)\n ->get() \n ->toArray();\n $lists = $data;\n return $lists;\n }", "public function getAllGroups();", "function getAllAffinityGroupsFromUser()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new AffinityGroupDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllAffinityGroupsFromUser($userID);\n }", "public function users_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n if(is_null($search))\n $result = $sutil->getUser($id,$from,$size);\n else \n {\n $result = $sutil->searchUsers($search,$from,$size);\n }\n $this->response($result);\n }", "function get_group( $id ) {\r\n global $wpdb;\r\n return $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}wpc_client_groups WHERE group_id = %d\", $id ), \"ARRAY_A\");\r\n }", "public function SeeMyPageGroups($id) {\n\n try{\n $select5 = $this->connexion->prepare(\"SELECT *, \n (SELECT SUM(donate_amount) \n FROM cp_donate E \n WHERE E.group_group_id = A.group_id) \n AS helped\n FROM cp_group A, cp_event B, cp_event_has_group C, cp_user_has_group D\n WHERE C.group_group_id = A.group_id\n AND D.group_group_id = A.group_id\n AND C.event_event_id = B.event_id\n AND D.user_user_id = :userID\");\n \n $select5->bindValue(':userID', $id, PDO::PARAM_INT);\n $select5->execute();\n $select5->setFetchMode(PDO::FETCH_ASSOC);\n $array = $select5->FetchAll();\n $select5->closeCursor(); \n\n\n return $array;\n } catch (Exception $e) {\n echo 'Message:' . $e->getMessage();\n }\n\n }", "public function getUserGroups($userId){\n $query = \"SELECT * FROM groups g JOIN user_groups ug \n ON g.id = ug.groupId\n WHERE ug.userId='$userId' ORDER BY g.groupName;\";\n return $this->getData($query);\n }", "function get_all_user_group()\n {\n $user_group = $this->db->query(\"\n SELECT\n *\n\n FROM\n `groups`\n\n WHERE\n 1 = 1\n AND gro_id != 1\n\n ORDER BY `gro_id` DESC\n \")->result_array();\n\n return $user_group;\n }", "public function getGroups();", "public function getGroups();", "function getUsersGroups($mysqli,$userID){\r\n $result = $mysqli->query(\"SELECT groups.*, group_members.isAdmin FROM `group_members` RIGHT JOIN groups ON group_members.group_ID = groups.ID WHERE Member_ID = \".$userID.\"\");\r\n $groups = array();\r\n\r\n $i=0;\r\n while($row = $result->fetch_row()){\r\n $g = new group();\r\n $g->groupID = $row[0];\r\n $g->name = $row[1];\r\n $g->description = $row[2];\r\n $g->website = $row[3];\r\n $g->private = $row[4];\r\n $g->type = $row[5];\r\n $g->sport = $row[6];\r\n $g->logoURL = $row[7];\r\n $g->city = $row[8];\r\n $g->userIsAdmin = $row[9];\r\n $groups[$i] = $g;\r\n $i++;\r\n }\r\n return $groups;\r\n }", "private function getUserGroups($userId){\n\t\t\t$publicGroups = $this->getGroupsByUserId($userId, 1);\n\t\t\t$privateGroups = $this->getGroupsByUserId($userId, 0);\n\t\t\t\n\t\t\t$userGroups = array();\n\t\t\t\n\t\t\tforeach($publicGroups as $group){\n\t\t\t\tif($group[\"joined\"] == 0)\n\t\t\t\t\tcontinue;\n\t\t\t\t$userGroups[] = $group;\n\t\t\t}\n\t\t\t\n\t\t\tforeach($privateGroups as $group){\n\t\t\t\t$userGroups[] = $group;\n\t\t\t}\n\t\t\t\n\t\t\treturn $userGroups;\n\t\t}", "function all_users($id){\n try{\n $get_users = $this->db->prepare(\"SELECT id, username, user_image FROM `users` WHERE id != ?\");\n $get_users->execute([$id]);\n if($get_users->rowCount() > 0){\n return $get_users->fetchAll(PDO::FETCH_OBJ);\n }\n else{\n return false;\n }\n }\n catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "public static function getGroupData($id) {\n global $lC_Database;\n\n $Qgroup = $lC_Database->query('select * from :table_administrators_groups where id = :id');\n $Qgroup->bindTable(':table_administrators_groups', TABLE_ADMINISTRATORS_GROUPS);\n $Qgroup->bindInt(':id', $id);\n $Qgroup->execute();\n\n $modules = array('access_modules' => array());\n\n $Qaccess = $lC_Database->query('select module, level from :table_administrators_access where administrators_groups_id = :administrators_groups_id');\n $Qaccess->bindTable(':table_administrators_access', TABLE_ADMINISTRATORS_ACCESS);\n $Qaccess->bindInt(':administrators_groups_id', $id);\n $Qaccess->execute();\n\n while ( $Qaccess->next() ) {\n $modules['access_modules'][$Qaccess->value('module')] = $Qaccess->valueInt('level');\n }\n\n $data = array_merge($Qgroup->toArray(), $modules);\n\n unset($modules);\n $Qaccess->freeResult();\n $Qgroup->freeResult();\n\n return $data;\n }", "function get_user_group($group_id)\n {\n $user_group = $this->db->query(\"\n SELECT\n *\n\n FROM\n `groups`\n\n WHERE\n `gro_id` = ?\n \",array($group_id))->row_array();\n \n return $user_group;\n }", "public function get_groups(){\n $group_users = private_party_group_user::search()->where('uid', $this->uid)->exec();\n $merged_groups = array();\n foreach($group_users as $group_user){\n /* @var $group_user private_party_group_user */\n $groups = $group_user->get_groups();\n $merged_groups = array_merge($merged_groups, $groups);\n }\n return $merged_groups;\n }", "public function getAllUsersInGroups($IdUser)\n\t{\n\t\t$query = \"\n\t\t\tSELECT\t`GroupName` AS `Group`,\n\t\t\t\t`UserName` AS `User`,\n\t\t\t\t`UserGroupStatusAdmin` AS `Admin`\n\n\t\t\tFROM \t`User`\n\n\t\t\tJOIN\t`UserGroup`\n\t\t\tUSING\t(`IdUser`)\n\n\t\t\tJOIN\t`Group` AS `g`\n\t\t\tUSING\t(`IdGroup`)\n\n\t\t\tWHERE\t`g`.`IdGroup` IN (\n\t\t\t\t\t\t\tSELECT\t`IdGroup`\n\t\t\t\t\t\t\tFROM\t`UserGroup`\n\t\t\t\t\t\t\tWHERE\t`IdUser` = ?\n\t\t\t\t\t\t )\n\t\t\";\n\n\t\t$result = $this->db->query($query, [$IdUser])->result_array();\n\n\t\t$data = array();\n\n\t\tif(!empty($result))\n\t\t\tforeach ($result as $row) $data[$row['Group']][$row['User']] = $row['Admin'];\n\n\t\t$query2 = \"\n\t\t\tSELECT\t`GroupName` AS `Group`\n\n\t\t\tFROM\t`Group`\n\n\t\t\tJOIN\t`UserGroup`\n\t\t\tUSING\t(`IdGroup`)\n\n\t\t\tWHERE\t`IdUser` = ?\n\t\t\tAND\t`UserGroupStatusAdmin` = 1\n\t\t\";\n\n\t\t$result2 = $this->db->query($query2, [$IdUser])->result_array();\n\n\t\t$data['GroupAdmin'] = array();\n\n\t\tif(!empty($result2))\n\t\t\tforeach ($result2 as $row) $data['GroupAdmin'][] = $row['Group'];\n\n\t\treturn $data;\n\t}", "function get_groupe_user($id)\n {\n return $this->db->get_where('groupe_user',array('id'=>$id))->row_array();\n }", "public function GetMembers()\n {\n if($this->getGroupId())\n {\n $user = new User($this->sqlDataBase);\n $groupMembers = $user->GetGroupUsers($this->groupId);\n return $groupMembers;\n }\n return array();\n }", "function getMemberGroupInfo1() {\n global $inputs;\n\n $res = getAll('SELECT mg.*,\n\t m.name\n FROM member_group mg\n JOIN member m\n ON m.id = mg.member_id\n WHERE group_id = ?' , [$inputs['id']]);\n formatOutput(true, 'success', $res);\n}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "function getMembersOfGroup($group_id) {\n\n\t\t$db = JFactory::getDbo();\n\n\t\t$query = $db -> getQuery(true);\n\t\t$query -> select(array('memberid'));\n\t\t$query -> from('#__community_groups_members');\n\t\t$query -> where('groupid = ' . $db -> quote($group_id));\n\t\t$query -> where(\"approved = '1'\");\n\n\t\t$db -> setQuery($query);\n\n\t\t// Load the results as a list of stdClass objects.\n\t\t$members = $db -> loadResultArray();\n\n\t\treturn $members;\n\t}", "function getGroupUsersByGroupId($groupId) {\n return $this->join('users', 'users.id', '=', 'group_users.userId')\n ->join('user_roles', 'users.id', '=', 'user_roles.userId')\n ->join('roles', 'roles.id', '=', 'user_roles.roleId')\n ->where('group_users.groupId', $groupId)\n ->where('group_users.status', '1')\n ->select('users.firstName', 'users.lastName', 'users.email', 'roles.roleName')\n ->get();\n }", "public function getGroups() {}", "function listUsers($gid)\n {\n return array();\n }", "function getUserGroup(){\n\t\t$con = connect();\n\t\t$sql= \"SELECT ID,userGroup FROM user_group\" ;\n \t$stmt = $con->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll();\n\t \tforeach($result as $row){\n\t\t\t echo \"<option value=\" .$row['ID'].\">\" . $row['userGroup'] . \"</option>\";\n\t\t\t}\n\t}", "private function getUserGroups($userID)//this function should be moved to the UserVo\n\t{\n\t\t$db = Zend_Registry::get('db');\n\t\t\n\t\t$select = $db->select()\n\t\t\t\t\t->from(PrecurioTableConstants::USER_GROUPS,'group_id')\n\t\t\t\t\t->join(PrecurioTableConstants::GROUPS,'user_groups.group_id = groups.id','')\n\t\t\t\t\t->where('user_id= ?',$userID)\n\t\t\t\t\t->where ('active= ?',true);\n\t\t\t\t\t\n\t\t$stmt = $select->query();\n\t\t\n\t\t$stmt->setFetchMode(Zend_Db::FETCH_NUM);\n\t\t\n\t\t$userGroups = $stmt->fetchAll();\n\t\t$userGroups = Precurio_Utils::getSecondLevelArray($userGroups,0);\n\t\treturn $userGroups;\n\t}", "function getMemberGroupInfo() {\n global $inputs;\n\n if (empty($inputs)) {\n $mid = getLogin()['mid'];\n } else {\n $mid = $inputs['id'];\n }\n\n $res = getAll(\"SELECT b.*,a.id AS union_id \n FROM member_group a \n INNER JOIN `group` b \n ON a.group_id = b.id \n WHERE a.member_id = ?\", [$mid]);\n\n if (empty($inputs)) {\n return $res;\n } else {\n formatOutput(true, 'success', $res);\n }\n}", "function listAllUsers($gid)\n {\n return array();\n }", "function get_group_by_id($group_id) {\n $sql = \"SELECT a.*, portal_nm \n FROM com_group a \n INNER JOIN com_portal b ON a.portal_id = b.portal_id\n WHERE group_id = ?\";\n $query = $this->db->query($sql, $group_id);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }", "function getAllGroups() {\n return getAll(\"SELECT * FROM `group`\");\n}", "public function allForUser($userId);", "public function allForUser($userId);", "public function obtenerCuentaGrupos($id) {\n\t\t\n $this->db->where('account_id', $id);\n $query = $this->db->get('investorgroups_accounts');\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n \n }", "function get_groups($ids = array(), $skip_registered = true) {\n\tif(!defined(\"SCOPER_VERSION\")) {\n\t\treturn null;\n\t}\n\n\t$where = array();\n\n\tif(count($ids) > 0) {\n\t\t$where[] = \"group_id IN(\".implode(\",\",$ids).\")\";\n\t}\n\n\tif($skip_registered) {\n\t\t$where[] = \"group_id != 1\";\n\t}\n\n\tif(count($where) > 0) {\n\t\t$where_str = \"WHERE \" . implode(\" AND \", $where);\n\t}\n\n\tglobal $wpdb;\n\t$sql = \"SELECT group_id, name FROM it_groups_group $where_str ORDER BY group_id\";\n\t$res = $wpdb->get_results($sql);\n\n\treturn $res;\n}", "function group_by_id($id)\n{\n\t$db = Database::getInstance();\n\t$group = $db->query(\n\t\t\"select * from {chatgroup} where groupid = ?\",\n\t\tarray($id),\n\t\tarray('return_rows' => Database::RETURN_ONE_ROW)\n\t);\n\treturn $group;\n}", "public function listGroupByUser($name){\n \n $this->connect->connector();\n $ad = $this->connect->getConnector();\n \n \n $racine = \"cn=Users,dc=admc, dc=com\";\n $rechercheGroupe = ldap_search($ad, $racine, \"(&(objectclass=user)(name=\".$name.\"))\");\n $entries = ldap_get_entries($ad, $rechercheGroupe);\n $listGroup = False;\n \n for ($x=0; $x<$entries['count']; $x++){\n \n if(!empty($entries[$x]['memberof'][0])){\n //var_dump($entries[$x]['memberof']);\n for($y=0; $y< $entries[$x]['memberof']['count']; $y++){\n\n\n $listGroup[$y] = $this->getBetween($entries[$x]['memberof'][$y], \"=\", \",\");\n }\n\n }\n }\n return $listGroup;\n \n \n }", "public function getUserById($id){\n $sql=\"SELECT * FROM users WHERE (id = ?)\";\n $select=parent::connect_db()->prepare($sql);\n $select->bindValue(1, $id);\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 listgroup() { \n \n if (!is_null(auth()->guard('api')->user()->groups)){\n \n //$user->find(Auth::user()->id); \n $data = auth()->guard('api')->user()->groups->toArray();\n $response = [ \n 'success' => true, \n 'data' => $data, \n 'message' => 'Group retrieved successfully.' \n ]; \n return response()->json($response, 200);\n }\n else { \n return response()->json(['error' => 'Unauthorised'], 401); \n } \n }", "public function getForUserGroups()\n\t{\n##if @BUILDER.strUGConnectionID.len##\n\t\treturn $this->byId( \"##@BUILDER.strUGConnectionID s##\" );\n##else##\t\t\n\t\treturn $this->getDefault();\n##endif##\n\t}", "public function getMembersForGroup($group_id) {\n return $this->get('get_members_for_group', ['group_id' => $group_id]);\n }", "public function retrieveGroups()\n {\n return $this->start()->uri(\"/api/group\")\n ->get()\n ->go();\n }", "private function getAloneUsers()\n {\n $groupUser_ids = array_unique(array_pluck(GroupUser::all()->toArray(), 'user_id'));\n\n //Descartamos estos usuarios del total\n $users_ids = array_pluck(User::all()->whereNotIn('id', $groupUser_ids)->toArray(), 'id');\n\n return $users_ids;\n }", "public function listAllbyUser($id){\n try{\n $sql = 'select * from user u inner join person p on u.id_person = p.id_person where id_user = ?';\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n $result = $stm->fetch();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "public function show($id) \n {\n $usergroup = array();\n try {\n $query = \"SELECT * FROM pgc_halo.fn_get_user_type(?)\n RESULT (user_type_id integer, user_type varchar, description varchar, status integer);\";\n $values = array((int)$id);\n $result = DB::select($query,$values);\n if ( count($result) > 0 ) {\n $usergroup = array(\n 'id' => $result[0]->user_type_id,\n 'groupname' => $result[0]->user_type,\n 'description' => $result[0]->description,\n 'status' => $result[0]->status\n );\n \n }\n } catch (Exception $exc) {\n \n }\n return json_encode($usergroup);\n }", "protected function _get_usergroup_list()\n {\n $results = $this->connection->query('SELECT gid,title FROM ' . $this->connection->get_table_prefix() . 'usergroups');\n $mod_results = array();\n foreach ($results as $key => $value) {\n $mod_results[] = array('group_id' => $value['gid'], 'group_name' => $value['title']);\n }\n $results2 = collapse_2d_complexity('group_id', 'group_name', $mod_results);\n return $results2;\n }", "function get_all_userslist()\n {\n if($this->session->userdata('id')==1){\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_users');\n\t\t$this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id');\n\t\t$this->db->join('tbl_group', 'tbl_group.id=tbl_users.group_id');\n\t\t$this->db->order_by('tbl_users.id', 'desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t\t}\n\t\telse{\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_users');\n\t\t$this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id');\n\t\t$this->db->where('tbl_users.group_id >', $this->session->userdata('group_id'));\n\t\t$this->db->where('tbl_users.group_id <>', 6);\n\t\t$this->db->order_by('tbl_users.id', 'desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n \n\t\t}\n }", "public function getGroupsList(){\n return $this->_get(1);\n }", "public function list($id){\n try{\n $sql = 'select * from user where id_user = ? limit 1';\n $stm = $this->pdo->prepare($sql);\n $stm->execute([$id]);\n $result = $stm->fetch();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "public function getGroups() {\r\n // Array to hold the group objects\r\n $groups = [];\r\n // Loop through each of the groups the user belongs to\r\n foreach ($this->groups as $group) {\r\n // Get the group from the database\r\n $grp = UserGroup::getByName($group);\r\n // If the group has a valid ID (not 0 or less)\r\n if ($grp->id != 0) {\r\n // Add the group to the array\r\n $groups[] = $grp;\r\n }\r\n }\r\n // Return the groups array\r\n return $groups;\r\n }", "static function users($id)\n {\n return User::where('deleted_at', null)->where('country_id', $id)->get();\n }", "public function getAllGrpIds(){\n\n\t\t$qry=$this->db->select('id');\n\t\t$this->db->from('customer_groups');\n\t\t$qry=$this->db->get();\n\t\t$count=$qry->num_rows();\n\t\t$result= $qry->result_array();\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\t$values[$result[$i]['id']]=$result[$i]['id'];\n\t\t\t\t}\n\t\n\t\treturn $values;\n\t\n\t}", "public function getAllGroupUser(){\n $client = new Client();\n $req = $client->request('GET', 'http://localhost:8000/allgroupuser');\n $res = $req->getBody();\n $data = json_decode($res);\n\n $groupUser = $data->groupUser;\n $permissions = $data->permissions;\n $message = $data->message;\n\n return json_encode(['groupUser' => $groupUser, 'permissions' => $permissions]);\n }", "function get( $id )\n {\n $this->dbInit(); \n if ( $id != \"\" )\n {\n array_query( $user_group_array, \"SELECT * FROM Grp WHERE ID='$id'\" );\n if ( count( $user_group_array ) > 1 )\n {\n die( \"Feil: Flere user_grouper med samme ID funnet i database, dette skal ikke være mulig. \" );\n }\n else if ( count( $user_group_array ) == 1 )\n {\n $this->ID = $user_group_array[ 0 ][ \"ID\" ];\n $this->Name = $user_group_array[ 0 ][ \"Name\" ];\n $this->Description = $user_group_array[ 0 ][ \"Description\" ];\n $this->UserAdmin = $user_group_array[ 0 ][ \"UserAdmin\" ];\n $this->UserGroupAdmin = $user_group_array[ 0 ][ \"UserGroupAdmin\" ];\n $this->PersonTypeAdmin = $user_group_array[ 0 ][ \"PersonTypeAdmin\" ];\n $this->CompanyTypeAdmin = $user_group_array[ 0 ][ \"CompanyTypeAdmin\" ];\n $this->PhoneTypeAdmin = $user_group_array[ 0 ][ \"PhoneTypeAdmin\" ];\n $this->AddressTypeAdmin = $user_group_array[ 0 ][ \"AddressTypeAdmin\" ];\n }\n }\n }", "public function SeeOneUserEvents($id) {\n\n try{\n $select5 = $this->connexion->prepare(\"SELECT * \n FROM cp_user_has_group A, cp_event_has_group B\n JOIN cp_event C \n ON C.event_id = B.event_event_id \n WHERE A.user_user_id = :userID\n AND A.group_group_id = B.group_group_id \");\n \n $select5->bindValue(':userID', $id, PDO::PARAM_INT);\n $select5->execute();\n $select5->setFetchMode(PDO::FETCH_ASSOC);\n $array = $select5->FetchAll();\n $select5->closeCursor(); \n\n\n return $array;\n } catch (Exception $e) {\n echo 'Message:' . $e->getMessage();\n }\n\n }", "public function getGroups(){\n $groups = Group::get()->toArray();\n $groups_array = array();\n foreach($groups as $group){\n $groups_array[$group['id']]['group_name'] = $group['group_name'];\n $groups_array[$group['id']]['user_ids'] = explode(\",\",$group['user_ids']);\n }\n return $groups_array;\n }", "public function getListByUserId($userid){\n $qb = $this->createQueryBuilder('kuchigroup')\n ->join('kuchigroup.users', 'users')\n ->where('users.id = :userid')\n ->setParameter('userid', $userid);\n\n return $qb->getQuery()->getResult();\n }", "public function findUsersByGroup($igid)\n {\n MyLogger2::info(\"Enter InterestGroupDataService.findUsersByGroup()\");\n try\n {\n // Run the Query to find all the Groups available from the Database\n $result = $this->conn->prepare(\"SELECT \n i.USERNAME\n FROM \n users as i\n LEFT JOIN user_interest as u\n ON i.ID = u.users_ID\n LEFT JOIN interest_group as ii\n on u.interest_group_id = ii.ID\n WHERE u.interest_group_ID=:id\");\n // Bind the params with variables:\n $result->bindParam(':id', $igid);\n // Execute the Query\n $result->execute();\n\n MyLogger2::info(\"Exit InterestGroupDataService.findUsersByGroup()\");\n \n // return the result\n return $result->fetchAll();\n }\n catch (PDOException $el)\n {\n MyLogger2::error(\"PDOException in IntGroupDataService.findUsersByGroup(): \", array(\n \"message\" => $el->getMessage()\n ));\n throw new DatabaseException(\"Database Exception: \" . $el->getMessage(), 0, $el);\n }\n catch (Exception $e)\n {\n MyLogger2::error(\"Exception in IntGroupDataService.findUsersByGroup(): \", array(\n \"message\" => $e->getMessage()\n ));\n throw new $e->getMessage();\n }\n }", "private function getUserOrgs($id) {\n return OrganizationGroup::where('user_id', $id)\n ->with('organization')\n ->get();\n }", "public function show($id)\n {\n //\n $usergroup = Usergroup::with(['users', 'userstemp'])->find($id);\n return \\response()->json($usergroup);\n }", "public function getUsergroup() {}", "public function getUserGroupIds()\n\t{\n\t\treturn $this->user_group_ids;\n\t}", "function joined_groups() // pulls all the groups the user is joined but excludes school group\n {\n $user = $this->ion_auth->get_user();\n $query_string = \"SELECT group_relationships.group_id, groups.name FROM group_relationships LEFT JOIN groups ON group_relationships.group_id = groups.id \" .\n \"WHERE group_relationships.user_joined_id = ? AND groups.school_group=0\";\n $query = $this->db->query($query_string, array($user->id));\n\n $return_array = array();\n foreach ($query->result() as $row)\n {\n $return_array[] = array('id' => $row->group_id,\n 'name' => $row->name);\n }\n\n return $return_array;\n }", "public static function bygroup()\r\n {\r\n if(!self::user()->hasPerm('users_membership'))\r\n \\CAT\\Helper\\Json::printError('You are not allowed for the requested action!');\r\n $id = self::router()->getParam();\r\n $data = \\CAT\\Groups::getInstance()->getMembers($id);\r\n if(self::asJSON())\r\n {\r\n echo header('Content-Type: application/json');\r\n echo json_encode($data,true);\r\n return;\r\n }\r\n }", "public function getGroupsById($groups_ids) {\n\t\treturn SQLQuery::create()->select(\"StudentsGroup\")->whereIn(\"StudentsGroup\",\"id\",$groups_ids)->execute();\n\t}", "public function index()\n {\n return Auth::user()->groups()->orderBy('order')->get();\n }", "public function getUserGroupMemberShip($userId)\n {\n return $this->_userDao->getGroupList($userId);\n }", "public function groupsGet($group_id = '') {\n\t\t$url = 'groups';\n\t\tif (!empty($group_id)) {\n\t\t\t$url .= '/';\n\t\t\tif (is_string($group_id)) {\n\t\t\t\t$url .= '=';\n\t\t\t\t$group_id = urlencode(urlencode($group_id));\n\t\t\t}\n\t\t\t$url .= $group_id;\n\t\t}\n\t\t$output = $this->get($url);\n\t\treturn $this->parseOutput($output);\n\t}" ]
[ "0.77710325", "0.7619285", "0.73007435", "0.7285554", "0.7254269", "0.7220797", "0.7218185", "0.71800876", "0.71375525", "0.7124583", "0.7029133", "0.7028978", "0.7011046", "0.69891775", "0.6983566", "0.69533724", "0.6952207", "0.6948252", "0.6946043", "0.6940061", "0.6935926", "0.6867659", "0.68454856", "0.6834272", "0.68234676", "0.6799461", "0.67963153", "0.67788285", "0.67761", "0.6764899", "0.6747945", "0.6741555", "0.6689873", "0.6621561", "0.661525", "0.6609846", "0.65968055", "0.6590065", "0.6587736", "0.65813446", "0.65813446", "0.6562879", "0.65610564", "0.6548642", "0.65485126", "0.65374374", "0.6532817", "0.6523684", "0.6521963", "0.651448", "0.64977556", "0.64946604", "0.64946604", "0.64946604", "0.6494311", "0.6489971", "0.64865696", "0.64757127", "0.6465638", "0.64608467", "0.64566576", "0.64496624", "0.643921", "0.6428547", "0.64277774", "0.64277774", "0.64232105", "0.640893", "0.6407883", "0.63958925", "0.6393651", "0.6375776", "0.63756233", "0.6374106", "0.6359899", "0.6352102", "0.6344431", "0.63435185", "0.63370895", "0.6335149", "0.6329034", "0.63269824", "0.63234675", "0.63126135", "0.6311396", "0.6307961", "0.63029695", "0.62972754", "0.6283072", "0.62799597", "0.62718123", "0.6266859", "0.6263863", "0.6255651", "0.6248096", "0.62460476", "0.6242834", "0.62428135", "0.6238417", "0.6237668", "0.62328786" ]
0.0
-1
/ Role Module Edit and Delete Made by Manish and Previous Module function name as edit as edit1 delete as delete 1 START
function viewData($id) { $res = $this->db->select("cr.*") ->from("cz_roles cr") ->where(array("cr.id" => $id)) ->get() ->row(); return $res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getEditModule() {}", "function helpDesk_edit()\n {\n //create model object\n $helpDeskObj=new HelpDeskModel();\n \n // Check region valid code thorugh ajax\n if(isset($_REQUEST['ajaxCall']) && $_REQUEST['ajaxCall']!=\"\")\n {\n $isExist = false;\n if (isset($_REQUEST['code']) && $_REQUEST['code'] != '') {\n $isExist = ($helpDeskObj->check_helpDesk_code($_REQUEST['code']) == '') ? true : false;\n }\n \n if (!$isExist) {\n echo 'false';\n } else {\n echo 'true';\n }\n exit;\n }\n \n //Save category record\n $helpDeskObj->saveHelpDesk();\n\n \n \n //get record for update\n $data['helpDeskData']=$helpDeskObj->getHelpDeskData(APP::$curId);\n \n /*\n * Following Code For Manage Whene Login User Roll As Help Desk Manager \n * Only Display Those Help Desk Which Can Assign To Current Login Help Desk Admin User\n * @Author Mayur Patel<[email protected]> \n */\n \n /*\n $filteHelpDeskUserUserLoginFilterId=\"\";\n if($_SESSION['user_login']['roll_name'] == \"Help Desk Manager\"){\n //pre($_SESSION,1);\n $filteHelpDeskUserUserLoginFilterId=$_SESSION['user_login']['id'];\n }\n //get record for update\n $data['helpDeskData']=$helpDeskObj->getHelpDeskData(APP::$curId,$filteHelpDeskUserUserLoginFilterId);\n \n // Following Code Help To Restric Access to The Un-Assign HelpDesk Edit \n if(empty($data['helpDeskData']) && isset(APP::$curId))\n {\n $_SESSION['actionResult']=array(\"warning\"=>\"You Cant Access This Help Desk\"); // different type success, info, warning, error \n UTIL::redirect(URI::getURL(APP::$moduleName,\"helpDesk_list\")); // Redirect to the list page\n }\n */\n \n\n //load user manager model\n Load::loadModel(\"region\",\"mod_region\");\n\n // create object\n $regionObj = new RegionModel();\n\n //get all region record for update\n// $data['allRegionData']=$regionObj->getAllRegion(); // Its Return All Region Without Parent Child Group\n $data['allRegionData']=$regionObj->getParentAllRegion(); // Its Return All Region With Parent Child Group\n //print_r($data['allRegionData']);\n $data['remainRegionData']=$regionObj->getRemainParentRegion();\n \n $data['remainingManagerData']=$helpDeskObj->getRemainManager();\n //load user manager model\n Load::loadModel(\"user\",\"mod_user\");\n\n // create object\n $userObj = new UserModel();\n if(count($data['remainingManagerData'])==0)\n {\n $data['remainingManagerData']=$userObj->getAllHelpDeskManager();\n }\n //$data['registerRegionData']=$regionObj->getAssignParentRegion();\n \n \n\n //get all help desk manager Users record for update\n $data['helpDeskManagersData']=$userObj->getAllHelpDeskManager();\n \n// pre($data,1);\n \n //include js in footer\n $jsData=Layout::bufferContent(URI::getAbsModulePath().\"/js/helpDesk_edit.php\",$data);\n\n // create javascrpt variable for ajax url\n Layout::addFooter($jsData);\n \n //render layout\n Layout::renderLayout();\n \n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function editAction() {}", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "function account_edit()\n {\n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function edit()\n { \n }", "public function edit()\n {\n \n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit()\n { }", "public function testUpdateRole()\n {\n }", "public function testUpdateRole()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function editManagelistAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a functio to update themes//\n if($this->_request->getParam('submit') != ''){\n $ebookers_obj->editManagelist($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }\n }", "public function edit()\n {\n //\n }", "public static function editModule($row, $orders2, $lists, $params, $option){\n $my = LCore::getUser();\n\t\t$row->title = htmlspecialchars($row->title);\n\t\t$row->titleA = '';\n\t\tif($row->id){\n\t\t\t$row->titleA = '<small><small>[ ' . $row->title . ' ]</small></small>';\n\t\t}\n\t\tLHtml::loadOverlib();\n\t\t?>\n\t<script>\n\t\tfunction ch_apply() {\n\t\t\t<?php $row->module == \"\" ? getEditorContents('editor1', 'content') : NULL ?>\n\t\t\tSRAX.get('tb-apply').className = 'tb-load';\n\t\t\tdax({\n\t\t\t\turl:'ajax.index.php?option=com_plugins&task=apply',\n\t\t\t\tid:'publ-1',\n\t\t\t\tmethod:'post',\n\t\t\t\tform:'adminForm',\n\t\t\t\tcallback:function (resp) {\n\t\t\t\t\tlog('Получен ответ: ' + resp.responseText);\n\t\t\t\t\tmess_cool(resp.responseText);\n\t\t\t\t\tSRAX.get('tb-apply').className = 'tb-apply';\n\t\t\t\t}});\n\t\t}\n\t\tfunction submitbutton(pressbutton) {\n\t\t\tif (( pressbutton == 'save' ) && ( document.adminForm.title.value == \"\" )) {\n\t\t\t\talert(\"<?php echo _PLEASE_ENTER_MODULE_NAME?>\");\n\t\t\t} else {\n\t\t\t\t<?php if($row->module == \"\"){\n\t\t\t\t\tgetEditorContents('editor1', 'content');\n\t\t\t\t} ?>\n\t\t\t}\n\t\t\tsubmitform(pressbutton);\n\t\t}\n\t\t<!--\n\t\tvar originalOrder = '<?php echo $row->ordering; ?>';\n\t\tvar originalPos = '<?php echo $row->position; ?>';\n\t\tvar orders = new Array(); // array in the format [key,value,text]\n\t\t\t<?php $i = 0;\n\t\t\tforeach($orders2 as $k => $items){\n\t\t\t\tforeach($items as $v){\n\t\t\t\t\techo \"\\n orders[\" . $i++ . \"] = new Array( \\\"$k\\\",\\\"$v->value\\\",\\\"$v->text\\\" );\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t//-->\n\t</script>\n\t<table class=\"adminheading\">\n\t\t<tr>\n\t\t\t<th class=\"modules\"><?php echo _MODULE?> -&nbsp;<?php echo $lists['client_id'] ? _CONTROL_PANEL : _SITE; ?> :\n\t\t\t\t<small><?php echo $row->id ? _EDITING : _NEW; ?></small><?php echo $row->titleA; ?></th>\n\t\t</tr>\n\t</table>\n\t<form action=\"index2.php\" method=\"post\" name=\"adminForm\" id=\"adminForm\">\n\t\t<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n\t\t\t<tr valign=\"top\">\n\t\t\t\t<td width=\"60%\">\n\t\t\t\t\t<table class=\"adminform\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th colspan=\"2\"><?php echo _DETAILS?></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=\"100\" class=\"key\"><?php echo _CAPTION?>:</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input class=\"text_area\" type=\"text\" name=\"title\" size=\"35\" value=\"<?php echo $row->title; ?>\"/>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td width=\"100\" class=\"key\"><?php echo _SHOW_TITLE?>:</td>\n\t\t\t\t\t\t\t<td><?php echo $lists['showtitle']; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=\"top\" class=\"key\"><?php echo _MODULE_POSITION?>:</td>\n\t\t\t\t\t\t\t<td><?php echo $lists['position']; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=\"top\" class=\"key\"><?php echo _MODULE_ORDER?>:</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\t\t\t<!--\n\t\t\t\t\t\t\t\t\twriteDynaList('class=\"inputbox\" name=\"ordering\" size=\"1\"', orders, originalPos, originalPos, originalOrder);\n\t\t\t\t\t\t\t\t\t//-->\n\t\t\t\t\t\t\t\t</script>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=\"top\" class=\"key\"><?php echo _ACCESS?>:</td>\n\t\t\t\t\t\t\t<td><?php echo $lists['access']; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=\"top\" class=\"key\"><?php echo _PUBLISHED?>:</td>\n\t\t\t\t\t\t\t<td><?php echo $lists['published']; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=\"top\" class=\"key\">ID:</td>\n\t\t\t\t\t\t\t<td><?php echo $row->id; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=\"top\" class=\"key\"><?php echo _NAME?></td>\n\t\t\t\t\t\t\t<td><?php echo $row->module; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td valign=\"top\" class=\"key\"><?php echo _DESCRIPTION?>:</td>\n\t\t\t\t\t\t\t<td><?php echo $row->description; ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t<table class=\"adminform\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><?php echo _PARAMETERS?></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><?php echo $params->render(); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t<?php\n\t\t\t\t\tif($row->module == \"\"){\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<table class=\"adminform\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<table align=\"center\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t$visible = 0;\n\t\t\t\t\t\t\t\t\t\t// check to hide certain paths if not super admin\n\t\t\t\t\t\t\t\t\t\tif($my->gid == 25){\n\t\t\t\t\t\t\t\t\t\t\t$visible = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tLHtml::writableCell(LCore::getCfg('cachepath'), 0, '<strong>' . _CACHE_DIR . '</strong> ', $visible);\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</td>\n\t\t\t\t<td width=\"40%\">\n\t\t\t\t\t<table width=\"100%\" class=\"adminform\">\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><?php echo _MODULE_PAGE_COM_ITEMS?></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td><?php echo _MENU_COM; ?>:<br/><?php echo $lists['components']; ?>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<?php\n\t\t\tif($row->module == \"\"){\n\t\t\t\t?>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t\t<table width=\"100%\" class=\"adminform\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th colspan=\"2\"><?php echo _MODULE_USER_CONTENT?></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td valign=\"top\" align=\"left\"><?php echo _CONTENT?>:</td>\n\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t// parameters : areaname, content, hidden field, width, height, rows, cols\n\t\t\t\t\t\t\t\t\teditorArea('editor1', $row->content, 'content', '800', '400', '110', '40');\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<?php\n\t\t\t}\n\t\t\t?>\n\t\t</table>\n\t\t<input type=\"hidden\" name=\"option\" value=\"<?php echo $option; ?>\"/>\n\t\t<input type=\"hidden\" name=\"id\" value=\"<?php echo $row->id; ?>\"/>\n\t\t<input type=\"hidden\" name=\"original\" value=\"<?php echo $row->ordering; ?>\"/>\n\t\t<input type=\"hidden\" name=\"module\" value=\"<?php echo $row->module; ?>\"/>\n\t\t<input type=\"hidden\" name=\"task\" value=\"\"/>\n\t\t<input type=\"hidden\" name=\"client_id\" value=\"<?php echo $lists['client_id']; ?>\"/>\n\t\t<?php\n\t\tif($row->client_id || $lists['client_id']){\n\t\t\techo '<input type=\"hidden\" name=\"client\" value=\"admin\" />';\n\t\t}\n\t\t?>\n\t\t<input type=\"hidden\" name=\"<?php echo josSpoofValue(); ?>\" value=\"1\"/>\n\t</form>\n\t<?php\n\t}", "public function edit() {\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \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}", "function sso_admin_page(){\r\n global $wp_roles;\r\n $groups = $wp_roles->get_names();\r\n\r\n // Edit datas\r\n $edit_rule = FALSE;\r\n switch($_GET['action']){\r\n \r\n\tcase 'add_rule':\r\n if($_POST['var'] AND $_POST['regexp'] AND $_POST['group'] AND isset($groups[$_POST['group']])){\r\n $is_saved = _save_rule($_POST['var'], $_POST['regexp'], $_POST['group']);\r\n if($is_saved === FALSE) $message = \"A szabályt nem sikerült elmenteni!\";\r\n }else{\r\n\t $message = \"A szabályt nem sikerült elmenteni, mert hiányos!\";\r\n }\r\n break;\r\n \r\n\tcase 'delete_rule':\r\n $rule_id = $_GET['rule_id'];\r\n if(is_numeric($rule_id)) _delete_rule($rule_id);\r\n break;\r\n \r\n\tcase 'edit_rule':\r\n $rule_id = $_GET['rule_id'];\r\n if(isset($rule_id) AND is_numeric($rule_id)){\r\n if(_get_rule($rule_id)){\r\n $edited_rule = _get_rule($rule_id);\r\n $edit_rule = TRUE;\r\n }else{\r\n $message = \"A szabályt nem sikerült módosítani, mert ilyen szabály nem létezik!\";\r\n\t\t}\r\n }else{\r\n $message = \"A szabályt nem sikerült módosítani, mert hibás az azonosítója!\";\r\n\t }\r\n break;\r\n \r\n case 'edit_rule_end':\r\n $rule_id = $_GET['rule_id'];\r\n if(isset($rule_id) AND is_numeric($rule_id)){\r\n if(isset($_POST['var']) AND isset($_POST['regexp']) AND isset($_POST['group']) AND isset($groups[$_POST['group']])){\r\n\t $is_updated = _update_rule($rule_id, $_POST['var'], $_POST['regexp'], $_POST['group']);\r\n\t if($is_updated === FALSE) $message = \"A szabályt nem sikerült módosítani!\";\r\n\t }else{\r\n\t $message = \"A szabályt nem sikerült módosítani, mert hiányos!\";\r\n\t\t }\r\n }else{\r\n $message = \"A szabályt nem sikerült módosítani, mert hibás az azonosítója!\";\r\n\t }\r\n break;\r\n \r\n case 'edit_settings':\r\n if(isset($_POST['is_ssl'])){\r\n update_option('sso_is_ssl', (int)$_POST['is_ssl']);\r\n\t\t}\r\n if(isset($_POST['trigger']) AND is_string($_POST['trigger'])){\r\n update_option('sso_trigger', $_POST['trigger']);\r\n\t\t}\r\n if(isset($_POST['logout_url']) AND is_string($_POST['logout_url'])){\r\n update_option('sso_logout_url', $_POST['logout_url']);\r\n\t\t}\r\n if(isset($_POST['login_url']) AND is_string($_POST['login_url'])){\r\n update_option('sso_login_url', trim($_POST['login_url']));\r\n\t\t}\r\n if(isset($_POST['user_name']) AND is_string($_POST['user_name'])){\r\n update_option('sso_user_name', $_POST['user_name']);\r\n\t\t}\r\n if(isset($_POST['user_email']) AND is_string($_POST['user_email'])){\r\n update_option('sso_user_email', $_POST['user_email']);\r\n\t\t}\r\n if(isset($_POST['user_lastname']) AND is_string($_POST['user_lastname'])){\r\n update_option('sso_user_lastname', $_POST['user_lastname']);\r\n\t\t}\r\n if(isset($_POST['user_firstname']) AND is_string($_POST['user_firstname'])){\r\n update_option('sso_user_firstname', $_POST['user_firstname']);\r\n\t\t}\r\n if(isset($_POST['user_nickname']) AND is_string($_POST['user_nickname'])){\r\n update_option('sso_user_nickname', $_POST['user_nickname']);\r\n\t\t}\r\n break;\r\n\r\n }\r\n\r\n ?>\r\n \r\n <div class=\"wrap\" style=\"padding-bottom: 40px;\">\r\n \r\n <h2>SSO Autentikáció</h2>\r\n \r\n <?php if($message): ?>\r\n <blockquote style=\"border: 1px solid; margin: 15px; padding: 5px; display: block;\" id=\"rules\">\r\n <b><?php echo $message; ?></b>\r\n </blockquote>\r\n <?php endif; ?>\r\n \r\n <?php if(!$edit_rule): ?>\r\n \r\n <form action=\"/wp-admin/users.php?page=<?php echo plugin_basename(__FILE__); ?>&action=edit_settings\" method=\"post\" style=\"padding-bottom: 20px;\">\r\n <p>Az SSO által védett hely URL-je (trigger):<br />\r\n <input type=\"text\" size=\"70\" name=\"trigger\" value=\"<?php echo get_option('sso_trigger'); ?>\" />\r\n\t </p>\r\n <p>Az SSO szolgáltatás kiléptető URL-je:<br />\r\n <input type=\"text\" size=\"70\" name=\"logout_url\" value=\"<?php echo get_option('sso_logout_url'); ?>\" />\r\n\t </p>\r\n <p>Az SSO szolgáltatás beléptető URL-je:<br />\r\n <input type=\"text\" size=\"70\" name=\"login_url\" value=\"<?php echo get_option('sso_login_url'); ?>\" /><br />\r\n <small>\r\n\t\t*Ezt az URL-t akkor használjuk, ha az IDP-ről már kijelentkezett, de az ágens még tárolja<br />\r\n\t\ta felhasználó adatit.\tEbből adódóan a védett URL-re (trigger) ugráskor az úgy viselkedne,<br />\r\n\t\tmintha be lenne lépve. Ekkor nem a védett URL-re (trigger) ugrik, hanem ide. Ha ez nincs<br />\r\n\t\tbeállítva, akkor engedi belépni a felhasználót!\r\n\t\t</small>\r\n\t </p>\r\n <p>Használ-e SSL titkosítást:<br />\r\n <select name=\"is_ssl\">\r\n <option value=\"1\" <?php if(get_option('sso_is_ssl')) echo 'selected=\"selected\"'; ?>>Igen</option>\r\n <option value=\"0\" <?php if(!get_option('sso_is_ssl')) echo 'selected=\"selected\"'; ?>>Nem</option>\r\n </select>\r\n\t </p>\r\n <p>A felhasználói nevet tartalmazó _SERVER változó:<br />\r\n <input type=\"text\" name=\"user_name\" value=\"<?php echo get_option('sso_user_name'); ?>\" />\r\n\t </p>\r\n <p>A felhasználó e-mail címét tartalmazó _SERVER változó:<br />\r\n <input type=\"text\" name=\"user_email\" value=\"<?php echo get_option('sso_user_email'); ?>\" />\r\n\t </p>\r\n <p>A felhasználó becenevét tartalmazó _SERVER változó (opcionális):<br />\r\n <input type=\"text\" name=\"user_nickname\" value=\"<?php echo get_option('sso_user_nickname'); ?>\" />\r\n\t </p>\r\n <p>A felhasználó vezetéknevét tartalmazó _SERVER változó (opcionális):<br />\r\n <input type=\"text\" name=\"user_lastname\" value=\"<?php echo get_option('sso_user_lastname'); ?>\" />\r\n\t </p>\r\n <p>A felhasználó keresztnevét tartalmazó _SERVER változó (opcionális):<br />\r\n <input type=\"text\" name=\"user_firstname\" value=\"<?php echo get_option('sso_user_firstname'); ?>\" />\r\n\t </p>\r\n\t <input type=\"submit\" value=\"Beállít\" />\r\n </form>\r\n \r\n <h3 id=\"rules\">Szabályok</h3>\r\n <table cellspacing=\"0\" cellpadding=\"5px\" border=\"1\" style=\"padding-bottom: 20px;\">\r\n <thead>\r\n <tr>\r\n <td style=\"border: 1px solid #464646; padding: 5px; font-weight: bold;\">\r\n Változó\r\n </td>\r\n <td style=\"border-top: 1px solid #464646; border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px; font-weight: bold;\">\r\n Regexp szabály\r\n </td>\r\n <td style=\"border-top: 1px solid #464646; border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px; font-weight: bold;\">\r\n Csoport\r\n </td>\r\n <td style=\"border-top: 1px solid #464646; border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px; font-weight: bold;\">\r\n Szerkesztés\r\n </td>\r\n <td style=\"border-top: 1px solid #464646; border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px; font-weight: bold;\">\r\n Törlés\r\n </td>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <?php\r\n\t for($i=0; $i<get_option('sso_rules_number'); $i++){\r\n\t $rule = _get_rule($i);\r\n\t if($rule !== FALSE){\r\n\t ?>\r\n <tr>\r\n <td style=\"border-bottom: 1px solid #464646; border-left: 1px solid #464646; border-right: 1px solid #464646; padding: 5px;\"><?php echo $rule['var']; ?></td>\r\n <td style=\"border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px;\"><?php echo wordwrap($rule['regexp'], 45, \"<br />\\n\", TRUE); ?></td>\r\n <td style=\"border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px;\"><?php echo $groups[$rule['group']]; ?></td>\r\n <td style=\"border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px;\"><a href=\"/wp-admin/users.php?page=<?php echo plugin_basename(__FILE__); ?>&action=edit_rule&rule_id=<?php echo $i; ?>\">Szerkesztés</a></td>\r\n <td style=\"border-bottom: 1px solid #464646; border-right: 1px solid #464646; padding: 5px;\"><a href=\"/wp-admin/users.php?page=<?php echo plugin_basename(__FILE__); ?>&action=delete_rule&rule_id=<?php echo $i; ?>#rules\">Törlés</a></td>\r\n </tr>\r\n <?php\r\n }\r\n\t } \r\n\t ?>\r\n\t </tbody>\r\n </table>\r\n\r\n <h3>Új szabály hozzáadása</h3>\r\n <form method=\"post\" action=\"/wp-admin/users.php?page=<?php echo plugin_basename(__FILE__); ?>&action=add_rule#rules\">\r\n Változó neve:<input type=\"text\" name=\"var\" /><br />\r\n Regexp:<input type=\"text\" size=\"70\" name=\"regexp\" /><br />\r\n Csoport neve:<select name=\"group\" title=\"--Csoport--\">\r\n\t\t\t <?php foreach($groups AS $group=>$name): ?>\r\n <option value=\"<?php echo $group; ?>\"><?php echo $name; ?></option>\r\n\t\t\t\t\t\t\t\t <?php endforeach; ?>\r\n </select><br />\r\n <input type=\"submit\" value=\"Hozzáad\" />\r\n </form>\r\n \r\n <?php else: ?>\r\n \r\n <h3>Szabály szerkesztése</h3>\r\n <form method=\"post\" action=\"/wp-admin/users.php?page=<?php echo plugin_basename(__FILE__); ?>&action=edit_rule_end&rule_id=<?php echo $_GET['rule_id']; ?>#rules\">\r\n Változó neve:<input type=\"text\" name=\"var\" value=\"<?php echo $edited_rule['var']; ?>\" /><br />\r\n Regexp:<input type=\"text\" size=\"70\" name=\"regexp\" value=\"<?php echo $edited_rule['regexp']; ?>\" /><br />\r\n Csoport neve:<select name=\"group\" title=\"--Csoport--\">\r\n\t\t\t <?php foreach($groups AS $group=>$name): ?>\r\n <option value=\"<?php echo $group; ?>\" <?php if($group === $edited_rule['group']) echo 'selected=\"selected\" '; ?>><?php echo $name; ?></option>\r\n\t\t\t\t\t\t\t\t <?php endforeach; ?>\r\n </select><br />\r\n <input type=\"reset\" value=\"Visszaállítás\" />\r\n <input type=\"submit\" value=\"Szerkeszt\" />\r\n </form>\r\n \r\n <?php endif; ?>\r\n \r\n </div>\r\n \r\n \r\n <?php\r\n\r\n}", "abstract function allowEditAction();", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function editAction()\r\n {\r\n }", "public function edit() {\n\n }", "function default_delete(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod,$log;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$classTable = \"Setting_Lipe\";\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\t$c_id = isset($_REQUEST[\"c_id\"])? $_REQUEST[\"c_id\"] : \"\";\n\tif ($pval!=\"\"){\n\t\t$clsTable->deleteOne($pval);\n $log->logThis('DELETE Settting Lipe '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\t$checkList = isset($_REQUEST[\"checkList\"])? $_REQUEST[\"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\t $username=$_COOKIE['username'];\n\t\t\t\t$actionlog=new ActionLog();\n\t\t\t\t$actionlog->insertValue($username,'Setting Lipe / Delete a lipe ','Course id: '.$c_id);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod&c_id=$c_id\");\n\t}\n\tunset($clsTable);\n}", "public function edit()\n {\n \n \n }", "public function hook_after_edit($id) {\n\t //Your code here \n\n\t }", "public function hook_after_edit($id) {\n\t //Your code here \n\n\t }", "public function annimalEditAction()\n {\n }", "function modules($accion, $id = false){\n\t\t\tif($_POST){\n\t\t\t\t$codigo \t=\t$this->administration_model->setModule($this->input->post(), $_SESSION['pos_user_id'], $accion);\n\t\t\t\tif ($codigo > 0) {\n\t\t\t\t\tif ($accion == \"crear\") { $_SESSION['ok'] = \"REGÍSTRO CREADO EXITOSAMENTE\"; }else\n\t\t\t\t\tif ($accion == \"editar\") { $_SESSION['ok'] = \"REGÍSTRO ACTUALIZADO EXITOSAMENTE\"; }\n\t\t\t\t}else{ $_SESSION['error'] = \"OCURRIO UN PROBLEMA, POR FAVOR INTENTE DE NUEVO\"; }\n\t\t\t\tredirect(base_url('administration/modules/crear'));\n\n\t\t\t}else if($id){\n\t\t\t\t$this->data[\"title\"] \t= \t\"Editar Módulo\";\n\t\t\t\t$this->data[\"accion\"] \t= \t\"editar\";\n\n\t\t\t\t$this->data[\"vista\"] \t= \t\"modules/administration/modules\";\n\n\t\t\t\t$this->data[\"row\"]\t\t= \t$this->administration_model->getModule($id);\n\t\t\t\t$this->data[\"status\"]\t= \t$this->administration_model->getModuleStatus();\n\t\t\t\t$this->data[\"module\"]\t= \t$this->STR_model->getModuleClassification();\n\n\t\t\t}else if($accion == \"crear\"){\n\t\t\t\t$this->data[\"title\"] \t= \t\"Crear Módulo\";\n\t\t\t\t$this->data[\"accion\"] \t= \t\"crear\";\n\t\t\t\t$this->data[\"focus\"] \t= \t\"pos_module_name\";\n\t\t\t\t$this->data[\"vista\"] \t= \t\"modules/administration/modules\";\n\t\t\t\t$this->data[\"status\"]\t= \t$this->administration_model->getModuleStatus();\n\t\t\t\t$this->data[\"module\"]\t= \t$this->STR_model->getModuleClassification();\n\n\t\t\t}else{\n\t\t\t\t$this->data[\"result\"]\t= \t$this->administration_model->getModule();\n\t\t\t\t$this->data[\"vista\"]\t=\t\"modules/administration/modules_maintenance\";\n\t\t\t}\n\n\t\t\tif (isset($_SESSION['ok'])) { \t$this->data[\"ok\"] = $_SESSION['ok']; unset($_SESSION['ok']); }\n\t\t\tif (isset($_SESSION['error'])){ $this->data[\"error\"] = $_SESSION['error']; unset($_SESSION['error']); }\n\n\t\t\t$this->load->view(\"templates/template_main\", $this->data);\n\t\t}", "public function relatorio4(){\n $this->isAdmin();\n }", "function edit($iAccountNo=0) {\n\n\n\t\t$this->authentication->is_admin_logged_in(true);\n\n\t\tif( !$this->mcontents['oUser'] = $this->user_model->getUserBy('account_no', $iAccountNo) ) {\n\n\t\t\tsf('error_message', 'Invalid user');\n\t\t\tredirect('user/listing');\n\n\t\t}\n\n\t\tisAdminSection();\n\n\t\t$this->mcontents['page_heading'] = $this->mcontents['page_title'] = 'Edit User';\n\t\t$this->mcontents['aExistingRoles'] = getUserRoles( $this->mcontents['oUser']->account_no );\n\n\t\tif ( isset($_POST) && !empty($_POST)) {\n\n\n\t\t\t$this->form_validation->set_rules('status', 'Status', 'trim|required');\n\t\t\t//$this->form_validation->set_rules('user_roles','User Roles', '');\n\t\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t\t$aData = array(\n\t\t\t\t\t\t\t'email_id' => safeText('email_id'),\n\t\t\t\t\t\t\t'status' => safeText('status'),\n\t\t\t\t\t\t\t'gender' => safeText('gender'),\n\t\t\t\t\t\t);\n\n\t\t\t\t$this->db->where('account_no', $iAccountNo);\n\t\t\t\t$this->db->update('users', $aData);\n\n\t\t\t\t//update roles.\n\t\t\t\t$aRoles \t\t\t= array_trim( safeText('user_roles') );\n\n\t\t\t\t$aDeletedRoles \t= array_diff($this->mcontents['aExistingRoles'], $aRoles);\n\t\t\t\t$aNewRoles \t\t= array_diff($aRoles, $this->mcontents['aExistingRoles']);\n\n\n\t\t\t\t//echo 'EXISTING : ';p( $this->mcontents['aExistingRoles']);\n\t\t\t\t//echo 'DELETED : ';p( $aDeletedRoles );\n\t\t\t\t//echo 'NEW : ';p( $aNewRoles );\n\n\t\t\t\t//p($aNewRoles);\n\t\t\t\t$this->_createRoles($aNewRoles, $this->mcontents['oUser']->account_no);\n\t\t\t\t$this->_deleteRoles($aDeletedRoles, $this->mcontents['oUser']->account_no);\n\n\t\t\t\tsf('success_message', 'The user data has been updated');\n\t\t\t\tredirect('user/edit/'.$iAccountNo);\n\n\t\t\t}\n\t\t}\n\n\t\t//p($this->mcontents['aExistingRoles']);\n\n\t\t$this->mcontents['aUserRolesTitles'] \t= $this->config->item('user_roles_title');\n\t\t$this->mcontents['iTotalNumRoles'] \t\t= count( $this->mcontents['aUserRolesTitles'] );\n\t\t$this->mcontents['aUserStatusFlipped'] \t= array_flip( $this->config->item('user_status') );\n\t\t$this->mcontents['iAccountNo'] \t\t\t= $iAccountNo;\n\n\t\tloadAdminTemplate('user/edit');\n\t}", "public function run()\n\t{\n\t\tModel::unguard();\n\t\t\n\t\t\n\t\tModel::unguard();\n\t\t$reception_role=Role::where('name','recepcion')->first();\n\t\t$reception_manager=Role::where('name','recepcion_manager')->first();\n\t\t$emission_role=Role::where('name','emision')->first();\n\t\t$emission_manager=Role::where('name','emision_manager')->first();\n\t\t$administracion=Role::where('name','administracion')->first();\n\n\t\n\t\t\\DB::table('permission')->delete();\n\n\t\t/**********Recepcion**********/\n\t\t$module = Module::where(\"code\",\"sgs_reception\")\n\t\t\t\t\t\t\t->first();\n\t\tif($module==null){\n\t\t\t$module = Module::create(['display_name'=>'Recepción',\n\t\t\t\t\t\t\t\t\t\t'code'=>'sgs_reception',\n\t\t\t\t\t\t\t\t\t\t'module_order'=>1]);\n\t\t}\n\n\t\t$menu1 = Menu::where(\"display_name\",'Nueva Póliza')\n\t\t\t\t\t\t->where('module_code','sgs_reception')\n\t\t\t\t\t\t->first();\n\t\tif($menu1==null){\n\t\t\t$menu1=Menu::create([\n\t\t\t\t\t\t\t'display_name'=>'Nueva Póliza',\n\t\t\t\t\t\t\t'is_parent'=>0,\n\t\t\t\t\t\t\t'level'=>1,\n\t\t\t\t\t\t\t'link'=>'.recepcion-emisiones.nueva-poliza',\n\t\t\t\t\t\t\t'icon'=>'glyphicon glyphicon-pencil',\n\t\t\t\t\t\t\t'order'=>1,\n\t\t\t\t\t\t\t'module_code'=>'sgs_reception',\n\t\t\t\t\t\t\t]);\n\t\t}\n\t\t$menu2 = Menu::where(\"display_name\",'Nuevo Reclamo')\n\t\t\t\t\t\t->where('module_code','sgs_reception')\n\t\t\t\t\t\t->first();\n\t\tif($menu2==null){\n\t\t\t$menu2=Menu::create([\n\t\t\t\t\t\t\t'display_name'=>'Nuevo Reclamo',\n\t\t\t\t\t\t\t'is_parent'=>0,\n\t\t\t\t\t\t\t'level'=>1,\n\t\t\t\t\t\t\t'link'=>'.recepcion-reclamos.nuevo-reclamo',\n\t\t\t\t\t\t\t'icon'=>'glyphicon glyphicon-pencil',\n\t\t\t\t\t\t\t'order'=>2,\n\t\t\t\t\t\t\t'module_code'=>'sgs_reception',\n\t\t\t\t\t\t\t]);\n\t\t}\n\t\t$menu3 = Menu::where(\"display_name\",'Emisiones Pendientes')\n\t\t\t\t\t\t->where('module_code','sgs_reception')\n\t\t\t\t\t\t->first();\n\t\tif($menu3==null){\n\t\t\t$menu3=Menu::create([\n\t\t\t\t\t\t\t'display_name'=>'Emisiones Pendientes',\n\t\t\t\t\t\t\t'is_parent'=>0,\n\t\t\t\t\t\t\t'level'=>1,\n\t\t\t\t\t\t\t'link'=>'.recepcion-emisiones',\n\t\t\t\t\t\t\t'icon'=>'glyphicon glyphicon-th-list',\n\t\t\t\t\t\t\t'order'=>3,\n\t\t\t\t\t\t\t'module_code'=>'sgs_reception',\n\t\t\t\t\t\t\t]);\n\t\t}\n\t\t$menu4 = Menu::where(\"display_name\",'Reclamos Pendientes')\n\t\t\t\t\t\t->where('module_code','sgs_reception')\n\t\t\t\t\t\t->first();\n\t\tif($menu4==null){\n\t\t\t$menu4=Menu::create([\n\t\t\t\t\t\t\t'display_name'=>'Reclamos Pendientes',\n\t\t\t\t\t\t\t'is_parent'=>0,\n\t\t\t\t\t\t\t'level'=>1,\n\t\t\t\t\t\t\t'link'=>'.recepcion-reclamos',\n\t\t\t\t\t\t\t'icon'=>'glyphicon glyphicon-th-list',\n\t\t\t\t\t\t\t'order'=>4,\n\t\t\t\t\t\t\t'module_code'=>'sgs_reception',\n\t\t\t\t\t\t\t]);\n\t\t}\n\t\t$menu5 = Menu::where(\"display_name\",'Liquidaciones Pendientes')\n\t\t\t\t\t\t->where('module_code','sgs_reception')\n\t\t\t\t\t\t->first();\n\t\tif($menu5==null){\n\t\t\t$menu5=Menu::create([\n\t\t\t\t\t\t\t'display_name'=>'Liquidaciones Pendientes',\n\t\t\t\t\t\t\t'is_parent'=>0,\n\t\t\t\t\t\t\t'level'=>1,\n\t\t\t\t\t\t\t'link'=>'.recepcion-liquidaciones',\n\t\t\t\t\t\t\t'icon'=>'glyphicon glyphicon-th-list',\n\t\t\t\t\t\t\t'order'=>5,\n\t\t\t\t\t\t\t'module_code'=>'sgs_reception',\n\t\t\t\t\t\t\t]);\n\t\t}\n\t\t$menu6 = Menu::where(\"display_name\",'Envío Documentos')\n\t\t\t\t\t\t->where('module_code','sgs_reception')\n\t\t\t\t\t\t->first();\n\t\tif($menu6==null){\n\t\t\t$menu6=Menu::create([\n\t\t\t\t\t\t\t'display_name'=>'Envío Documentos',\n\t\t\t\t\t\t\t'is_parent'=>0,\n\t\t\t\t\t\t\t'level'=>1,\n\t\t\t\t\t\t\t'link'=>'.envio-documentos({receiver: null})',\n\t\t\t\t\t\t\t'icon'=>'glyphicon glyphicon-th-list',\n\t\t\t\t\t\t\t'order'=>6,\n\t\t\t\t\t\t\t'module_code'=>'sgs_reception',\n\t\t\t\t\t\t\t]);\n\t\t}\n\t\t$menu7 = Menu::where(\"display_name\",'Envío Documentos')\n\t\t\t\t\t\t->where('module_code','sgs_reception')\n\t\t\t\t\t\t->first();\n\t\tif($menu7==null){\n\t\t\t$menu7=Menu::create([\n\t\t\t\t\t\t\t'display_name'=>'Recepción General Documentos',\n\t\t\t\t\t\t\t'is_parent'=>0,\n\t\t\t\t\t\t\t'level'=>1,\n\t\t\t\t\t\t\t'link'=>'.recepcion-documentos',\n\t\t\t\t\t\t\t'icon'=>'glyphicon glyphicon-th-list',\n\t\t\t\t\t\t\t'order'=>7,\n\t\t\t\t\t\t\t'module_code'=>'sgs_reception',\n\t\t\t\t\t\t\t]);\n\t\t}\n\n\t\t//creation of permission\n\t\t$permission1 = Permission::create([\n\t\t\t\t\t\t\t\t\"name\" => \"reception_emit_policy\",\n\t\t\t\t\t\t\t\t\"display_name\" => \"Emitir Póliza\",\n\t\t\t\t\t\t\t\t\"description\" => \"emitir una poliza nueva\",\n\t\t\t\t\t\t\t]);\n\t\t$permission2 = Permission::create([\n\t\t\t\t\t\t\t\t\"name\" => \"reception_claim\",\n\t\t\t\t\t\t\t\t\"display_name\" => \"Realizar Reclamo\",\n\t\t\t\t\t\t\t\t\"description\" => \"Registrar Papeles Reclamos\",\n\t\t\t\t\t\t\t]);\n\t\t$permission3 = Permission::create([\n\t\t\t\t\t\t\t\t\"name\" => \"reception_receive_docs\",\n\t\t\t\t\t\t\t\t\"display_name\" => \"Recibir Documentos Varios\",\n\t\t\t\t\t\t\t\t\"description\" => \"Recibir Documentos Varios\",\n\t\t\t\t\t\t\t]);\n\t\t//creation of permission\n\t\t$permission4 = Permission::create([\n\t\t\t\t\t\t\t\t\"name\" => \"dispach_documents\",\n\t\t\t\t\t\t\t\t\"display_name\" => \"Envio Documentos\",\n\t\t\t\t\t\t\t\t\"description\" => \"enviar documentos\",\n\t\t\t\t\t\t\t]);\n\n\t\t$roles = array($reception_role->id,\n\t\t\t\t\t $reception_manager->id,\n\t\t\t\t\t $administracion->id);\n\t\t$permission1->roles()->sync($roles);\n\t\t$permission2->roles()->sync($roles);\n\t\t$permission3->roles()->sync($roles);\n\t\t$permission4->roles()->sync($roles);\n\n\t\t$menuIDs = array(\n\t\t\t\t\t\t\t$menu1->id,\n\t\t\t\t\t\t\t$menu2->id,\n\t\t\t\t\t\t\t$menu3->id,\n\t\t\t\t\t\t\t$menu4->id,\n\t\t\t\t\t\t\t$menu5->id,\n\t\t\t\t\t\t\t$menu6->id,\n\t\t\t\t\t\t\t$menu7->id,\n\t\t\t\t\t\t);\n\n\t\t$permission1->menus()->sync($menuIDs);\n\t\t$permission2->menus()->sync($menuIDs);\n\t\t$permission3->menus()->sync($menuIDs);\n\t\t$permission4->menus()->sync($menuIDs);\n\t}", "function index()\n\t{\n\t\techo \"Welcome to Permission modify\";\n\t}", "public function isEditAction() {}", "public function editAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n\t \t\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n //$id = sapp_Global::_decrypt($id);\n if(is_numeric($id) && $id>0)\n {\n $app_manager_model = new Default_Model_Appraisalmanager();\n $appraisal_init_model = new Default_Model_Appraisalinit();\n $appraisalQsModel = new Default_Model_Appraisalquestions();\n $tablename = 'main_pa_questions_privileges';\n \n $appraisal_data = $appraisal_init_model->getappdata_forview($id);\n if($appraisal_data['status'] == 1 && $appraisal_data['enable_step'] == 1)\n {\n\t \t$appraisal_data['process_status'] = '';\n\t if(!empty($appraisal_data))\n\t {\n\t \tif($appraisal_data['initialize_status'] == 1)\n\t \t{\n\t \t\tif($appraisal_data['enable_step'] == 1)\n\t \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n\t \t\tif($appraisal_data['enable_step'] == 2)\n\t \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n\t \t}\n\t \telse if($appraisal_data['initialize_status'] == 2)\n\t \t{\n\t \t\t$appraisal_data['process_status'] = 'Initialize Later';\n\t \t}else\n\t\t\t\t\t {\n\t\t\t\t\t \t $appraisal_data['process_status'] = 'In progress';\t\n\t\t\t\t\t }\n\t }\n\t $EmpCountArr = $app_manager_model->getManagerGroupCount($id,$loginUserId);\n\t\t\t\t\t\tif(!empty($EmpCountArr))\n\t\t\t\t\t\t\t$appraisal_data['empcount'] = $EmpCountArr[0]['empcount'];\n\t $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n\t \n\t $questionsArr = $appraisalQsModel->getQuestionsByCategory($appraisal_data['category_id'],'');\n\t \n\t $view = $this->getHelper('ViewRenderer')->view;\n\t $view->previ_data = 'no'; \n\t $view->data = $appraisal_data;\n\t $text = $view->render('appraisalinit/view.phtml');\n\t $this->view->appraisal_id = $id;\n\t $this->view->manager_id = $loginUserId;\n\t $this->view->manager_groups = $manager_groups;\n\t $this->view->appraisal_data = $appraisal_data;\n\t $this->view->app_text = $text; \n\t $this->view->questionsArr = $questionsArr;\n }\n else\n {\n \t$this->view->ermsg = 'nodata';\n } \n\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\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 edit(Module $module)\n {\n //\n }", "protected function editar()\n {\n }", "public function edit_toko(){\n\t}", "function superadmin_update($id=NULL) {\n\t\t $this->set('meta_title','Edit User Group');\n\t\t $errors ='';\n\t\t if(isset($this->data['Role']['id'])) {\n\t\t\t $this->id = (int)$this->data['Role']['id'];\n\t\t\t $this->set('id',$this->id);\n\t\t }\n\t\t else {\n\t\t \t$this->id = (int)$id;\n\t\t\t$this->set('id',$this->id);\n\t\t }\t\n\t\t if(!$this->id) {\n\t\t \t$this->Session->setFlash('Invalid User Group update id.');\n\t\t $this->redirect(array('controller'=>'roles','action'=>'index'));\n\t\t }\n\t\t $this->Role->set($this->data);\n\t\t\n\t \t if(!empty($this->data) && is_array($this->data)){\n\t\t \n\t\t\t\n\t\t \n\t\t $this->Role->set($this->data);\n\t\t \n\t\t$errorsArr='';\n\t\t if(!$this->Role->validates()) \n\t\t\t{\n\t\t\t\n\t\t\t\t$errorsArr = $this->Role->validationErrors;\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 if($errorsArr) {\n\t\t \n\t\t $this->Session->setFlash($errors);\n\t\t\t\t\n\t\t\t\t $this->set('data',$this->data);\n\t\t\t\t\n\t\t\t// $this->redirect(array('controller'=>'roles','action' =>\"update\",$this->id));\n\t\t\t}\n\t\t\telse { \n\t\t\t\t $this->request->data['Role']['id']\t= $this->id;\n\t\t\t\t if($this->request->data['Role']['id'] != 1) {\n\t\t\t\t\t if(in_array($this->params['controller'].'/'.substr($this->params['action'],5),$userpermissions) || $this->Session->read('Auth.Adminuser.role_id')==1) {\n\t\t\t\t\t $this->data['Role']['allowedfunctions']= $this->common->arrayToCsvString($this->data['Role']['allowedfunctions']);\n\t\t\t\t\t }\t\n\t\t\t\t } \t\t\t \n\t\t\t\t // pr($this->data);\n\t\t\t \t if($this->Role->save($this->data)) {\n\t\t\t\t $this->Session->write('popup','User Group has been updated successfully.');\n\t\t\t\t\t\t$this->Session->setFlash('User Group has been updated successfully.'); \n\t\t\t\t\t\t$this->redirect(array('controller'=>'roles','action' => \"index/message:success\"));\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \t$this->Session->setFlash('Data save problem, Please try again.'); \n\t\t\t\t\t\t$this->redirect(array('controller'=>'roles','action' => \"update\",$this->id));\n\t\t\t\t }\t\t\n\t\t \t}//end if not error\n\t \t}// end if of check data array\n\t\t else {\n\t\t $this->set('data',$this->Role->read('',$id));\n\t\t }\n\t }", "static public function ctrEditarOrientaModali(){\r\n\r\n\r\n if(isset($_POST[\"editarIdClase\"])){\r\n\r\n\r\n if(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarIdClase\"])){\r\n\r\n $tabla = \"tbl_mod_orientacion\";\r\n\r\n $datos = array(\"Id_Clase\" => $_POST[\"editarIdClase\"],\r\n \"Id_Modalidad\" => $_POST[\"editarSelecModalidad\"],\r\n \"Id_Orientacion\" => $_POST[\"editarSelecOrientacion\"]);\r\n\r\n $respuesta = ModeloClases::mdlEditarOrientaModali($tabla, $datos);\r\n\r\n\r\n }\r\n\r\n }\r\n }", "function xanthia_admin_main()\n{\n\t/** Security check - important to do this as early as possible to avoid\n\t* potential security holes or just too much wasted processing. For the\n\t* main function we want to check that the user has at least edit privilege\n\t* for some item within this component, or else they won't be able to do\n\t* anything and so we refuse access altogether. The lowest level of access\n\t* for administration depends on the particular module, but it is generally\n\t* either 'edit' or 'delete'\n\t*/\n if (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n // Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\t \n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n // Return the Admin View Function\n\t//return xanthia_adminmenu();\n\treturn xanthia_admin_view();\n}", "public function run()\n {\n $permission = [\n \t[\n \t\t'name' => 'create-role',\n \t\t'display_name' => 'create data role',\n \t\t'description' => 'tambah data Role'\n \t],\n \t[\n \t\t'name' => 'edit-role',\n \t\t'display_name' => 'edit data Role',\n \t\t'description' => 'ubah New Role'\n \t],\n \t[\n \t\t'name' => 'delete-role',\n \t\t'display_name' => 'delete data Role',\n \t\t'description' => 'hapus Role'\n \t],\n [\n 'name' => 'create-user',\n 'display_name' => 'create data user',\n 'description' => 'tambah data user'\n ],\n [\n 'name' => 'edit-user',\n 'display_name' => 'edit data user',\n 'description' => 'ubah New user'\n ],\n [\n 'name' => 'delete-user',\n 'display_name' => 'delete data user',\n 'description' => 'hapus user'\n ],\n [\n 'name' => 'create-bidang',\n 'display_name' => 'create data bidang',\n 'description' => 'tambah data bidang'\n ],\n [\n 'name' => 'edit-bidang',\n 'display_name' => 'edit data bidang',\n 'description' => 'ubah New bidang'\n ],\n [\n 'name' => 'delete-bidang',\n 'display_name' => 'delete data bidang',\n 'description' => 'hapus bidang'\n ],\n [\n 'name' => 'create-pkl',\n 'display_name' => 'create data pkl',\n 'description' => 'tambah data pkl'\n ],\n [\n 'name' => 'edit-pkl',\n 'display_name' => 'edit data pkl',\n 'description' => 'ubah New pkl'\n ],\n [\n 'name' => 'delete-pkl',\n 'display_name' => 'delete data pkl',\n 'description' => 'hapus pkl'\n ],\n [\n 'name' => 'create-perusahaan',\n 'display_name' => 'create data perusahaan',\n 'description' => 'tambah data perusahaan'\n ],\n [\n 'name' => 'edit-perusahaan',\n 'display_name' => 'edit data perusahaan',\n 'description' => 'ubah New perusahaan'\n ],\n [\n 'name' => 'delete-perusahaan',\n 'display_name' => 'delete data perusahaan',\n 'description' => 'hapus perusahaan'\n ],\n [\n 'name' => 'create-bidangpkl',\n 'display_name' => 'create data bidangpkl',\n 'description' => 'tambah data bidangpkl'\n ],\n [\n 'name' => 'edit-bidangpkl',\n 'display_name' => 'edit data bidangpkl',\n 'description' => 'ubah New bidangpkl'\n ],\n [\n 'name' => 'delete-bidangpkl',\n 'display_name' => 'delete data bidangpkl',\n 'description' => 'hapus bidangpkl'\n ],\n [\n 'name' => 'create-dosen',\n 'display_name' => 'create data dosen',\n 'description' => 'tambah data dosen'\n ],\n [\n 'name' => 'edit-dosen',\n 'display_name' => 'edit data dosen',\n 'description' => 'ubah New Role'\n ],\n [\n 'name' => 'delete-dosen',\n 'display_name' => 'delete data dosen',\n 'description' => 'hapus dosen'\n ],\n [\n 'name' => 'create-pembimbing',\n 'display_name' => 'create data pembimbing',\n 'description' => 'tambah data pembimbing'\n ],\n [\n 'name' => 'edit-pembimbing',\n 'display_name' => 'edit data pembimbing',\n 'description' => 'ubah New pembimbing'\n ],\n [\n 'name' => 'delete-pembimbing',\n 'display_name' => 'delete data pembimbing',\n 'description' => 'hapus pembimbing'\n ],\n [\n 'name' => 'create-prodi',\n 'display_name' => 'create data prodi',\n 'description' => 'tambah data prodi'\n ],\n [\n 'name' => 'edit-prodi',\n 'display_name' => 'edit data prodi',\n 'description' => 'ubah New prodi'\n ],\n [\n 'name' => 'delete-prodi',\n 'display_name' => 'delete data prodi',\n 'description' => 'hapus prodi'\n ],\n [\n 'name' => 'edit-field-mhs',\n 'display_name' => 'edit field oleh mhs',\n 'description' => 'field yang dapat di akses mhs'\n ],\n [\n 'name' => 'edit-field-kaprodi',\n 'display_name' => 'edit field oleh kaprodi',\n 'description' => 'field yang dapat di akses kaprodi'\n ],\n [\n 'name' => 'download-pembimbing',\n 'display_name' => 'download data pembimbing',\n 'description' => 'download pembimbing'\n ],\n [\n 'name' => 'download-pkl',\n 'display_name' => 'download data pkl',\n 'description' => 'download pkl'\n ],\n [\n 'name' => 'show-data',\n 'display_name' => 'show data oleh user',\n 'description' => 'melihat data sesuai role'\n ],\n [\n 'name' => 'edit-data',\n 'display_name' => 'edit data oleh user',\n 'description' => 'ubah data sesuai role'\n ],\n ];\n\n foreach ($permission as $key => $value) {\n \tPermission::create($value);\n }\n \n }", "public static function _EDIT(){\n\t\tglobal $id;\n\n\t\tif(!$id){\n\t\t\t$cid = josGetArrayInts('cid');\n\t\t\t$id = $cid[0];\n\t\t}\n\t\t$menutype = strval(mosGetParam($_REQUEST, 'menutype', 'mainmenu'));\n\n\t\tLibMenuBar::startTable();\n\t\tif(!$id){\n\t\t\t$link = 'index2.php?option=com_menus&menutype=' . $menutype . '&task=new&hidemainmenu=1';\n\t\t\tLibMenuBar::back(_MENU_BACK, $link);\n\t\t\tLibMenuBar::spacer();\n\t\t}\n\t\tLibMenuBar::custom('save_and_new', '-save-and-new', '', _SAVE_AND_ADD, false);\n\t\tLibMenuBar::save();\n\t\tLibMenuBar::spacer();\n\t\tLibMenuBar::apply();\n\t\tLibMenuBar::spacer();\n\t\tif($id){\n\t\t\t// for existing content items the button is renamed `close`\n\t\t\tLibMenuBar::cancel('cancel', _CLOSE);\n\t\t} else{\n\t\t\tLibMenuBar::cancel();\n\t\t}\n\t\tLibMenuBar::spacer();\n\t\tLibMenuBar::help('screen.menus.edit');\n\t\tLibMenuBar::endTable();\n\t}", "public function Admin_Action_Edit() {\n $ssf = new SendStudio_Functions ( );\n $id = $this->_getGETRequest ( 'id', 0 );\n $userAPI = &GetUser ();\n\n\t\t$userLists = $userAPI->GetLists();\n\t\t$userListsId = array_keys($userLists);\n\t\tif (sizeof($userListsId) < 1) {\n\t\t\t$GLOBALS['Intro_Help'] = GetLang('Addon_dynamiccontenttags_Form_Intro');\n\t\t\t$GLOBALS['Intro'] = GetLang('Addon_dynamiccontenttags_Form_CreateHeading');\n\t\t\t$GLOBALS['Lists_AddButton'] = '';\n\n\t\t\tif ($userAPI->CanCreateList() === true) {\n\t FlashMessage(sprintf(GetLang('Addon_dynamiccontenttags_Tags_NoLists'), GetLang('Addon_dynamiccontenttags_ListCreate')), SS_FLASH_MSG_SUCCESS);\n\t $GLOBALS['Message'] = GetFlashMessages ();\n\t\t\t\t$GLOBALS['Lists_AddButton'] = $this->template_system->ParseTemplate('Dynamiccontenttags_List_Create_Button', true);\n\t\t\t} else {\n\t FlashMessage(sprintf(GetLang('Addon_dynamiccontenttags_Tags_NoLists'), GetLang('Addon_dynamiccontenttags_ListAssign')), SS_FLASH_MSG_SUCCESS);\n\t $GLOBALS['Message'] = GetFlashMessages ();\n\t\t\t}\n\t\t\t$this->template_system->ParseTemplate('Dynamiccontenttags_Subscribers_No_Lists');\n\t\t\treturn;\n\t\t}\n\n $listIDs = array ();\n $this->template_system->Assign ( 'DynamicContentTagId', intval ( $id ) );\n if ($id === 0) {\n $this->template_system->Assign ( 'FormType', 'create' );\n } else {\n $this->template_system->Assign ( 'FormType', 'edit' );\n // Load the existing Tags.\n $tag = new DynamicContentTag_Api_Tag ( $id );\n if (!$tag->getTagId()) {\n FlashMessage ( GetLang ( 'NoAccess' ), SS_FLASH_MSG_ERROR, $this->admin_url );\n return false;\n }\n\n $tag->loadLists ();\n $tag->loadBlocks ();\n $listIDs = $tag->getLists ();\n $blocks = $tag->getBlocks ();\n $blocksString = '';\n\n foreach ( $blocks as $blockEntry ) {\n $rule = $blockEntry->getRules ();\n $rule = str_replace(array('\\\"', \"'\"), array('\\\\\\\\\"', '&#39;'), $rule);\n $blocksString .= \" BlockInterface.Add(\" . intval ( $blockEntry->getBlockId () ) . \", '\" . $blockEntry->getName () . \"', \" . intval ( $blockEntry->isActivated () ) . \", \" . intval ( $blockEntry->getSortOrder() ) . \", '\" . $rule . \"'); \";\n }\n\n $this->template_system->Assign ( 'dynamiccontenttags_name', $tag->getName () );\n $this->template_system->Assign ( 'dynamiccontenttags_blocks', $blocksString );\n }\n\n $tempList = $userAPI->GetLists ();\n $tempSelectList = '';\n\n foreach ( $tempList as $tempEach ) {\n $tempSubscriberCount = intval ( $tempEach ['subscribecount'] );\n\n $GLOBALS ['ListID'] = intval ( $tempEach ['listid'] );\n $GLOBALS ['ListName'] = htmlspecialchars ( $tempEach ['name'], ENT_QUOTES, SENDSTUDIO_CHARSET );\n $GLOBALS ['OtherProperties'] = in_array ( $GLOBALS ['ListID'], $listIDs ) ? ' selected=\"selected\"' : '';\n\n if ($tempSubscriberCount == 1) {\n $GLOBALS ['ListSubscriberCount'] = GetLang ( 'Addon_dynamiccontenttags_Subscriber_Count_One' );\n } else {\n $GLOBALS ['ListSubscriberCount'] = sprintf ( GetLang ( 'Addon_dynamiccontenttags_Subscriber_Count_Many' ), $ssf->FormatNumber ( $tempSubscriberCount ) );\n }\n\n $tempSelectList .= $this->template_system->ParseTemplate ( 'DynamicContentTags_Form_ListRow', true );\n\n unset ( $GLOBALS ['OtherProperties'] );\n unset ( $GLOBALS ['ListSubscriberCount'] );\n unset ( $GLOBALS ['ListName'] );\n unset ( $GLOBALS ['ListID'] );\n }\n\n // If list is less than 10, use the following formula: list size * 25px for the height\n $tempCount = count ( $tempList );\n if ($tempCount <= 10) {\n if ($tempCount < 3) {\n $tempCount = 3;\n }\n $selectListStyle = 'height: ' . ($tempCount * 25) . 'px;';\n $this->template_system->Assign ( 'SelectListStyle', $selectListStyle );\n }\n $flash_messages = GetFlashMessages ();\n\n $this->template_system->Assign ( 'FlashMessages', $flash_messages, false );\n $this->template_system->Assign ( 'AdminUrl', $this->admin_url, false );\n $this->template_system->Assign ( 'SelectListHTML', $tempSelectList );\n $this->template_system->ParseTemplate ( 'dynamiccontenttags_form' );\n }", "function XXLINK_edit($action, $lid = '')\n{\n global $_CONF, $_GROUPS, $_TABLES, $_USER, $_LI_CONF,\n $LANG_LINKS_ADMIN, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE;\n\n USES_lib_admin();\n\n $retval = '';\n $editFlag = false;\n\n switch ($action) {\n case 'edit':\n $blocktitle = $LANG_LINKS_ADMIN[1]; // Link Editor\n $saveoption = $LANG_ADMIN['save']; // Save\n break;\n case 'moderate':\n $blocktitle = $LANG_LINKS_ADMIN[65]; // Moderate Link\n $saveoption = $LANG_ADMIN['moderate']; // Save & Approve\n break;\n }\n\n $link_templates = new Template($_CONF['path'] . 'plugins/links/templates/admin/');\n $link_templates->set_file('editor','linkeditor.thtml');\n\n $link_templates->set_var('lang_pagetitle', $LANG_LINKS_ADMIN[28]);\n $link_templates->set_var('lang_link_list', $LANG_LINKS_ADMIN[53]);\n $link_templates->set_var('lang_new_link', $LANG_LINKS_ADMIN[51]);\n $link_templates->set_var('lang_validate_links', $LANG_LINKS_ADMIN[26]);\n $link_templates->set_var('lang_list_categories', $LANG_LINKS_ADMIN[50]);\n $link_templates->set_var('lang_new_category', $LANG_LINKS_ADMIN[52]);\n $link_templates->set_var('lang_admin_home', $LANG_ADMIN['admin_home']);\n $link_templates->set_var('instructions', $LANG_LINKS_ADMIN[29]);\n\n if ($action <> 'moderate' AND !empty($lid)) {\n $result = DB_query(\"SELECT * FROM {$_TABLES['links']} WHERE lid ='$lid'\");\n if (DB_numRows($result) !== 1) {\n $msg = COM_startBlock ($LANG_LINKS_ADMIN[24], '',\n COM_getBlockTemplate ('_msg_block', 'header'));\n $msg .= $LANG_LINKS_ADMIN[25];\n $msg .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));\n return $msg;\n }\n $A = DB_fetchArray($result);\n $access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);\n if ($access == 0 OR $access == 2) {\n $retval .= COM_startBlock($LANG_LINKS_ADMIN[16], '',\n COM_getBlockTemplate ('_msg_block', 'header'));\n $retval .= $LANG_LINKS_ADMIN[17];\n $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));\n COM_accessLog(\"User {$_USER['username']} tried to illegally submit or edit link $lid.\");\n return $retval;\n }\n $editFlag = true;\n } else {\n if ($action == 'moderate') {\n $result = DB_query (\"SELECT * FROM {$_TABLES['linksubmission']} WHERE lid = '$lid'\");\n $A = DB_fetchArray($result);\n } else {\n $A['lid'] = COM_makesid();\n $A['cid'] = '';\n $A['url'] = '';\n $A['description'] = '';\n $A['title']= '';\n $A['owner_id'] = $_USER['uid'];\n }\n $A['hits'] = 0;\n if (isset ($_GROUPS['Links Admin'])) {\n $A['group_id'] = $_GROUPS['Links Admin'];\n } else {\n $A['group_id'] = SEC_getFeatureGroup ('links.edit');\n }\n SEC_setDefaultPermissions ($A, $_LI_CONF['default_permissions']);\n $access = 3;\n }\n $retval .= COM_startBlock ($blocktitle, '',\n COM_getBlockTemplate ('_admin_block', 'header'));\n\n if ( $editFlag ) {\n $lang_create_or_edit = $LANG_ADMIN['edit'];\n } else {\n $lang_create_or_edit = $LANG_LINKS_ADMIN[51];\n }\n $menu_arr = array(\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/index.php',\n 'text' => $LANG_LINKS_ADMIN[53]),\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/index.php?edit=x',\n 'text' => $lang_create_or_edit,'active'=>true),\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/category.php',\n 'text' => $LANG_LINKS_ADMIN[50]),\n array('url' => $_CONF['site_admin_url'] . '/plugins/links/index.php?validate=enabled',\n 'text' => $LANG_LINKS_ADMIN[26]),\n array('url' => $_CONF['site_admin_url'],\n 'text' => $LANG_ADMIN['admin_home'])\n );\n\n\n\n $retval .= ADMIN_createMenu($menu_arr, $LANG_LINKS_ADMIN[66], plugin_geticon_links());\n\n $link_templates->set_var('link_id', $A['lid']);\n if (!empty($lid) && SEC_hasRights('links.edit')) {\n $delbutton = '<input type=\"submit\" value=\"' . $LANG_ADMIN['delete']\n . '\" name=\"delete\"%s>';\n $jsconfirm = ' onclick=\"return confirm(\\'' . $MESSAGE[76] . '\\');\"';\n $link_templates->set_var ('delete_option',\n sprintf ($delbutton, $jsconfirm));\n $link_templates->set_var ('delete_option_no_confirmation',\n sprintf ($delbutton, ''));\n $link_templates->set_var ('delete_confirm_msg',$MESSAGE[76]);\n if ($action == 'moderate') {\n $link_templates->set_var('submission_option',\n '<input type=\"hidden\" name=\"type\" value=\"submission\">');\n }\n }\n $link_templates->set_var('lang_linktitle', $LANG_LINKS_ADMIN[3]);\n $link_templates->set_var('link_title',\n htmlspecialchars ($A['title']));\n $link_templates->set_var('lang_linkid', $LANG_LINKS_ADMIN[2]);\n $link_templates->set_var('lang_linkurl', $LANG_LINKS_ADMIN[4]);\n $link_templates->set_var('max_url_length', 255);\n $link_templates->set_var('link_url', $A['url']);\n $link_templates->set_var('lang_includehttp', $LANG_LINKS_ADMIN[6]);\n $link_templates->set_var('lang_category', $LANG_LINKS_ADMIN[5]);\n $othercategory = links_select_box (3,$A['cid']);\n $link_templates->set_var('category_options', $othercategory);\n $link_templates->set_var('lang_ifotherspecify', $LANG_LINKS_ADMIN[20]);\n $link_templates->set_var('category', $othercategory);\n $link_templates->set_var('lang_linkhits', $LANG_LINKS_ADMIN[8]);\n $link_templates->set_var('link_hits', $A['hits']);\n $link_templates->set_var('lang_linkdescription', $LANG_LINKS_ADMIN[9]);\n $link_templates->set_var('link_description', $A['description']);\n $link_templates->set_var('lang_save', $saveoption);\n $link_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']);\n\n // user access info\n $link_templates->set_var('lang_accessrights', $LANG_ACCESS['accessrights']);\n $link_templates->set_var('lang_owner', $LANG_ACCESS['owner']);\n $ownername = COM_getDisplayName ($A['owner_id']);\n $link_templates->set_var('owner_username', DB_getItem($_TABLES['users'],\n 'username', \"uid = {$A['owner_id']}\"));\n $link_templates->set_var('owner_name', $ownername);\n $link_templates->set_var('owner', $ownername);\n $link_templates->set_var('link_ownerid', $A['owner_id']);\n $link_templates->set_var('lang_group', $LANG_ACCESS['group']);\n $link_templates->set_var('group_dropdown',\n SEC_getGroupDropdown ($A['group_id'], $access));\n $link_templates->set_var('lang_permissions', $LANG_ACCESS['permissions']);\n $link_templates->set_var('lang_permissionskey', $LANG_ACCESS['permissionskey']);\n $link_templates->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']));\n $link_templates->set_var('lang_lockmsg', $LANG_ACCESS['permmsg']);\n $link_templates->set_var('gltoken_name', CSRF_TOKEN);\n $link_templates->set_var('gltoken', SEC_createToken());\n $link_templates->parse('output', 'editor');\n $retval .= $link_templates->finish($link_templates->get_var('output'));\n\n $retval .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer'));\n\n return $retval;\n}", "public function showEdit()\n {\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 hook_after_edit($id) {\n\n }", "function check_perm_old($act = NULL, $mid, $need = 0, $module = NULL, $type = \"admin\")\n{\n\tglobal $mdb2;\n\n\tif (isset($_REQUEST['p']) || !empty($module)) {\n\t\t$p = (!empty($module) ? $module : $mdb2->escape($_REQUEST['p']));\n\t\t$query = \"\n\t\t\tSELECT m.module_id AS mmodid, '0' AS mcontid\n\t\t\tFROM iShark_Modules m\n\t\t\tWHERE m.file_name = '$p' AND is_active = '1' AND type = '\".$type.\"'\n\t\t\";\n\t} elseif (isset($_REQUEST['mid']) || !empty($mid)) {\n\t\t$mid = (!empty($mid) ? $mid : (int) $_REQUEST['mid']);\n\t\t$query = \"\n\t\t\tSELECT m.module_id AS mmodid, m.content_id AS mcontid\n\t\t\tFROM iShark_Menus m\n\t\t\tWHERE menu_id = '$mid'\n\t\t\";\n\t} else {\n\t return FALSE;\n\t}\n\t$result =& $mdb2->query($query);\n\tif (!$row = $result->fetchRow()) {\n\t\treturn FALSE;\n\t}\n\t$module_id = $row['mmodid'];\n\t$content_id = $row['mcontid'];\n\n\t//lekerdezzuk, hogy milyen funkciok erhetoek el az adott modulhoz\n\t$func_array = array();\n\t$query = \"\n\t\tSELECT f.function_id AS fid, f.function_name AS fname\n\t\tFROM iShark_Functions f\n\t\tWHERE f.module_id = '$module_id'\n\t\";\n\n\t$result = $mdb2->query($query);\n\tif ($result->numRows() > 0) {\n\t\twhile ($row = $result->fetchRow())\n\t\t{\n\t\t\t$func_array[$row['fname']] = $row['fid'];\n\t\t}\n\n\t\tif ($act != NULL) {\n\t\t\t$func = $func_array[$act];\n\t\t}\n\t} else {\n\t\treturn true;\n\t}\n\n\t//lekerdezzuk a csoportokat, akik hozzaferhetnek az adott menuponthoz az adott jogosultsaggal\n\tif (!empty($func)) {\n\t\t$group_array = array();\n\t\t$query = \"\n\t\t\tSELECT gr.group_id AS gid\n\t\t\tFROM iShark_Rights r, iShark_Rights_Functions rf, iShark_Groups_Rights gr\n\t\t\tWHERE r.right_id = rf.right_id AND rf.function_id = '$func' AND gr.right_id = r.right_id AND\n\t\t\";\n\t\tif ($module_id != 0) {\n\t\t\t$query .= \"\n\t\t\t\tr.module_id = '$module_id'\n\t\t\t\";\n\t\t}\n\t\tif ($content_id != 0) {\n\t\t\t$query .= \"\n\t\t\t\tr.content_id = '$content_id'\n\t\t\t\";\n\t\t}\n\t\t$result = $mdb2->query($query);\n\t\t//ha nincs talalat, akkor nincs beallitva hozza semmilyen jog, ezert true-val terunk vissza\n\t\tif ($result->numRows() > 0) {\n\t\t\twhile ($row = $result->fetchRow())\n\t\t\t{\n\t\t\t\t$group_array[] = $row['gid'];\n\t\t\t}\n\t\t} else {\n\t\t\tif ($need == 0) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\telse if (empty($func) && $need != 0) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\n\n\t//ha letezik a session, csak akkor vizsgaljuk\n\tif (isset($_SESSION['user_groups'])) {\n\t\t//letrehozzuk a user session-bol a tombot, hogy milyen csoportok tagja\n\t\t$usergroup_array = explode(\" \", $_SESSION['user_groups']);\n\n\t\t//megnezzuk, hogy a ket tombben vannak-e megegyezo azonositok\n\t\tif (count(array_intersect($usergroup_array, $group_array)) > 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tif ($need == 0) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ($need == 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function do_Manage ($lang)\n {\n global $vnT, $func, $DB, $conf;\n\n\n if ($vnT->input['btnUpdate'])\n {\n $cot['favicon'] = trim($_POST['favicon']);\n\n $arr_old = $vnT->func->fetchDbConfig();\n $ok = $vnT->func->writeDbConfig(\"config\", $cot, $arr_old);\n if ($ok) {\n $mess = $vnT->lang[\"edit_success\"];\n } else {\n $mess = $vnT->lang[\"edit_failt\"];\n }\n $url = $this->linkUrl;\n $func->html_redirect($url, $mess);\n }\n\n //update\n if ($vnT->input[\"do_action\"]) {\n if(empty($vnT->input['csrf_token']) || ($vnT->input['csrf_token'] != $_SESSION['vnt_csrf_token']) ) {\n $err = $func->html_err($vnT->lang['err_csrf_token']) ;\n }else{\n unset($_SESSION['vnt_csrf_token']);\n\n //xoa cache\n $func->clear_cache();\n if ($vnT->input[\"del_id\"])\n $h_id = $vnT->input[\"del_id\"];\n switch ($vnT->input[\"do_action\"]) {\n case \"do_edit\":\n if (isset($vnT->input[\"txt_Order\"]))\n $arr_order = $vnT->input[\"txt_Order\"];\n $mess .= \"- \" . $vnT->lang['edit_success'] . \" ID: <strong>\";\n $str_mess = \"\";\n for ($i = 0; $i < count($h_id); $i ++) {\n $dup['display_order'] = $arr_order[$h_id[$i]];\n $ok = $DB->do_update(\"ad_pos\", $dup, \"id={$h_id[$i]}\");\n if ($ok) {\n $str_mess .= $h_id[$i] . \", \";\n }\n }\n $mess .= substr($str_mess, 0, - 2) . \"</strong><br>\";\n $err = $func->html_mess($mess);\n break;\n case \"do_hidden\":\n $mess .= \"- \" . $vnT->lang['hidden_success'] . \" ID: <strong>\";\n for ($i = 0; $i < count($h_id); $i ++) {\n $dup['display'] = 0;\n $ok = $DB->do_update(\"ad_pos\", $dup, \"id={$h_id[$i]}\");\n if ($ok) {\n $str_mess .= $h_id[$i] . \", \";\n }\n }\n $mess .= substr($str_mess, 0, - 2) . \"</strong><br>\";\n $err = $func->html_mess($mess);\n break;\n case \"do_display\":\n $mess .= \"- \" . $vnT->lang['display_success'] . \" ID: <strong>\";\n for ($i = 0; $i < count($h_id); $i ++) {\n $dup['display'] = 1;\n $ok = $DB->do_update(\"ad_pos\", $dup, \"id={$h_id[$i]}\");\n if ($ok) {\n $str_mess .= $h_id[$i] . \", \";\n }\n }\n $mess .= substr($str_mess, 0, - 2) . \"</strong><br>\";\n $err = $func->html_mess($mess);\n break;\n }\n }\n\n }\n\t\tif((int)$vnT->input[\"do_display\"]) {\n\t\t if(empty($vnT->input['csrf_token']) || ($vnT->input['csrf_token'] != $_SESSION['vnt_csrf_token']) ) {\n $err = $func->html_err($vnT->lang['err_csrf_token']) ;\n }else {\n unset($_SESSION['vnt_csrf_token']);\n $ok = $DB->query(\"Update ad_pos SET display=1 WHERE id=\".$vnT->input[\"do_display\"]);\n if($ok){\n $mess .= \"- \" . $vnT->lang['display_success'] . \" ID: <strong>\".$vnT->input[\"do_display\"] . \"</strong><br>\";\n $err = $func->html_mess($mess);\n }\n //xoa cache\n $func->clear_cache();\n }\n\n\t\t}\n\t\tif((int)$vnT->input[\"do_hidden\"]) {\n\t\t if(empty($vnT->input['csrf_token']) || ($vnT->input['csrf_token'] != $_SESSION['vnt_csrf_token']) ) {\n $err = $func->html_err($vnT->lang['err_csrf_token']) ;\n }else {\n unset($_SESSION['vnt_csrf_token']);\n $ok = $DB->query(\"Update ad_pos SET display=0 WHERE id=\".$vnT->input[\"do_hidden\"]);\n if($ok){\n $mess .= \"- \" . $vnT->lang['display_success'] . \" ID: <strong>\".$vnT->input[\"do_hidden\"] . \"</strong><br>\";\n $err = $func->html_mess($mess);\n }\n //xoa cache\n $func->clear_cache();\n }\n\n\t\t}\n\n if (! isset($_SESSION['vnt_csrf_token'])) {\n $_SESSION['vnt_csrf_token'] = md5(uniqid(rand(), TRUE)) ;\n }\n\n $p = ((int) $vnT->input['p']) ? $p = $vnT->input['p'] : 1;\n $n = ($conf['record']) ? $conf['record'] : 30;\n $query = $DB->query(\"SELECT id FROM ad_pos \");\n $totals = intval($DB->num_rows($query));\n $num_pages = ceil($totals / $n);\n if ($p > $num_pages)\n $p = $num_pages;\n if ($p < 1)\n $p = 1;\n $start = ($p - 1) * $n;\n $nav = $func->paginate($totals, $n, $ext, $p);\n $table['link_action'] = $this->linkUrl . \"{$ext}&p=$p\"; \n\t\t$ext_link = $ext.\"&p=$p\" ;\n $table['title'] = array(\n 'check_box' => \"<input type=\\\"checkbox\\\" name=\\\"checkall\\\" id=\\\"checkall\\\" class=\\\"checkbox\\\" />|5%|center\" , \n 'order' => $vnT->lang['order'] . \"|5%|center\" , \n 'name' => $vnT->lang['name'] . \"|15%|center\" , \n 'title' => $vnT->lang['title'] . \"|25%|center\" , \n 'kichthuoc' => $vnT->lang['info'] . \"|15%|center\" , \n 'align' => \"Align|15%|center\" , \n 'type_show' => $vnT->lang['type_show'] . \"|20%|center\" , \n 'action' => \"Action|10%|center\");\n $sql = \"SELECT * FROM ad_pos ORDER BY display_order ASC , id DESC LIMIT $start,$n\";\n // print \"sql = \".$sql.\"<br>\";\n $result = $DB->query($sql);\n if ($DB->num_rows($result)) {\n $row = $DB->get_array($result);\n for ($i = 0; $i < count($row); $i ++) {\n\t\t\t\t$row[$i]['ext_link'] = $ext_link ;\n\t\t\t\t$row[$i]['ext_page'] = $ext_page;\n $row_info = $this->render_row($row[$i], $lang);\n $row_field[$i] = $row_info;\n $row_field[$i]['stt'] = ($i + 1);\n $row_field[$i]['row_id'] = \"row_\" . $row[$i]['id'];\n $row_field[$i]['ext'] = \"\";\n }\n $table['row'] = $row_field;\n } else {\n $table['row'] = array();\n $table['extra'] = \"<div align=center class=font_err >\" . $vnT->lang['no_have_pos'] . \"</div>\";\n }\n $table['button'] = '<input type=\"button\" name=\"btnHidden\" value=\" ' . $vnT->lang['hidden'] . ' \" class=\"button\" onclick=\"do_submit(\\'do_hidden\\')\">&nbsp;';\n $table['button'] .= '<input type=\"button\" name=\"btnDisplay\" value=\" ' . $vnT->lang['display'] . ' \" class=\"button\" onclick=\"do_submit(\\'do_display\\')\">&nbsp;';\n $table['button'] .= '<input type=\"button\" name=\"btnEdit\" value=\" ' . $vnT->lang['update'] . ' \" class=\"button\" onclick=\"do_submit(\\'do_edit\\')\">&nbsp;';\n $table['button'] .= '<input type=\"button\" name=\"btnDel\" value=\" ' . $vnT->lang['delete'] . ' \" class=\"button\" onclick=\"del_selected(\\'' . $this->linkUrl . '&sub=del&csrf_token='.$_SESSION['vnt_csrf_token'].'&ext=' . $ext_page . '\\')\">';\n $table['csrf_token'] = $_SESSION['vnt_csrf_token'] ;\n $table_list = $func->ShowTable($table);\n $data['table_list'] = $table_list;\n $data['totals'] = $totals;\n $data['err'] = $err;\n $data['nav'] = $nav;\n\n $data['favicon'] = $conf['favicon'];\n\n /*assign the array to a template variable*/\n $this->skin->assign('data', $data);\n $this->skin->parse(\"manage\");\n return $this->skin->text(\"manage\");\n }", "public function modul($id){\n // $id_user = $this->session->userdata('id_user');\n //\n // // Get the user's ID and add it to the config array\n // $config = array('userID'=>$id_user);\n //\n // // Load the ACL library and pas it the config array\n // $this->load->library('acl',$config);\n //\n // // Get the perm key\n // // I'm using the URI to keep this pretty simple ( http://www.example.com/test/this ) would be 'test_this'\n // $acl_test = $this->uri->segment(1).'_';\n // $acl_test .= $this->uri->segment(2);\n //\n // // If the user does not have permission either in 'user_perms' or 'role_perms' redirect to login, or restricted, etc\n // if ( !$this->acl->hasPermission($acl_test) || !$this->acl->hasECIdPermission($id_user,$id)) {\n // redirect('');\n // }\n if($this->input->method() == 'get'){\n $this->load->model('Stored_procedure');\n $this->load->model('Vw_data_ec');\n $this->load->model('Vw_data_modul');\n $this->load->model('T_narasumber_topik');\n $this->load->model('T_narasumber');\n $data = $this->Vw_data_ec->get($id);\n $topik_arr = $this->Stored_procedure->get_topik_peserta($this->session->userdata('id_user'),$id,0);\n foreach ($topik_arr as $row) {\n $modul = $this->Vw_data_modul->get($row->id_topik);\n $row->modul = $modul;\n $ids_narasumber= $this->T_narasumber_topik->getNarasumber($row->id_topik);\n $narasumber = array();\n foreach ($ids_narasumber as $temp) {\n array_push($narasumber, $this->T_narasumber->get($temp->id_narasumber));\n }\n $row->narasumber = $narasumber;\n }\n $this->load->view('V_header');\n $this->load->view('V_navbar');\n $this->load->view('V_list_modul',[\n 'data' => $data,\n 'topik_arr' => $topik_arr\n ]);\n $this->load->view('V_footer');\n } else if($this->input->method() == 'post'){\n\n\n }\n }", "function Execute($formname,$nextformaction)\n {\n //$this->app->DBUpgrade->Checker('tabellenname');\n\n $this->FormList[$formname]->formaction=$nextformaction;\n $formaction = $this->app->Secure->GetGET(\"formaction\");\n\n // check for edit if id is online\n $pkname = $this->FormList[$formname]->pkname;\n if($this->FormList[$formname]->pkvalue==\"\")\n $this->FormList[$formname]->pkvalue=$this->app->Secure->GetGET($pkname);\n\n if($this->FormList[$formname]->pkvalue!=\"\" && $formaction==\"\")\n { \n $this->FormList[$formname]->getvaluesfromdb=true;\n }\n\n\n if($nextformaction==\"delete\")\n $formaction=\"delete\";\n \n switch($formaction)\n {\n case \"create\":\n\tif($this->MandatoryCheck($formname))\n\t{\n\t //print_r($this->GetAssocValueArray($formname));\n\t $this->InsertFormToDB($formname);\t\n\t $this->GoToLocation($formname);\n\t} \n\telse \n\t{\n\t // show mandatory msgs and given values\n\t $this->MandatoryErrors($formname);\n\t //$this->FillActualFields($formname);\n\t $this->PrintForm($formname);\n\t}\n break;\n case \"edit\":\n\tif($this->MandatoryCheck($formname))\n\t{\n\t //print_r($this->GetAssocValueArray($formname));\n\t //$this->FillActualFields($formname);\n\t $this->UpdateFormToDB($formname);\t\n\t $this->GoToLocation($formname);\n\t} \n\telse \n\t{\n\t // show mandatory msgs and given values\n\t $this->MandatoryErrors($formname);\n\t //$this->FillActualFields($formname);\n\t $this->PrintForm($formname);\n\t}\n break;\n\n case \"replace\":\n\tif($this->MandatoryCheck($formname))\n\t{\n\t //print_r($this->GetAssocValueArray($formname));\n\t if($this->FormList[$formname]->pkvalue==\"\")\n\t $this->InsertFormToDB($formname);\t\n\t else\n\t $this->UpdateFormToDB($formname);\t\n\t $this->GoToLocation($formname);\n\t} \n\telse \n\t{\n\t // show mandatory msgs and given values\n\t $this->MandatoryErrors($formname);\n\t //$this->FillActualFields($formname);\n\t $this->PrintForm($formname);\n\t}\n break;\n\n case \"delete\":\n\t// delete actual data\n\t$pkname=$this->FormList[$formname]->pkname;\n\t$pkvalue=$this->FormList[$formname]->pkvalue;\n\t$table=$this->FormList[$formname]->table;\n\t\n\t$pkvalue = $this->app->DB->Select(\"SELECT $pkname FROM `$table` \n\t WHERE userid='\".$this->app->User->GetID().\"' AND `$pkname`='$pkvalue' LIMIT 1\");\n\n\t$this->app->DB->Delete(\"DELETE FROM `$table` WHERE `$pkname`='$pkvalue' LIMIT 1\");\n\n\t$this->GoToLocation($formname);\n break;\n default:\n\t$this->PrintForm($formname);\n }\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}", "public function run()\n {\n $groupService = ManageNodeGroupService::getInstance();\n $group = $groupService->updateOrCreate('角色管理', NodeCodeConstants::ROLE_CUSTOM_MANAGE);\n if ($group) {\n $roleService = new AdminRoleService();\n $nodeService = ManageNodeService::getInstance();\n $nodeRead = $nodeService->edit(\n $group,\n '角色管理-讀取',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_READ\n );\n if ($nodeRead) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeRead);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeRead);\n }\n $nodeCreate = $nodeService->edit(\n $group,\n '角色管理-新增',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_CREATE\n );\n if ($nodeCreate) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeCreate);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeCreate);\n }\n $nodeUpdate = $nodeService->edit(\n $group,\n '角色管理-編輯',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_UPDATE\n );\n if ($nodeUpdate) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeUpdate);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeUpdate);\n }\n $nodeDel = $nodeService->edit(\n $group,\n '角色管理-刪除',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_DELETE\n );\n if ($nodeDel) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeDel);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeDel);\n }\n $nodePermission = $nodeService->edit(\n $group,\n '角色管理-權限',\n NodeCodeConstants::ROLE_PUBLIC_AUTHORIZATION\n );\n if ($nodePermission) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodePermission);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodePermission);\n }\n }\n }", "function mod_core_admin() {\n\t\tglobal $NeptuneCore;\n\t\tglobal $NeptuneSQL;\n\t\tglobal $NeptuneAdmin;\n\t\t\n\t\tif (!isset($NeptuneCore)) {\n\t\t\t$NeptuneCore = new NeptuneCore();\n\t\t}\t\n\t\tif (!isset($NeptuneSQL)) {\n\t\t\t$NeptuneSQL = new NeptuneSQL();\n\t\t}\t\n\t\tif (!isset($NeptuneAdmin)) {\n\t\t\t$NeptuneAdmin = new NeptuneAdmin();\n\t\t}\t\n\t\t\n\t\t\n\t\tif (neptune_get_permissions() >= 3) {\n\t\t\t$query = $NeptuneCore->var_get(\"system\",\"query\");\n\t\t\tif (@isset($query[1]) && @isset($query[2])) {\n\t\t\t\t$AdminFunction = \"acp_\" . $query[1] . \"_\" . $query[2];\n\t\t\t\t\n\t\t\t\t$AdminFunction();\n\t\t\t} else {\n\t\t\t\t$NeptuneAdmin->run();\n\t\t\t}\n\t\t} else {\n\t\t\t$NeptuneCore->title($NeptuneCore->var_get(\"locale\",\"accessdenied\"));\n\t\t\t$NeptuneCore->neptune_echo(\"<p>\" . $NeptuneCore->var_get(\"locale\",\"nopermission\") . \"</p>\");\n\t\t\t\n\t\t\theader(\"HTTP/1.1 403 Forbidden\");\n\t\t}\n\t}", "public function editar()\n {\n }", "public function delete()\n {\n auth_admin();\n $this->load->model(getAdminFolder() . '/module_model', 'Module_model');\n if ($this->input->post('id') != \"\" && ctype_digit($this->input->post('id')) && $this->input->post('id') > 0) {\n if (auth_access_validation(adm_sess_usergroupid(), $this->ctrl)) {\n\n $this->Module_model->DeleteModule($this->input->post('id'));\n\n #insert to log\n $log_last_user_id = $this->input->post('id');\n $log_id_user = adm_sess_userid();\n $log_id_group = adm_sess_usergroupid();\n $log_action = 'Delete ' . $this->title . ' ID : ' . $log_last_user_id;\n $log_desc = 'Delete ' . $this->title . ' ID : ' . $log_last_user_id . ';';\n $data_log = array(\n 'id_user' => $log_id_user,\n 'id_group' => $log_id_group,\n 'action' => $log_action,\n 'desc' => $log_desc,\n 'create_date' => date('Y-m-d H:i:s'),\n );\n insert_to_log($data_log);\n $this->session->set_flashdata('success_msg', $this->title . ' (s) has been deleted.');\n } else {\n $this->session->set_flashdata('error_msg', 'You can\\'t manage this content.<br/>');\n }\n } else {\n $this->session->set_flashdata('error_msg', 'Delete failed. Please try again.');\n }\n }", "function role_permission() {\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\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->model('user_model');\n\t\t\n\t\t$this->load->view('global/header', $this->output_head);\n\t\t\n\t\t$this->output_data['title'] = 'Role & Permission Manager';\n\t\t$this->load->view('role_permission', $this->output_data);\n\t\t$this->load->view('global/footer');\n\t}", "public function DAOModulosxRol() {\n }", "function action_edit($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action1'])) {\n //Check if the \"Ok\" button is set.\n\n //Modify category name.\n if( model_category::editC($id,$_POST['form']['name'])){\n header('Location: ' . APP_URL . 'category/list');\n die;\n\n }\n $form_error =false;\n }\n if(isset($_POST['form']['action2'])) {\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }", "function getActionByRoleAndModule($role,$module){\n\t\t$tablename = 'acl';\n\t\t$db = Database::Instance();\n\t\t$dataArr = $db->getDataFromTable(array('role'=>$role,'module'=>$module),$tablename,'action','','',false);\n\t\treturn $dataArr[0]['action'];\n\t}", "function edit_name_perm()\n\t{\n\t\t//-----------------------------------------\n\t\t// Check for legal ID\n\t\t//-----------------------------------------\n\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['perm_name'] == \"\" )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Необходимо ввести имя\");\n\t\t}\n\n\t\t$gid = $this->ipsclass->input['id'];\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $gr = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Не действительный ID группы\");\n\t\t}\n\n\t\t$this->ipsclass->DB->do_update( 'forum_perms', array( 'perm_name' => $this->ipsclass->input['perm_name'] ), 'perm_id='.intval($this->ipsclass->input['id']) );\n\n\t\t$this->ipsclass->admin->save_log(\"Права доступа на форум отредактированы для маски: '{$gr['perm_name']}'\");\n\n\t\t$this->ipsclass->main_msg = \"Permission Set Name Updated\";\n\n\t\t$this->forum_perms( );\n\t}", "protected function editTaskAction() {}", "function edit_employee($emp_id='')\r\n\t{\r\n\t\t//$user=$this->auth();\r\n\t\t$user = $this->auth_pnh_employee();\r\n\t\t if(!$emp_id)\r\n\t\t\tshow_404(); \r\n\t\t$role_id=$this->get_jobrolebyuid($user['userid']);\r\n\t\tif(empty($role_id))\r\n\t\t\tshow_error(\"Access Denied\");\r\n\t\tif($role_id<=3)\r\n\t\t{ \r\n\t\t\t$data['emp_details']=$this->erpm->get_empinfo($emp_id);\r\n\t\t\t$data['page']='edit_emp';\r\n\t\t\t$this->load->view('admin',$data);\r\n\t\t}\r\n\t}", "function edit_function($postdata,$function_id) {\n\n $query = $this->db->query(\"update functions set function_name=\".$this->db->escape($postdata['name']).\" , description = \".$this->db->escape($postdata['description']).\", status = \".$this->db->escape($postdata['status']).\", category = \".$this->db->escape($postdata['category']).\" where function_id='$function_id'\");\t\n\t\t\treturn 1;\n\t\t\t\n }", "protected function editAction() : void\n {\n $this->editAction\n ->execute($this, RoleEntity::class, RoleActionEvent::class, __METHOD__);\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}", "public function actionUpdate($id)\n {\n Url::remember('', 'actions-redirect');\n $user = $this->findModel($id);\n // var_dump($user);die;\n $user->scenario = 'update';\n \n $session = Yii::$app->session;\n $company=$session->get('user.company');\n\t\t\n \n $commonCode=new \\common\\models\\CommonCode();\n \n $userPermission= json_decode($session->get('userPermission'));\n\t\t$company_id = $userPermission->company_id;\n $roles=$userPermission->roles;\n $roleId=$this->getUserPermissionRoleId($roles);\n $ownupdate=0;\n if($userPermission->isSystemAdmin)\n {\n \n $roleObj = \\backend\\models\\Roles::find()->where([\"is_superadmin\"=>1])->asArray()->all(); \n $user->is_superadmin=1;\n \n \n }else if($userPermission->isSuperAdmin) \n {\n if($id==$userPermission->user_id)\n {\n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company_id,\"id\"=>$roleId])->asArray()->all(); \n \n $ownupdate=1;\n }\n else\n {\n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company_id,\"is_superadmin\"=>0])->asArray()->all(); \n }\n \n \n }else{\n \n if($commonCode->canAccess(\"user-create\") || $commonCode->canAccess(\"user-update\"))\n {\n if($id==$userPermission->user_id)\n {\n $ownupdate=1;\n }\n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company['id'],\"is_superadmin\"=>0])->asArray()->all();\n \n }else\n {\n \n $roleObj = \\backend\\models\\Roles::find()->where([\"company_id\"=>$company['id'],\"id\"=>$roleId])->asArray()->all(); \n \n \n }\n }\n $roleArray = ArrayHelper::map($roleObj, 'id', 'role_name'); \n if($userPermission->isSystemAdmin)\n {\n if($id==$userPermission->user_id)\n {\n \n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"=\",\"id\",$company['id']])->asArray()->all();\n \n }\n else{\n \n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"!=\",\"id\",$company['id']])->asArray()->all();\n }\n \n }else{\n \n $companyObj = \\backend\\models\\CompanyMaster::find()->where([\"id\"=>$company['id']])->asArray()->all();\n }\n \n $companyArray = ArrayHelper::map($companyObj, 'id', 'company_code'); \n \n if(isset($param['User']['company_id']))\n {\n $user->company_id=$param['User']['company_id'];\n }else{\n \n $user->company_id=$user->getUserCompany($id);\n }\n\n $this->performAjaxValidation($user);\n \n $param=Yii::$app->request->post();\n $rarray=$selectedRoleArray= $user->getUserRole($id);\n if(isset($param['selectItemUser']['role_id']))\n {\n $selectedRoleArray=implode(\",\",$param['selectItemUser']['role_id']); \n \n }\n \n $userdbrole=$user->getDBRole($id);\n \n \n if($userdbrole)\n $dbRole=explode(\",\",$userdbrole);\n\n if ($user->load(Yii::$app->request->post()) && $user->save()) \n {\n $user->company_id=$param['User']['company_id'];\n if(isset($param['selectItemUser']['role_id']))\n {\n if($param['selectItemUser']['role_id']!=explode(\",\",$rarray))\n {\n $auth = Yii::$app->authManager;\n $userroledelete=$user->deleteuserrole($id);\n $userrole=$auth->getRolesByUser($id);\n\n if(isset($param['selectItemUser']['role_id']))\n {\n $roles=$param['selectItemUser']['role_id'];\n foreach($roles as $role)\n {\n $userrole=new \\backend\\models\\UserRoles(); \n $userrole->role_id=$role;\n $userrole->user_id=$user->id; \n $userrole->save();\n }\n\n //assign permission to user\n $rolepermission=$user->UpdateRolePermission($user->id,$param['selectItemUser']['role_id'],$userdbrole);\n\n\n\n }else{\n\n $user->addError(\"role_id\",\"please select role\");\n return $this->render('_account', [\n 'user' => $user,\n 'roleArray'=>$roleArray,\n 'companyArray'=>$companyArray,\n \"selectedRoleArray\"=>$selectedRoleArray,\n 'ownupdate'=>$ownupdate\n ]); \n }\n }\n \n }else{\n \n $user->addError(\"role_id\",\"please select role\");\n return $this->render('_account', [\n 'user' => $user,\n 'roleArray'=>$roleArray,\n 'companyArray'=>$companyArray,\n \"selectedRoleArray\"=>$selectedRoleArray,\n 'ownupdate'=>$ownupdate]);\n }\n $user->updateUserCompany($id,$user->company_id);\n \n Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Account details have been updated'));\n\n return $this->refresh();\n }\n\n return $this->render('_account', [\n 'user' => $user,\n 'roleArray'=>$roleArray,\n 'companyArray'=>$companyArray,\n \"selectedRoleArray\"=>$selectedRoleArray,\n 'ownupdate'=>$ownupdate\n ]);\n }", "function do_Edit ($lang)\n {\n global $vnT, $func, $DB, $conf;\n $id = (int) $vnT->input['id'];\n if ($vnT->input['do_submit']) {\n $data = $_POST;\n $name = $vnT->input['name'];\n // Check for Error\n $query = $DB->query(\"SELECT name FROM ad_pos WHERE name='{$name}' and id<>$id \");\n if ($check = $DB->fetch_row($query))\n $err = $func->html_err(\"Name existed\");\n\n if(empty($_POST['csrf_token']) || ($_POST['csrf_token'] != $_SESSION['vnt_csrf_token']) ) {\n $err = $func->html_err($vnT->lang['err_csrf_token']) ;\n }\n\n if (empty($err)) {\n $cot['name'] = trim($data['name']);\n $cot['title'] = $func->txt_HTML($data['title']);\n $cot['width'] = $data['width'];\n $cot['height'] = $data['height'];\n $cot['align'] = $data['align'];\n $cot['type_show'] = $data['type_show'];\n $kq = $DB->do_update(\"ad_pos\", $cot, \"id=$id\");\n if ($kq) {\n unset($_SESSION['vnt_csrf_token']);\n //xoa cache\n $func->clear_cache();\n //insert adminlog\n $func->insertlog(\"Edit\", $_GET['act'], $id);\n $err = $vnT->lang[\"edit_success\"];\n $url = $this->linkUrl . \"&sub=edit&id=$id\";\n $func->html_redirect($url, $err);\n } else\n $err = $func->html_err($vnT->lang[\"edit_failt\"] . $DB->debug());\n }\n }\n $query = $DB->query(\"SELECT * FROM ad_pos WHERE id=$id\");\n if ($data = $DB->fetch_row($query)) {\n $data['title'] = $func->txt_unHTML($data[\"title\"]);\n } else {\n $mess = $vnT->lang['not_found'] . \" ID : \" . $id;\n $url = $this->linkUrl;\n $func->html_redirect($url, $mess);\n }\n $data['list_align'] = $this->listAlign($data['align']);\n $data['list_type_show'] = $this->List_Type_Show($data['type_show']);\n $data['readonly'] = 'readonly=\"ReadOnly\"';\n if (! isset($_SESSION['vnt_csrf_token'])) {\n $_SESSION['vnt_csrf_token'] = md5(uniqid(rand(), TRUE)) ;\n }\n $data['csrf_token'] = $_SESSION['vnt_csrf_token'] ;\n $data['err'] = $err;\n $data['link_action'] = $this->linkUrl . \"&sub=edit&id=$id\";\n /*assign the array to a template variable*/\n $this->skin->assign('data', $data);\n $this->skin->parse(\"edit\");\n return $this->skin->text(\"edit\");\n }", "public function editionAction() {\r\n //inactivate header/footer\r\n $this->_includeTemplate = false;\r\n\r\n if ($_GET['checkboxAd'] == 'false') {\r\n $typeU = \"child\";\r\n } else {\r\n $typeU = \"adult\";\r\n }\r\n\r\n if ($_GET['checkboxAdmin'] == 'false') {\r\n $admin = \"0\";\r\n } else {\r\n $admin = \"1\";\r\n }\r\n\r\n //test to know if the user already exists\r\n $cpt = true;\r\n foreach ($_SESSION['members'] as $member) {\r\n\r\n if (($_GET['Name'] == $member->getName()) && ($_GET['CurrName'] != $member->getName() )) {\r\n $cpt = false;\r\n }\r\n }\r\n\r\n //if user doesn't exist\r\n if ($cpt) {\r\n //sql connection\r\n\r\n if ($_SESSION['Name'] == $_GET['CurrName'])//Current edit current\r\n $_SESSION['Name'] = $_GET['Name'];\r\n\r\n $connect = connection::getInstance();\r\n $_GET['Name'] = Users::secure($_GET['Name']);\r\n $_GET['Pass'] = Users::secure($_GET['Pass']);\r\n $_GET['Id'] = Users::secure($_GET['Id']);\r\n\r\n $sql = \"UPDATE users SET nameU='\" . $_GET['Name'] . \"', typeU='\" . $typeU . \"',password='\" . $_GET['Pass'] . \"', admin='\" . $admin . \"' where IDU ='\" . $_GET['Id'] . \"'\"; //on recupere tout les utilisateurs\r\n //sending request\r\n $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());\r\n\r\n \r\n $_SESSION['admin'] = $admin;\r\n $_SESSION['current'] = 'members';\r\n $this->members = Users::Getuser(); //give data to view\r\n } else {\r\n $this->members = $_SESSION['members']; //give data to view\r\n }\r\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function showAdmins() {\n // permissions...\n if(!Current_User::isDeity()) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Menu.php');\n $error = 'Uh Uh Uh! You didn\\'t say the magic word!';\n Sysinventory_Menu::showMenu($error);\n return;\n }\n // see if we need to do anything to the db\n if(isset($_REQUEST['newadmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->department_id = $_REQUEST['department_id'];\n $admin->username = $_REQUEST['username'];\n $admin->save();\n }else if (isset($_REQUEST['deladmin'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $admin = new Sysinventory_Admin;\n $admin->id = $_REQUEST['id'];\n $admin->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Administrators';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of admins\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Admin.php');\n $adminList = Sysinventory_Admin::generateAdminList();\n // get the list of departments\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Department.php');\n $depts = Sysinventory_Department::getDepartmentsByUsername();\n\n // build the array for the department drop-down box\n $deptIdSelect = array();\n foreach($depts as $dept) {\n $deptIdSelect[$dept['id']] = $dept['description'];\n }\n\n // make the form for adding a new admin\n $form = new PHPWS_Form('add_admin');\n $form->addSelect('department_id',$deptIdSelect);\n $form->setLabel('department_id','Department');\n $form->addText('username');\n $form->setLabel('username','Username');\n $form->addSubmit('submit','Create Admin');\n $form->setAction('index.php?module=sysinventory&action=edit_admins');\n $form->addHidden('newadmin','add');\n\n $tpl['PAGER'] = $adminList;\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_admin.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }", "function flag_note_for_deletion($module_key,$space_key,$link_key,$delete_action) \r\n{\r\n \r\n\treturn true;\r\n\r\n}", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "function editAdminHandler() {\n global $inputs;\n\n updateDb('admin',[\n 'name' => $inputs['admin_username'],\n 'password' => $inputs['admin_password'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n updateDb('admin_building',[\n 'building_id' => $inputs['admin_building'],\n ], [\n 'admin_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}" ]
[ "0.6732957", "0.6531685", "0.6470069", "0.6461191", "0.6456927", "0.6375099", "0.6358518", "0.63504994", "0.63504994", "0.6283216", "0.62545425", "0.6250286", "0.6235836", "0.6235738", "0.6235165", "0.622827", "0.622827", "0.6218546", "0.6218546", "0.6218546", "0.61921614", "0.61891925", "0.618082", "0.6166955", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.61573297", "0.615234", "0.615234", "0.615234", "0.61447406", "0.6141187", "0.61387223", "0.6128031", "0.6128031", "0.6128031", "0.6128031", "0.6094213", "0.607664", "0.6063591", "0.6049568", "0.6037806", "0.6037806", "0.60155255", "0.60020065", "0.5991195", "0.5987685", "0.5977773", "0.59668297", "0.5960748", "0.595876", "0.59583396", "0.59572744", "0.59534657", "0.5951982", "0.5942992", "0.59414804", "0.59347814", "0.59347534", "0.5933088", "0.5924487", "0.5922994", "0.59084916", "0.58937657", "0.5890732", "0.5890583", "0.5889926", "0.58880436", "0.5885677", "0.58841085", "0.5873116", "0.5865438", "0.5861613", "0.5839379", "0.5837834", "0.58344305", "0.58316064", "0.58305675", "0.5828961", "0.5826516", "0.58262974", "0.5825365", "0.58156174", "0.58152825", "0.58074623", "0.5803508", "0.58031183", "0.5797602", "0.5797602", "0.57954836", "0.57928014", "0.57905424" ]
0.0
-1
Create a new pagination instance.
public function __construct( protected QueryBuilder $query, protected PaginationParameters $parameters = (new PaginationParameters), protected ?PaginationColumns $columnsMap = null, protected array $headers = [] ) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function factory(array $config = array())\n\t{\n\t\treturn new Pagination($config);\n\t}", "public function createPaginationObject()\n {\n $adapter = new DoctrineDbalAdapter($this->deliverQueryObject(), function ($query) {\n $query->resetQueryParts(['groupBy', 'orderBy'])->select('count(distinct uph.upID)')->setMaxResults(1);\n });\n\n return new Pagination($this, $adapter);\n }", "public function create($classname)\n \t{\n \t\treturn new Pagination_object($classname);\n \t}", "public function create( $_total, $_size, $_pageno )\r\n {\r\n return new Page($_total, $_size, $_pageno);\r\n }", "public static function create_pagination(array $data, int $perPage)\n {\n return new Paginator($data, $perPage);\n }", "public function createPages() {\n $pageCount = $this->getPageCount();\n $currentPageNumber = $this->getCurrentPage();\n\n $structure = new XGrid_Plugin_Pagination_Structure();\n $structure->setPageCount($pageCount);\n $structure->setItemCountPerPage($this->getItemCountPerPage());\n $structure->setFirst(1);\n $structure->setCurrent($currentPageNumber);\n $structure->setLast($pageCount);\n\n // Previous and next\n if ($currentPageNumber - 1 > 0) {\n $structure->setPrevious($currentPageNumber - 1);\n }\n \n if ($currentPageNumber + 1 <= $pageCount) {\n $structure->setNext($currentPageNumber + 1);\n }\n\n // Pages in range\n $scrollingStyle = $this->getScrollingStyle();\n $structure->setPagesInRange($scrollingStyle->getPages($this));\n $structure->setFirstPageInRange(min($structure->getPagesInRange()));\n $structure->setLastPageInRange(max($structure->getPagesInRange()));\n \n $this->_structure = $structure; \n }", "public static function instance() {\n\t\treturn new PaginationConfig();\n\t}", "protected function buildPagination() {}", "protected function buildPagination() {}", "public static function newPageInstance()\n {\n $model = new static();\n $model->setAttribute('type', static::PAGE);\n\n return $model;\n }", "protected function generatePages(): Pages\n\t{\n\t\t$paginator = new Pages();\n\n\t\t// If there is only 1 page\n\t\tif ($this->totalPages <= 1) {\n\t\t\t$paginator->buttons[] = $paginator->current = $this->createElement(1, 1);\n\n\t\t\treturn $paginator;\n\t\t}\n\n\t\t$paginator->current = $this->createElement($this->currentPage, $this->currentPage);\n\n\t\t$range = $this->getRange();\n\t\t// Where the middle part (exclude first and last page) starts\n\t\t$startMiddle = \\max($this->currentPage - $range, 2);\n\t\t$endMiddle = \\min($this->currentPage + $range, $this->totalPages - 1);\n\n\t\t$paginator->buttons[] = $this->createElement(1, $this->currentPage);\n\t\t$this->addBeginningButtons($paginator, $startMiddle);\n\n\t\tfor ($i = $startMiddle; $i <= $endMiddle; $i += 1) {\n\t\t\t$paginator->buttons[] = $this->createElement($i, $this->currentPage);\n\t\t}\n\n\t\t$this->addEndingButtons($paginator, $endMiddle);\n\t\t$paginator->buttons[] = $this->createElement($this->totalPages, $this->currentPage);\n\n\t\treturn $paginator;\n\t}", "public static function pagination()\n {\n $limit = (int) self::set(\"limit\");\n $offset = (int) self::set(\"offset\");\n\n $limit = Validator::intType()->notEmpty()->positive()->validate($limit)? $limit: false;\n $offset = Validator::intType()->notEmpty()->positive()->validate($offset)? $offset: 0;\n\n $pagination = \"\";\n $pagination .= $limit? \" LIMIT {$limit}\": null;\n $pagination .= ($limit && $offset)? \" OFFSET {$offset}\": null;\n\n return (object) [\n \"limit\" => $limit,\n \"offset\" => $offset,\n \"query\" => $pagination\n ];\n }", "public function __construct($pages,$pagination)\n {\n // $datas=tapel::all();\n $this->pages=$pages;\n $this->pagination=$pagination;\n }", "function pagination(){}", "public function setPagination($pagination)\n {\n $this->_pagination = $pagination;\n return $this;\n }", "public function pagination(string $value): static\n {\n $new = clone $this;\n $new->pagination = $value;\n\n return $new;\n }", "abstract public function preparePagination();", "public function getPagerObject() {\n\n\t\t/** @var $pager \\TYPO3\\CMS\\Vidi\\Persistence\\Pager */\n\t\t$pager = GeneralUtility::makeInstance('TYPO3\\CMS\\Vidi\\Persistence\\Pager');\n\n\t\t// Set items per page\n\t\tif (GeneralUtility::_GET('iDisplayLength') !== NULL) {\n\t\t\t$limit = (int) GeneralUtility::_GET('iDisplayLength');\n\t\t\t$pager->setLimit($limit);\n\t\t}\n\n\t\t// Set offset\n\t\t$offset = 0;\n\t\tif (GeneralUtility::_GET('iDisplayStart') !== NULL) {\n\t\t\t$offset = (int) GeneralUtility::_GET('iDisplayStart');\n\t\t}\n\t\t$pager->setOffset($offset);\n\n\t\t// set page\n\t\t$page = 1;\n\t\tif ($pager->getLimit() > 0) {\n\t\t\t$page = round($pager->getOffset() / $pager->getLimit());\n\t\t}\n\t\t$pager->setPage($page);\n\n\t\treturn $pager;\n\t}", "public function testGetPagesAndCreatePaginator()\n {\n $i = 0;\n $pageFrom = 1;\n $perPage = 20;\n $totalItems = 400;\n\n $link = $this->createMock(HalLink::class);\n $link\n ->expects($this->once())\n ->method('get')\n ->willReturn($this->getPaginatedResource($i, $pageFrom, $perPage, $totalItems));\n\n $instance = new DomainResourceMock($link);\n\n $count = 0;\n $criterias = ['page' => $pageFrom, 'limit' => $perPage];\n foreach ($instance->getPages($criterias) as $collection) {\n $count++;\n $this->assertInstanceOf(PaginatedResourceCollection::class, $collection);\n }\n\n // NumberItem / ItemPerPage = NumberOfPages,\n // NumberOfPages - (PageToStartAt - 1) = AwaitedNumberOfPages (-1 because page 0 does no exists)\n $this->assertEquals(($totalItems / $perPage) - ($pageFrom - 1), $count);\n }", "private function createLengthAwarePaginator()\n {\n $this->pagination = true;\n\n $this->_paginate_current = $this->data->currentPage();\n\n $this->_paginate_total = $this->data->lastPage();\n\n $this->data = $this->data->all();\n\n $this->normalize();\n }", "protected function getPaginationService()\n {\n return $this->services['pagination'] = new \\phpbb\\pagination(${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['controller.helper']) ? $this->services['controller.helper'] : $this->getController_HelperService()) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'});\n }", "public function paginator()\n {\n return new Tools\\Paginator($this);\n }", "function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }", "public function getPagination()\n\t{\n\t\t// Create pagination object if it doesn't already exist\n\t\tif (empty($this->_pagination))\n\t\t{\n\t\t\trequire_once (JPATH_COMPONENT_SITE.DS.'helpers'.DS.'pagination.php');\n\t\t\t$this->_pagination = new FCPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\n\t\treturn $this->_pagination;\n\t}", "protected function __construct($config = array()) \n\t{\n\t\t$config = Config::get('pagination', array()) + $config;\n\t\t$config = Config::get('hybrid.pagination', array()) + $config;\n\n\t\t// Bind passed config as instance's properties\n\t\tforeach ($config as $key => $value)\n\t\t{\n\t\t\t// manage template\n\t\t\tif ($key == 'template')\n\t\t\t{\n\t\t\t\t$this->template = array_merge($this->template, $config['template']);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// only config value if the property exist\n\t\t\tif (property_exists($this, $key))\n\t\t\t{\n\t\t\t\t$this->{$key} = $value;\n\t\t\t}\n\t\t}\n\n\t\t// process URI and get \n\t\t$this->initiate();\n\n\t\t// calculate current config\n\t\t$this->total_pages = ceil($this->total_items / $this->per_page) ?: 1;\n\n\t\tif ($this->current_page > $this->total_pages)\n\t\t{\n\t\t\t$this->current_page = $this->total_pages;\n\t\t}\n\t\telseif ($this->current_page < 1)\n\t\t{\n\t\t\t$this->current_page = 1;\n\t\t}\n\n\t\t// The current page must be zero based so that the offset for page 1 is 0.\n\t\t$this->offset = ($this->current_page - 1) * $this->per_page;\n\t}", "public function getPaginate()\n {\n /* Clone the original builder */\n $builder = clone $this->_builder;\n $totalBuilder = clone $builder;\n\n $limit = $this->_limitRows;\n $numberPage = $this->_page;\n\n if (is_null($numberPage) === true) {\n $numberPage = 1;\n }\n\n $prevNumberPage = $numberPage - 1;\n $number = $limit * $prevNumberPage;\n\n //Set the limit clause avoiding negative offsets\n if ($number < $limit) {\n $builder->limit($limit);\n } else {\n $builder->limit($limit, $number);\n }\n\n $query = $builder->getQuery();\n\n //Change the queried columns by a COUNT(*)\n $totalBuilder->columns('COUNT(*) [rowcount]');\n\n //Remove the 'ORDER BY' clause, PostgreSQL requires this\n $totalBuilder->orderBy(null);\n\n //Obtain the PHQL for the total query\n $totalQuery = $totalBuilder->getQuery();\n\n //Obtain the result of the total query\n $result = $totalQuery->execute();\n $row = $result->getFirst();\n\n $totalPages = $row['rowcount'] / $limit;\n $intTotalPages = (int)$totalPages;\n\n if ($intTotalPages !== $totalPages) {\n $totalPages = $intTotalPages + 1;\n }\n\n $page = new stdClass();\n $page->first = 1;\n $page->before = ($numberPage === 1 ? 1 : ($numberPage - 1));\n $page->items = $query->execute();\n $page->next = ($numberPage < $totalPages ? ($numberPage + 1) : $totalPages);\n $page->last = $totalPages;\n $page->current = $numberPage;\n $page->total_pages = $totalPages;\n $page->total_items = (int)$row['rowcount'];\n\n return $page;\n }", "private function preparePagination($query)\n {\n $countQuery = clone $query;\n $pagination = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => static::PAGINATION_PAGE_SIZE]);\n $query->offset($pagination->offset)->limit($pagination->limit);\n return $pagination;\n\n }", "protected function buildPagination()\n {\n $this->calculateDisplayRange();\n $pages = [];\n for ($i = $this->displayRangeStart; $i <= $this->displayRangeEnd; $i++) {\n $pages[] = [\n 'number' => $i,\n 'offset' => ($i - 1) * $this->itemsPerPage,\n 'isCurrent' => $i === $this->currentPage\n ];\n }\n $pagination = [\n 'linkConfiguration' => $this->linkConfiguration,\n 'pages' => $pages,\n 'current' => $this->currentPage,\n 'numberOfPages' => $this->numberOfPages,\n 'lastPageOffset' => ($this->numberOfPages - 1) * $this->itemsPerPage,\n 'displayRangeStart' => $this->displayRangeStart,\n 'displayRangeEnd' => $this->displayRangeEnd,\n 'hasLessPages' => $this->displayRangeStart > 2,\n 'hasMorePages' => $this->displayRangeEnd + 1 < $this->numberOfPages\n ];\n if ($this->currentPage < $this->numberOfPages) {\n $pagination['nextPage'] = $this->currentPage + 1;\n $pagination['nextPageOffset'] = $this->currentPage * $this->itemsPerPage;\n }\n if ($this->currentPage > 1) {\n $pagination['previousPage'] = $this->currentPage - 1;\n $pagination['previousPageOffset'] = ($this->currentPage - 2) * $this->itemsPerPage;\n }\n return $pagination;\n }", "function getPagination()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_pagination))\n\t\t{\n\t\t\tjimport('joomla.html.pagination');\n\t\t\t$this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit'));\n\t\t}\n\n\t\treturn $this->_pagination;\n\t}", "function getPagination()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_pagination))\n\t\t{\n\t\t\tjimport('joomla.html.pagination');\n\t\t\t$this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\n\t\treturn $this->_pagination;\n\t}", "function getPagination()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_pagination))\n\t\t{\n\t\t\tjimport('joomla.html.pagination');\n\t\t\t$this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\n\t\treturn $this->_pagination;\n\t}", "function getPagination()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\t\tif (empty($this->_pagination))\n\t\t\t{\n\t\t\t\tjimport('joomla.html.pagination');\n\t\t\t\t$this->_pagination\t\t\t\t= new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit'));\n\t\t\t}\n\n\t\treturn $this->_pagination;\n\t}", "public static function pagination($pagination, $url = null, $class = 'pagination', $countOut = 0, $countIn = 2)\n {\n if ($pagination->total_pages < 2) {\n return;\n }\n // Beginning group of pages: $n1...$n2\n $n1 = 1;\n $n2 = min($countOut, $pagination->total_pages);\n\n // Ending group of pages: $n7...$n8\n $n7 = max(1, $pagination->total_pages - $countOut + 1);\n $n8 = $pagination->total_pages;\n\n // Middle group of pages: $n4...$n5\n $n4 = max($n2 + 1, $pagination->current - $countIn);\n $n5 = min($n7 - 1, $pagination->current + $countIn);\n $useMiddle = ($n5 >= $n4);\n\n // Point $n3 between $n2 and $n4\n $n3 = (int) (($n2 + $n4) / 2);\n $useN3 = ($useMiddle && (($n4 - $n2) > 1));\n\n // Point $n6 between $n5 and $n7\n $n6 = (int) (($n5 + $n7) / 2);\n $useN6 = ($useMiddle && (($n7 - $n5) > 1));\n\n // Links to display as array(page => content)\n $links = array();\n\n // Generate links data in accordance with calculated numbers\n for ($i = $n1; $i <= $n2; $i++) {\n $links[$i] = $i;\n }\n\n if ($useN3) {\n $links[$n3] = '&hellip;';\n }\n\n for ($i = $n4; $i <= $n5; $i++) {\n $links[$i] = $i;\n }\n\n if ($useN6) {\n $links[$n6] = '&hellip;';\n }\n\n for ($i = $n7; $i <= $n8; $i++) {\n $links[$i] = $i;\n }\n\n // Detect URL\n $tag = \\Phalcon\\DI::getDefault()->getShared('tag');\n $query = \\Phalcon\\DI::getDefault()->getShared('request')->getQuery();\n $url = $url ? $url : substr($query['_url'], 1);\n unset($query['_url']);\n\n // Prepare list\n $html = '<ul class=\"' . $class . '\">';\n\n // Prepare First button\n if ($pagination->current != $pagination->first) {\n unset($query['page']);\n $html .= '<li>' . $tag->linkTo(array($url, 'query' => $query, 'rel' => 'first', __('First'))) . '</li>';\n } else {\n $html .= '<li class=\"disabled\"><span>' . __('First') . '</span></li>';\n }\n\n // Prepare Previous button\n if ($pagination->current > $pagination->before) {\n $query['page'] = $pagination->before;\n $html .= '<li>' . $tag->linkTo(array($url, 'query' => $query, 'rel' => 'prev', 'title' => __('Previous'), '«')) . '</li>';\n } else {\n $html .= '<li class=\"disabled\"><span>«</span></li>';\n }\n\n // Prepare Pages\n $paginations = array();\n foreach ($links as $number => $content) {\n if ($number === $pagination->current) {\n $paginations[] = '<li class=\"active\"><span>' . $content . '</span></li>';\n } else {\n $query['page'] = $number;\n $paginations[] = '<li' . ($content == '&hellip;' ? ' class=\"disabled\"' : '') . '>' . $tag->linkTo(array($url, 'query' => $query, $content)) . '</li>';\n }\n }\n\n $html .= implode('', $paginations);\n\n // Prepare Next button\n if ($pagination->current < $pagination->next) {\n $query['page'] = $pagination->next;\n $html .= '<li>' . $tag->linkTo(array($url, 'query' => $query, 'rel' => 'next', 'title' => __('Next'), '»')) . '</li>';\n } else {\n $html .= '<li class=\"disabled\"><span>»</span></li>';\n }\n\n // Prepare Last button\n if ($pagination->current != $pagination->last) {\n $query['page'] = $pagination->last;\n $html .= '<li>' . $tag->linkTo(array($url, 'query' => $query, 'rel' => 'last', __('Last'))) . '</li>';\n } else {\n $html .= '<li class=\"disabled\"><span>' . __('Last') . '</span></li>';\n }\n\n // Close list\n $html .= '</ul>';\n\n return $html;\n }", "public function newPage($timestamp = null)\n {\n return new Page($this, $timestamp);\n }", "function getPagination()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_pagination))\n\t\t{\n\t\t\tjimport('joomla.html.pagination');\n\t\t\t$this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\t\treturn $this->_pagination;\n\t}", "function getPagination()\r\n\t{\r\n\t\t// Lets load the content if it doesn't already exist\r\n\t\tif (empty($this->_pagination))\r\n\t\t{\r\n\t\t\tjimport('joomla.html.pagination');\r\n\t\t\t$this->_pagination = new JPagination( $this->itemCount(), rsgInstance::getInt( 'limitstart', 0 ), rsgInstance::getInt( 'limit', 0 ) );\r\n\t\t}\r\n\r\n\t\treturn $this->_pagination;\r\n\t}", "protected function setupPager($query, $page)\n {\n $paginator = new Pagerfanta(new DoctrineORMAdapter($query, true));\n $paginator->setMaxPerPage(15);\n $paginator->setCurrentPage($page, false, true);\n\n return $paginator;\n }", "public function __construct() {\n\t\t$this->page \t= new Page;\n\t\t$this->url \t\t= new Url;\n\t\t$this->session \t= new Session;\n\t\t$this->paging \t= new Paging;\n\t}", "public static function fromPaginationLink(array $link): static\n {\n return static::make([\n 'url' => Arr::get($link, 'url'),\n 'title' => Arr::get($link, 'label'),\n 'active' => Arr::get($link, 'active', false),\n ]);\n }", "public function __construct()\r\n\t{\r\n\t\tif(!Role::is('admin'))\r\n\t\t{\r\n\t\t\tRedirect::to('/login');\r\n\r\n\t\t\texit();\r\n\t\t}\r\n\r\n\t\t// Inject Pagination container\r\n\t\tnew Pagination;\r\n\r\n\t}", "function getPagination()\r\n\t{\r\n\t\tif ( empty( $this->_pagination ) )\r\n\t\t{\r\n\t\t\tjimport('joomla.html.pagination');\r\n\t\t\t$this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\r\n\t\t}\r\n\r\n\t\treturn $this->_pagination;\r\n\t}", "public function pageListObject(){\n if( $this->_pageListObj === null ){\n $this->_pageListObj = new PageList;\n $this->_pageListObj->setItemsPerPage( $this->numToShow );\n $this->_pageListObj->filterByParentID( $this->getParentPageID() );\n // if we're applying attribute filters\n if( isset($_REQUEST['akID']) ){\n $this->applyAttributeFilters( $this->_pageListObj );\n }\n // if we're filtering by a month (eg. \"archives\")\n if( isset($_REQUEST['blog_list_archive']) ){\n $year = (int) $_REQUEST['blog_list_archive']['year'];\n $month = date_parse($_REQUEST['blog_list_archive']['month']);\n $month = $month['month'];\n $this->_pageListObj->filter(false, \"(YEAR(cv.cvDatePublic) = {$year} and MONTH(cv.cvDatePublic) = {$month})\");\n }\n }\n return $this->_pageListObj;\n }", "public function __construct()\n {\n $this->rendererClass = Renderer::class;\n\n $this->cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);\n $this->cObj->start(array());\n\n $this->offset = max(0, (int) GeneralUtility::_GET('offset'));\n $this->limit = max(0, (int) GeneralUtility::_GET('limit'));\n if ($this->limit <= 0) {\n $this->limit = 100;\n }\n\n $this->createRenderer();\n\n $singlePid = intval(GeneralUtility::_GP('singlePid'));\n $this->singlePid = $singlePid && $this->isInRootline($singlePid) ?\n $singlePid : \\FelixNagel\\T3extblog\\Utility\\GeneralUtility::getTsFe()->id;\n\n $this->validateAndcreatePageList();\n }", "public function __construct()\n {\n $this->itemsPerPage = 15;\n $this->currentPage = 1;\n $this->previousPage = 1;\n $this->nextPage = 1;\n $this->url = '';\n $this->totalPages = 1;\n $this->renderedItemsMax = 8;\n }", "function getPagination() {\n\t\tif (empty($this->_pagination)) {\n\t\t\tjimport('joomla.html.pagination');\n\t\t\t$this->_pagination = new JPagination( $this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\n\t\treturn $this->_pagination;\n\t}", "function getPagination()\r\n\t{\r\n\t\tif (empty($this->_pagination))\r\n\t\t{\r\n\t\t\tjimport('joomla.html.pagination');\r\n\t\t\t$this->_pagination = new JPagination( $this->getState('total'), $this->getState('limitstart'), $this->getState('limit') );\r\n\t\t}\r\n\r\n\t\treturn $this->_pagination;\r\n\t}", "private function constructPagination($dataArr){\n $currentPage = LengthAwarePaginator::resolveCurrentPage();\n $col = new Collection($dataArr);\n $perPage = 10;\n $entries = new LengthAwarePaginator($col->forPage($currentPage, $perPage), $col->count(), $perPage, $currentPage);\n $entries->setPath(LengthAwarePaginator::resolveCurrentPath());\n return $entries;\n }", "public function setPagination($value)\n {\n if (is_array($value)) {\n $config = ['class' => Pagination::className()];\n if ($this->id !== null) {\n $config['pageParam'] = $this->id . '-page';\n $config['pageSizeParam'] = $this->id . '-per-page';\n }\n $this->_pagination = Yii::createObject(array_merge($config, $value));\n } elseif ($value instanceof Pagination || $value === false) {\n $this->_pagination = $value;\n } else {\n throw new InvalidParamException('Only Pagination instance, configuration array or false is allowed.');\n }\n }", "public static function create()\n {\n $page = new Page();\n $page->site_id = \\Bazalt\\Site::getId();\n if (!\\Bazalt\\Auth::getUser()->isGuest()) {\n $page->user_id = \\Bazalt\\Auth::getUser()->id;\n }\n return $page;\n }", "public function getPagination()\n {\n if ($this->_pagination === null) {\n $this->setPagination([]);\n }\n\n return $this->_pagination;\n }", "public function __construct() {\n\n $this->_queries = new queries();\n $this->_pagination = new PagePagination();\n }", "public function slice($configs) {\n $this->__page__ = new Paging($configs);\n return $this;\n }", "function getPagination()\n\t{\n\t\tif (empty($this->_pagination)) {\n\t\t\tjimport('joomla.html.pagination');\n\t\t\t$this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\t\treturn $this->_pagination;\n\t}", "function getPagination()\n\t{\n\t\tif (empty($this->_pagination)) {\n\t\t\tjimport('joomla.html.pagination');\n\t\t\t$this->_pagination = new JPagination($this->getTotal(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t}\n\t\treturn $this->_pagination;\n\t}", "public function paginator(PaginatorInterface $value): static\n {\n $new = clone $this;\n $new->paginator = $value;\n\n return $new;\n }", "function getPagination() {\r\n\t\tif (empty ( $this->_pagination )) {\r\n\t\t\tjimport ( 'joomla.html.pagination' );\r\n\t\t\t$this->_pagination = new JPagination ( $this->getTotal (), $this->getState ( 'limitstart' ), $this->getState ( 'limit' ) );\r\n\t\t}\r\n\t\treturn $this->_pagination;\r\n\t}", "protected function createPageLinks()\n {\n $pageLinks = array();\n\n if ($this->totalPages > 10) {\n $startRange = $this->page - floor($this->range/2);\n $endRange = $this->page + floor($this->range/2);\n\n //Start range\n if ($startRange <= 0) {\n $startRange = 1;\n $endRange += abs($startRange) + 1;\n }\n\n // End range\n if ($endRange > $this->totalPages) {\n $startRange -= $endRange - $this->totalPages;\n $endRange = $this->totalPages;\n }\n\n // Range\n $range = range($startRange, $endRange);\n\n // Add first page\n $this->pageLinks[] = array(\n 'page' => 1,\n 'uri' => $this->createUri(1)\n );\n\n foreach ($range as $page) {\n // Skip for first and last page\n if ($page == 1 or $page == $this->totalPages) {\n continue;\n }\n\n $this->pageLinks[] = array(\n 'page' => $page,\n 'uri' => $this->createUri($page)\n );\n }\n\n // Add last page\n $this->pageLinks[] = array(\n 'page' => $this->totalPages,\n 'uri' => $this->createUri($this->totalPages)\n );\n } else {\n for ($i = 1; $i <= $this->totalPages; $i++) {\n $this->pageLinks[] = array(\n 'page' => $i,\n 'uri' => $this->createUri($i)\n );\n }\n }\n }", "function &getPagination()\r\n{\r\n\tif ($this->_pagination == Null)\r\n\t\t$this->_pagination = new JPagination(0,0,0);\r\n\treturn $this->_pagination;\r\n}", "public function getPagination()\n {\n // Get a storage key.\n// $store = $this->getStoreId('getPagination');\n//\n// // Try to load the data from internal storage.\n// if (isset($this->cache[$store]))\n// {\n// return $this->cache[$store];\n// }\n\n // Create the pagination object.\n jimport('joomla.html.pagination');\n $limit = (int) $this->getState('list.limit') - (int) $this->getState('list.links');\n $page = new JPagination($this->getTotal(), $this->getStart(), $limit);\n\n // Add the object to the internal cache.\n// $this->cache[$store] = $page;\n\n return $page;\n }", "function get_pager()\n\t{\n\t\tinclude_once('Pager/Pager.php');\n\t\t$pager_options = array();\n\t\t$pager_options['mode'] = 'Sliding';\n\t\t$pager_options['urlVar'] = 'page';\n\t\t$pager_options['delta'] = 2;\n\t\t$pager_options['perPage'] = (int) $this->rows_per_page;\n\t\t$pager_options['separator'] = '|';\n\t\t$pager_options['prev'] = '&laquo;';\n\t\t$pager_options['next'] = '&raquo;';\n\t\t$pager_options['append'] = false;\n\t\t$pager_options['fileName'] = $this->pager_file_name;\n\t\t\n\t\t$pager_options['totalItems'] = $this->totalItems;\n\t\t\n\t\t$currentPage = common::arg($this->pager_arg_no);\n\t\t//$this->content->debug .= ' currentPage: '.$currentPage .' argno: '.$this->pager_arg_no .' a:'.(int)common::arg(3);\n\t\tif (! isset($currentPage) || ! $currentPage) { $currentPage = 1; }\n\t\tif ($currentPage > ceil($this->totalItems/$this->rows_per_page)) { $currentPage = 1; }\n\t\t\n\t\t$pager_options['currentPage'] = $currentPage;\n\t\t\n\t\t$pager =& Pager::factory($pager_options);\n\t\treturn $pager->links;\n\t}", "function createPaging($query,$resultPerPage) \r\n {\r\n\t\t\r\n $this->query = $query;\r\n $this->resultPerPage= $resultPerPage;\r\n\t\r\n $this->fullresult = mysql_query($this->query);\r\n $this->totalresult = mysql_num_rows($this->fullresult);\r\n $this->pages = $this->findPages($this->totalresult,$this->resultPerPage);\r\n if(isset($_GET['page']) && $_GET['page']>0) {\r\n $this->openPage = $_GET['page'];\r\n if($this->openPage > $this->pages) { \r\n $this->openPage = 1;\r\n }\r\n $start = $this->openPage*$this->resultPerPage-$this->resultPerPage;\r\n $end = $this->resultPerPage;\r\n $this->query.= \" LIMIT $start,$end\";\r\n }\r\n elseif($_GET['page']>$this->pages) {\r\n $start = $this->pages;\r\n $end = $this->resultPerPage;\r\n $this->query.= \" LIMIT $start,$end\";\r\n }\r\n else {\r\n $this->openPage = 1;\r\n $this->query .= \" LIMIT 0,$this->resultPerPage\";\r\n }\r\n $this->resultpage = mysql_query($this->query);\r\n\t\t\r\n }", "public static function create($all = null, $limit = null)\r\n\t{\r\n\t\treturn new Opc_Paginator_Range($all, $limit);\r\n\t}", "public static function createInstance()\n {\n return new TabPage('ISerializable', 'ISerializable');\n }", "public static function create(Configuration $configuration, Pagination &$pagination = null)\n {\n return new static(\n $configuration->createHttpClient(),\n $pagination\n );\n }", "public function createPagination($total_rows, $base_url, $cur_page, $per_page = '', $num_links = '') {\n if ($per_page == '') {\n $per_page = 10;\n }\n if ($num_links == '') {\n $num_links = 5;\n }\n /* Loading the pagination library */\n $this->load->library('pagination');\n\n /* Setting the config for pagination */\n $config['base_url'] = $base_url;\n $config['total_rows'] = $total_rows;\n $config['per_page'] = $per_page;\n $config['cur_page'] = $cur_page;\n $config['num_links'] = $num_links;\n $config['full_tag_open'] = '<ul style=\"display: inline-block;\">';\n $config['full_tag_close'] = '</ul>';\n\n $config['first_tag_open'] = '<li>';\n $config['first_link'] = '<< Start';\n $config['first_tag_close'] = '</li>';\n $config['last_tag_open'] = '<li>';\n $config['last_link'] = 'End >> ';\n $config['last_tag_close'] = '</li></ul>';\n $config['next_tag_open'] = '<li>';\n $config['next_link'] = \"Next&gt;\";\n $config['next_tag_close'] = '</li>';\n $config['prev_tag_open'] = '<li>';\n $config['prev_link'] = \"&lt;Previous\";\n $config['prev_tag_close'] = '</li>';\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['cur_tag_open'] = '<li class=\"active\"><a href=\"javascript:void(0);\">';\n $config['cur_tag_close'] = '</a></li>';\n /* Initializing the library */\n $this->pagination->initialize($config);\n /* creating the links */\n $links = $this->pagination->create_links();\n\n /* returning the links */\n $error = $this->db->_error_message();\n $error_number = $this->db->_error_number();\n if ($error) {\n $controller = $this->router->fetch_class();\n $method = $this->router->fetch_method();\n $error_details = array(\n 'error_name' => $error,\n 'error_number' => $error_number,\n 'model_name' => 'Common_Model',\n 'model_method_name' => 'createPagination',\n 'controller_name' => $controller,\n 'controller_method_name' => $method\n );\n $this->common_model->errorSendEmail($error_details);\n redirect(base_url() . 'page-not-found'); //create this route\n }\n return $links;\n }", "public function __construct(){\n \n $pagini = new PaginaModel();\n $pagina = $pagini->pagina(100);\n $this->continut = $pagini->content;\n \n $pagini->inchideConexiune();\n }", "private function getPagination(){\n\t\t$pager=new pager();\n\t\t$pager->isAjaxCall($this->iAmAjax);\n\t\t$pager->set(\"type\", \"buttons\");\n\t\t$pager->set(\"gridId\",$this->id);\n\t\t$pager->set(\"pages\", $this->pages);\n\t\t$pager->set(\"currPage\", $this->currPage);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\treturn $pager->render(true);\n\t}", "public function __construct($fromIndex, $pageSize, $recordCount, $pageSizes = \"\", $range = 10, $autoHidePager = null, $autoHidePageSizeSelector = null, $usePageSizeSelector = null)\n {\n $this->AutoHidePager = $autoHidePager === null ? Config(\"AUTO_HIDE_PAGER\") : $autoHidePager;\n $this->AutoHidePageSizeSelector = $autoHidePageSizeSelector === null ? Config(\"AUTO_HIDE_PAGE_SIZE_SELECTOR\") : $autoHidePageSizeSelector;\n $this->UsePageSizeSelector = $usePageSizeSelector === null ? true : $usePageSizeSelector;\n $this->FromIndex = (int)$fromIndex;\n $this->PageSize = (int)$pageSize;\n $this->RecordCount = (int)$recordCount;\n $this->Range = (int)$range;\n $this->PageSizes = $pageSizes;\n // Handle page size = 0\n if ($this->PageSize == 0) {\n $this->PageSize = $this->RecordCount > 0 ? $this->RecordCount : 10;\n }\n // Handle page size = -1 (ALL)\n if ($this->PageSize == -1) {\n $this->PageSizeAll = true;\n $this->PageSize = $this->RecordCount > 0 ? $this->RecordCount : 10;\n }\n }", "public static function factory( $data, $view ) \n {\n\t\tZend_Paginator::setDefaultScrollingStyle('Sliding');\n\t\tZend_View_Helper_PaginationControl::setDefaultViewPartial( 'paginator/sliding.phtml' );\n\t\t$instance = Zend_Paginator::factory( $data );\n\t\t$instance->setView( $view ); \t\n\t\treturn $instance;\n }", "public function __construct() {\n parent::__construct();\n //load helpers\n $this->load->helper(array('url', 'cookie', 'form'));\n $this->load->library('pagination');\n }", "public function __construct($param = array()) {\n\t\t$this->total = empty($param['total']) ? 1 : $param['total'];\n\t\t$this->each_page_num = empty($param['each']) ? 10 : $param['each'];\n\t\t$this->url = empty($param['url']) ? '' : $param['url'];\n\t\t$this->page_name = empty($param['name']) ? 'page' : $param['name'];\n\n\t\t$this->total_page = ceil($this->total / $this->each_page_num);\t\n\n\t\t// 处理page_name 数据\n\t\tif (isset($_GET[$this->page_name]))\n\t\t\t$page = intval($_GET[$this->page_name]);\n\t\telse\n\t\t\t$page = 1;\n\t\tif ($page < 1)\n\t\t\t$this->current_page = 1;\n\t\telse if ($page > $this->total_page)\n\t\t\t$this->current_page = $this->total_page;\n\t\telse\n\t\t\t$this->current_page = $page;\n\t\t\n\t}", "public function page($num){\r\n $this->page = $num;\r\n return $this;\r\n }", "public function __construct($itemCount, $pageSize)\r\n {\r\n if(!is_numeric($itemCount) || (!is_numeric($pageSize)))\r\n throw new Exception(\"Pagination Error:not Number\");\r\n $this->_itemCount = $itemCount;\r\n $this->_pageSize = $pageSize;\r\n $this->_front = Zend_Controller_Front::getInstance();\r\n\r\n $this->_pageCount = ceil($itemCount/$pageSize); //the total page\r\n $page = $this->_front->getRequest()->getParam($this->_PageParaName);\r\n if(empty($page) || (!is_numeric($page))) \r\n {\r\n $this->_currentPage = 1;\r\n }\r\n else\r\n {\r\n if($page < 1)\r\n $page = 1;\r\n if($page > $this->_pageCount)\r\n $page = $this->_pageCount;\r\n $this->_currentPage = $page;\r\n }\r\n }", "public function pagination(): ?Paginator\n {\n return PagePagination::make();\n }", "public function createPagination($data, $countPage, $path)\n {\n $this->currentPage = LengthAwarePaginator::resolveCurrentPage();\n $this->collection = new Collection($data);\n\n $this->perPage = $countPage;\n $this->currentPageSearchResults = $this->collection->slice(($this->currentPage - 1) * $this->perPage,\n $this->perPage)->all();\n $this->paginatedSearchResults = new LengthAwarePaginator($this->currentPageSearchResults,\n count($this->collection), $this->perPage);\n $this->paginatedSearchResults->setPath($path);\n\n return $this->paginatedSearchResults;\n }", "public function paginate(): RepositoryInterface {\n $show = (int) $this->limitRows;\n $config = $this->config;\n\n /** @var SeekableIterator $items */\n $items = $config[\"data\"];\n $page_number = (int) $this->page;\n\n if (!is_object($items)) {\n throw new Exception(\"Invalid data for paginator\");\n }\n\n // Prevents 0 or negative page numbers\n if ($page_number <= 0) {\n $page_number = 1;\n }\n\n // Prevents a limit creating a negative or zero first page\n if ($show <= 0) {\n throw new Exception(\"The start page number is zero or less\");\n }\n\n $n = count($items);\n $last_show_page = $page_number - 1;\n $start = $show * $last_show_page;\n $page_items = [];\n\n if ($n % $show != 0) {\n $total_pages = (int) ($n / $show + 1);\n } else {\n $total_pages = (int) ($n / $show);\n }\n\n if ($n > 0) {\n // Seek to the desired position\n if ($start <= $n) {\n $items->seek($start);\n } else {\n $items->seek(0);\n $page_number = 1;\n }\n\n // The record must be iterable\n $i = 1;\n while ($items->valid()) {\n $page_items[] = $items->current();\n\n if ($i >= $show) {\n break;\n }\n\n $i++;\n $items->next();\n }\n }\n\n // Fix next\n $next = $page_number + 1;\n if ($next > $total_pages) {\n $next = $total_pages;\n }\n\n if ($page_number > 1) {\n $before = $page_number - 1;\n } else {\n $before = 1;\n }\n\n return $this->getRepository(\n [\n RepositoryInterface::PROPERTY_ITEMS => $page_items,\n RepositoryInterface::PROPERTY_TOTAL_ITEMS => $n,\n RepositoryInterface::PROPERTY_LIMIT => $this->limitRows,\n RepositoryInterface::PROPERTY_FIRST_PAGE => 1,\n RepositoryInterface::PROPERTY_PREVIOUS_PAGE => $before,\n RepositoryInterface::PROPERTY_CURRENT_PAGE => $page_number,\n RepositoryInterface::PROPERTY_NEXT_PAGE => $next,\n RepositoryInterface::PROPERTY_LAST_PAGE => $total_pages\n ]\n );\n }", "function getPagination()\n\t{\n\t\tif (empty($this->_pagination)) {\n\t\t\tjimport('joomla.html.pagination');\n\n\t\t\t$this->_pagination = new JPagination($this->getTotalHotels(), $this->getState('limitstart'), $this->getState('limit') );\n\t\t\t$this->_pagination->setAdditionalUrlParam('controller','hotels');\n\t\t\t$this->_pagination->setAdditionalUrlParam('view','hotels');\n\t\t\t$this->_pagination->setAdditionalUrlParam('task','viewHotels');\n\t\t}\n\t\treturn $this->_pagination;\n\t}", "public function getPaginationDataSource();", "public function paginator()\r\n\t{\r\n\t\treturn $this;\r\n\t}", "public function assign() {\r\n\t\t$this->current_page = parent::getCurrentPageNumber();\r\n\t\t$per_page = parent::getItemCountPerPage();\r\n\t\t\r\n\t\t// Busca o total de paginas\r\n\t\t$this->total_pages = (int)(parent::getTotalItemCount() / parent::getItemCountPerPage());\r\n\t\t$this->total_pages++;\r\n\t\t\r\n\t\t// Busca o total\r\n\t\t$this->total_items = parent::getTotalItemCount();\r\n\t\t\r\n\t\t// Verifica o total\r\n\t\tif($this->total_items % $per_page == 0) {\r\n\t\t\t$this->total_pages--;\r\n\t\t}\r\n\t\t\r\n\t\t// Busca a pagina anterior\r\n\t\t$this->previous_page = $this->current_page - 1;\r\n\t\tif($this->previous_page <= 0) {\r\n\t\t\t$this->previous_page = 1;\r\n\t\t}\r\n\t\t\r\n\t\t// Busca a proxima pagina \r\n\t\t$this->next_page = $this->current_page + 1;\r\n\t\tif($this->next_page > $this->total_pages) {\r\n\t\t\t$this->next_page = $this->total_pages;\r\n\t\t}\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "public function generatePagination()\n {\n $this->buffer = [];\n\n if ($this->currentPage != 1) {\n $this->generateLeftButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n\n $this->generatePages();\n\n if ($this->currentPage != self::getPages($this->records, $this->recordsInPage)) {\n $this->generateRightButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n }", "public function getPageInfo(): PagingInfo\n {\n return new PagingInfo([\n self::PAGE => $this->page,\n self::PER_PAGE => $this->per_page,\n ]);\n }", "public function setPagination($limit, $offset = 0);", "public function paginate()\n {\n }", "abstract protected function createPages($count = 10): array;", "public function make()\n {\n $data = [\n 'items' => $this->items,\n 'current' => $this->currentDate,\n 'format' => $this->format,\n 'urlFormat' => $this->urlFormat,\n 'url' => $this->url,\n ];\n return new HtmlString(view('pagination', $data)->render());\n }", "public function setPagination(\\message\\common\\Pagination $value=null)\n {\n return $this->set(self::pagination, $value);\n }", "private function prepareTemplate()\n {\n $template = new TwigFrontendTemplate('pagination');\n\n $template->hasFirst = $this->hasFirst();\n $template->hasPrevious = $this->hasPrevious();\n $template->hasNext = $this->hasNext();\n $template->hasLast = $this->hasLast();\n\n $template->items = $this->getItems();\n $template->page = $this->intPage;\n $template->total = $this->intTotalPages;\n\n $template->first = array\n (\n 'page' => 1,\n 'link' => $this->lblFirst,\n 'href' => $this->linkToPage(1),\n );\n\n $template->previous = array\n (\n 'page' => $this->intPage - 1,\n 'link' => $this->lblPrevious,\n 'href' => $this->linkToPage($this->intPage - 1),\n );\n\n $template->next = array\n (\n 'page' => $this->intPage + 1,\n 'link' => $this->lblNext,\n 'href' => $this->linkToPage($this->intPage + 1),\n );\n\n $template->last = array\n (\n 'page' => $this->intTotalPages,\n 'link' => $this->lblLast,\n 'href' => $this->linkToPage($this->intTotalPages),\n );\n\n return $template;\n }", "function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}", "function __construct(){\n parent::__construct();\n $this->load->model('insertmodel');\n $this->load->library(\"pagination\");\n }", "public function __construct()\n {\n $page = \\App::make('Lablog\\Lablog\\Page\\PageGatewayInterface');\n $this->page = $page;\n }", "public function create($data)\n {\n return Page::create($data);\n }", "private function _pagination()\n {\n\n if (Request::has('pq_curpage') && Request::has('pq_rpp')) {\n $columnsTemp = $this->_columnsRaw;\n $pq_curPage = Request::input('pq_curpage');\n $pq_rPP = Request::input('pq_rpp');\n $queryTemp = new \\stdClass();\n $queryTemp = $this->_getQueryStatement();\n $queryTemp->columns = null;\n\n // Verifica si existe algun filtro para aplicarlo al COUNT y determinar cuantos registros hay en la consulta\n if (property_exists($this->_filterTable, 'query')) {\n $queryTemp->whereRaw($this->_filterTable->query, $this->_filterTable->param);\n }\n\n $totalRecordQuery = $queryTemp->count();\n $this->_query->columns = $columnsTemp;\n\n $skip = ($pq_rPP * ($pq_curPage - 1));\n\n if ($skip >= $totalRecordQuery) {\n $pq_curPage = ceil($totalRecordQuery / $pq_rPP);\n $skip = ($pq_rPP * ($pq_curPage - 1));\n }\n\n // Make limit to query\n $this->_query->offset($skip)\n ->limit($pq_rPP);\n\n $this->_paginationLimit = [\n 'totalRecords' => $totalRecordQuery,\n 'curPage' => $pq_curPage,\n ];\n }\n }", "public static function pagination($pagination_type = null, $query = null) {\n\t\tif ( is_null( $pagination_type ) ) {\n\t\t\t$pagination_type = wpv_get_option( 'pagination-type' );\n\t\t}\n\n\t\tif ( is_null( $query ) ) {\n\t\t\t$query = $GLOBALS['wp_query'];\n\t\t}\n\n\t\tif($pagination_type == 'paged') {\n\t\t\tself::pagination_list( $query );\n\t\t} elseif($pagination_type == 'basic') {\n\t\t\tpaginate_links();\n\t\t} else {\n\t\t\t$max = $query->max_num_pages;\n\t\t\t$paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1);\n\n\t\t\t$class = apply_filters('wpv_lmbtn_class', 'lm-btn button clearboth');\n\n\t\t\tif((int)$max > (int)$paged) {\n\t\t\t\t$url = remove_query_arg(array('page', 'paged'));\n\t\t\t\t$url .= (strpos($url, '?') === false) ? '?' : '&';\n\t\t\t\t$url .= 'paged='.($paged+1);\n\n\t\t\t\techo '<div class=\"load-more\"><a href=\"'.esc_attr( $url ) .'\" class=\"'.$class.'\"><span>'.__('Load more', 'church-event').'</span></a></div>';\n\t\t\t}\n\t\t}\n\t}", "public function paginate(array $query = [])\n {\n $resource = Inflector::pluralize($this->getResourceName());\n\n return new CursorBasedPagination($this->client, $this, $resource, $query);\n }", "private function generatePages()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n $total = 0;\n $start = 1;\n while ($total < $all_pages) {\n $shift = $this->getShift();\n $paging_start = $total < $this->getLeftShift() ? true : false;\n $paging_end = $total >= ($all_pages - $this->getRightShift()) ? true : false;\n\n if ($this->currentPage == $start) {\n $this->appendData(sprintf('<li class=\"active\"><span>%d</span></li>', $start));\n }\n elseif ($paging_start|| $paging_end) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">%d</a></li>', $this->url, $start, $start));\n }\n elseif (($this->currentPage == $start - $shift) || ($this->currentPage == $start + $shift)) {\n $this->appendData('<li><span>...</span></li>');\n }\n $total++;\n $start++;\n }\n }", "public function __construct(Render $render)\r\n\t{\r\n\t\t$this->_render=$render;\r\n\t\t$render->setPagination($this);\r\n\t}", "public function getIterator() {\n return new PageIterator($this);\n }", "public function getPagination()\n {\n return $this->get(self::pagination);\n }", "public function prepare(DataRequest $dataRequest, $paginationUrl, $numberOfEntries, $numberOfEntriesPerPage = 10)\n {\n $this->paginationUrl = $paginationUrl;\n $neededPages = ceil($numberOfEntries / $numberOfEntriesPerPage);\n $activePage = $dataRequest->getPage();\n\n $pagination = new PaginationObject();\n \n if ($activePage > 1) {\n // Add the first page button\n $button = new Button('&laquo;', $this->buildUrl(1));\n $pagination->addEntry($button); \n \n \n // Add the prev page button\n $button = new Button('&lsaquo;', $this->buildUrl(($activePage - 1)));\n $pagination->addEntry($button);\n }\n \n $this->addPages($pagination, $activePage, $neededPages);\n \n if ($activePage < $neededPages) {\n // Add the next page button\n $button = new Button('&rsaquo;', $this->buildUrl(($activePage + 1)));\n $pagination->addEntry($button);\n \n // Add the last page button\n $button = new Button('&raquo;', $this->buildUrl($neededPages));\n $pagination->addEntry($button);\n }\n \n return $pagination;\n }", "public function getPagination() {\n $store = $this->getStoreId('getPagination');\n\n // Try to load the data from internal storage.\n if (isset($this->cache[$store])) {\n return $this->cache[$store];\n }\n\n // Create the pagination object.\n jimport('joomla.html.pagination');\n //$limit = (int) $this->getState('list.limit') - (int) $this->getState('list.links');\n $app = JFactory::getApplication();\n $limit = $app->get('list_limit');\n $page = new JPagination($this->getTotal(), JRequest::getInt('start', 0), $limit);\n\n // Add the object to the internal cache.\n $this->cache[$store] = $page;\n\n return $this->cache[$store];\n }" ]
[ "0.76954424", "0.7440678", "0.72468036", "0.69956094", "0.69608575", "0.6931889", "0.6864904", "0.6631564", "0.6631564", "0.65893376", "0.65145475", "0.6399691", "0.6383643", "0.62498474", "0.623786", "0.6231355", "0.6205589", "0.61730784", "0.61042404", "0.6088625", "0.60435176", "0.6036603", "0.6023452", "0.60161686", "0.60161173", "0.60041475", "0.59878665", "0.59136117", "0.5874757", "0.58738595", "0.58738595", "0.58705896", "0.58691645", "0.5864592", "0.5861721", "0.5857046", "0.58382297", "0.5836693", "0.5816073", "0.5804619", "0.580008", "0.5783802", "0.5781172", "0.57769674", "0.5763888", "0.5753387", "0.5753303", "0.57524085", "0.5746768", "0.5733176", "0.5728581", "0.5721196", "0.572054", "0.572054", "0.571757", "0.57119554", "0.57038385", "0.57033783", "0.5703289", "0.5658347", "0.5648491", "0.56449866", "0.5633694", "0.56327635", "0.5627034", "0.56160533", "0.5607826", "0.5604621", "0.55960524", "0.559341", "0.5588849", "0.5579615", "0.5574667", "0.5537826", "0.5536836", "0.55279946", "0.55262905", "0.55151", "0.5514014", "0.5513035", "0.55129915", "0.5510131", "0.5507528", "0.5488345", "0.5488045", "0.54869944", "0.5486218", "0.5482371", "0.54821944", "0.54748565", "0.5471706", "0.5461332", "0.546076", "0.54472923", "0.5431474", "0.5430555", "0.5427861", "0.54218256", "0.5419137", "0.54083425", "0.53960055" ]
0.0
-1
Returns the paginated query, with information on pages.
public function paginate(): array { $this->fetchRecords(); $this->fetchTotalRecordCount(); $this->setHeaders(); return [ 'data' => $this->data, 'total_records' => $this->totalRecords, 'current_page' => $this->parameters->getCurrentPage(), 'items_per_page' => $this->parameters->getResultsPerPage(), 'last_page' => ceil($this->totalRecords / $this->parameters->getResultsPerPage()), 'headers' => $this->headers, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaginated();", "public static function pagination()\n {\n $limit = (int) self::set(\"limit\");\n $offset = (int) self::set(\"offset\");\n\n $limit = Validator::intType()->notEmpty()->positive()->validate($limit)? $limit: false;\n $offset = Validator::intType()->notEmpty()->positive()->validate($offset)? $offset: 0;\n\n $pagination = \"\";\n $pagination .= $limit? \" LIMIT {$limit}\": null;\n $pagination .= ($limit && $offset)? \" OFFSET {$offset}\": null;\n\n return (object) [\n \"limit\" => $limit,\n \"offset\" => $offset,\n \"query\" => $pagination\n ];\n }", "public function getPagination()\n {\n return $this->get(self::pagination);\n }", "public function getPaginate ($p_rowsPerPage, $p_currentPage);", "public function getPaginate()\n {\n /* Clone the original builder */\n $builder = clone $this->_builder;\n $totalBuilder = clone $builder;\n\n $limit = $this->_limitRows;\n $numberPage = $this->_page;\n\n if (is_null($numberPage) === true) {\n $numberPage = 1;\n }\n\n $prevNumberPage = $numberPage - 1;\n $number = $limit * $prevNumberPage;\n\n //Set the limit clause avoiding negative offsets\n if ($number < $limit) {\n $builder->limit($limit);\n } else {\n $builder->limit($limit, $number);\n }\n\n $query = $builder->getQuery();\n\n //Change the queried columns by a COUNT(*)\n $totalBuilder->columns('COUNT(*) [rowcount]');\n\n //Remove the 'ORDER BY' clause, PostgreSQL requires this\n $totalBuilder->orderBy(null);\n\n //Obtain the PHQL for the total query\n $totalQuery = $totalBuilder->getQuery();\n\n //Obtain the result of the total query\n $result = $totalQuery->execute();\n $row = $result->getFirst();\n\n $totalPages = $row['rowcount'] / $limit;\n $intTotalPages = (int)$totalPages;\n\n if ($intTotalPages !== $totalPages) {\n $totalPages = $intTotalPages + 1;\n }\n\n $page = new stdClass();\n $page->first = 1;\n $page->before = ($numberPage === 1 ? 1 : ($numberPage - 1));\n $page->items = $query->execute();\n $page->next = ($numberPage < $totalPages ? ($numberPage + 1) : $totalPages);\n $page->last = $totalPages;\n $page->current = $numberPage;\n $page->total_pages = $totalPages;\n $page->total_items = (int)$row['rowcount'];\n\n return $page;\n }", "function getPagingInfo($sql,$input_arguments=null);", "protected function paginate_results($query, Request $request = null){\n\n \t$page = 1;\n \t$number_per_page = env(\"NUMBER_PER_PAGE_API_RESPONSE\");\n\n \tif( $request && $request->has('page') ){\n \t\t$page = $request->input('page');\n \t}\n\n \tif( $request && $request->has('pagination.page') ){\n \t\t$page = $request->pagination['page'];\n \t}\n\n \tif( $request && $request->has('pagination.number_per_page') ){\n \t\t$number_per_page = $request->pagination['number_per_page'];\n \t} \n\n \tif( $number_per_page == \"0\" || $number_per_page === 0 || !$number_per_page ){\n \t\t$number_per_page = $query->count();\n \t}\n\n \treturn $query->paginate($number_per_page, ['*'], 'page', $page);\n \t\n }", "function getPagedStatement($sql,$page,$items_per_page);", "public function paginate()\n {\n return $this->operator->paginate($this->page, $this->limit);\n }", "public function get_pagination() {\n\t\treturn $this->pagination();\n\t}", "private function _pagination()\n {\n\n if (Request::has('pq_curpage') && Request::has('pq_rpp')) {\n $columnsTemp = $this->_columnsRaw;\n $pq_curPage = Request::input('pq_curpage');\n $pq_rPP = Request::input('pq_rpp');\n $queryTemp = new \\stdClass();\n $queryTemp = $this->_getQueryStatement();\n $queryTemp->columns = null;\n\n // Verifica si existe algun filtro para aplicarlo al COUNT y determinar cuantos registros hay en la consulta\n if (property_exists($this->_filterTable, 'query')) {\n $queryTemp->whereRaw($this->_filterTable->query, $this->_filterTable->param);\n }\n\n $totalRecordQuery = $queryTemp->count();\n $this->_query->columns = $columnsTemp;\n\n $skip = ($pq_rPP * ($pq_curPage - 1));\n\n if ($skip >= $totalRecordQuery) {\n $pq_curPage = ceil($totalRecordQuery / $pq_rPP);\n $skip = ($pq_rPP * ($pq_curPage - 1));\n }\n\n // Make limit to query\n $this->_query->offset($skip)\n ->limit($pq_rPP);\n\n $this->_paginationLimit = [\n 'totalRecords' => $totalRecordQuery,\n 'curPage' => $pq_curPage,\n ];\n }\n }", "public function getPerPage();", "protected function buildPagination() {}", "protected function buildPagination() {}", "public function getPaginate(){ }", "public function getPaginatedQuery(): Query\n {\n return $this->createDerivedQuery()\n ->limit($this->getLimit())\n ->offset($this->getOffset());\n }", "public static function obtenerPaginate()\n {\n $rs = self::builder();\n return $rs->paginate(self::$paginate) ?? [];\n }", "public function paginate($page) {\n $page = (string) page;\n return $this->getQueryString(array('page' => $page));\n }", "public function paging(){\n\t\t$sql = \"SELECT * FROM berita\";\n\t\t$query = $this->db->query($sql) or die ($this->db->error);\n\t\treturn $query;\n\t}", "function pagination(){}", "public function testPage()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->page(10));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(225, $elasticQuery['from']);\n $this->assertSame(25, $elasticQuery['size']);\n\n $this->assertSame($query, $query->page(20, 50));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(950, $elasticQuery['from']);\n $this->assertSame(50, $elasticQuery['size']);\n\n $query->limit(15);\n $this->assertSame($query, $query->page(20));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(285, $elasticQuery['from']);\n $this->assertSame(15, $elasticQuery['size']);\n }", "public function get_result_page(){\n\n global $wp_query;\n\n $pagination = new wm_pagination();\n\n $html = $pagination->get_top();\n\n foreach( $wp_query->posts as $post ){\n\n setup_postdata( $post );\n\n $html .= $this->prep_result_html( $post );\n }\n\n $html .= $pagination->get_bottom();\n\n return $html;\n }", "abstract public function preparePagination();", "function paginate() {\n\t\t$all_rs = $this->db->query($this->sql );\n\t\t$this->total_rows = $all_rs->num_rows;\n\t\t\n\t\t//Return FALSE if no rows found\n\t\tif ($this->total_rows == 0) {\n\t\t\tif ($this->debug)\n\t\t\t\techo \"Query returned zero rows.\";\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//Max number of pages\n\t\t$this->max_pages = ceil($this->total_rows / $this->rows_per_page );\n\t\tif ($this->links_per_page > $this->max_pages) {\n\t\t\t$this->links_per_page = $this->max_pages;\n\t\t}\n\t\t\n\t\t//Check the page value just in case someone is trying to input an aribitrary value\n\t\tif ($this->page > $this->max_pages || $this->page <= 0) {\n\t\t\t$this->page = 1;\n\t\t}\n\t\t\n\t\t//Calculate Offset\n\t\t$this->offset = $this->rows_per_page * ($this->page - 1);\n\t\t\n\t\t//Fetch the required result set\n\t\t$rs = $this->db->query($this->sql . \" LIMIT {$this->offset}, {$this->rows_per_page}\" );\n\t\t$this->data = $rs->rows;\n\t}", "public function get_pagination_args() {\n\t\tif ( ! empty( $this->pagination_args ) ) {\n\t\t\treturn $this->pagination_args;\n\t\t}\n\n\t\t$this->pagination_args = array(\n\t\t\t'total_items' => (int) $this->found,\n\t\t\t'per_page' => $this->query_args['limit'],\n\t\t\t'total_pages' => ceil( $this->found / $this->query_args['limit'] ),\n\t\t);\n\n\t\treturn $this->pagination_args;\n\t}", "public function getPagination()\n {\n return $this->pagination;\n }", "abstract function query($queryString, $page = 1);", "public function getPage($pageNumber = 0);", "public function getPagination() {\n return $this->pagination_;\n }", "function getPagingParameters()\n {\n }", "public function getPagination()\n {\n return $this->pagination;\n }", "public function paging() {\n\t\t$pages = ceil($this->count('all') / $this->_page_length);\n\t\t$response = array('pages' => $pages, 'page' => $this->_on_page,'length' => $this->_page_length,'items' => $this->count('all'));\n\t\treturn (object) $response;\t\t\n\t}", "public function paginate()\n {\n return $this->configurationRepository->scopeQuery(function ($query) {\n return $query->orderBy('id', 'desc');\n })->paginate();\n }", "public function getPagination()\n {\n return $this->getRange();\n }", "public function getItemsPerPage();", "public function getItemsPerPage();", "public function paginate()\n {\n }", "public function getJoinPagesForQuery() {}", "public function getJoinPagesForQuery() {}", "public function getQueryPageSize(): int\n {\n return $this->pageSize;\n }", "function pagination( $query ) {\n\n\t# Get the current page.\n\tif ( ! $current_page = get_query_var( 'paged' ) ) {\n\t\t$current_page = 1;\n\t}\n\n\techo paginate_links( array(\n\t\t'base' => get_pagenum_link( 1 ) . '%_%',\n\t\t'format' => 'page/%#%/',\n\t\t'current' => $current_page,\n\t\t'total' => $total,\n\t\t'mid_size' => 4,\n\t\t'type' => 'plain'\n\t) );\n}", "public function paginateQuery($query, $key='page', $max=5, $range=2, $url='', $delim='&page=$1', $display=array('first'=>'|&lt;&lt;', 'prev'=>'&lt;', 'next'=>'&gt;', 'last'=>'&gt;&gt;|')) {\n // initialisation\n $paginatedQuery = array();\n if(!isset($_GET[$key])) {\n $_GET[$key] = 1; // so if GET isn't set, it still shows the first page's results\n }\n \n // gets total pages and results\n $paginatedQuery['totalnum'] = count($query);\n $paginatedQuery['pages'] = ceil($paginatedQuery['totalnum']/$max);\n $paginatedQuery['results'] = array_slice($query, ($max*($_GET[$key]-1)), $max, true);\n $paginatedQuery['resultsnum'] = count($paginatedQuery['results']); \n \n // formats paginated links\n // current\n $current = $_GET[$key];\n \n // first\n $first = 1;\n \n // prev\n if ($current==1) $prev = 1; \n else $prev = $current-1;\n \n // next\n if ($paginatedQuery['totalnum']==1) $next = 1; \n else $next = $current+1;\n \n // last\n $last = $paginatedQuery['pages'];\n \n // display \n $paginatedQuery['links'] = ''; // initialisation\n \n // first, prev\n if($current!=$first) $paginatedQuery['links'] = '<a class=\"first\" href=\"'.$url.str_replace('$1', $first, $delim).'\">'.$display['first'].'</a>'.\"\\n\".'<a class=\"prev\" href=\"'.$url.str_replace('$1', $prev, $delim).'\">'.$display['prev'].'</a>'.\"\\n\";\n \n // numbers\n for ($i = ($current - $range); $i < ($current + $range + 1); $i++) {\n if ($i > 0 && $i <= $paginatedQuery['pages']) {\n // current\n if ($i==$current) {\n $paginatedQuery['links'] .= '<span class=\"current\">'.$i.'</span>'.\"\\n\";\n }\n // link\n else {\n $paginatedQuery['links'] .= '<a class=\"page\" href=\"'.$url.str_replace('$1', $i, $delim).'\">'.$i.'</a>'.\"\\n\";\n }\n }\n }\n \n // next, last\n if($current!=$last) $paginatedQuery['links'] .= '<a class=\"next\" href=\"'.$url.str_replace('$1', $next, $delim).'\">'.$display['next'].'</a>'.\"\\n\".'<a class=\"last\" href=\"'.$url.str_replace('$1', $last, $delim).'\">'.$display['last'].'</a>';\n \n // return array\n return $paginatedQuery;\n }", "protected function paginateQuery(&$query) {\n $start = 0;\n $limit = 30;\n if(Input::has('offset')) {\n $start = intval(Input::get('offset'));\n }\n if(Input::has('limit')) {\n $limit = intval(Input::get('limit'));\n }\n $query->skip($start)->take($limit);\n }", "public function paginateLatestQueries($page = 1, $perPage = 15);", "public function getPageSize();", "public function pagination(){\n\t\treturn $this->dataInfos['XMLPM']['PAGINATION'];\n\t}", "public function getPager() \n {\n \n return ( isset ( $_REQUEST[\"{$this->_paginator}\"] ) ) \n ? (int) $_REQUEST[\"{$this->_paginator}\"] \n : 0 \n ; \n \n }", "public function pagination($query,$offset,$limit) {\n $afterPrepare = $this->db->prepare($query);\n $afterPrepare->bindParam(\":offset\", $offset, PDO::PARAM_INT);\n $afterPrepare->bindParam(\":page_limit\", $limit, PDO::PARAM_INT);\n $afterPrepare->execute();\n return $afterPrepare->fetchAll(PDO::FETCH_ASSOC);\n }", "public function paginate(array $query = [])\n {\n return $this->page('operacional/pessoas', $query);\n }", "public function customQuery($query, $paginate='') {\n $statement = Connect::ArangoStatementHandler(\n $this->_arangoConnect, $query\n );\n // execute the statement\n $cursor = $statement->execute();\n if($paginate==true) {\n $totalPages = isset($cursor->getExtra()['stats']['scannedFull'])?$cursor->getExtra()['stats']['scannedFull']:\"\"; \n return $result = ['data'=> $cursor->getAll(), 'total'=> $totalPages]; \n } \n return $cursor = $cursor->getAll();\n }", "public function searchPaged($query, array $inApps = [], $page = 1, $size = 30);", "public function getPagination($where = \"\"){\n\t\t$data = $this->db->query('select * from pagination '.$where);\n\t\treturn $data->result_array();\n\t\t}", "public function getAll($page = 1, $q='')\n {\n $query = $this->em\n ->getRepository($this->entityClass)\n ->findAllQuery($q);\n\n $pagination = $this->paginator->paginate(\n $query,\n $page \n );\n\n return $pagination;\n }", "public function get_pagenum()\n {\n }", "public function getPerPage(): int;", "function getPaging() {\n\t\t//if the total number of rows great than page size\n\t\tif($this->totalRows > $this->pageSize) {\n\t\t\tprint '<div class=\"paging\">';\n\t\t\tprint '<ul>';\n\t\t\tprint $this->first() . $this->prev() . $this->pageList() . $this->next() . $this->end();\n\t\t\tprint '</ul>';\n\t\t\tprint '</div>';\n\t\t}\n }", "function results_are_paged()\n {\n }", "public function get_page_permastruct()\n {\n }", "public function getPaginationDataSource();", "function sc_pagination( $query = false ){\n\n\t$string = \"\";\n\n\tif( !$query ){\n\n\t\tglobal $wp_query;\n\n\t\tif( $wp_query->max_num_pages > 1 ){\n\n\t\t\t//Get current page and query type.\n\t\t\t$current_page = max( 1, get_query_var('paged') );\n\t\t\t$query_type = isset( $_GET['s'] ) ? '&' : '?';\n\n\t\t\t$args = array(\n\t\t\t\t'base' => esc_url(get_pagenum_link()).\"{$query_type}paged=%#%\",\n\t\t\t\t'format' => \"{$query_type}paged=%#%\",\n\t\t\t\t'total' => $wp_query->max_num_pages,\n\t\t\t\t'current' => max( 1, get_query_var('paged') ),\n\t\t\t\t'show_all' => true,\n\t\t\t\t//'end_size' => 1,\n\t\t\t\t//'mid_size' => 2,\n\t\t\t\t//'prev_next' => True,\n\t\t\t\t//'prev_text' => __('« Previous'),\n\t\t\t\t//'next_text' => __('Next »'),\n\t\t\t\t'type' => 'list',\n\t\t\t\t//'add_args' => False,\n\t\t\t\t//'add_fragment' => ''\n\t\t\t);\n\n\t\t\t$string = paginate_links($args);\n\n\t\t}\n\n\t} else {\n\n\t\tif( $query->max_num_pages > 1 ){\n\n\t\t\t$args = array(\n\t\t\t\t'base' => @add_query_arg('pp', '%#%'),\n\t\t\t\t'format' => \"pp=%#%\",\n\t\t\t\t'total' => $query->max_num_pages,\n\t\t\t\t'current' => max( 1, isset($_GET['pp']) ? $_GET['pp'] : 1 ),\n\t\t\t\t'show_all' => true,\n\t\t\t\t//'end_size' => 1,\n\t\t\t\t//'mid_size' => 2,\n\t\t\t\t//'prev_next' => True,\n\t\t\t\t// 'prev_text' => __('&larr;'),\n\t\t\t\t// 'next_text' => __('&rarr;'),\n\t\t\t\t 'type' => 'list',\n\t\t\t\t//'add_args' => true,\n\t\t\t\t//'add_fragment' => ''\n\t\t\t);\n\n\t\t\t$string = paginate_links($args);\n\n\t\t}\n\n\t}\n\n\treturn $string;\n\n}", "function Pagination() \n { \n $this->current_page = 1; \n $this->mid_range = 7; \n $this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp; \n }", "public function getPaginatedData()\n {\n return $this->paginatedData;\n }", "function getAllPaginated($page=1,$perPage=-1) {\r\n\t\tif ($perPage == -1)\r\n\t\t\t$perPage = \tCommon::getRowsPerPage();\r\n\t\tif (empty($page))\r\n\t\t\t$page = 1;\r\n\t\t$cond = new Criteria();\r\n\t\t$pager = new PropelPager($cond,\"SurveyAnswerPeer\", \"doSelect\",$page,$perPage);\r\n\t\treturn $pager;\r\n\t }", "public function getPageResults(int $page = 1): array;", "private function getPagination(){\n\t\t$pager=new pager();\n\t\t$pager->isAjaxCall($this->iAmAjax);\n\t\t$pager->set(\"type\", \"buttons\");\n\t\t$pager->set(\"gridId\",$this->id);\n\t\t$pager->set(\"pages\", $this->pages);\n\t\t$pager->set(\"currPage\", $this->currPage);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\treturn $pager->render(true);\n\t}", "public function GetByPaginated($offset, $limit);", "public function getPages();", "public function getPages() {}", "abstract public function getPaginate($premiereEntree, $messageTotal, $where);", "public function getCurrentPageResults(): array;", "public static function pagination_list( $query = null ) {\n\t\tif ( is_null( $query ) ) {\n\t\t\t$query = $GLOBALS['wp_query'];\n\t\t}\n\n\t\t$total_pages = (int)$query->max_num_pages;\n\n\t\tif($total_pages > 1) {\n\t\t\t$big = PHP_INT_MAX;\n\t\t\t$current_page = max(1, get_query_var('paged'));\n\n\t\t\techo '<div class=\"wp-pagenavi\">';\n\n\t\t\techo '<span class=\"pages\">'.sprintf(__('Page %d of %d', 'church-event'), $current_page, $total_pages).'</span>';\n\n\t\t\techo paginate_links(array(\n\t\t\t\t'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),\n\t\t\t\t'format' => '?paged=%#%',\n\t\t\t\t'current' => $current_page,\n\t\t\t\t'total' => $total_pages,\n\t\t\t\t'prev_text' => __('Prev', 'church-event'),\n\t\t\t\t'next_text' => __('Next', 'church-event'),\n\t\t\t));\n\n\t\t\techo '</div>';\n\t\t}\n\t}", "public function paginate(Request $request);", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "function pager_get_query_parameters() {\n $query = &drupal_static(__FUNCTION__);\n if (!isset($query)) {\n $query = drupal_get_query_parameters($_GET, array('q', 'page'));\n }\n return $query;\n}", "public function page_numbers() {\n $pages = $this->total_pages();\n $query = htmlentities($this->term);\n $page = $this->pagenumber;\n $next = get_string('next', 'search');\n $back = get_string('back', 'search');\n\n $ret = \"<div align='center' id='search_page_links'>\";\n\n //Back is disabled if we're on page 1\n if ($page > 1) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page-1).\"'>&lt; {$back}</a>&nbsp;\";\n } else {\n $ret .= \"&lt; {$back}&nbsp;\";\n } \n\n //don't <a href> the current page\n for ($i = 1; $i <= $pages; $i++) {\n if ($page == $i) {\n $ret .= \"($i)&nbsp;\";\n } else {\n $ret .= \"<a href='query.php?query_string={$query}&page={$i}'>{$i}</a>&nbsp;\";\n } \n } \n\n //Next disabled if we're on the last page\n if ($page < $pages) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page+1).\"'>{$next} &gt;</a>&nbsp;\";\n } else {\n $ret .= \"{$next} &gt;&nbsp;\";\n } \n\n $ret .= \"</div>\";\n\n //shorten really long page lists, to stop table distorting width-ways\n if (strlen($ret) > 70) {\n $start = 4;\n $end = $page - 5;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n\n $start = $page + 5;\n $end = $pages - 3;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n }\n\n return $ret;\n }", "function getPagedElements() {\n return $this->page_object;\n }", "public function getItemsForPagination($query, $currentPage = 1, $itemsPerPage = 10)\n {\n $adapter = new DoctrineAdapter(new ORMPaginator($query, false));\n $paginator = new Paginator($adapter);\n $paginator->setDefaultItemCountPerPage($itemsPerPage);\n $paginator->setCurrentPageNumber($currentPage);\n return $paginator;\n }", "public function getItemsForPagination($query, $currentPage = 1, $itemsPerPage = 10)\n {\n $adapter = new DoctrineAdapter(new ORMPaginator($query, false));\n $paginator = new Paginator($adapter);\n $paginator->setDefaultItemCountPerPage($itemsPerPage);\n $paginator->setCurrentPageNumber($currentPage);\n return $paginator;\n }", "public function page() { return $this->paginating ? $this->page : 1; }", "function doPages($page_size, $thepage, $query_string, $total=0) {\n \n //per page count\n $index_limit = 10;\n\n //set the query string to blank, then later attach it with $query_string\n $query='';\n \n if(strlen($query_string)>0){\n $query = \"&amp;\".$query_string;\n }\n \n //get the current page number example: 3, 4 etc: see above method description\n $current = get_current_page();\n \n $total_pages=ceil($total/$page_size);\n $start=max($current-intval($index_limit/2), 1);\n $end=$start+$index_limit-1;\n\n echo '<br /><br /><div class=\"paging\">';\n\n if($current==1) {\n echo '<span class=\"prn\">&lt; Previous</span>&nbsp;';\n } else {\n $i = $current-1;\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" class=\"prn\" rel=\"nofollow\" title=\"go to page '.$i.'\">&lt; Previous</a>&nbsp;';\n echo '<span class=\"prn\">...</span>&nbsp;';\n }\n\n if($start > 1) {\n $i = 1;\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" title=\"go to page '.$i.'\">'.$i.'</a>&nbsp;';\n }\n\n for ($i = $start; $i <= $end && $i <= $total_pages; $i++){\n if($i==$current) {\n echo '<span>'.$i.'</span>&nbsp;';\n } else {\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" title=\"go to page '.$i.'\">'.$i.'</a>&nbsp;';\n }\n }\n\n if($total_pages > $end){\n $i = $total_pages;\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" title=\"go to page '.$i.'\">'.$i.'</a>&nbsp;';\n }\n\n if($current < $total_pages) {\n $i = $current+1;\n echo '<span class=\"prn\">...</span>&nbsp;';\n echo '<a href=\"'.$thepage.'?page='.$i.$query.'\" class=\"prn\" rel=\"nofollow\" title=\"go to page '.$i.'\">Next &gt;</a>&nbsp;';\n } else {\n echo '<span class=\"prn\">Next &gt;</span>&nbsp;';\n }\n \n //if nothing passed to method or zero, then dont print result, else print the total count below:\n if ($total != 0){\n //prints the total result count just below the paging\n echo '<p id=\"total_count\">(total '.$total.' results)</p></div>';\n }\n \n }", "function get_page($page_num = 0, $dont_get_more = false)\n\t{\n\t\tif (empty($this->use_db)) $this->use_db = false; //use default connection\n\t\t$total_records = $this->get_num_records();\n\t\t$this->sql = 'SELECT * FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\t$this->apply_sort();\n\t\t//applying limit modifier\n\t\t$total_pages = ceil($total_records / $this->items_per_page);\n\t\tif ($page_num < 1) $page_num = 1;\n\t\t$start = ($page_num - 1) * $this->items_per_page;\n\t\t$this->sql .= \" LIMIT $start, \" . $this->items_per_page;\n\n\t\t//info for paginator template\n\t\t$res['pages']['total_pages'] = $total_pages;\n\t\t$res['pages']['total_records'] = $total_records;\n\t\t$res['pages']['limit'] = $this->items_per_page;\n\t\t$res['pages']['page_num'] = $page_num;\n\t\t//preparing uri\n\t\t$res['pages']['uri'] = $this->page_uri;\n\t\t//prepare page numbersfor paginator\n\t\t$page_min = $page_num - $this->pages_to_side;\n\t\tif ($page_min < 1) $page_min = 1;\n\t\t$page_max = $page_num + $this->pages_to_side;\n\t\tif ($page_max > $total_pages) $page_max = $total_pages;\n\t\tfor ($i = $page_min; $i <= $page_max; ++$i) $res['pages']['paginator_array'][] = $i;\n\t\t$res['data'] = $this->fetch_records($dont_get_more);\n\t\treturn $res;\n\t}", "public function pagination() {\n\t\tglobal $post, $page, $numpages, $multipage;\n\t\t$post = $this;\n\t\t$ret = array();\n\t\tif ( $multipage ) {\n\t\t\tfor ( $i = 1; $i <= $numpages; $i++ ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$data = array('name' => $i, 'title' => $i, 'text' => $i, 'link' => $link);\n\t\t\t\tif ( $i == $page ) {\n\t\t\t\t\t$data['current'] = true;\n\t\t\t\t}\n\t\t\t\t$ret['pages'][] = $data;\n\t\t\t}\n\t\t\t$i = $page - 1;\n\t\t\tif ( $i ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$ret['prev'] = array('link' => $link);\n\t\t\t}\n\t\t\t$i = $page + 1;\n\t\t\tif ( $i <= $numpages ) {\n\t\t\t\t$link = self::get_wp_link_page($i);\n\t\t\t\t$ret['next'] = array('link' => $link);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function paginate($option = []){\n\t\t$option = array_replace_recursive($this->defaultQuery,$option);\n\t\t$dOption = Config::get('paginator');\n\t\t$option = array_replace_recursive($dOption,$option);\n\t\tif(!$option['page']){\n\t\t\t$option['page'] = 1;\n\t\t}\n\t\t$option['skip'] = $option['limit']*($option['page']-1);\n\t\t$option['count'] = $this->count($option['query']);\n\t\t$result = $this->find($option);\n\t\t$paginator = new Paginator($result);\n\t\tunset($option['query']);\n\t\tunset($option['skip']);\n\t\t$paginator->setOption($option);\n\n\t\treturn $paginator;\n\t}", "public function do_paging()\n {\n }", "public function get_paginate(Request $request)\n {\n }", "function tw_get_pagination(){\n\t\tglobal $wp_query;\n\t\t\n\t\tif( $wp_query->max_num_pages <= 1 ){\n\t\t\treturn null;\n\t\t}\n\n\t\t$pagination_args = array(\n\n\t\t\t'prev_text' => __( '&laquo; Prev' ),\n\t\t\t'next_text' => __( 'Next &raquo;' ),\n\t\t\t'mid_size' \t=> __( '1' ),\n\n\t\t);\n\n\t\treturn paginate_links( $pagination_args );\n\n\t}", "function paginate($perpage=50)\n\t{\n\t\tif($perpage == 0) return ''; // zero means unlimited\n\n\t\t$page = $this->page->param('p_p', 1);\n\t\t$perpage = $this->page->param('p_pp', $perpage);\n\t\t$offset = max(0,($page-1) * $perpage);\n \n\t\treturn \"$perpage OFFSET $offset\";\n\t}", "static public function pagination( $query ) {\n\t\t$total_pages = $query->max_num_pages;\n\t\t$permalink_structure = get_option( 'permalink_structure' );\n\t\t$paged = self::get_paged();\n\t\t$base = html_entity_decode( get_pagenum_link() );\n\t\t$add_args = false;\n\n\t\tif ( $total_pages > 1 ) {\n\n\t\t\tif ( ! $current_page = $paged ) { // @codingStandardsIgnoreLine\n\t\t\t\t$current_page = 1;\n\t\t\t}\n\n\t\t\t$base = self::build_base_url( $permalink_structure, $base );\n\t\t\t$format = self::paged_format( $permalink_structure, $base );\n\n\t\t\t// Flag if it's a first posts module in an archive page.\n\t\t\t// Fix pagination issues in archive page since it's using the main WP query for pagination.\n\t\t\tif ( $query->is_archive && 1 === self::$loop_counter ) {\n\t\t\t\tif ( isset( $query->query['settings']->data_source ) && 'custom_query' == $query->query['settings']->data_source ) {\n\t\t\t\t\t$add_args = array(\n\t\t\t\t\t\t'flpaging' => 1,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo paginate_links(array(\n\t\t\t\t'base'\t => $base . '%_%',\n\t\t\t\t'format' => $format,\n\t\t\t\t'current' => $current_page,\n\t\t\t\t'total'\t => $total_pages,\n\t\t\t\t'type'\t => 'list',\n\t\t\t\t'add_args' => $add_args,\n\t\t\t));\n\t\t}\n\t}", "protected function paginator($query, Request $request)\n { \n // Paginator\n $adapter = new DoctrineORMAdapter($query);\n $pagerfanta = new Pagerfanta($adapter);\n $pagerfanta->setMaxPerPage($request->get('pcg_show' , 10));\n\n try {\n $pagerfanta->setCurrentPage($request->get('pcg_page', 1));\n } catch (\\Pagerfanta\\Exception\\OutOfRangeCurrentPageException $ex) {\n $pagerfanta->setCurrentPage(1);\n }\n \n $entities = $pagerfanta->getCurrentPageResults();\n\n // Paginator - route generator\n $me = $this;\n $routeGenerator = function($page) use ($me, $request)\n {\n $requestParams = $request->query->all();\n $requestParams['pcg_page'] = $page;\n return $me->generateUrl('reimpresion', $requestParams);\n };\n\n // Paginator - view\n $view = new TwitterBootstrap3View();\n $pagerHtml = $view->render($pagerfanta, $routeGenerator, array(\n 'proximity' => 3,\n 'prev_message' => 'anterior',\n 'next_message' => 'siguiente',\n ));\n\n return array($entities, $pagerHtml);\n }", "public function paginate($orderBy = 'nome', $perPage = 10);", "public function getPages()\n {\n $repo = $this->manager->getRepository($this->entityClass);\n $total = count($repo->findAll());\n\n // Divide by limit to know the number of pages\n $pages = ceil($total / $this->limit);\n return $pages;\n }", "public function selectPage($query)\n {\n if ($this->count == -1) {\n $this->count = $query->count();\n }\n $this->checkBounds();\n\n return $query->limit($this->perPage)->offset($this->perPage * $this->page);\n }", "public function paginate(\n $page_size = 10,\n $page = null,\n $q = null,\n $sort_column = null,\n $sort_direction = null,\n array $wheres = []\n );", "public function totalPage();", "function get_paged() {\n\t\treturn isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 1;\n\t}", "function get_page_params($count) {\n\n\tglobal $ROWS_PER_PAGE;\n\t\n\tif ($ROWS_PER_PAGE == '') $ROWS_PER_PAGE=10;\n\n\t$page_arr=array();\n\n\t$firstpage = 1;\n\t$lastpage = intval($count / $ROWS_PER_PAGE);\n\t$page=(int)get_arg($_GET,\"page\");\n\n\n\tif ( $page == \"\" || $page < $firstpage ) { $page = 1; }\t// no page no\n\tif ( $page > $lastpage ) {$page = $lastpage+1;}\t\t\t// page greater than last page\n\t//echo \"<pre>first=$firstpage last=$lastpage current=$page</pre>\";\n\n\tif ($count % $ROWS_PER_PAGE != 0) {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE) + 1;\n\t} else {\n\t\t$pagecount = intval($count / $ROWS_PER_PAGE);\n\t}\n\t$startrec = $ROWS_PER_PAGE * ($page - 1);\n\t$reccount = min($ROWS_PER_PAGE * $page, $count);\n\n\t$currpage = ($startrec/$ROWS_PER_PAGE) + 1;\n\n\n\tif($lastpage==0) {\n\t\t$lastpage=null;\n\t} else {\n\t\t$lastpage=$lastpage+1;\n\t}\n\n\tif($startrec == 0) {\n\t\t$prevpage=null;\n\t\t$firstpage=null;\n\t\tif($count == 0) {$startrec=0;}\n\t} else {\n\t\t$prevpage=$currpage-1;\n\t}\n\t\n\tif($reccount < $count) {\n\t\t$nextpage=$currpage+1;\n\t} else {\n\t\t$nextpage=null;\n\t\t$lastpage=null;\n\t}\n\n\t$appstr=\"&page=\"; \n\n\t// Link to PREVIOUS page (and FIRST)\n\tif($prevpage == null) {\n\t\t$prev_href=\"#\";\n\t\t$first_href=\"#\";\n\t\t$prev_disabled=\"disabled\";\n\t} else {\n\t\t$prev_disabled=\"\";\n\t\t$prev_href=$appstr.$prevpage; \n\t\t$first_href=$appstr.$firstpage; \n\t}\n\n\t// Link to NEXT page\n\tif($nextpage == null) {\n\t\t$next_href = \"#\";\n\t\t$last_href = \"#\";\n\t\t$next_disabled=\"disabled\";\n\t} else {\n\t\t$next_disabled=\"\";\n\t\t$next_href=$appstr.$nextpage; \n\t\t$last_href=$appstr.$lastpage; \n\t}\n\n\tif ( $lastpage == null ) $lastpage=$currpage;\n\n\t$page_arr['page_start_row']=$startrec;\n\t$page_arr['page_row_count']=$reccount;\n\n\t$page_arr['page']=$page;\n\t$page_arr['no_of_pages']=$pagecount;\n\n\t$page_arr['curr_page']=$currpage;\n\t$page_arr['last_page']=$lastpage;\n\n\t$page_arr['prev_disabled']=$prev_disabled;\n\t$page_arr['next_disabled']=$next_disabled;\n\n\t$page_arr['first_href']=$first_href;\n\t$page_arr['prev_href']=$prev_href;\n\t$page_arr['next_href']=$next_href;\n\t$page_arr['last_href']=$last_href;\n\n\t//LOG_MSG('INFO',\"Page Array=\".print_r($page_arr,true));\n\treturn $page_arr;\n}", "public function params(): array\n {\n return $this->view()->get('paging') ?? [];\n }", "function query_pages_callback() {\n $query = new WP_Query([\n 'order' => 'ASC',\n 'orderby' => 'menu_order',\n 'posts_per_page' => '-1',\n // 'post__not_in' => [$exclude->ID],\n 'post_type' => ['page'],\n ]);\n $data = $this->prepare($query, $data = []);\n return new WP_REST_Response($data);\n }", "public function paginatedSearch($params) {\n // get items page\n $search_params = [];\n $qb = $this->db->createQueryBuilder();\n $qb->select('contacto_id', 'obra_id', 'cargo', 'intervencion');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n $search = '%'.$params['search_fields']['search'].'%';\n for ($i = 0; $i < 4; $i++) {\n $search_params[] = $search;\n }\n }\n $qb->orderBy($params['sort_field'], $params['sort_dir']);\n $qb->setFirstResult($params['page_size'] * ($params['page'] - 1));\n $qb->setMaxResults($params['page_size']);\n\n $items = [];\n $items = $this->db->fetchAll($qb->getSql(), $search_params); \n\n\n // get total count\n $qb = $this->db->createQueryBuilder();\n $qb->select('count(*) AS total');\n $qb->from($this->table_name);\n if (!empty($params['search_fields']['search'])) {\n $qb->andWhere('(contacto_id LIKE ? OR obra_id LIKE ? OR cargo LIKE ? OR intervencion LIKE ?)');\n }\n $total = [['total' => 0]];\n $total = $this->db->fetchAll($qb->getSql(), $search_params);\n \n\n // return result\n return [\n 'total' => $total[0]['total'], \n 'items' => $items\n ];\n }", "public function getPage() {\n try {\n $client = new SoapClient($this->PAGE_WSDL);\n $res = $client->findAllPage();\n return $res;\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }" ]
[ "0.74140435", "0.7093016", "0.695601", "0.6922239", "0.68954295", "0.6866279", "0.68196595", "0.6817425", "0.68059605", "0.6802844", "0.672842", "0.67269826", "0.67122895", "0.67122895", "0.6660465", "0.6616792", "0.65994495", "0.6593966", "0.6587169", "0.6501885", "0.6458266", "0.64557534", "0.64188504", "0.64158493", "0.641339", "0.6408027", "0.6393764", "0.63937604", "0.63849103", "0.63780594", "0.6367853", "0.635975", "0.6358918", "0.63567066", "0.6350029", "0.6350029", "0.6343904", "0.63404053", "0.63404053", "0.6334295", "0.63290507", "0.63229156", "0.6315167", "0.630586", "0.6288046", "0.6272676", "0.6267931", "0.6265212", "0.62505776", "0.6238925", "0.62366074", "0.6230795", "0.62169075", "0.6213764", "0.6169292", "0.6161069", "0.6143274", "0.61401325", "0.612409", "0.6116537", "0.6113192", "0.610136", "0.6099745", "0.6084988", "0.60787594", "0.6067876", "0.60498965", "0.6048753", "0.6046047", "0.60458046", "0.60343987", "0.6021285", "0.60078627", "0.59996754", "0.59961456", "0.5988215", "0.597534", "0.597534", "0.59725755", "0.59519184", "0.5951402", "0.5948284", "0.59455764", "0.59290135", "0.59269935", "0.59209424", "0.59149396", "0.5913317", "0.5909793", "0.5891136", "0.58803606", "0.5870313", "0.586728", "0.58544", "0.5851226", "0.58433765", "0.58301103", "0.5828161", "0.5826102", "0.5824225" ]
0.6306259
43
Fetch the limited results for the current page.
protected final function fetchRecords() { $this->query->setLimit( (($this->parameters->getCurrentPage() - 1) * $this->parameters->getResultsPerPage()), $this->parameters->getResultsPerPage() ); $this->data = $this->query->execute()->getAssociative(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get( $limit = 10 );", "public function apiFetch( $limit, $offset );", "public function all($limit, $offset);", "function fetchList($limit, $offset);", "public function take($limit = 20);", "public function all($limit = 5, $offset = 0);", "public function all($limit = 5, $offset = 0);", "public function getItemsPerPage();", "public function getItemsPerPage();", "public function GetByPaginated($offset, $limit);", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->limit=$row->answersperpage;\n }", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function fetchAll()\n {\n return Accessory::paginate(25);\n }", "public function limit($limit,$offset);", "public function getPerPage();", "public function limit($count, $offset);", "public function getPaginated();", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->questionsPerPage=$row->questionsperpage;\n }", "function allWithLimit() {\n\n }", "final public function execute() {\n if (!$this->viewer) {\n throw new Exception(\"Call setViewer() before execute()!\");\n }\n\n $results = array();\n\n $filter = new PhabricatorPolicyFilter();\n $filter->setViewer($this->viewer);\n\n if (!$this->capabilities) {\n $capabilities = array(\n PhabricatorPolicyCapability::CAN_VIEW,\n );\n } else {\n $capabilities = $this->capabilities;\n }\n $filter->requireCapabilities($capabilities);\n $filter->raisePolicyExceptions($this->raisePolicyExceptions);\n\n $offset = (int)$this->getOffset();\n $limit = (int)$this->getLimit();\n $count = 0;\n\n if ($limit) {\n $need = $offset + $limit;\n } else {\n $need = 0;\n }\n\n $this->willExecute();\n\n do {\n if ($need) {\n $this->rawResultLimit = min($need - $count, 1024);\n } else {\n $this->rawResultLimit = 0;\n }\n\n $page = $this->loadPage();\n\n $visible = $this->willFilterPage($page);\n $visible = $filter->apply($visible);\n foreach ($visible as $key => $result) {\n ++$count;\n\n // If we have an offset, we just ignore that many results and start\n // storing them only once we've hit the offset. This reduces memory\n // requirements for large offsets, compared to storing them all and\n // slicing them away later.\n if ($count > $offset) {\n $results[$key] = $result;\n }\n\n if ($need && ($count >= $need)) {\n // If we have all the rows we need, break out of the paging query.\n break 2;\n }\n }\n\n if (!$this->rawResultLimit) {\n // If we don't have a load count, we loaded all the results. We do\n // not need to load another page.\n break;\n }\n\n if (count($page) < $this->rawResultLimit) {\n // If we have a load count but the unfiltered results contained fewer\n // objects, we know this was the last page of objects; we do not need\n // to load another page because we can deduce it would be empty.\n break;\n }\n\n $this->nextPage($page);\n } while (true);\n\n $results = $this->didLoadResults($results);\n\n return $results;\n }", "public function getLimit() {}", "public function getPageSize();", "function news_get_limited_rows( $p_offset, $p_project_id = null ) {\r\n\t\tif ( $p_project_id === null ) {\r\n\t\t\t$p_project_id = helper_get_current_project();\r\n\t\t}\r\n\r\n\t\t$c_offset\t\t= db_prepare_int( $p_offset );\r\n\r\n\t\t$t_projects = current_user_get_all_accessible_subprojects( $p_project_id );\r\n\t\t$t_projects[] = $p_project_id;\r\n\t\tif ( ALL_PROJECTS != $p_project_id ) {\r\n\t\t\t$t_projects[] = ALL_PROJECTS;\r\n\t\t}\r\n\r\n\t\t$t_projects = array_map( 'db_prepare_int', $t_projects );\r\n\r\n\t\t$t_news_table\t\t\t= config_get( 'mantis_news_table' );\r\n\t\t$t_news_view_limit\t\t= config_get( 'news_view_limit' );\r\n\t\t$t_news_view_limit_days = config_get( 'news_view_limit_days' );\r\n\r\n\t\tswitch ( config_get( 'news_limit_method' ) ) {\r\n\t\t\tcase 0 :\r\n\t\t\t\t# BY_LIMIT - Select the news posts\r\n\t\t\t\t$query = \"SELECT *\r\n\t\t\t\t\t\tFROM $t_news_table\";\r\n\r\n\t\t\t\tif ( 1 == count( $t_projects ) ) {\r\n\t\t\t\t\t$c_project_id = $t_projects[0];\r\n\t\t\t\t\t$query .= \" WHERE project_id='$c_project_id'\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$query .= ' WHERE project_id IN (' . join( $t_projects, ',' ) . ')';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$query .= ' ORDER BY announcement DESC, id DESC';\r\n\t\t\t\t$result = db_query( $query , $t_news_view_limit , $c_offset);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1 :\r\n\t\t\t\t# BY_DATE - Select the news posts\r\n\t\t\t\t$query = \"SELECT *\r\n\t\t\t\t\t\tFROM $t_news_table\";\r\n\r\n\t\t\t\tif ( 1 == count( $t_projects ) ) {\r\n\t\t\t\t\t$c_project_id = $t_projects[0];\r\n\t\t\t\t\t$query .= \" WHERE project_id='$c_project_id'\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$query .= ' WHERE project_id IN (' . join( $t_projects, ',' ) . ')';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$query .= \" AND \" . db_helper_compare_days( db_now(), 'date_posted', \"< $t_news_view_limit_days\") .\r\n\t\t\t\t\t\t \" OR announcement = 1\r\n\t\t\t\t\t\tORDER BY announcement DESC, id DESC\";\r\n\t\t\t\t$result = db_query( $query, $t_news_view_limit, $c_offset );\r\n\t\t\t\tbreak;\r\n\t\t} # end switch\r\n\r\n\t\t$t_row_count = db_num_rows( $result );\r\n\r\n\t\t$t_rows = array();\r\n\t\tfor ( $i = 0; $i < $t_row_count; $i++ ) {\r\n\t\t\t$row = db_fetch_array( $result ) ;\r\n\t\t\t$row['date_posted'] = db_unixtimestamp( $row['date_posted'] );\r\n\t\t\tarray_push( $t_rows, $row );\r\n\t\t}\r\n\r\n\t\treturn $t_rows;\r\n\t}", "public function getLimit(): int\n {\n return $this->getQueryPageSize();\n }", "public function limit($limit, $offset = null);", "public function limit($limit);", "public function limit($limit);", "function selectMaxPage() {\n // 1) get Connection\n $dbInfo = new DBInfo();\n $con = $dbInfo->getConnection();\n if(!$con) {\n echo 'false_selectPageList_connect';\n return;\n }\n\n // 2) set SQL sentence\n $sql = \"SELECT CEIL(COUNT(*) / 10) \n FROM board b\n JOIN user_info u\n ON (writer = id)\";\n $sql .= $this->queryFilter;\n\n // 3) act SQL\n if(!($result = $con->query($sql))) {\n echo 'false_selectPageList_sqlQuery';\n return;\n }\n\n if(!$result) {\n echo 'false_selectPageList_noSelect';\n return;\n }\n $con->close();\n\n return $result->fetch_array()[0];\n }", "public function paginate($limit, array $params = null);", "public function setMaxResults($maxResults);", "public function paginateLatestQueries($page = 1, $perPage = 15);", "private function limit_page()\n {\n $page = $this->define_page();\n $start = $page * $this->count - $this->count;\n $fullnumber = $this->total;\n $total = $fullnumber['count'] / $this->count;\n is_float($total) ? $max = $total + 2 : $max = $total + 1;\n $array = array('start'=>(int)$start,'max'=>(int)$max);\n return $array;\n }", "protected function checkForMorePages()\n {\n $this->hasMore = $this->items->count() > $this->limit;\n\n $this->items = $this->items->slice(0, $this->limit);\n }", "public function fetchData()\n\t{\n\t\tif (isset($this->rows))\n\t\t{\n\t\t\treturn $this->rows;\n\t\t}\n\t\t$this->rows = parent::fetchData();\n\t\tif ($this->force_count)\n\t\t{\n\t\t\treturn $this->rows;\n\t\t}\n\n\t\tif (count($this->rows) > $this->pagination->pageSize)\n\t\t{\n\t\t\t$this->hasMore = true;\n\t\t\tarray_pop($this->rows);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->hasMore = false;\n\t\t}\n\t\t$this->totalItemCount = $this->pagination->offset + count($this->rows);\n\t\t$this->pagination->itemCount = $this->totalItemCount + ($this->hasMore ? 1 : 0);\n\t\treturn $this->rows;\n\t}", "public function limit(int $limit, int $offset);", "protected function actionGetByLimit($start=0,$limit=0) {\n $model = new News();\n \n $result= $model->getItemsByLimit($start, $limit);\n return $result;\n }", "protected function fetchData()\n\t{\n\t\t$this->addScopes();\n\t\t$criteria=$this->getCriteria();\n\t\tif(($pagination=$this->getPagination())!==false)\n\t\t{\n\t\t\t$pagination->setItemCount($this->getTotalItemCount());\n\t\t\t$pagination->applyLimit($criteria);\n\t\t}\n\t\tif(($sort=$this->getSort())!==false)\n\t\t\t$sort->applyOrder($criteria);\n\t\treturn CActiveRecord::model($this->modelClass)->findAll($criteria);\n\t}", "function get_paged_list($limit = 10, $offset = 0){\n\t $this->db->join('department', 'department.id = employee.Department');\n $this->db->order_by('EmployeeId','asc');\n return $this->db->get($this->tbl_Employeeinfo, $limit, $offset);\n }", "function getFeatureProducts(){\n \n $itemonpage = !empty($_GET['per_page'])?$_GET['per_page']:3;\n $page = !empty($_GET['page'])?$_GET['page']:1;\n $offset= ($page-1)*$itemonpage;\n\n $numberPage = ceil(30/$itemonpage);\n \n $sql = self::$connection->prepare(\"SELECT * FROM products limit \".$itemonpage.\" offset \".$offset);\n \n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n include \"link.php\";\n return $items; //return an array\n }", "public function get_pagination( $page, $limit)\n {\n $sql = \"select id, `name`, price, `view` from fs_product limit %u,%u\";\n $x = sprintf($sql,$page,$limit);\n// $options = [\n// ':sort' => $sort,\n// ':page' => $page,\n// ':perpage' => $limit\n// ];\n return $this->loadRows($x);\n }", "function show_posts($post_per_page, $connection){\n $start = (current_page() > 1) ? current_page() * $post_per_page - $post_per_page : 0;\n $sentence = $connection->prepare(\"SELECT SQL_CALC_FOUND_ROWS * FROM articles LIMIT $start, $post_per_page\");\n $sentence->execute();\n return $sentence->fetchAll();\n}", "public function getProjectsPaginatedList($limit)\n {\n }", "function paginate() {\n\t\t$all_rs = $this->db->query($this->sql );\n\t\t$this->total_rows = $all_rs->num_rows;\n\t\t\n\t\t//Return FALSE if no rows found\n\t\tif ($this->total_rows == 0) {\n\t\t\tif ($this->debug)\n\t\t\t\techo \"Query returned zero rows.\";\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t//Max number of pages\n\t\t$this->max_pages = ceil($this->total_rows / $this->rows_per_page );\n\t\tif ($this->links_per_page > $this->max_pages) {\n\t\t\t$this->links_per_page = $this->max_pages;\n\t\t}\n\t\t\n\t\t//Check the page value just in case someone is trying to input an aribitrary value\n\t\tif ($this->page > $this->max_pages || $this->page <= 0) {\n\t\t\t$this->page = 1;\n\t\t}\n\t\t\n\t\t//Calculate Offset\n\t\t$this->offset = $this->rows_per_page * ($this->page - 1);\n\t\t\n\t\t//Fetch the required result set\n\t\t$rs = $this->db->query($this->sql . \" LIMIT {$this->offset}, {$this->rows_per_page}\" );\n\t\t$this->data = $rs->rows;\n\t}", "function pagination(){}", "function getLimit() ;", "public function get_limit();", "private function query($cursor, $limit) {\n // here. Since this is an example, we just use a premade dataset.\n\n return array_slice($this->data, $cursor, $limit);\n }", "public function setMaxResults()\n {\n return $this;\n }", "private function _pagination()\n {\n\n if (Request::has('pq_curpage') && Request::has('pq_rpp')) {\n $columnsTemp = $this->_columnsRaw;\n $pq_curPage = Request::input('pq_curpage');\n $pq_rPP = Request::input('pq_rpp');\n $queryTemp = new \\stdClass();\n $queryTemp = $this->_getQueryStatement();\n $queryTemp->columns = null;\n\n // Verifica si existe algun filtro para aplicarlo al COUNT y determinar cuantos registros hay en la consulta\n if (property_exists($this->_filterTable, 'query')) {\n $queryTemp->whereRaw($this->_filterTable->query, $this->_filterTable->param);\n }\n\n $totalRecordQuery = $queryTemp->count();\n $this->_query->columns = $columnsTemp;\n\n $skip = ($pq_rPP * ($pq_curPage - 1));\n\n if ($skip >= $totalRecordQuery) {\n $pq_curPage = ceil($totalRecordQuery / $pq_rPP);\n $skip = ($pq_rPP * ($pq_curPage - 1));\n }\n\n // Make limit to query\n $this->_query->offset($skip)\n ->limit($pq_rPP);\n\n $this->_paginationLimit = [\n 'totalRecords' => $totalRecordQuery,\n 'curPage' => $pq_curPage,\n ];\n }\n }", "public function handleGetListRequest($page, $limit, $filters = [], $joins = []);", "public function getLimit()\n {\n return $this->number_of_items_per_page;\n }", "protected function _getMaxResultsPerPage() {\r\n return 500;\r\n }", "public function getCurrentPageResults(): array;", "static function getTopArticles($limit)\n {\n $con = $GLOBALS['con'];\n $sql = \"SELECT content_id, resource_id, content_title, content_text, content_description, date_format(date_created, '%m/%d/%y') as date_created FROM content where resource_id = 1 ORDER BY date_created DESC LIMIT $limit\";\n\n\n $result = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($result)) {\n $resource_name = self::GetResourceNameByResourceId($row['resource_id']);\n $date_created = $row[\"date_created\"];\n echo \"<div class=\\\"block-last-viewed\\\">\n <a class=\\\"text-dark\\\" href=\\\"#\\\" onclick=\\\"ReadArticle(\" . $row['content_id'] . \")\\\">\n <p class=\\\"h3 text-dark\\\">\" . $row['content_title'] . \"</p></a>\n <span class=\\\"badge badge-pill badge-ngreen\\\">$resource_name</span>\n <span class=\\\"badge badge-pill badge-light\\\">Created on: $date_created</span>\n <p class=\\\"content_text\\\">\" . $row['content_description'] . \"</p>\n <a class=\\\"btn btn-outline-ngreen\\\" href=\\\"#\\\" onclick=\\\"ReadArticle(\" . $row['content_id'] . \")\\\">Read More</a>\n </div>\";\n }\n }", "public static function limit($limit);", "public function getPerPage(): int;", "public function load($limit = 5)\n {\n $query = $this->getQuery();\n\n $query\n ->where(\"a.published = 1\")\n ->order(\"a.votes DESC\");\n\n $this->db->setQuery($query, 0, (int)$limit);\n\n $this->data = $this->db->loadAssocList();\n\n if (!$this->data) {\n $this->data = array();\n }\n }", "public function getPaginatedList($offset, $limit, $criteria = array());", "public function do_paging()\n {\n }", "private function paginate()\n\t{\n\t\tif ($this->_listModel) {\n\t\t\t$this->_listModel->loadNextPage();\n\t\t}\n\t}", "function getPagedStatement($sql,$page,$items_per_page);", "public function GetUsersByLIMIT($pageid)\n {\n $db = new DB();\n $start = 10*($pageid-1);\n $row = 10;\n $query = \"SELECT * FROM `users` LIMIT $start,$row\";\n $stm = $db->prepare($query);\n $stm->execute();\n $result = $stm->fetchAll();\n $db = NULL;\n return $result;\n }", "public function limit(): int\n {\n return $this->per_page;\n }", "public function limitBy(int $limit, int $offset = null): ICollection;", "public function getPageResults(int $page = 1): array;", "public function read()\n {\n return Contest::paginate(5);\n }", "protected function queryMore()\n {\n $result = $this->client->queryMore($this->queryResult->getQueryLocator());\n $this->setQueryResult($result);\n $this->rewind();\n }", "public function find_limit($limit = 100, $offset = 0 )\n {\n $query= $this->db->query(\"\n SELECT *\n FROM punti_spesi\n LIMIT $offset , $limit \"); \n return $query->result();\n }", "public function paging() {\n\t\t$pages = ceil($this->count('all') / $this->_page_length);\n\t\t$response = array('pages' => $pages, 'page' => $this->_on_page,'length' => $this->_page_length,'items' => $this->count('all'));\n\t\treturn (object) $response;\t\t\n\t}", "public function setPagination($limit, $offset = 0);", "public function getData($limit = 10, $page = 1) { // set default arguments values\n $results = array();\n $this->limit = $limit;\n $this->page = $page;\n\n // no limiting necessary, use query as it is\n if ($this->limit == 'all') {\n $query = $this->query;\n } else {\n // echo (($this->page - 1) * $this->limit); die;\n // create the query, limiting records from page, to limit\n $this->rowstart = (($this->page - 1) * $this->limit);\n // add to original query: (minus one because of the way SQL works)\n $query = $this->query . \" LIMIT {$this->rowstart}, $this->limit\";\n }\n\n try {\n $stmt = $this->conn->query($query);\n\n if ($stmt->execute()):\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n endif;\n } catch (PDOException $e) {\n echo \"Error: \" . $e->getMessage();\n die;\n }\n\n return $results; // object\n }", "public function fetchData()\n {\n if (null === $this->data) {\n $adaptable = $this->getAdaptable();\n if ($adaptable instanceof \\ArrayObject) {\n $this->data = $adaptable->getArrayCopy();\n } else {\n $this->data = (array) $adaptable;\n }\n\n $page = $this->getPageNumber() - 1;\n $limit = $this->getItemsPerPage();\n $this->data = array_splice($this->data, $page * $limit, $limit);\n }\n }", "public function paginate()\n {\n return $this->configurationRepository->scopeQuery(function ($query) {\n return $query->orderBy('id', 'desc');\n })->paginate();\n }", "public function paginate($limit = 15)\n {\n return $this->model->paginate($limit);\n }", "public function page(int $page, $limit = null);", "protected function fetch()\n\t{\n\t\tif(isset($this->total_record_count) && !$this->valid())\n\t\t{\n\t\t\treturn array();\n\t\t}\n\n\t\tlist($page, $total_record_count) = $this->resource->fetchAll($this->url, array(\n\t\t\t'page_number' => $this->key(),\n\t\t\t'page_size' => $this->page_size,\n\t\t\t'sort' => $this->sort,\n\t\t\t'filters' => $this->filters\n\t\t));\n\n\t\tif(is_null($this->total_record_count))\n\t\t{\n\t\t\t$this->total_record_count = $total_record_count;\n\t\t}\n\n\t\tif($this->total_record_count != $total_record_count)\n\t\t{\n\t\t\tthrow new Exception('Concurrent Modification Occurred! The number of remote records changed.');\n\t\t}\n\n\t\treturn $page;\n\t}", "function index_limit($limit, $start = 0) {\n $this->db->order_by($this->id, $this->order);\n $this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }", "function index_limit($limit, $start = 0) {\n $this->db->order_by($this->id, $this->order);\n $this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }", "public function getPaginate(){ }", "public function paginate()\n {\n }", "public function showEntities()\n {\n return Entity::paginate(10);\n }", "public function limit($offset, $max = null);", "public function findAllWithPagination() {\n\n $this->checkOptionsAndEnableCors();\n\n $page = $this->input->get('page');\n $limit = $this->input->get('limit');\n $sortParam = $this->input->get('sort');\n if(isset($sortParam)){\n $sort = json_decode($sortParam);\n } else {\n $sort = null;\n }\n\n if(isset($page) && isset($limit)){\n $users = $this->repository->findAllWithPagination($page - 1, $limit, $sort);\n $count = $this->repository->count();\n echo json_encode([ \"data\" => $users, \"count\" => $count ]);\n } else {\n $this->handleError('Missing page and limit parameter');\n }\n }", "public function testFindByQWithLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'limit' => 2];\n $this->filterTest($filters, [$all[0], $all[1]]);\n }", "function get_limit_data($limit, $start = 0, $q = NULL) {\n $db2 = $this->load->database('database_kedua', TRUE);\n\n $db2->order_by($this->id, $this->order);\n $db2->like('id', $q);\n\t$db2->or_like('kelas', $q);\n\t$db2->limit($limit, $start);\n return $db2->get($this->table)->result();\n }", "public function get_all($limit = 0, $offset = 0)\n\t{\n\t\treturn $this->get_many(null, null, $limit, $offset);\n\t}", "private function getItems()\n\t{\n\t\tglobal $objPage;\n\t\t$objDatabase = \\Database::getInstance();\n\t\t\n\t\t$time = time();\n\t\t$strBegin;\n\t\t$strEnd;\n\t\t$arrArticles = array();\n\t\t\n\t\t// Create a new data Object\n\t\t$objDate = new \\Date();\n\t\t\n\t\t// Set scope of pagination\n\t\tif($this->pagination_format == 'news_year')\n\t\t{\n\t\t\t// Display current year only\n\t\t\t$strBegin = $objDate->__get('yearBegin');\n\t\t\t$strEnd = $objDate->__get('yearEnd');\n\t\t}\n\t\telseif ($this->pagination_format == 'news_month')\t\n\t\t{\n\t\t\t// Display current month only\n\t\t\t$strBegin = $objDate->__get('monthBegin');\n\t\t\t$strEnd = $objDate->__get('monthEnd');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Display all\n\t\t}\n\t\t\n\t\t$strCustomWhere = '';\n\t\t// HOOK: allow other extensions to modify the sql WHERE clause\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) && count($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['customsql_where'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$strCustomWhere = $this->$callback[0]->$callback[1]('news',$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fetch all news that fit in the scope\n\t\t$objArticlesStmt = $objDatabase->prepare(\"\n \tSELECT * FROM tl_news\n \tWHERE \n \t\tpid IN(\" . implode(',', $this->archives) . \") AND published=1 AND hide_in_pagination!=1\n \t\t\" . (!BE_USER_LOGGED_IN ? \" AND (start='' OR start<$time) AND (stop='' OR stop>$time)\" : \"\") . \"\n \t\t\" . ($strBegin ? \" AND (date>$strBegin) AND (date<$strEnd)\" : \"\" ) .\" \".$strCustomWhere. \"\n \tORDER BY date DESC\");\n\t \n\t\t$objArticles = $objArticlesStmt->execute();\n\t\t\n\t\tif ($objArticles->numRows < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// get all articles\n\t\t$arrArticles = $objArticles->fetchAllAssoc();\n\t\t\n\t\t// HOOK: allow other extensions to modify the items\n\t\tif (isset($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) && count($GLOBALS['TL_HOOKS']['readerpagination']['getItems']) > 0)\n\t\t{\n\t\t\tforeach($GLOBALS['TL_HOOKS']['readerpagination']['getItems'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$arrArticles = $this->$callback[0]->$callback[1]('news',$arrArticles,$this);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// add keys for pagination (title, href)\n\t\tforeach($arrArticles as $i => $article)\n\t\t{\n\t\t\t// get alias\n \t\t$strAlias = (!$GLOBALS['TL_CONFIG']['disableAlias'] && $article['alias'] != '') ? $article['alias'] : $article['id'];\n \t\t\t\n \t\t\t$arrTmp = array\n \t\t\t(\n \t\t\t\t'href' => ampersand($this->generateFrontendUrl($objPage->row(), ((isset($GLOBALS['TL_CONFIG']['useAutoItem']) && $GLOBALS['TL_CONFIG']['useAutoItem']) ? '/' : '/items/') . $strAlias)),\n 'title' => specialchars($article['headline']),\n \t);\n \t\t\t\n \t\t\t$arrResult[] = array_merge($arrArticles[$i], $arrTmp);\n \t\t\tunset($arrTmp);\n\t\t}\n\t\t$arrArticles = $arrResult;\n\t\tunset($arrResult);\n\t\t\n\t\tif(count($arrArticles) < 1)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t\t// Higher the keys of the array by 1\n\t\t$arrTmp = array();\n\t\tforeach($arrArticles as $key => $value)\n\t\t{\n\t\t\t$arrTmp[$key+1] = $value;\n\t\t}\n\t\tksort($arrTmp);\n\t\t\n\t\t$arrArticles = $arrTmp;\n\t\tunset($arrTmp);\n\t\t\n\t\treturn $arrArticles;\n\t}", "public function findPaged($page = 1, $limit = 10) {\n\t\t$offset = $page == 1 ? 0 : ($page - 1) * $limit;\n\t\t$q = $this->query();\n\t\t$q->select('*');\n\t\t$q->limit(\"$offset, $limit\");\n\t\treturn $q->execute()->fetchAll(static::MODEL_CLASS);\n\t}", "function paginateWithExtra($size = 15);", "function &getLastTen( $limit, $offset )\n {\n $this->dbInit();\n $link_array = 0;\n \n $this->Database->array_query( $link_array, \"SELECT * FROM eZLink_Link WHERE Accepted='Y' ORDER BY Title DESC LIMIT $offset, $limit\" );\n\n return $link_array;\n }", "function index_limit($limit, $start = 0) {\n $this->db->join('tbl_perusahaan','tbl_out.id_perusahaan=tbl_perusahaan.id_perusahaan');\n $this->db->group_by('nomor_permohonan');\n $this->db->order_by($this->id, $this->order);\n $this->db->limit($limit, $start);\n return $this->db->get($this->table)->result();\n }", "protected function initQueryLimit()\n {\n $url = $this->getBaseUrl(true) . 'accounts/self/capabilities?format=JSON';\n $response = $this->getConnector()->get($url);\n $response = $this->verifyResult($response, $url);\n\n $content = $this->transformJsonResponse($response->getContent());\n\n return $content['queryLimit']['max'];\n }", "function getResult($limit, $idField, $dateField = null);", "public function getResults($offset, $limit)\n {\n return $this->queryBuilder->setFirstResult($offset)->setMaxResults($limit)->getQuery()->execute(array(), $this->getHydrationMode());\n }", "protected function buildPagination() {}", "protected function buildPagination() {}" ]
[ "0.7114474", "0.691118", "0.6677167", "0.6676789", "0.66713196", "0.6653808", "0.6653808", "0.6597848", "0.6597848", "0.65496635", "0.65357697", "0.6499749", "0.6499749", "0.6499749", "0.6499749", "0.6499749", "0.6495498", "0.6469914", "0.64226276", "0.64062303", "0.64061886", "0.639904", "0.6394087", "0.63206935", "0.6314432", "0.6306241", "0.62999463", "0.6266402", "0.6246764", "0.6217812", "0.6217812", "0.6204667", "0.61961675", "0.6186484", "0.61673576", "0.6138878", "0.61232674", "0.6090345", "0.6082621", "0.6079115", "0.60768247", "0.6076052", "0.60613626", "0.6052822", "0.6039997", "0.6038588", "0.60125625", "0.60122216", "0.6008601", "0.60063314", "0.5998033", "0.5980105", "0.5978433", "0.5971582", "0.5968158", "0.5964738", "0.5955981", "0.5936268", "0.59349465", "0.59345245", "0.5923887", "0.592349", "0.592256", "0.59156275", "0.590723", "0.5903062", "0.58915806", "0.5881555", "0.58814394", "0.58751845", "0.5872584", "0.5870682", "0.58671904", "0.58663553", "0.5864856", "0.58520734", "0.5843182", "0.58429646", "0.5842674", "0.58399993", "0.58351415", "0.58351415", "0.5827871", "0.5824493", "0.58205646", "0.580358", "0.57990336", "0.57962483", "0.57872164", "0.5783706", "0.57801026", "0.5777359", "0.57759047", "0.57749856", "0.57746226", "0.57722086", "0.57667637", "0.5766355", "0.57641625", "0.57641625" ]
0.62943757
27
Fetch thw total number of results before limits. Uses MySQL found rows function to get count of records that would have been returned before the limit.
protected final function fetchTotalRecordCount(): void { $query = $this->query; $query->resetColumns() ->count() ->resetOrders() ->removeLimit(); $this->totalRecords = $this->query->execute()->getOne(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRowsCountBeforeLimitFilter()\n {\n $toReturn = $this->rowsCountBeforeLimitFilter;\n if ($toReturn == 0) {\n return $this->getRowsCount();\n }\n return $toReturn;\n }", "function getNumRows() {\r\n\t\t\tif($this->privateVars['resultset']) {\r\n\t\t\t\tif(@mysql_num_rows($this->privateVars['resultset']))\r\n\t\t\t\t\treturn mysql_num_rows($this->privateVars['resultset']);\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}", "public function count()\n\t{\n\t\tif ($this->limited_count_cache === null) {\n\t\t\tif ($this->trust_row_count === false) {\n\t\t\t\t$this->limited_count_cache = $this->query->runTotalRowsCount();\n\t\t\t} else {\n\t\t\t\t$this->limited_count_cache = $this->getStatement()\n\t\t\t\t\t\t\t\t\t\t\t\t ->rowCount();\n\t\t\t}\n\t\t}\n\n\t\treturn $this->limited_count_cache;\n\t}", "function getNRows() \n { \n if($this->rsQry)\n {\n return true;\n }\n else\n {\n\t\t\t return mysql_num_rows($this->rsQry);\n }\n\t\t}", "public function getFoundRows()\n\t{\n\t\treturn (int) $this->value('SELECT FOUND_ROWS()', [], null);\n\t}", "public function numRows() {\n\t\t$val = $this->numResults;\n\t\t$this->numResults = array();\n\t\treturn $val;\n\t}", "function get_num_records()\n\t{\n\t\t$this->sql = 'SELECT COUNT(*) FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\treturn db_getOne($this->sql, $this->use_db);\n\t}", "public function setRowsCountBeforeLimitFilter()\n {\n $this->rowsCountBeforeLimitFilter = $this->getRowsCount();\n }", "public function numRows(){\n $val = $this->numResults;\n $this->numResults = array();\n return $val;\n }", "public function getNumRows($sql, $num_limit){\n\t\t$result = $this->query($sql);\n\t\tif($this->num_rows($result) > 0){\n\t\t\t$data = array();\n\t\t\twhile($row = $this->fetch_array($result) or $num_limit-- > 0 ){\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function numResults() {\n\t\treturn $this->num_rows();\n\t}", "public function getFoundRows(): int\n\t{\n\t\ttry\n\t\t{\n\t\t\t$result = $this->connection->query('SELECT FOUND_ROWS()');\n\t\t\t\n\t\t\tif (empty($result))\n\t\t\t{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t\t$count = $result->fetchColumn(0);\n\t\t\t\n\t\t\treturn (empty($count) ? 0 : intval($count));\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->limit=$row->answersperpage;\n }", "public function hasNumRowsLimit(){\n return $this->_has(7);\n }", "function numRows()\n{\n\t$num = mysql_num_rows($this->res);\n\treturn $num;\n}", "function fetch_count($res)\n\t{\n\t\t$count=mysql_num_rows($res);\n\t\treturn $count;\n\t}", "public function getNbResults()\n {\n return $this->select->count();\n }", "public function getPaginationCount()\n {\n return ceil(DB::count($this->table) / $this->paginationLimit);\n }", "public function count() {\n\t\t$this->checkResultSet();\n\t\treturn $this->indexMax;\n\t}", "function nbrRows() {\n return mysqli_num_rows($this->result);\n }", "public function cekRowsPerCat(){\n $query = \"SELECT COUNT(*) AS numrows FROM \".NEWS_TABLE.\" WHERE newsCategory =\".$this->idCategory;\n $result = mysql_query($query) or die('Error, query failed');\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $numrows = $row['numrows']; \n \n return $numrows;\n }", "public function getLimit(): int\n {\n return $this->getQueryPageSize();\n }", "function num_rows() {\n\t\n\t\t$num = @mysql_num_rows($this->rstemp);\n\t\tif ($this->debug) echo \"$num records returneds <br>\\n\\n\";\t\n\t\t\n\t\treturn $num;\t\t\n\t}", "public function numRows() : int\n\t{\n\t\treturn $this->handle->numRows($this->result);\n\t}", "public function numberRows(): int\n {\n $number = 0;\n $dbResult = $this->query(\"SELECT FOUND_ROWS() AS number\");\n $data = $dbResult->fetch();\n if (isset($data[\"number\"])) {\n $number = $data[\"number\"];\n }\n return (int) $number;\n }", "function number_pages($post_per_page, $connection){\n $total_post = $connection->prepare('SELECT FOUND_ROWS() as total');\n $total_post->execute();\n $total_post = $total_post->fetch()['total'];\n\n $number_pages = ceil($total_post / $post_per_page);\n return $number_pages;\n}", "private function getNumPages() {\n\n return $this->rowCount / $this->limit;\n }", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function count()\n {\n if (array_key_exists('count', $this->information))\n $totalCount = $this->information['count'];\n else\n $totalCount = 0;\n if ($this->limit < $totalCount)\n return $this->limit;\n else\n return $totalCount;\n }", "private function getCountFilteredResults()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('count(distinct ' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');\n $qb->from($this->metadata->getName(), $this->tableName);\n\n $this->setLeftJoin($qb);\n $this->setWhere($qb);\n $this->setWhereCallbacks($qb);\n\n return (int) $qb->getQuery()->getSingleScalarResult();\n }", "public function countResults()\n {\n return mysqli_num_rows($this->lastResults);\n }", "function &getNumRows($filter = null, $content = null, $date_ini = '2009-01-01 00:00:00', $date_fin = NOW){\n global $db;\n global $user;\n\n $sql = \"SELECT COUNT(*) AS numRows FROM products\";\n\n if(($filter != null) and ($content != null)){\n $sql = \t\"SELECT COUNT(*) AS numRows \"\n .\"FROM products \"\n .\"WHERE \".$filter.\" like '%$content%'\";\n }\n //Basic::EventLog(\"products->getNumRows: \".$sql);\n $res =& $db->queryOne($sql);\n return $res;\t\t\n }", "private function getCountAllResults()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('count(' . $this->tableName . '.' . $this->rootEntityIdentifier . ')');\n $qb->from($this->metadata->getName(), $this->tableName);\n\n $this->setWhereCallbacks($qb);\n\n return (int) $qb->getQuery()->getSingleScalarResult();\n }", "public function foundRows()\n {\n // Execute the query directly\n $result = $this->client->query('SELECT FOUND_ROWS() AS \"count\"');\n\n // If no results are returned, return an empty array\n if ($result === false) {\n return [];\n }\n\n $data = $result->fetch_assoc();\n\n return (int) $data['count'];\n }", "public function getTotalItems()\n {\n return intval($this->property('limit'));\n }", "public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }", "protected function getFoundRows ($comment=null) {\n\t\t// make sure 'SELECT FOUND_ROWS();' is not cached by adding a timestamp, comment\n\t\t$time = time();\n\t\tif ($comment) $comment = ':'.$comment;\n\t\t$sqlComment = sprintf(\"/* paginateCount for {$this->alias}%s @{$time} */\", $comment);\n\t\t$found_rows = $this->query(\"{$sqlComment} SELECT FOUND_ROWS();\");\n\t\t$count = array_shift($found_rows[0][0]);\n\t\treturn $count;\t\t\n\t}", "public function count(): int\n {\n if ($this->numberOfResults === null) {\n $this->initialize();\n if ($this->queryResult !== null) {\n $this->numberOfResults = count($this->queryResult ?? []);\n } else {\n parent::count();\n }\n }\n\n return $this->numberOfResults;\n }", "public function fetchNrRecordsToGet();", "public function numRows() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\treturn mysql_num_rows($this->result);\r\n\t}", "public function get_cantidad_resultados(){\n \treturn $this->db->query('select FOUND_ROWS() as found_rows')->row()->found_rows;\n }", "public function getTotalCountSql()\n\t{\n\t\tif (true !== $this->_sqlCalcFoundRows) {\n\t\t\tthrow new Xend_Db_Exception('The option `SQL_CALC_FOUND_ROWS is not allowed.');\n\t\t}\n\n\t\ttry {\n\t\t\t$count = $this->_adapter->query('SELECT FOUND_ROWS()')->fetchColumn(0);\n\t\t} catch (Exception $e) {\n\t\t\tif (DEBUG) {\n throw $e;\n }\n\n $count = false;\n\t\t}\n\n\t\treturn $count;\n\t}", "function getNumRows() {\r\n return mysql_num_rows($this->m_Result);\r\n }", "function fetchCount();", "public function count(): int\r\n\t{\r\n\t\t$limit = $this->queryBuilder->getMaxResults();\r\n\t\t$offset = $this->queryBuilder->getFirstResult();\r\n\r\n\t\t$this->queryBuilder->setMaxResults(null);\r\n\t\t$this->queryBuilder->setFirstResult(null);\r\n\r\n\t\t$pager = new Paginator($this->queryBuilder->getQuery());\r\n\r\n\t\t$this->queryBuilder->setMaxResults($limit);\r\n\t\t$this->queryBuilder->setFirstResult($offset);\r\n\r\n\t\treturn $pager->count();\r\n\t}", "public function count(){\n\t\t$this->initRecordSet();\n\t\treturn $this->recordSetSize;\n\t}", "public function cekRows(){\n $query = \"SELECT COUNT(*) AS numrows FROM \".NEWS_TABLE;\n $result = mysql_query($query) or die('Error, query failed');\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $numrows = $row['numrows']; \n \n return $numrows;\n }", "private function setNumResults()\n\t{\n\t\t$this->numResults = (int) count($this->data);\n\t}", "public function getTotalNumberOfResults();", "public function paginationAll() {\n\n $query = \"select * from `rental` ORDER BY id DESC\";\n $res = mysql_query($query);\n $num = mysql_num_rows($res);\n return (int) $num;\n }", "public function count(): int\n\t{\n\t\t$limit = $this->queryBuilder->getMaxResults();\n\t\t$offset = $this->queryBuilder->getFirstResult();\n\n\t\t$this->queryBuilder->setMaxResults(null);\n\t\t$this->queryBuilder->setFirstResult(null);\n\n\t\t$sql = $this->queryBuilder->getSQL();\n\n\t\t$this->queryBuilder->setMaxResults($limit);\n\t\t$this->queryBuilder->setFirstResult($offset);\n\n\t\t$stmt = $this->queryBuilder->getConnection()->prepare(\"\n\t\t\tSELECT COUNT(*) \n\t\t\tFROM ($sql) AS counter\n\t\t\");\n\n\n\t\tforeach ($this->queryBuilder->getParameters() as $name => $value) {\n\t\t\t$stmt->bindValue($name, $value, $this->queryBuilder->getParameterType($name));\n\t\t}\n\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchColumn();\n\t}", "public function getNbResults(): int\n {\n return $this->adapter->getTotalHits();\n }", "public function get_rows_count()\n\t{\n\t\treturn count($this->get_rows());\n\t}", "public function getLimit() {}", "public function getNumRows(): int\n {\n if (is_int($this->numRows)) {\n return $this->numRows;\n }\n if ($this->resultArray !== []) {\n return $this->numRows = count($this->resultArray);\n }\n if ($this->resultObject !== []) {\n return $this->numRows = count($this->resultObject);\n }\n\n return $this->numRows = count($this->getResultArray());\n }", "private function selectLimit(){\n $result=parent::selectSomething('*', 'config');\n $row=mysqli_fetch_object($result);\n $this->questionsPerPage=$row->questionsperpage;\n }", "function num_rows($rs)\n{\n\treturn @mysql_num_rows($rs);\n}", "public function limit(): int\n {\n return $this->per_page;\n }", "public function count()\n\t{\n\t\t$query = clone $this->df;\n\n\t\t$query->removeClause('select')\n\t\t\t->removeClause('limit')\n\t\t\t->removeClause('offset')\n\t\t\t->removeClause('order by')\n\t\t\t->select('count(*)');\n\n\t\treturn $this->count = (int)$query->fetchSingle();\n\t}", "public function getNumTotalQueryResults() : int{\n return $this->numTotalQueryResults;\n }", "public function getLimit()\n {\n return $this->number_of_items_per_page;\n }", "function numRows()\n {\n $this->getRows();\n return $this->row_counter;\n }", "function getLimit() ;", "function num_rows()\r\n\t{\r\n\t\tif ( ! $this->pdo_results ) {\r\n\t\t\t$this->pdo_results = $this->result_id->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t}\r\n\t\treturn sizeof($this->pdo_results);\r\n\t}", "public function numRows($conf)\n {\n $conf['select.']['selectFields'] = 'count(*)';\n $statement = $this->exec_getQuery($conf['table'], $conf['select.']);\n\n return (int)$statement->fetchColumn(0);\n }", "function &SelectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false,$arg3=false,$secs2cache=0) \r\n\t {\r\n\t $offsetStr = ($offset >= 0) ? \" OFFSET $offset\" : '';\r\n\t $limitStr = ($nrows >= 0) ? \" LIMIT $nrows\" : '';\r\n\t return $secs2cache ?\r\n\t $this->CacheExecute($secs2cache,$sql.\"$limitStr$offsetStr\",$inputarr,$arg3)\r\n\t :\r\n\t $this->Execute($sql.\"$limitStr$offsetStr\",$inputarr,$arg3);\r\n\t }", "public function numResults($r)\r\n {\r\n return @mysql_num_rows($r);\r\n }", "public function getCount() {\n\t\treturn $this->db->fetchColumn ( \"SELECT COUNT(id) FROM \" . $this->table );\n\t}", "public abstract function getRowsCount($clause, $options = [], $result_set = null);", "public function getNumRows() {\n\t\t$this->_numRows = mysqli_num_rows($this->_result);\n\t\treturn $this->_numRows;\n\t}", "public function count_rows() {\r\n return $this->db->count_all_results($this->table_name);\r\n }", "function getResultsCounter()\n\t{\n\t\t// Initialize variables\n\t\t$html = null;\n\t\t$fromResult = $this->limitstart + 1;\n\n\t\t// If the limit is reached before the end of the list\n\t\tif ($this->limitstart + $this->limit < $this->total) {\n\t\t\t$toResult = $this->limitstart + $this->limit;\n\t\t} else {\n\t\t\t$toResult = $this->total;\n\t\t}\n\n\t\t// If there are results found\n\t\tif ($this->total > 0) {\n\t\t\t$msg = JText::sprintf('Results of', $fromResult, $toResult, $this->total);\n\t\t\t$html .= \"\\n\".$msg;\n\t\t} else {\n\t\t\t$html .= \"\\n\".JText::_('No records found');\n\t\t}\n\n\t\treturn $html;\n\t}", "function SelectRecordCount() {\n\t\tglobal $conn;\n\t\t$origFilter = $this->CurrentFilter;\n\t\t$this->Recordset_Selecting($this->CurrentFilter);\n\t\t$sSql = $this->SelectSQL();\n\t\t$cnt = $this->TryGetRecordCount($sSql);\n\t\tif ($cnt == -1) {\n\t\t\tif ($rs = $conn->Execute($this->SelectSQL())) {\n\t\t\t\t$cnt = $rs->RecordCount();\n\t\t\t\t$rs->Close();\n\t\t\t}\n\t\t}\n\t\t$this->CurrentFilter = $origFilter;\n\t\treturn intval($cnt);\n\t}", "public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}", "public function limit($count, $offset);", "public function countQuery(\n $sql\n ) \n {\n\t\tif (++self::$queryCount > self::$queryLimit\n &&(empty($GLOBALS['current_user']) || !is_admin($GLOBALS['current_user']))) {\n\t\t require_once('include/resource/ResourceManager.php');\n\t\t $resourceManager = ResourceManager::getInstance();\n\t\t $resourceManager->notifyObservers('ERR_QUERY_LIMIT');\n\t\t}\n }", "public function getNumRows()\n {\n $db = DB::conn();\n $query = \"SELECT COUNT(*) FROM \" . self::COMMENT_TABLE . \" WHERE thread_id = ?\";\n $where_params = array($this->thread_id);\n $count = $db->value($query, $where_params);\n return $count; \n }", "public function num_rows()\n\t{\n\t\t$regex = '/^SELECT\\s+(?:ALL\\s+|DISTINCT\\s+)?(?:.*?)\\s+FROM\\s+(.*)$/i';\n\t\t$output = array();\n\n\t\tif (preg_match($regex, $this->last_query, $output) > 0)\n\t\t{\n\t\t\t$stmt = $this->query(\"SELECT COUNT(*) FROM {$output[1]}\");\n\t\t\treturn (int) $stmt->fetchColumn();\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function nbRows();", "function lastNumRows() {\n\t\tif ($this->hasResult()) {\n\t\t\treturn mysql_num_rows($this->_result);\n\t\t}\n\t\treturn null;\n\t}", "public function testGetLastTotalResultsCountWhenResultIsLarge()\n {\n // (!) maxRows default is 100\n $arr = $this->client->search([\n 'q' => '東京都',\n 'lang' => 'en',\n ]);\n\n $this->assertIsArray($arr);\n $this->assertNotEmpty($arr);\n\n $count = count($arr);\n\n $total = $this->client->getLastTotalResultsCount();\n\n $this->assertIsInt($total);\n $this->assertEquals(100, $count);\n $this->assertGreaterThan($count, $total);\n }", "public function count(){\n $query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n return $row['total_rows'];\n }", "public function numRows($result = false){\n $this->resCalc($result);\n return (int) mysql_num_rows($result);\n }", "public function getNumberOfRecords() {\r\n\t\treturn mysqli_num_rows($this->result);\r\n\t}", "function get_row_count() {\n $query = \"SELECT COUNT(*) FROM failure;\";\n $count = select_scalar($query);\n return $count;\n}", "public function getCount() {\n return $this->db->fetchColumn(\"SELECT COUNT(id) FROM $this->table\");\n }", "function get_num_queries()\n {\n }", "function num_rows()\r\n {\r\n return mysql_num_rows($this->res_id);\r\n }", "public function getNbResults()\n\t{\n\t\tif (!$this->itemCount) {\n\t\t\t$this->itemCount = count($this->collection);\n\t\t}\n\n\t\treturn $this->itemCount;\n\t}", "function NumRows() {\n\t\t\tif ($this->result) {\n\t\t\t\treturn mysql_num_rows($this->result);\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n \t}", "function getLimit()\n\t{\n\t\tif ($this->total_records == 0)\n\t\t{\n\t\t\t$lastpage = 0;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$lastpage = ceil($this->total_records/$this->size);\n\t\t}\n\t\t\n\t\t$page = $this->page;\t\t\n\t\t\n\t\tif ($this->page < 1)\n\t\t{\n\t\t\t$page = 1;\n\t\t} \n\t\telse if ($this->page > $lastpage && $lastpage > 0)\n\t\t{\n\t\t\t$page = $lastpage;\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$page = $this->page;\n\t\t}\n\t\t\n\t\t$sql = ($page - 1) * $this->size . \",\" . $this->size;\n\t\t\n\t\treturn $sql;\n\t}", "function RecordCount() {\n return @mysql_num_rows($this->resource);\n }", "public function getNumberOfRows() {\n\n $query = $this->db->prepare(\"SELECT COUNT(*) FROM `products`\");\n\n try {\n\n $query->execute();\n $rows = $query->fetchColumn();\n\n return $rows;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "function numrows() {\r\n\t\treturn $this->numrows;\r\n\t}", "public function num_rows() {\n\t\t\treturn $this->count();\n\t\t}", "public function pageCount()\n {\n return ($this->dbConnection->query('SELECT * FROM todos')->rowCount()/$this->numRecords);\n\n }" ]
[ "0.7462784", "0.6892318", "0.6880414", "0.67617273", "0.6711503", "0.6652498", "0.66465074", "0.66442", "0.66393024", "0.66270167", "0.6619477", "0.66177034", "0.65735036", "0.6518861", "0.6506373", "0.6478601", "0.6457412", "0.64372313", "0.6426371", "0.6414735", "0.64087915", "0.64056957", "0.6395507", "0.6386192", "0.6372805", "0.6357372", "0.6356333", "0.63551694", "0.63551694", "0.63551694", "0.63551694", "0.63551694", "0.63503224", "0.6348102", "0.6345892", "0.6343115", "0.632618", "0.63240653", "0.63200057", "0.63047266", "0.6274749", "0.6274503", "0.6252552", "0.624756", "0.6247105", "0.62395126", "0.6216404", "0.62110764", "0.6197437", "0.6195931", "0.61917984", "0.6190829", "0.6190143", "0.61862236", "0.61843807", "0.6180984", "0.61755687", "0.6165752", "0.6163464", "0.61344415", "0.6133768", "0.6130299", "0.61263007", "0.6120328", "0.6115276", "0.61134195", "0.6112983", "0.6112413", "0.61109793", "0.6109261", "0.6108329", "0.61005616", "0.60993356", "0.6098395", "0.6095568", "0.60929227", "0.609057", "0.60886264", "0.60849524", "0.60842204", "0.6081449", "0.6079153", "0.6073088", "0.60712594", "0.6070752", "0.6068837", "0.6056044", "0.60545117", "0.60473776", "0.6042745", "0.60417515", "0.6039162", "0.6033256", "0.60326916", "0.6030859", "0.602802", "0.602179", "0.60174537", "0.60158837", "0.6015659" ]
0.6594433
12
Sets the humanreadable headers. Set generated headers from the pagination dataset column titles, if no headers have been set.
protected function setHeaders(): void { if (empty($this->headers) === false || empty($this->data) === true) { return; } $headers = array_keys(reset($this->data)); array_walk($headers, fn(&$header) => $header = ucwords(str_replace("_", " ", $header))); $this->headers = $headers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function headers()\n {\n // Maintain URL params for pagination\n if (empty($this->params['pass'])) {\n $this->params['pass'] = array();\n }\n $options = array(\n 'url' => array_merge($this->tableOptions['url'], $this->params['named'], $this->params['pass']),\n //'model' => $this->defaultModel\n );\n if (!empty($this->tableOptions['ajax'])) {\n $options['update'] = $this->tableOptions['ajax']['mh-update'];\n $options['indicator'] = $this->tableOptions['ajax']['mh-indicator'];\n $options['before'] = $this->Js->get($options['indicator'])->effect('fadeIn', array('buffer' => false));\n $options['complete'] = $this->Js->get($options['indicator'])->effect('fadeOut', array('buffer' => false));\n }\n\n\n $this->Paginator->options($options);\n\n $lines = array();\n foreach ($this->Columns as $field => $Column) {\n $lines[] = $headerHTML[] = $Column->header();\n }\n\n $row = $this->Html->tag('tr', implode(chr(10), $lines));\n\n return $this->Html->tag('thead', $row);\n }", "function InitDataPrintTitles()\n {\n $titles=array();\n foreach ($this->ColsDef[ \"AllowedDatas\" ] as $data)\n {\n $titles[ $this->MyMod_Data_Title($data) ]=$data;\n }\n\n $names=array_keys($titles);\n sort($names);\n\n $this->ColsDef[ \"SelectNames\" ]=array(0);\n $this->ColsDef[ \"SelectTitles\" ]=array(\"\");\n\n foreach ($names as $name)\n {\n array_push($this->ColsDef[ \"SelectNames\" ],$name);\n array_push($this->ColsDef[ \"SelectTitles\" ],$titles[ $name ]);\n }\n }", "private function setHeader($data)\n {\n $this->headers = array_map('self::formatString', $data[0]);\n array_unshift($this->headers, 'row');\n }", "public function setHeadings($headings);", "public function doMetaHeaders(&$headers)\r\n {\r\n $headers = array(\r\n 'title' => 'Title',\r\n 'description' => 'Description',\r\n 'author' => 'Author',\r\n 'date' => 'Date',\r\n 'robots' => 'Robots',\r\n 'template' => 'Template'\r\n );\r\n }", "function setHeadings($headings){\n\t\t\tglobal $tableHeadings;\n\t\t\t\n\t\t\t$tableHeadings = $headings;\n\t\t\t\n\t\t}", "function setHeadings($headings){\n\t\t\tglobal $tableHeadings;\n\t\t\t\n\t\t\t$tableHeadings = $headings;\n\t\t\t\n\t\t}", "public function setHeadings($headings){\n\t\t\t$this->headings = $headings;\n\t\t}", "public function makeReportUnusableToBeAbleToSeeAllColumnHeaders()\n {\n $javascript = <<<JS\n $('thead th').css('display', 'inline');\nJS;\n\n $this->getSession()->executeScript($javascript);\n }", "private function getHeaders(){\n\t\t$thead=\"\";\n\t\tif(!empty($this->headers)){\n\t\t\t$thead=\"<thead>\";\n\t\t\t$thead.=\"<tr>\";\n\t\t\t$headerNumber=0;\n\t\t\t$fieldNumber=0;\n\t\t\t$count=count($this->headers)-1;\n\t\t\t\n\t\t\t//Busca si hay columnas anteriores a agregar\n\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Busca las columnas declaradas\n\t\t\tforeach($this->headers as $name){\n\t\t\t\tif($this->headerSortable){\n\t\t\t\t\tif($this->order!==\"\"&&!empty($this->order)){\n\t\t\t\t\t\t$order=explode('|',$this->order);\n\t\t\t\t\t\tif(is_array($order)&&$fieldNumber==$order[0]){\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-\".$order[1];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header class=\\\"$classSortable\\\" onclick=\\\"javascript:{$this->id}Reorder($fieldNumber);\\\" {$this->id}_field_number=\\\"$fieldNumber\\\">$name</th>\";\n\t\t\t\t}else{\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header>$name</th>\";\n\t\t\t\t}\n\t\t\t\t$fieldNumber++;\n\t\t\t\t$headerNumber++;\n\t\t\t}\n\t\t\t\n\t\t\t//Busca si hay columnas posteriores a agregar\n\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"</tr>\";\n\t\t\t\n\t\t\t//Guardamos el numero total de columnas\n\t\t\t$this->cols=$headerNumber;\n\t\t\t\n\t\t\t\n\t\t\t$tfilter=\"\";\n\t\t\t$type=\"\";\n\t\t\tif($this->headerFilterable){\n\t\t\t\t$cols=count($this->fields)-1;\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<=$cols;$i++){\n\t\t\t\t\t$meClass=velkan::$config[\"datagrid\"][\"filters\"][\"inputClass\"];\n\t\t\t\t\t\n\t\t\t\t\t$type=\"\";\n\t\t\t\t\tif(!empty($this->types)){\n\t\t\t\t\t\t$type=$this->types[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$value=\"\";\n\t\t\t\t\tif(!empty($this->filters)){\n\t\t\t\t\t\tforeach($this->filters as $filter){\n\t\t\t\t\t\t\tif($filter[0]==$i){\n\t\t\t\t\t\t\t\t$value=$filter[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$tfilter.=\"<th class='velkan-grid-column-filter'>\";\n\t\t\t\t\t\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase \"date\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATE));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"datetime\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATETIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"time\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_TIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$tfilter.=\"<input type='search' name='grid{$this->id}Filter[]' $type value=\\\"$value\\\">\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$tfilter.=\"</th>\";\n\t\t\t\t}\n\t\t\t\t$display=($this->ShowFilters?\"\":\"style='display:none'\");\n\t\t\t\t\n\t\t\t\t$filterPrepend=\"\";\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$filterPrepend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$filterAppend=\"\";\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$filterAppend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tfilter=\"<tr id='grid{$this->id}Filters' $display>{$filterPrepend}{$tfilter}{$filterAppend}</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($type!=\"\"){\n\t\t\t\t$jss=new generalJavaScriptFunction();\n\t\t\t\t$jss->registerFunction(\"applyFormats\");\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"$tfilter</thead>\";\n\t\t}\n\t\t\n\t\treturn $thead;\n\t}", "public function setColumnsHeadData()\n\t{\n\t\tFileStorage::getInstance()->store([], 'league_table_columns_head');\n\t}", "protected function getTableHeader() {\n $newDirection = ($this->sortDirection == 'asc') ? 'desc' : 'asc';\n\n $tableHeaderData = array(\n 'title' => array(\n 'link' => $this->getLink('title', ($this->sortField == 'title') ? $newDirection : $this->sortDirection),\n 'name' => 'Title',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'document_type' => array(\n 'link' => $this->getLink('type', $this->sortField == 'document_type' ? $newDirection : $this->sortDirection),\n 'name' => 'Type',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'date' => array(\n 'link' => $this->getLink('date', $this->sortField == 'date' ? $newDirection : $this->sortDirection),\n 'name' => 'Date',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n );\n\t\t\n // insert institution field in 3rd column, if this is search results\n if($this->uri == 'search') {\n $tableHeaderData = array_slice($tableHeaderData, 0, 2, true) +\n array('institution' => array(\n 'link' => $this->getLink('institution', $this->sortField == 'institution' ? $newDirection : $this->sortDirection),\n 'name' => 'Institution',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n )) +\n array_slice($tableHeaderData, 2, count($tableHeaderData)-2, true);\n }\n\t\t\n return $tableHeaderData;\n }", "private function createFileHeadings() {\n\t\t// Allow other plugins to add their own column headers\n\t\t$headings = elgg_trigger_plugin_hook('row:headers', 'userexport', array(), $this->fields);\n\n\t\t// Attempt to translate the fields\n\t\tforeach ($headings as $key => $field) {\n\t\t\t$lang_string = \"profile:{$field}\";\n\t\t\t$heading = elgg_echo($lang_string);\n\n\t\t\t// No translation was found, fall back to the original string\n\t\t\tif ($heading === $lang_string) {\n\t\t\t\t$heading = elgg_echo($field);\n\t\t\t}\n\n\t\t\t$headings[$key] = $heading;\n\t\t}\n\n\t\t$this->writeToCSV($headings);\n\t}", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "private function buildHeader()\n\t{\n\t\tif ($this->hide_header)\n\t\t\treturn;\n\n\t\techo '<thead><tr>';\n\n\t\t// Get field names of result\n\t\t$headers = $this->_db->fieldNameArray($this->result);\n\t\t$this->column_count = count($headers);\n\n\t\t// Add a blank column if the row number is to be shown\n\t\tif ($this->show_row_number)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\t// Show checkboxes\n\t\tif ($this->show_checkboxes)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header tbl-checkall\"><input type=\"checkbox\" name=\"checkall\" onclick=\"tblToggleCheckAll'.$this->_clsnumber.'()\"></td>';\n\t\t}\n\n\t\t// Loop through each header and output it\n\t\tforeach ($headers as $t)\n\t\t{\n\t\t\t// Skip column if hidden\n\t\t\tif (in_array($t, $this->hidden))\n\t\t\t{\n\t\t\t\t$this->column_count--;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check for header caption overrides\n\t\t\tif (array_key_exists($t, $this->header))\n\t\t\t\t$header = $this->header[$t];\n\t\t\telse\n\t\t\t\t$header = $t;\n\n\t\t\tif ($this->hide_order)\n\t\t\t\techo '<td class=\"tbl-header\">' . $header; // Prevent the user from changing order\n\t\t\telse {\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\t$order = ($this->order['Order'] == self::ORDER_ASC)\n\t\t\t\t\t? self::ORDER_DESC\n\t\t\t\t\t: self::ORDER_ASC;\n\t\t\t\telse\n\t\t\t\t\t$order = self::ORDER_ASC;\n\n\t\t\t\techo '<td class=\"tbl-header\"><a href=\"javascript:;\" onclick=\"tblSetOrder'.$this->_clsnumber.'(\\'' . $t . '\\', \\'' . $order . '\\')\">' . $header . \"</a>\";\n\n\t\t\t\t// Show the user the order image if set\n\t\t\t\tif ($this->order and $this->order['Column'] == $t)\n\t\t\t\t\techo '&nbsp;<img src=\"images/sort_' . strtolower($this->order['Order']) . '.gif\" class=\"tbl-order\">';\n\t\t\t}\n\n\t\t\t// Add filters if allowed and only if the column type is not \"special\"\n\t\t\tif ($this->allow_filters and !empty($t)){\n\t\t\t\t\t\n\t\t\t\tif (!in_array($this->type[$t][0], array(\n\t\t\t\t\t\tself::TYPE_ARRAY,\n\t\t\t\t\t\tself::TYPE_IMAGE,\n\t\t\t\t\t\tself::TYPE_FUNCTION,\n\t\t\t\t\t\tself::TYPE_DATE,\n\t\t\t\t\t\tself::TYPE_CHECK,\n\t\t\t\t\t\tself::TYPE_CUSTOM,\n\t\t\t\t\t\tself::TYPE_PERCENT\n\t\t\t\t)))\n\t\t\t\t{\n\t\t\t\t\tif ($this->filter['Column'] == $t and !empty($this->filter['Value']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$filter_display = 'block';\n\t\t\t\t\t\t$filter_value = $this->filter['Value'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$filter_display = 'none';\n\t\t\t\t\t\t$filter_value = '';\n\t\t\t\t\t}\n\t\t\t\t\techo '<a href=\"javascript:;\" onclick=\"tblShowHideFilter'. $this->_clsnumber .'(\\'' . $t . '\\')\"> filter </a>\n\t\t\t\t\t<br><div class=\"tbl-filter-box\" id=\"'.$this->_clsnumber.'filter-' . $t . '\" style=\"display:' . $filter_display . '\">\n\t\t\t\t\t<input type=\"text\" size=\"6\" id=\"'.$this->_clsnumber.'filter-value-' . $t . '\" value=\"'.$filter_value.'\">&nbsp;\n\t\t\t\t\t<a href=\"javascript:;\" onclick=\"tblSetFilter'.$this->_clsnumber.'(\\'' . $t . '\\')\">filter</a></div>';\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\n\t\t\techo '</td>';\n\t\t}\n\n\t\t// If we have controls, add a blank column\n\t\tif (count($this->controls) > 0)\n\t\t{\n\t\t\t$this->column_count++;\n\t\t\techo '<td class=\"tbl-header\">&nbsp;</td>';\n\t\t}\n\n\t\techo '</tr></thead>';\n\t}", "private function headings() {\n\t\t$this->section_data['general_h_tags'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_h_tags',\n\t\t\t'label' \t\t\t\t=> __( 'Headings', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h1' => 'Heading 1',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h2' => 'Heading 2',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h3' => 'Heading 3',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h4' => 'Heading 4',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h5' => 'Heading 5',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'h6' => 'Heading 6',\n\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check which HTML headings automatically generated table of contents.', 'fixedtoc' )\n\t\t);\n\t}", "function Header()\r\n{\r\n if($this->ProcessingTable)\r\n $this->TableHeader();\r\n}", "function set_heading()\n\t{\n\t\t$args = func_get_args();\n\t\t$this->heading = $this->_prep_args($args);\n\t}", "public function setHeaders()\n {\n }", "public function initPageHeaders()\n\t{\n\t\tinclude_once('view/main_page_header.php');\n\t}", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "public function setPrintHeaders($value) {\n\t}", "public function table_headers() {\n\t\t\tglobal $mycred_types;\n\n\t\t\treturn apply_filters( 'mycred_log_column_headers', array(\n\t\t\t\t'column-username' => __( 'User', 'twodayssss' ),\n\t\t\t\t'column-time' => __( 'Date', 'twodayssss' ),\n\t\t\t\t'column-creds' => $this->core->plural(),\n\t\t\t\t'column-entry' => __( 'Entry', 'twodayssss' )\n\t\t\t), $this );\n\t\t}", "public static function set_headers()\n {\n }", "public function setHeader($array) {\n $this->colName= $array;\n $this->headerWritten= FALSE;\n }", "function headings() {\r\n\t\t// and that they receive anchors so that they may be linked to from the table of contents.\r\n\t\t//ReTidy::force_headings();\r\n\t\tReTidy::heading_anchors();\r\n\t}", "protected function setHeadTags()\n {\n $strTagClose = ($GLOBALS['objPage']->outputFormat == 'xhtml')\n ? ' />'\n : '>';\n\n // Add rel=\"prev\" and rel=\"next\" links (see #3515)\n if ($this->hasPrevious()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"prev\" href=\"' .\n $this->linkToPage($this->intPage - 1) .\n '\"' . $strTagClose;\n }\n if ($this->hasNext()) {\n $GLOBALS['TL_HEAD'][] = '<link rel=\"next\" href=\"' .\n $this->linkToPage($this->intPage + 1) .\n '\"' . $strTagClose;\n }\n }", "public function column_headers( $columns = array() ) {\n\t\t\t$new_columns = array(\n\t\t\t\t'cat_talks' => _x( 'Categories', 'talks admin category column header', 'wordcamp-talks' ),\n\t\t\t\t'tag_talks' => _x( 'Tags', 'talks admin tag column header', 'wordcamp-talks' ),\n\t\t\t);\n\n\t\t\tif ( ! wct_is_rating_disabled() ) {\n\t\t\t\t$new_columns['rates'] = '<span class=\"vers\"><span title=\"' . esc_attr__( 'Average Rating', 'wordcamp-talks' ) .'\" class=\"talk-rating-bubble\"></span></span>';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * @param array $new_columns the specific columns\n\t\t\t */\n\t\t\t$new_columns = apply_filters( 'wct_admin_column_headers', $new_columns );\n\n\t\t\t$temp_remove_columns = array( 'comments', 'date' );\n\t\t\t$has_columns = array_intersect( $temp_remove_columns, array_keys( $columns ) );\n\n\t\t\t// Reorder\n\t\t\tif ( $has_columns == $temp_remove_columns ) {\n\t\t\t\t$new_columns['comments'] = $columns['comments'];\n\t\t\t\t$new_columns['date'] = $columns['date'];\n\t\t\t\tunset( $columns['comments'], $columns['date'] );\n\t\t\t}\n\n\t\t\t// Merge\n\t\t\t$columns = array_merge( $columns, $new_columns );\n\n\n\t\t\tif ( ! empty( $this->downloading_csv ) ) {\n\t\t\t\tunset( $columns['cb'], $columns['date'] );\n\n\t\t\t\tif ( ! empty( $columns['title'] ) ) {\n\t\t\t\t\t$csv_columns = array(\n\t\t\t\t\t\t'title' => $columns['title'],\n\t\t\t\t\t\t'talk_content' => esc_html_x( 'Content', 'downloaded csv content header', 'wordcamp-talks' ),\n\t\t\t\t\t\t'talk_link' => esc_html_x( 'Link', 'downloaded csv link header', 'wordcamp-talks' ),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$columns = array_merge( $csv_columns, $columns );\n\n\t\t\t\t// Replace dashicons to text\n\t\t\t\tif ( ! empty( $columns['comments'] ) ) {\n\t\t\t\t\t$columns['comments'] = esc_html_x( '# comments', 'downloaded csv comments num header', 'wordcamp-talks' );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['rates'] ) ) {\n\t\t\t\t\t$columns['rates'] = esc_html_x( 'Average rating', 'downloaded csv rates num header', 'wordcamp-talks' );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * User this filter to only add columns for the downloaded csv file\n\t\t\t\t *\n\t\t\t\t * @param array $columns the columns specific to the csv output\n\t\t\t\t */\n\t\t\t\t$columns = apply_filters( 'wct_admin_csv_column_headers', $columns );\n\t\t\t}\n\n\t\t\treturn $columns;\n\t\t}", "function reOrderColumnHeaders() {\n\n }", "public function onMetaHeaders(&$headers)\n {\n $headers['tags'] = 'Tags';\n $headers['filter'] = 'Filter';\n }", "private function buildHeader()\n {\n $month_name = $this->monthLabels[$this->month - 1] . ' ' . $this->year;\n $vclass = strtolower($this->view);\n $h = \"<table class='\" . $this->tableClass . \" \" . $vclass . \"'>\";\n $h .= \"<thead>\";\n $h .= \"<tr class='\" . $this->headClass . \"'>\";\n $cs = 5;\n if ($this->view == 'week' || $this->view == 'day') {\n $h .= \"<th>&nbsp;</th>\";\n }\n if ($this->view == 'day') {\n $cs = 1;\n }\n\n if ($this->nav) {\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->prevClass . \"' href='\" . $this->prevLink() . \"'>\" . $this->prevIco . \"</a>\";\n $h .= \"</th>\";\n $h .= \"<th colspan='$cs'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n $h .= \"<th>\";\n $h .= \"<a class='\" . $this->nextClass . \"' href='\" . $this->nextLink() . \"'>\" . $this->nextIco . \"</a>\";\n $h .= \"</th>\";\n } else {\n $h .= \"<th colspan='7'>\";\n $h .= $month_name;\n $h .= \"</th>\";\n }\n $h .= \"</tr>\";\n $h .= \"</thead>\";\n\n $h .= \"<tbody>\";\n if ($this->view != 'day' && $this->view != 'week') {\n $h .= \"<tr class='\" . $this->labelsClass . \"'>\";\n\n for ($i = 0; $i <= 6; $i++) {\n $h .= \"<td>\";\n $h .= $this->dayLabels[$i];\n $h .= \"</td>\";\n }\n\n $h .= \"</tr>\";\n }\n if ($this->view == 'day' || $this->view == 'week') {\n $h .= self::getWeekDays();\n }\n\n $this->html .= $h;\n }", "function setHeaders(&$headers) {\n\t\t$this->setData('headers', $headers);\n\t}", "public function setHeaders() {\r\n\t\t$this->resource->setHeaders();\r\n\t}", "public function prePageHeader();", "private function _initializeResponseHeaders()\n {\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTTYPE] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CONTENTLENGTH] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_ETAG] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_CACHECONTROL] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LASTMODIFIED] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_LOCATION] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS_CODE] = null;\n $this->_headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS_DESC] = null;\n $this->_dataServiceVersion = null;\n }", "public function setHttpHeaders() {\n $this->_httpHeaders[] = \"Content-Type: application/x-yaml\";\n parent::setHttpHeaders();\n }", "protected function setHeaders()\n {\n $row = 1; \n $this->objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);\n \n $mergeCells = 'A' . $row . ':' . 'E' . $row;\n $this->setCellValue('A' . $row, \"Differences between files.\");\n $this->objPHPExcel->getActiveSheet()->getStyle($mergeCells)->getFont()->setBold(true);\n $this->objPHPExcel->getActiveSheet()->mergeCells($mergeCells);\n $this->objPHPExcel->getActiveSheet()->getRowDimension($row)->setRowHeight(25);\n $this->objPHPExcel->getActiveSheet()->getStyle($mergeCells)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);\n \n \n $row++;\n $cell = 'A' . $row;\n $this->setCellValue($cell, \"Comparing by: \");\n $this->objPHPExcel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);\n \n $mergeCells = 'B' . $row . ':' . 'C' . $row;\n $this->setCellValue('B' . $row, $this->getCompareTypeLabel()); \n $this->objPHPExcel->getActiveSheet()->mergeCells($mergeCells);\n \n \n $row++;\n $cell = 'A' . $row;\n $this->setCellValue($cell, \"Configuration: \");\n $this->objPHPExcel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);\n \n $mergeCells = 'B' . $row . ':' . 'M' . $row;\n $this->setCellValue('B' . $row, $this->settings['configuration']); \n $this->objPHPExcel->getActiveSheet()->mergeCells($mergeCells);\n \n $row += 5;\n $columns = $this->getColumns(); \n foreach ($columns as $columnName => $column) {\n $cell = $columnName . $row;\n $this->setCellValue($cell, $column['title']);\n $this->objPHPExcel->getActiveSheet()->getColumnDimension($columnName)->setAutoSize(true);\n $this->objPHPExcel->getActiveSheet()->getStyle($cell)->getFont()->setBold(true);\n }\n \n return $row;\n }", "public static function getTableHeaders() {\r\n\t\t$array = self::getHeadersArray();\r\n\r\n\t\tif( $array == null ) {\r\n\t\t\t$headers = [];\r\n\t\t\treturn $headers;\r\n\t\t}\r\n\r\n\t\t$headers = self::getTableHeaderTitles( $array );\r\n\t\treturn $headers;\r\n\t}", "protected function set_default_headers() {\n\t\t$meta = $this->get_meta_data();\n\n\t\t$this->translations->setHeader( 'Project-Id-Version', $meta['name'] . ' ' . $meta['version'] );\n\t\t$this->translations->setHeader( 'Report-Msgid-Bugs-To', $meta['msgid-bugs-address'] );\n\t\t$this->translations->setHeader( 'Last-Translator', 'FULL NAME <EMAIL@ADDRESS>' );\n\t\t$this->translations->setHeader( 'Language-Team', 'LANGUAGE <[email protected]>' );\n\t}", "public function loadColumnHeaders() {\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$jinput->set('columnheaders', $this->data->_data[1]);\n\t\t$this->linepointer++;\n\t\treturn true;\n\t}", "function setHeaders($headers){\n\t\tforeach($headers as $name => $value){\n\t\t\t$this->setHeader($name,$value);\n\t\t}\n\t}", "function register_column_headers($screen, $columns)\n {\n }", "private function executeTableShowHeader(array $columns): void\n {\n $separator = '+';\n $header = '|';\n\n foreach ($columns as $column)\n {\n $separator .= str_repeat('-', $column['length'] + 2).'+';\n $spaces = ($column['length'] + 2) - mb_strlen((string)$column['header']);\n\n $spacesLeft = (int)floor($spaces / 2);\n $spacesRight = (int)ceil($spaces / 2);\n\n $fillerLeft = ($spacesLeft>0) ? str_repeat(' ', $spacesLeft) : '';\n $fillerRight = ($spacesRight>0) ? str_repeat(' ', $spacesRight) : '';\n\n $header .= $fillerLeft.$column['header'].$fillerRight.'|';\n }\n\n echo \"\\n\", $separator, \"\\n\";\n echo $header, \"\\n\";\n echo $separator, \"\\n\";\n }", "function tablethead_open() {\n $this->doc .= DOKU_TAB.'<thead>'.DOKU_LF;\n }", "public function setHeader() {\n $dt = date('j M, Y');\n $name_header = '';\n $ao = new Application_Model_DbTable_AuditOwner();\n if ($this->usertype != '') {\n $name_header = \"&nbsp {$this->userfullname}\";\n }\n $complete_user = array('ADMIN','USER','APPROVER');\n $complete_audit = '';\n $audit_id = $this->audit['audit_id'];\n logit(\"audit: \" . print_r($this->audit, true));\n $complete_audit .= <<<\"END\"\n<li class=\"divider\"></li>\n<li class=\"tri\"><span style=\"color:black;padding-left: 15px;\"> With Selected Audit:</span></li>\nEND;\n\n # incomplete and owned audit OR not incomplete audit can be viewed\n if (($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) || $this->audit['status'] != 'INCOMPLETE') {\n $complete_audit .= <<<\"END\"\n<!li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/view\"><span title=\".icon .icon-color .icon-book \" class=\"icon icon-color icon-book\"></span> View Audit</a></li>\nEND;\n }\n # only incomplete and owned audit can be edited\n if ($this->audit['status'] == 'INCOMPLETE' && $this->audit['owner']) {\n $complete_audit .= <<<\"END\"\n<!--li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/edit/\"><span title=\".icon .icon-color .icon-edit \" class=\"icon icon-color icon-edit\"></span> Edit Audit</a></li>\nEND;\n }\n if (in_array($this->usertype, $complete_user)) {\n $complete_audit .= <<<\"END\"\n<!--li class=\"divider\"></li-->\n<li><a href=\"{$this->baseurl}/audit/exportdata\"><span title=\".icon .icon-color .icon-extlink \" class=\"icon icon-color icon-extlink\"></span> Export Audit Data</a></li>\nEND;\n if ($this->audit['owner']) {\n # $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/delete\"\n onclick=\" return confirm('Do you want to delete Selected Audit?');\">\n <span title=\".icon .icon-color .icon-trash \" class=\"icon icon-color icon-trash\"></span>\n Delete Audit</a></li>\nEND;\n }\n $complete_audit .= <<<\"END\"\n<li class=\"divider\"></li>\n<li class=\"tri\"><span style=\"color:black;padding-left: 15px;\"> Change Audit State:</span></li>\nEND;\n if ($this->audit['status'] == 'INCOMPLETE' && $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/complete\">\n<span title=\".icon .icon-color .icon-locked \" class=\"icon icon-color icon-locked\"></span> Mark Audit Complete</a></li>\nEND;\n }\n if ($this->audit['status'] == 'COMPLETE' && $ao->isOwned($audit_id, $this->userid)) {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/incomplete\">\n<span title=\".icon .icon-color .icon-unlocked \" class=\"icon icon-color icon-unlocked\"></span> Mark Audit Incomplete</a></li>\nEND;\n }\n if ($this->audit['status'] == 'COMPLETE' && $this->usertype == 'APPROVER') {\n $complete_audit .= <<<\"END\"\n<li><a href=\"{$this->baseurl}/audit/finalize\"\nonclick=\" return confirm('Do you want to finalize Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');\"><span title=\".icon .icon-color .icon-sent \" class=\"icon icon-color icon-sent\"></span> Mark Audit Finalized</a></li>\n<li><a href=\"{$this->baseurl}/audit/reject\"\n onclick=\" return confirm('Do you want to reject Audit (#{$this->audit['audit_id']}-{$this->audit['tag']})?');\"><span title=\".icon .icon-color .icon-cross \" class=\"icon icon-color icon-cross\"></span> Mark Audit Rejected</a></li>\nEND;\n }\n }\n $this->header = <<<\"END\"\n<div class=\"navbar\">\n <div class=\"navbar-inner\">\n <div class=\"container-fluid\">\n <a class=\"brand\" href=\"{$this->baseurl}{$this->mainpage}\">\n <span title=\".icon .icon-black .icon-check \" class=\"icon icon-black icon-check\"></span> <span>eChecklist</span>\n </a>\nEND;\n $newuser = '';\n if ($this->usertype != '') {\n if ($this->usertype == 'ADMIN') {\n $newuser = <<<\"END\"\n<li><a href=\"{$this->baseurl}/user/create\">\n<span title=\".icon .icon-green .icon-user \" class=\"icon icon-green icon-user\"></span> New User</a></li>\nEND;\n }\n\n $this->header = $this->header . <<<\"END\"\n<div class=\"btn-group pull-left\" style=\"margin-left:100px;\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-blue .icon-clipboard \" class=\"icon icon-blue icon-clipboard\"></span>\n <span class=\"hidden-phone\">Audit</span>\n <span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\nEND;\n if (in_array($this->usertype, $complete_user)) {\n $this->header .= <<<\"END\"\n <li><a href=\"{$this->baseurl}/audit/create\"><span title=\".icon .icon-green .icon-clipboard \" class=\"icon icon-green icon-clipboard\"></span> New Audit</a></li>\nEND;\n }\n $this->header .= <<<\"END\"\n <li><a href=\"{$this->baseurl}/audit/search\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Search for Audit</a></li>\n{$complete_audit}\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/audit/runreports\"><span title=\".icon .icon-color .icon-newwin \" class=\"icon icon-color icon-newwin\"></span> Run Reports</a></li>\nEND;\n\n if (in_array($this->usertype, $complete_user)) {\n $this->header .= <<<\"END\"\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/audit/import\"><span title=\".icon .icon-blue .icon-import \" class=\"icon icon-blue icon-archive\"></span> Import Audit</a></li>\nEND;\n }\n $this->header .= <<<\"END\"\n</ul>\n</div>\n\n<div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-blue .icon-tag \" class=\"icon icon-blue icon-tag\"></span>\n <span class=\"hidden-phone\">Lab</span>\n <span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/lab/create\"><span title=\".icon .icon-green .icon-tag \" class=\"icon icon-green icon-tag\"></span> New Lab</a></li>\n <li><a href=\"{$this->baseurl}/lab/select\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Select a Lab</a></li>\n <li class=\"divider\"></li>\n <li><a href=\"{$this->baseurl}/lab/edit\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span> Edit Selected Lab</a></li>\n</ul>\n</div>\n\n<div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n<span title=\".icon .icon-blue .icon-user \" class=\"icon icon-blue icon-user\"></span>\n<span class=\"hidden-phone\">User</span>\n<span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n {$newuser}\n <li><a href=\"{$this->baseurl}/user/find\"><span title=\".icon .icon-blue .icon-search \" class=\"icon icon-blue icon-search\"></span>Find User</a></li>\n</ul>\n</div>\n\n<!--div class=\"btn-group pull-left\">\n<a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n<span title=\".icon .icon-blue .icon-flag \" class=\"icon icon-blue icon-flag\"></span>\n<span class=\"hidden-phone\">Language</span>\n<span class=\"caret\"></span></a>\n<ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/language/switch/EN\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> English</a></li>\n <li><a href=\"{$this->baseurl}/language/switch/FR\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> French</a></li>\n <li><a href=\"{$this->baseurl}/language/switch/VI\"><span title=\".icon .icon-green .icon-flag \" class=\"icon icon-green icon-flag\"></span> Vietnamese</a></li>\n</ul>\n</div-->\n\n<!-- user dropdown starts -->\n<div class=\"btn-group pull-right\">\n <a class=\"btn dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\">\n <span title=\".icon .icon-orange .icon-user \" class=\"icon icon-orange icon-user\"></span>\n <span class=\"hidden-phone\"> {$name_header}</span>\n\t<span class=\"caret\"></span>\n </a>\n <ul class=\"dropdown-menu\">\n <li><a href=\"{$this->baseurl}/user/profile\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Profile</a></li>\n <li><a href=\"{$this->baseurl}/user/changepw\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Change Password</a></li>\n <li class=\"divider\"></li>\n\t<li><a href=\"{$this->baseurl}/user/logout\">Logout</a></li>\n </ul>\n</div>\n<!-- user dropdown ends -->\nEND;\n $auditinfo = '';\n //if ($this->dialog_name == 'audit/edit') {\n $auditinfo = \"<div style=\\\"margin:6px 0 6px 20px;padding-right:5px;\\\">Selected Audit: {$this->showaudit}</div>\";\n //}\n $this->header .= <<<\"END\"\n<div style=\"display:inline-block;\">\n <div style=\"margin:6px 0px 6px 20px;padding-right:5px;\">Selected Lab: {$this->showlab}</div>\n {$auditinfo}\n <div style=\"clear:both;\"></div></div>\nEND;\n } else {\n $this->header = $this->header . <<<\"END\"\n<div class=\"btn-group pull-left\" style=\"margin-left:100px;\">\n<a class=\"btn\" href=\"{$this->baseurl}/user/login\"><span title=\".icon .icon-blue .icon-contacts \" class=\"icon icon-blue icon-contacts\"></span> Login</a></div>\nEND;\n }\n $this->header = $this->header . <<<\"END\"\n </div>\n </div> <!-- style=\"clear:both;\"></div -->\n</div>\nEND;\n\n $this->view->header = $this->header;\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_header($allLists)\n {\n $output_html = '';\n if (count($allLists) == 0) return '';\n $output_html .= '<tr>';\n foreach ($allLists as $item) {\n $output_html .= '<th>' . $item . '</th>';\n }\n $output_html .= '</tr>';\n return $output_html;\n }", "abstract public function SetHeaders();", "public static function create_table_head()\n\t{\n\t\t\n\t\tif (!static::$columns)\n\t\t{\n\t\t\treturn static::$template['wrapper_start'].'<tr><th>No columns config</th></tr>'.static::$template['wrapper_end'];\n\t\t}\n\n\t\t$table_head = static::$template['wrapper_start'];\n\t\t$table_head .= '<tr>';\n\t\t\n\t\tforeach(static::$columns as $column)\n\t\t{\n\t\t\t$sort_key \t= (is_array($column) ? isset($column[1]) ? $column[1] : strtolower($column[0]) : $column);\n\t\t\t$col_attr\t= (is_array($column) && isset($column[2]) ? $column[2] : array());\n\t\t\t\n\t\t\t$new_direction = static::$direction;\n\t\t\t\n\t\t\tif(static::$sort_by == $sort_key)\n\t\t\t{\n\t\t\t\t$active_class_name = static::$template['col_class_active'].' '.static::$template['col_class_active'].'_'.$new_direction;\n\t\t\t\tif(isset($col_attr['class']))\n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] .= ' '.$active_class_name;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] = $active_class_name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_direction = (static::$direction == 'asc' ? 'desc' : 'asc');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(is_array($column) && (!isset($column[1]) || isset($column[1]) && $column[1] !== false)){\n\t\t\t\t\n\t\t\t\t$url \t\t\t= rtrim(static::$base_url, '/').(static::$current_page ? '/'.static::$current_page : '');\n\t\t\t\t$url \t\t\t.= '/'.$sort_key.static::$uri_delimiter.$new_direction;\n\t\t\t\t\n\t\t\t\t$cell_content \t= rtrim(static::$template['link_start'], '> ').' href=\"'.$url.'\">';\n\t\t\t\t$cell_content \t.= $column[0];\n\t\t\t\t$cell_content \t.= static::$template['link_end'];\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif(is_array($column))\n\t\t\t\t{\n\t\t\t\t\t$column = $column[0];\n\t\t\t\t}\n\t\t\t\t$cell_content = static::$template['nolink_start'].$column.static::$template['nolink_end'];\t\n\t\t\t}\n\t\t\t\n\t\t\t$table_head .= html_tag(static::$template['col_tag'], $col_attr, $cell_content);\n\t\t\t\n\t\t}\n\t\t\n\t\t$table_head .= '</tr>';\n\t\t$table_head .= static::$template['wrapper_end'];\n\n\t\treturn $table_head;\n\t}", "function register_column_headers( $screen, $columns ) {\n\tnew Backend\\List_Table_Compat( $screen, $columns );\n}", "protected function setHeaderWithSportAndYear() {\n\t\t$HeaderParts = array();\n\n\t\tif ($this->sportid > 0 && $this->ShowSportsNavigation) {\n\t\t\t$Sport = new Sport($this->sportid);\n\t\t\t$HeaderParts[] = $Sport->name();\n\t\t}\n\n\t\tif ($this->ShowYearsNavigation) {\n\t\t\t$HeaderParts[] = $this->getYearString();\n\t\t}\n\n\t\tif (!empty($HeaderParts)) {\n\t\t\t$this->setHeader($this->name().': '.implode(', ', $HeaderParts));\n\t\t}\n\t}", "public function printHeaders() {\n\t}", "public function setTitle($str)\n\t{\n\t\t$this->headerTitle = $str;\n\t}", "public function setHeaders(array $header) {}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "function Page_DataRendering(&$header) {\r\n\r\n\t\t// Example:\r\n\t\t//$header = \"your header\";\r\n\r\n\t}", "abstract function getheadings();", "private function createHeaders($headers) {\r\n $html = '<tr class=\"ctable-headertag\">';\r\n foreach ($headers as $index => $header) {\r\n $html .= '<th>' . $header . '</th>';\r\n }\r\n $html .= '</tr>';\r\n return $html;\r\n\r\n }", "function Certificates_Table_Titles($datas=array())\n {\n if (empty($datas)) { $datas=$this->Certificates_Table_Datas(); }\n \n $titles=$this->MyMod_Data_Titles($datas);\n\n return $titles;\n }", "public function print_header() {\n header('Content-type: text/csv');\n $filename = $this->page->title;\n $filename = preg_replace('/[^a-z0-9_-]/i', '_', $filename);\n $filename = preg_replace('/_{2,}/', '_', $filename);\n $filename = $filename.'.csv';\n header(\"Content-Disposition: attachment; filename=$filename\");\n }", "function linkHeaders($headers)\n {\n $this->headers = $headers;\n $this->align = false;\n $this->style = false;\n }", "function setHeaderTitle($value) {\n $this->header_title = $value;\n}", "function _or_chart_url_build_header($user_page_user = NULL) {\n\n $header = array();\n if (user_access('manage and filter site statistics')) { \n //$header[] = theme('table_select_header_cell');\n }\n $header[] = array('data' => t('url'), 'field' => 'url');\n $header[] = array('data' => t('url名'), 'field' => 'urlname');\n $header[] = array('data' => t('时间'), 'field' => 'created', 'sort' => 'desc');\n $header[] = array('data' => t('总访问量'), 'field' => 'visit_num');\n if (user_access('manage and filter site statistics')) {\n $header[] = array('data' => t('操作'));\n }\n\n //add table select all\n drupal_add_js('misc/tableselect.js');\n array_unshift($header, array('class' => array('select-all')));\n return $header;\n}", "function setHeaders() {\r\n global $CONFIGURATION;\r\n $this->charset = $CONFIGURATION['charset'];\r\n $this->headerType();\r\n\r\n if (!empty($this->cc))\r\n $this->headers.= \"Cc: {$this->cc}\\r\\n\";\r\n if (!empty($this->bcc))\r\n $this->headers.= \"Bcc: {$this->bcc}\\r\\n\";\r\n $this->headerType();\r\n }", "function pgm_subscriber_column_headers($columns){\n $columns = array(\n 'cb'=>'<input type=\"checkbox\" />', //checkbox-HTML empty checkbox\n 'title'=>__('Subscriber Name'), //update header name to 'Subscriber Name'\n 'email'=>__('Email Address'), //create new header for email\n );\n\n return $columns;\n}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}", "function Page_DataRendering(&$header) {\n\n\t\t// Example:\n\t\t//$header = \"your header\";\n\n\t}" ]
[ "0.6783362", "0.6602488", "0.651894", "0.63091165", "0.6286213", "0.6249624", "0.6249624", "0.61655015", "0.6113085", "0.6095158", "0.60897046", "0.60629344", "0.60140234", "0.5992673", "0.59707206", "0.59653866", "0.59479445", "0.5940407", "0.59194064", "0.5919009", "0.59087294", "0.5893949", "0.5888023", "0.5839422", "0.5807526", "0.5806315", "0.579869", "0.5792663", "0.57756317", "0.57599604", "0.57513964", "0.57307386", "0.5714108", "0.57124364", "0.5705076", "0.5682744", "0.5680802", "0.568021", "0.56773454", "0.5677205", "0.5667507", "0.56314826", "0.5627836", "0.5624339", "0.5619104", "0.5617317", "0.5617317", "0.5617317", "0.5617317", "0.5592718", "0.5592624", "0.55489", "0.554634", "0.5535006", "0.55302393", "0.5516432", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5516062", "0.5514627", "0.54995227", "0.5497415", "0.5495045", "0.5491973", "0.54917383", "0.54883915", "0.5481821", "0.54609317", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864", "0.54551864" ]
0.7106551
0
Adds a new filter condition to the query. When passing in the first query, the operation cam be set to null. Subsequent filters must provide a valid operation.
public function addFilter(string $searchTern, string $condition, string $column, ?string $operation): void { if (empty($this->columnsMap) === true) { $this->query->addFilter($searchTern, $condition, $column, $operation); return; } if ($this->getColumn($column)->isFilterable() === false) { throw new LogicException("The given sort column '$column' is not sortable."); } $this->query->addFilter($searchTern, $condition, $this->getColumn($column)->toSql(), $operation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addFilter(Filter $filter)\n {\n // Start with an empty AND composite filter\n if (!isset($this->filter)) {\n $this->filter = Filter::_and();\n }\n\n $this->checkFilter($filter);\n $this->filter = $this->filter->withAdded($filter);\n }", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "public function addFilter($filterQuery) {\n if ($this->filter != \"\" && ! preg_match(\"/^\\s*NOT/\", $filterQuery) ) $this->filter .= \" AND \";\n $this->filter .= \" \" . $filterQuery;\n return $this;\n }", "public function addConditionToQuery($query, array $condition)\n\t{\n\t\t$value = trim(array_get($condition, 'value'));\n\t\t$field = array_get($condition, 'field');\n\t\t\n\t\tif ('xref_id' == $field) {\n\t\t\t$field = 'objectID';\n\t\t}\n\t\t\n\t\tif (array_get($condition, 'filter')) {\n\t\t\tif (is_numeric($value)) {\n\t\t\t\t$query['query']['numericFilters'][] = \"{$field}={$value}\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$query['query']['facetFilters'][] = \"{$field}:{$value}\";\n\t\t\t}\n\t\t}\n\t\telse if (array_get($condition, 'lat')) {\n\t\t\t$query['query']['aroundLatLng'] = array_get($condition, 'lat') . ',' . array_get($condition, 'long');\n\t\t\t$query['query']['aroundRadius'] = array_get($condition, 'distance');\n\t\t}\n\t\telse {\n\t\t\t$query['terms'] .= ' ' . $value;\n\t\t\t\n\t\t\tif (!empty($field) && '*' !== $field) {\n\t\t\t\t$field = is_array($field) ? $field : array($field);\n\t\t\t\t$query['query']['restrictSearchableAttributes'] = implode(',', $field);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $query;\n\t}", "public function addWhere($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'AND ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "private function appendWhere()\n\t{\n\t\t$whereCount = count($this->where);\n\n\t\tfor($i = 0; $i < $whereCount; $i++)\n\t\t{\n\t\t\t$where = $this->where[$i];\n\n\t\t\tif($i == 0)\n\t\t\t{\n\t\t\t\t$this->queryString .= self::WHERE;\n\t\t\t}\n\n\t\t\t$this->queryString .= $where->getCondition();\n\n\t\t\tif($i < $whereCount-1)\n\t\t\t{\n\t\t\t\t$this->queryString .= \" \" . $where->getOperator() . \" \";\n\t\t\t}\n\t\t}\n\t}", "protected function addWhereFilter($field, $value) {\n if($this->filterType == 'orWhere') {\n $this->builder = $this->builder->orWhere($field, $value);\n }else {\n $this->builder = $this->builder->where($field, $value);\n $this->filterType = 'orWhere';\n }\n }", "protected function modifyQueryForFilter()\n {\n //the following select includes the mobile number, but overrides\n //the columns with an empty string if the matching boolean is false\n $this->q->getDoctrineQuery()->addSelect(\n 'if(x.is_show_mobile_number_in_phonebook is not FALSE, x.mobile_number, \\'\\') as mobile_number'\n );\n \n if ($this->isLocationView)\n {\n //order results by location name first\n $this->q->addOrderByPrefix('UllLocation->name');\n }\n\n if (!empty($this->phoneSearchFilter))\n {\n $this->q->getDoctrineQuery()->openParenthesisBeforeLastPart();\n \n //we need special handling here because we don't want hidden\n //numbers to be searchable\n $phoneSearchFilterPattern = '%' . $this->phoneSearchFilter . '%';\n \n $this->q->getDoctrineQuery()->orWhere(\n '(is_show_extension_in_phonebook is not FALSE AND phone_extension LIKE ?) ' .\n 'OR (is_show_extension_in_phonebook is FALSE AND alternative_phone_extension LIKE ?)',\n array($phoneSearchFilterPattern, $phoneSearchFilterPattern));\n\n $this->q->orWhere('is_show_mobile_number_in_phonebook is not FALSE ' .\n 'AND mobile_number LIKE ?', $phoneSearchFilterPattern);\n \n $this->q->getDoctrineQuery()->closeParenthesis();\n }\n \n\n if (!empty($this->filter_location_id))\n {\n $this->q->addWhere('ull_location_id = ?', $this->filter_location_id);\n }\n \n //we only want users which are active and have their\n //show-in-phonebook not set to false\n $this->q->addWhere('UllUserStatus->is_active is TRUE and is_show_in_phonebook is not FALSE');\n }", "protected function applyFilterStatement(array $requestParam, $query = null, array $filter = null)\n {\n if (is_null($query)) {\n $query = $this->newQuery();\n }\n\n $filterTerms = ($filter) ? $filter : $this->validRequestParam($requestParam, config('repository.request.params.filter', 'filter'), null);\n\n if ($filterTerms) {\n $query = $this->createWhereClauseForFilter($filterTerms, $query);\n }\n\n return $query;\n }", "public function addMust(\\obiba\\mica\\FilterQueryDto $value) {\n return $this->_add(1, $value);\n }", "public function addFieldToFilter($field, $condition = null): self\n {\n if ($field === 'store_id') {\n return $this->addStoreFilter($condition, false);\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public function filter()\n {\n list($column, $operator, $value, $boolean) = func_get_args();\n empty($operator) && $operator = null;\n empty($value) && $value = null;\n empty($boolean) && $boolean = null;\n if($this->hasFilter) {\n $this->model = $this->model->where($column, $operator, $value, $boolean);\n } else {\n $this->model = $this->model->newQuery()->where($column, $operator, $value, $boolean);\n $this->hasFilter = true;\n }\n\n return $this;\n }", "public function testAddFilterConditionDefault(): void\n {\n // setup\n $where = [\n '1 = 2'\n ];\n unset($_GET['filter']);\n\n // test body\n $result = \\Mezon\\Filter::addFilterCondition($where);\n\n // assertions\n $this->assertEquals('1 = 2', $result[0]);\n $this->assertCount(1, $result);\n }", "private function addWhere(&$query, $column, $operator, $value)\n {\n if ($operator == 'in') {\n\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n if ($is_null) {\n $query->whereNull($column)->orWhereIn($column, $value);\n } else {\n $query->whereIn($column, $value);\n }\n\n } elseif ($operator == 'not in') {\n $is_null = false;\n foreach ($value as $key => $val) {\n if ($val === null) {\n $is_null = true;\n unset($value[$key]);\n }\n }\n\n $value = array_values($value);\n if ($is_null) {\n $query->whereNotNull($column)->whereNotIn($column, $value);\n } else {\n $query->whereNotIn($column, $value);\n }\n\n } elseif ($operator == 'search') {\n\n $input = mb_strtolower($value);\n $input = Transliterator::transliterate($input, ' ');\n $input = explode(' ', $input);\n $input = array_filter($input);\n\n foreach ($input as $word) {\n $query = $query->where('search', 'LIKE', '%' . $word . '%');\n }\n\n } else {\n $query->where($column, $operator, $value);\n }\n return $query;\n }", "public function addCondition($condition);", "public function addFieldToFilter($field, $condition = null)\n {\n if ($field === 'store_id') {\n return $this->addStoreFilter($condition, false);\n }\n\n if ($field === 'customer_group_id') {\n return $this->addCustomerGroupFilter($condition, false);\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public function applyFilter(Query $query);", "public function withQueryFilter(QueryFilter $queryFilter): self;", "protected function filter(&$query)\n {\n if (!empty($this->filterModel)) {\n if (isset($this->filterModel->status_id)) {\n $query->andWhere(['status' => $this->filterModel->status_id]);\n }\n }\n }", "public function addFilter($name, iFilter $filter, $condition = null)\n {\n\n $this->filters[$name] = [\n 'filter' => $filter,\n 'condition' => $condition\n ];\n\n return $this->filters;\n }", "protected function addCondition($condition, $one)\n {\n // query by primary key\n if($one && !empty($condition) && !is_array($condition))\n {\n $this->andWhere(static::primaryKey() . '=:id', [':id'=>$condition]);\n }\n elseif(!empty($condition))\n {\n foreach($condition as $key => $value)\n {\n if(is_array($value))\n $this->andWhere(['in', $key, $value]);\n else\n $this->andWhere($key . \"=:value$key\", [\":value$key\" => $value]);\n }\n }\n }", "protected function setWhereFilters() : ApiGetService\n {\n if(count($this->where_filters) === 0){\n return $this;\n }\n\n // Traverse prepared filters\n foreach($this->where_filters as $column => $value){\n // {column}:{operator} = {value}\n $column_operator = preg_split('/[:\\s]+/', $column);\n\n // Split value by \" , \"\n $splited_value = preg_split('/[,]+/', $value);\n\n //... and if {value} is not scalar\n if(count($splited_value) > 1){\n // ... we know that we will have SQL IN operator in WHERE\n $in_operator = true;\n }\n // ... else we are good with simple \" = \"\n else{\n $in_operator = false;\n }\n\n // Depending on $in_operator, we know if we are using IN or =\n $this->builder\n ->when($in_operator ,\n // If it is true, we are using IN\n function ($query) use($column_operator, $splited_value){\n if(isset($column_operator[1]) && $column_operator[1] == \"eq\"){\n\n return $query->whereIn($column_operator[0], $splited_value);\n\n }elseif(isset($column_operator[1]) && $column_operator[1] == \"ne\"){\n\n return $query->whereNotIn($column_operator[0], $splited_value);\n\n }else{\n\n return $query->whereIn($column_operator[0], $splited_value);\n }\n },\n // Else, we are using scalar operators...\n function ($query) use($column_operator, $splited_value) {\n\n return $query->where($column_operator[0],\n ((isset($column_operator[1]) && $column_operator[1] != \"\") ? $this->api_operators[$column_operator[1]] : \"=\"),\n $splited_value[0]);\n });\n }\n\n return $this;\n }", "private function _addFilter(IColumnFilter $filter)\n\t{\n\t\tif ($this->hasFilter()) {\n\t\t\t$this->getComponent('filters')\n\t\t\t\t->removeComponent($this->getFilter());\n\t\t}\n\t\t$this->getComponent('filters')\n\t\t\t->addComponent($filter, $this->getName());\n\t}", "public function addFieldToFilter($field, $condition = null)\n {\n return parent::addFieldToFilter($field, $condition);\n }", "public function addWhere($condition)\n\t{\n\t\tif ($this->fromQueryString)\n\t\t\tthrow(new QueryStringAlreadySpecified(\"The query string has already been specified. You can't access query builder's functions.\"));\n\t\t$this->wheres[] = $condition;\n\t\treturn $this;\n\t}", "public function addFilter(callable $filter);", "protected function applyFilter(\n QueryBuilder|EloquentBuilder|Relation $query,\n FilterContract $filter\n ): void {\n $operator = $filter->getOperator();\n $handler = $this->getFilterHandler($operator);\n\n call_user_func_array($handler, [$query, $filter]);\n }", "public function addFilterString(string $filterString, string $prependedAndOr = 'and'): ODataQueryBuilder {\n if ($prependedAndOr !== 'and' && $prependedAndOr !== 'or') {\n throw new \\Exception('Invalid andOr parameter. It should be either and or or.', 500);\n }\n\n $this->filters[$filterString] = $prependedAndOr;\n\n return $this;\n }", "public function condition(string $field, string $compare, string $operator = \"=\", string $connector = \"AND\");", "public function setFilter(BaseOperator $filter)\n {\n $this->filter = $filter;\n }", "public function condition($first, $operator, $second)\n\t{\n\t\t$this->_query['condition'] = (object)array(\n\t\t\t'first' => $first,\n\t\t\t'operator' => $operator,\n\t\t\t'second' => $second\n\t\t);\n\n\t\treturn $this;\n\t}", "public function addFieldToFilter($field, $condition = null)\n {\n if (isset($this->_fields[$field])) {\n $field = $this->_fields[$field];\n }\n\n return parent::addFieldToFilter($field, $condition);\n }", "public function addFilter($filter) {\n $this->filters[] = $filter;\n $this->rewind();\n }", "public function addFilter(DFilter $filter) {\n\t\t$this->filters[] = $filter;\n\t}", "private function loadFiltersFromQuery(): void\n {\n $request = RequestUtil::getMainRequest($this->requestStack) ?? Request::createFromGlobals();\n $requestFilters = $request->query->all('filter');\n\n if (is_array($requestFilters)) {\n foreach ($requestFilters as $name => $limitations) {\n foreach ($limitations as $comparison => $value) {\n $filterField = new FilterField();\n $filterField->setName($name)\n ->setValue($value)\n ->setComparison($comparison)\n ->setFilter($this->getFilterByName($name));\n\n $this->filterFields[] = $filterField;\n }\n }\n }\n }", "public function addWhere(string $col, $val, string $comparison = '=', bool $or = false) : void;", "public function andWhere() {\r\n\t\t$args = func_get_args();\r\n\t\t$statement = array_shift($args);\r\n\t\t//if ( (count($args) == 1) && (is_null($args[0])) ) {\r\n\t\t//\t$this->_wheres = array();\r\n\t\t//\treturn null;\r\n\t\t//}\r\n\t\t$criteria = new Dbi_Sql_Criteria($this, new Dbi_Sql_Expression($statement, $args));\r\n\t\t$this->_wheres[] = $criteria;\r\n\t\treturn $criteria;\r\n\t}", "protected function applyPrefilter(&$query)\n {\n $privateQuery = $query->getQuery();\n\n if (count($this->prefilter)>0) {\n foreach ($this->prefilter as $prefilter) {\n if (!isset($prefilter[\"field\"])) {\n $this->applyAdvancedPrefilter($privateQuery, $prefilter);\n continue;\n }\n \n if ($prefilter[\"field\"] === \"!trashed\") {\n $privateQuery->onlyTrashed();\n continue;\n }\n\n if ($prefilter[\"type\"] == \"OR\") {\n $privateQuery->where(function ($privateQuery) use ($prefilter) {\n for ($i=0; $i<count($prefilter[\"field\"]); $i++) {\n $privateQuery->orWhere($prefilter[\"field\"][$i], $prefilter[\"operator\"][$i], $prefilter[\"value\"][$i]);\n }\n });\n\n continue;\n }\n\n switch ($prefilter[\"operator\"]) {\n case ('in'):\n case ('IN'):\n $privateQuery->whereIn($prefilter[\"field\"], $prefilter[\"value\"]);\n break;\n case ('null'):\n $privateQuery->whereNull($prefilter[\"field\"]);\n break;\n case ('!null'):\n $privateQuery->whereNotNull($prefilter[\"field\"]);\n break;\n default:\n $privateQuery->where($prefilter[\"field\"], $prefilter[\"operator\"], $prefilter[\"value\"]);\n break;\n }\n }\n }\n }", "public function addWhereOr($cond)\n {\n if (func_num_args() > 1) {\n $val = func_get_arg(1);\n $cond = $this->_db->quoteInto($cond, $val);\n }\n if ($this->_where) {\n $this->_where[] = 'OR ' . $cond;\n } else {\n $this->_where[] = $cond;\n }\n return $this;\n }", "public function addFacetCondition()\n {\n $query = $this->getLayer()->getProductCollection()->getSearchEngineQuery();\n $options = array('interval' => 1, 'field' => $this->_getFilterField());\n $query->addFacet($this->_getFilterField(), 'histogram', $options);\n\n return $this;\n }", "private function addConditionToQuery($sqlPart) {\n if (empty($sqlPart)) {\n return;\n }\n $this->sql .= $sqlPart;\n }", "public function prepareFilter($operator, $value) {\r\n $this->_operator = $operator;\r\n $this->_value = $value;\r\n\r\n return $this;\r\n }", "public function OrCondition($field, $value, $operator = '=') {\n $this->filter->condition($field, $value, $operator);\n return $this;\n }", "protected function addFilter(array $filter) {\n $this->filter = array_merge($this->filter, array_flip($filter));\n }", "public function whereAND()\n {\n $this->where_clause .= \" AND \";\n }", "protected function applyFieldConditions()\n {\n if ($this->field !== null) {\n $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));\n }\n }", "protected function prepareFilterQuery()\n\t{\n\t\t$filterQuery = array();\n\n\t\t$storeid = $this->getParam('storeid');\n\n\t\t$config = $this->getConfig();\n\n\t\t$websiteid = isset($config['stores'][$storeid]['website_id'])?$config['stores'][$storeid]['website_id']:0;\n\n\t\t$checkInstock = (int) $this->getConfigValue('check_instock');\n\n\t\t$filterQuery = array_merge($filterQuery, array(\n\t\t\t\t'store_id' => array($storeid),\n\t\t\t\t'website_id' => array($websiteid),\n\t\t\t\t'product_status' => array(1)\n\t\t));\n\n\t\tif ($checkInstock > 0) {\n\t\t\t$filterQuery['instock_int'] = array(1);\n\t\t}\n\n\t\t$filterQueryArray = array();\n\n\t\tforeach($filterQuery as $key=>$filterItem)\n\t\t{\n\n\t\t\tif(count($filterItem) > 0){\n\t\t\t\t$query = '';\n\t\t\t\tforeach($filterItem as $value){\n\t\t\t\t\t\t$query .= $key.':%22'.urlencode(trim(addslashes($value))).'%22+OR+';\n\t\t\t\t}\n\n\t\t\t\t$query = trim($query, '+OR+');\n\n\t\t\t\t$filterQueryArray[] = $query;\n\t\t\t}\n\t\t}\n\n\t\t$filterQueryString = '';\n\n\t\tif(count($filterQueryArray) > 0) {\n\t\t\tif(count($filterQueryArray) < 2) {\n\t\t\t\t$filterQueryString .= $filterQueryArray[0];\n\t\t\t}else{\n\t\t\t\t$filterQueryString .= '%28'.@implode('%29+AND+%28', $filterQueryArray).'%29';\n\t\t\t}\n\t\t}\n\n\t\t$this->filterQuery = $filterQueryString;\n\t}", "public function raw_filter($sql_condition){\n\t\t$this->raw_filter = $sql_condition;\n\t\treturn $this;\n\t}", "protected function filterQuery(&$query) {\n foreach($this->filter_params as $filter) {\n if(Input::has($filter)) {\n $val = Input::get($filter);\n $query->where($filter, '=', $val);\n }\n }\n }", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public function where($condition, $operator = 'AND') {\n if ($condition === ')' || substr(end($this->where), -1) == '(') {\n $this->where[] = $condition;\n } else {\n $this->where[] = (count($this->where) > 0 ? ($operator . ' ') : 'WHERE ' ) . $condition;\n }\n return $this;\n }", "public function condition()\n {\n $op = $this->getDefaultOperator();\n $params = func_get_args();\n \n switch (count($params)) {\n case 1:\n if (is_string($params[0])) {\n $this->addCondition('literal', [$params[0]]);\n } elseif (is_array($params[0])) {\n $combination = $this->getDefaultOperator();\n \n /**\n * The code within the foreach is an extraction of Zend\\Db\\Sql\\Select::where()\n */\n foreach ($params[0] as $pkey => $pvalue) {\n if (is_string($pkey) && strpos($pkey, '?') !== false) {\n # ['id = ?' => 1]\n # ['id IN (?, ?, ?)' => [1, 3, 4]]\n $predicate = new ZfPredicate\\Expression($pkey, $pvalue);\n } elseif (is_string($pkey)) {\n if ($pvalue === null) {\n # ['name' => null] -> \"ISNULL(name)\"\n $predicate = new ZfPredicate\\IsNull($pkey, $pvalue);\n } elseif (is_array($pvalue)) {\n # ['id' => [1, 2, 3]] -> \"id IN (1, 2, 3)\"\n $predicate = new ZfPredicate\\In($pkey, $pvalue);\n } else {\n # ['id' => $id] -> \"id = 15\"\n $predicate = new ZfPredicate\\Operator($pkey, ZfPredicate\\Operator::OP_EQ, $pvalue);\n }\n } elseif ($pvalue instanceof ZfPredicate\\PredicateInterface) {\n $predicate = $pvalue;\n } else {\n # ['id = ?'] -> \"id = ''\"\n # ['id = 1'] -> literal.\n $predicate = (strpos($pvalue, Expression::PLACEHOLDER) !== false)\n ? new ZfPredicate\\Expression($pvalue) : new ZfPredicate\\Literal($pvalue);\n }\n $this->getCurrentPredicate()->addPredicate($predicate, $combination);\n }\n }\n break;\n \n case 2:\n # $rel->where('foo = ? AND id IN (?) AND bar = ?', [true, [1, 2, 3], false]);\n # If passing a non-array value:\n # $rel->where('foo = ?', 1);\n # But if an array is to be passed, must be inside another array\n # $rel->where('id IN (?)', [[1, 2, 3]]);\n if (!is_array($params[1])) {\n $params[1] = [$params[1]];\n }\n $this->expandPlaceholders($params[0], $params[1]);\n $this->addCondition('expression', [$params[0], $params[1]]);\n break;\n \n case 3:\n # $rel->where('id', '>', 2);\n $this->getCurrentPredicate()->addPredicate(\n new ZfPredicate\\Operator($params[0], $params[1], $params[2])\n );\n break;\n \n default:\n throw new Exception\\BadMethodCallException(\n sprintf(\n \"One to three arguments are expected, %s passed\",\n count($params)\n )\n );\n }\n \n return $this;\n }", "public function addFilterField($filterField, $operator = 'like', $formFilter = NULL, $filterTransformer = NULL)\n {\n $this->filterFields[] = $filterField;\n $this->operators[] = $operator;\n $this->formFilters[] = isset($formFilter) ? $formFilter : $filterField;\n $this->filterTransformers[] = $filterTransformer;\n }", "public function applyFilterSelect(Filter\\FilterSelect $filter)\n\t{\n\t\tforeach ($filter->getCondition() as $column => $value) {\n\t\t\t$expr = Criteria::expr()->eq($column, $value);\n\t\t\t$this->criteria->andWhere($expr);\n\t\t}\n\t}", "public function where($field, $value, $comparison = '==', $logical = 'and');", "public function addShould(\\obiba\\mica\\FilterQueryDto $value) {\n return $this->_add(3, $value);\n }", "public function andWhere($field, $operator, $value);", "final public static function where($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= (self::$where == false ? ' WHERE ' : '');\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= (self::$where == false ? ' WHERE ' : '') . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n if (self::$where == false) {\n self::$where = true;\n }\n\n return (new static);\n }", "protected function construct_where_clause() {\n\t\t\t$whereclause = $this->get_where_clause();\n\t\t\tif ( '' !== $whereclause ) {\n\t\t\t\t$this->where = '' === $this->where ? \" where ($whereclause) \" : \" {$this->where} and ($whereclause) \";\n\t\t\t}\n\t\t}", "public function filter($args = array(), $operator = 'AND')\n {\n }", "public function addFilter($filter, $options = null)\n {\n if (!$filter instanceof Datagrid_Filter) {\n $filter = new Datagrid_Filter($filter, $options);\n }\n \n if(array_key_exists($filter->getName(), $this->_filters)) {\n throw new Datagrid_Exception(\"Filter '{$filter->getName()}' already exists\");\n }\n \n $this->_filters[$filter->getName()] = $filter;\n\n return $this;\n }", "public function addWhere(Expression $expression, $type = AbstractSearchQuery::WHERE_AND);", "public function andWhere($col, $operator = self::NO_OPERATOR, $value = self::NO_VALUE);", "private function setFilter()\n\t{\n\t\t// get filter values\n\t\t$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();\n\t\t$this->filter['application'] = $this->getParameter('application');\n\t\t$this->filter['module'] = $this->getParameter('module');\n\t\t$this->filter['type'] = $this->getParameter('type', 'array');\n\t\t$this->filter['name'] = $this->getParameter('name');\n\t\t$this->filter['value'] = $this->getParameter('value');\n\n\t\t// build query for filter\n\t\t$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);\n\t}", "public function filter($column, $operation = IDataSource::EQUAL, $value = NULL, $chainType = NULL)\n\t{\n\t\tif (!$this->hasColumn($column)) {\n\t\t\tthrow new \\InvalidArgumentException('Trying to filter data source by unknown column.');\n\t\t}\n\n\t\tif (is_array($operation)) {\n\t\t\tif ($chainType !== self::CHAIN_AND && $chainType !== self::CHAIN_OR) {\n\t\t\t\tthrow new \\InvalidArgumentException('Invalid chain operation type.');\n\t\t\t}\n\t\t\t$conds = array();\n\t\t\tforeach ($operation as $t) {\n\t\t\t\t$this->validateFilterOperation($t);\n\t\t\t\tif ($t === self::IS_NULL || $t === self::IS_NOT_NULL) {\n\t\t\t\t\t$conds[] = array('%n', $this->mapping[$column], $t);\n\t\t\t\t} else {\n\t\t\t\t\t$modifier = is_double($value) ? dibi::FLOAT : dibi::TEXT;\n\t\t\t\t\tif ($operation === self::LIKE || $operation === self::NOT_LIKE) $value = DataSources\\Utils\\WildcardHelper::formatLikeStatementWildcards($value);\n\n\t\t\t\t\t$conds[] = array('%n', $this->mapping[$column], $t, '%' . $modifier, $value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($chainType === self::CHAIN_AND) {\n\t\t\t\tforeach ($conds as $cond) {\n\t\t\t\t\t$this->df->where($cond);\n\t\t\t\t}\n\t\t\t} elseif ($chainType === self::CHAIN_OR) {\n\t\t\t\t$this->df->where('( %or )', $conds);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->validateFilterOperation($operation);\n\n\t\t\tif ($operation === self::IS_NULL || $operation === self::IS_NOT_NULL) {\n\t\t\t\t$this->qb->where('%n', $this->mapping[$column], $operation);\n\t\t\t} else {\n\t\t\t\t$modifier = is_double($value) ? dibi::FLOAT : dibi::TEXT;\n\t\t\t\tif ($operation === self::LIKE || $operation === self::NOT_LIKE) $value = DataSources\\Utils\\WildcardHelper::formatLikeStatementWildcards($value);\n\n\t\t\t\t$this->df->where('%n', $this->mapping[$column], $operation, '%' . $modifier, $value);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "private function addWhere($addType, $fieldOrExpr, $operator, $valueOrExpr) {\r\n\t\t$absoluteField = $this->resolveFieldName(ClauseType::WHERE, $fieldOrExpr);\r\n\r\n\t\t// a value can be a field of another query\r\n\t\t$valueOrExpr = $this->resolveFieldName(ClauseType::WHERE, $valueOrExpr, $fieldOrExpr);\r\n\t\tif (is_array($valueOrExpr)) {\r\n\t\t\t$valueOrExpr = '('.implode(', ', $valueOrExpr).')';\r\n\t\t}\r\n\t\t$this->addWhereClause($addType, $absoluteField.' '.$operator.' '.$valueOrExpr);\r\n\t}", "public function addFilters()\n {\n }", "private function addQueryFilter($fromValue, $toValue)\n {\n $sellerIdFilter = $this->queryFactory->create(\n QueryInterface::TYPE_TERM,\n ['field' => 'offer.seller_id', 'value' => $this->getRetailerId()]\n );\n $mustClause = ['must' => [$sellerIdFilter]];\n\n $rangeFilter = $this->queryFactory->create(\n QueryInterface::TYPE_RANGE,\n ['field' => 'offer.price', 'bounds' => ['gte' => $fromValue, 'lte' => $toValue]]\n );\n $mustClause['must'][] = $rangeFilter;\n\n $boolFilter = $this->queryFactory->create(QueryInterface::TYPE_BOOL, $mustClause);\n $nestedFilter = $this->queryFactory->create(QueryInterface::TYPE_NESTED, ['path' => 'offer', 'query' => $boolFilter]);\n\n $this->getLayer()->getProductCollection()->addQueryFilter($nestedFilter);\n }", "protected function getWhereClause() {}", "public function where()\n {\n $args = func_get_args();\n $num_args = count($args);\n \n // Custom queries\n if ( $num_args == 2 && is_array($args[1]) )\n {\n $this->where = $args[0];\n $this->params = $args[1];\n }\n else\n {\n // AND equality condition\n if ( $num_args == 2 )\n {\n list($field, $value) = $args;\n $op = '=';\n }\n // AND with custom operation condition\n else\n {\n list($field, $op, $value) = $args;\n }\n $this->appendWhere('AND', $field, $op, $value); \n }\n return $this;\n }", "public function setAdditionalFilter($dataProvider, $filter);", "protected function getGeneralWhereClause() {}", "private function init_andWhereFilter()\n {\n // RETURN : $this->andWhereFilter was set before\n if ( !( $this->andWhereFilter === null ) )\n {\n return $this->andWhereFilter;\n }\n // RETURN : $this->andWhereFilter was set before\n // RETURN : there isn't any filter\n if ( !$this->bool_isFilter )\n {\n $this->andWhereFilter = false;\n return $this->andWhereFilter;\n }\n // RETURN : there isn't any filter\n\n $arr_andWhereFilter = null;\n\n // Init area\n $this->pObj->objCal->area_init();\n $conf = $this->pObj->conf;\n $viewWiDot = $this->view . '.';\n $conf_view = $conf[ 'views.' ][ $viewWiDot ][ $this->mode . '.' ];\n // Init area\n // LOOP: filter tableFields\n//$this->pObj->dev_var_dump( $this->arr_tsFilterTableFields );\n foreach ( $this->arr_tsFilterTableFields as $tableField )\n {\n list( $table ) = explode( '.', $tableField );\n $str_andWhere = null;\n\n // Get nice_piVar\n $arr_result = $this->zz_getNicePiVar( $tableField );\n $arr_piVar = $arr_result[ 'data' ][ 'arr_piVar' ];\n//var_dump( __METHOD__, __LINE__, $tableField, $arr_piVar );\n unset( $arr_result );\n // Get nice_piVar\n // CONTINUE : There isn't any piVar\n if ( empty( $arr_piVar ) )\n {\n continue;\n }\n // CONTINUE : There isn't any piVar\n // SWITCH : manual mode versus auto mode\n switch ( true )\n {\n case( $this->pObj->b_sql_manual ):\n // SQL manual mode\n $str_andWhere = $this->init_andWhereFilter_manualMode( $arr_piVar, $tableField, $conf_view );\n//$this->pObj->dev_var_dump( $str_andWhere );\n break;\n // SQL manual mode\n case(!$this->pObj->b_sql_manual ):\n default:\n // SQL auto mode\n // SWITCH : local table versus foreign table\n switch ( true )\n {\n case( $table == $this->pObj->localTable ):\n $str_andWhere = $this->init_andWhereFilter_localTable( $arr_piVar, $tableField );\n//$this->pObj->dev_var_dump( $str_andWhere );\n break;\n case( $table != $this->pObj->localTable ):\n default:\n $str_andWhere = $this->init_andWhereFilter_foreignTable( $arr_piVar, $tableField );\n//var_dump( __METHOD__, __LINE__, $str_andWhere );\n break;\n }\n // SWITCH : local table versus foreign table\n break;\n // SQL auto mode\n }\n // SWITCH : manual mode versus auto mode\n\n if ( !empty( $str_andWhere ) )\n {\n $arr_andWhereFilter[ $tableField ] = $str_andWhere;\n // #56329, 140227, dwildt, 1+\n $this->arr_andWhereFilter[ $tableField ] = \" AND \" . $str_andWhere;\n }\n // Build the andWhere statement\n }\n // LOOP: filter tableFields\n // andWhere statement\n $strAndWhere = implode( \" AND \", ( array ) $arr_andWhereFilter );\n\n // #52486, 131002, dwildt, 6+\n if ( $this->radialsearchTable )\n {\n $strAndWhere = $strAndWhere\n . $this->init_andWhereFilter_radialsearch()\n ;\n }\n // #52486, 131002, dwildt, 6+\n // RETURN : there isn't any andWhere statement\n if ( empty( $strAndWhere ) )\n {\n $this->andWhereFilter = false;\n return $this->andWhereFilter;\n }\n // RETURN : there isn't any andWhere statement\n\n $this->andWhereFilter = \" AND \" . $strAndWhere;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql )\n {\n if ( is_array( $arr_andWhereFilter ) )\n {\n $prompt = 'andWhere statement: ' . $this->andWhereFilter;\n t3lib_div :: devlog( '[INFO/FILTER+SQL] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n // DRS\n\n return $this->andWhereFilter;\n }", "protected function applyAdvancedPrefilter(&$query, $prefilter)\n {\n $query->orWhere(function ($query) use ($prefilter) {\n foreach ($prefilter as $pf) {\n if (!is_null($pf[\"relation\"]) && $pf[\"field\"] instanceof Closure) {\n // This is a whereHas clause\n $query->whereHas($pf[\"relation\"], $pf[\"field\"], $pf[\"operator\"], $pf[\"value\"]);\n } elseif (is_null($pf['value'])) {\n if ($pf['operator'] == '=') {\n $query->whereNull($pf[\"field\"]);\n } else {\n $query->whereNotNull($pf[\"field\"]);\n }\n } elseif ($pf[\"operator\"] == 'in') {\n $query->whereIn($pf[\"field\"], $pf[\"value\"]);\n } else {\n $query->where($pf[\"field\"], $pf[\"operator\"], $pf[\"value\"]);\n }\n }\n });\n }", "protected function prepareFilters()\n {\n if(count($this->api_query) === 0){\n return;\n }\n\n // Matched WHERE filters would be all\n // that are not KEYWORDS (count, page, embed...)\n foreach($this->api_query as $column => $value) {\n if(in_array($column, $this->api_keyword_filters)){\n continue;\n }\n\n $this->where_filters[$column]= $value;\n }\n }", "public function addOperation($name , $operator , $value , $andSeparator = true);", "public function getWhereExpression()\n {\n if (!count($this->filters)) {\n return null;\n }\n\n $expr = $this->qb->expr()->andX();\n foreach ($this->filters as $filter) {\n $expr = $expr->add($filter->getExpression());\n }\n\n return $expr;\n }", "public function addSearchFilter($query)\n {\n if (!$this->features->isEnabled(__CLASS__)) {\n return parent::addSearchFilter($query);\n }\n\n $self = $this;\n\n /* @var $searchFilter SearchFilter */\n $searchFilter = $this->query->getFilterGroup('search', function($name) use ($self) {\n return $self->factory->createSearchFilter($name);\n });\n\n $searchFilter->addSearchText($query);\n\n return parent::addSearchFilter($query);\n }", "public function andWhere($field, $predicate): self;", "final public static function and($field = '', $operator = '', $value = '', bool $valueIsFunction = false)\n {\n //add the condition\n if ($field == '' || $operator == '' || $value == '') {\n self::$query .= ' AND ';\n } else {\n if (!$valueIsFunction)\n self::$bindParams[] = [$field => $value];\n\n self::$query .= ' AND ' . $field . ' ' . $operator . ' ' . ($valueIsFunction ? $value : self::prepareBind([$field], true));\n }\n return (new static);\n }", "public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter first_name\n if ($request->has('first_name')) {\n $query->where('first_name', 'like', \"%{$request->get('first_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('first_name')}%\");\n }\n // filter first_name\n if ($request->has('last_name')) {\n $query->where('first_name', 'like', \"%{$request->get('last_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('last_name')}%\");\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_active',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }", "public function addFieldToFilter($field, $condition = null)\n {\n if ($field == 'store_ids') {\n return $this->addStoreFilter($condition);\n }\n\n parent::addFieldToFilter($field, $condition);\n return $this;\n }", "public function add_filter($filter, $key = NULL)\n\t{\n\t\tif (!empty($key))\n\t\t{\n\t\t\t$this->filters[$key] = $filter;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filters[] = $filter;\n\t\t}\n\t}", "public function createFilter();", "protected function user_where_clause() {}", "public function addAttributeToFilter($attribute, $condition = null, $joinType = 'inner')\n {\n switch ($attribute) {\n case 'wi_warehouse_id':\n case 'wi_physical_quantity':\n case 'wi_quantity_to_ship':\n case 'wi_available_quantity':\n case 'sh_range_1':\n case 'sh_range_2':\n case 'sh_range_3':\n $conditionSql = $this->_getConditionSql($attribute, $condition);\n $this->getSelect()->where($conditionSql);\n break;\n case 'qty_to_order':\n $conditionSql = $this->_getConditionSql($this->getQtyOrderExpression(), $condition);\n $this->getSelect()->where($conditionSql);\n break;\n case 'average_per_week':\n $conditionSql = $this->_getConditionSql($this->getAvgPerWeekExpression(), $condition);\n $this->getSelect()->where($conditionSql);\n break;\n case 'run_out':\n $conditionSql = $this->_getConditionSql($this->getRunOutExpression(), $condition);\n $this->getSelect()->where($conditionSql);\n break;\n default:\n parent::addAttributeToFilter($attribute, $condition, $joinType);\n break;\n }\n return $this;\n }", "protected function applyFilters(\n QueryBuilder|EloquentBuilder|Relation $query,\n FiltersCollectionContract $filters\n ): void {\n $method = match ($filters->getBoolean()) {\n BooleanOperator::AND => 'where',\n BooleanOperator::OR => 'orWhere',\n };\n\n $query->{$method}(function ($query) use ($filters) {\n foreach ($filters as $filter) {\n if (is_a($filter, FiltersCollectionContract::class)) {\n $this->applyFilters($query, $filter);\n } else {\n $this->applyFilter($query, $filter);\n }\n }\n });\n }", "public function Condition($field, $value, $operator = '=') {\n $this->query->condition($field, $value, $operator);\n return $this;\n }", "private function addRightsClauseFilter() {\r\n\t\t\t// Add rights clause\r\n\t\t$this->addRightsFilter('rights', '');\r\n\r\n\t\t\t// Add status filter\r\n\t\tif( ! TodoyuAuth::isAdmin() ) {\r\n\t\t\t$statusIDs\t= TodoyuProjectProjectStatusManager::getStatusIDs();\r\n\t\t\tif( sizeof($statusIDs) > 0 ) {\r\n\t\t\t\t$statusList = implode(',', $statusIDs);\r\n\t\t\t\t$this->addRightsFilter('status', $statusList);\r\n\t\t\t} else {\r\n\t\t\t\t$this->addRightsFilter('Not', 0);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function filterWhere(string $leftOperand): SimpleFilterBuilder {\n return new SimpleFilterBuilder($this, $leftOperand, 'and');\n }", "private function buildWhere($existing, $add)\n {\n if(empty($existing))\n return \"WHERE {$add} \";\n else\n return \"{$existing} AND {$add} \";\n }", "public function addFieldToFilter($field, $cond, $type = 'and')\n {\n if (is_array($cond)) {\n if (isset($cond['like'])) {\n return $this->addCallbackFilter($field, $cond['like'], $type, 'filterCallbackLike');\n }\n if (isset($cond['eq'])) {\n return $this->addCallbackFilter($field, $cond['eq'], $type, 'filterCallbackEqual');\n }\n } else {\n return $this->addCallbackFilter($field, $cond);\n }\n return $this;\n }", "public function addMustNot(\\obiba\\mica\\FilterQueryDto $value) {\n return $this->_add(2, $value);\n }", "protected function assembleQueries()\n {\n if ($this->getExecutedFilters()) {\n return $this;\n }\n\n $objectType = $this->getObjectType();\n\n $whereConditions = [];\n\n $mainTable = $this->getEntityService()->getTableName($objectType);\n $pre = 'v2';\n $dqlFilters = [];\n $tables = $this->getEntityService()->getVarOptionTables();\n $bindTypes = [];\n $pdoBindTypes = $this->getEntityService()->getPdoBindTypes();\n $filterable = $this->getFilterable();\n\n $x = 0; //count($this->getFilters()); // for tracking bind types\n\n // handle basic filters eg key=value\n // also, special handling of price range\n $filterParams = [];\n if ($this->getFilters()) {\n foreach($this->getFilters() as $field => $value) {\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n\n // handle special case for numerical ranges\n // eg price=100-199 or subtotal=50-100\n // note : the handling of strpos is very intentional, want an index > 0\n if ($filterInfo[CartRepositoryInterface::DATATYPE] == 'number' && strpos($value, '-')) {\n $rangeValues = explode('-', $value);\n $rangeMin = $rangeValues[0];\n $rangeMax = isset($rangeValues[1]) ? $rangeValues[1] : null;\n if (isset($rangeMax)) {\n\n $rangeMin = (float) $rangeMin;\n $rangeMax = (float) $rangeMax;\n\n // minimum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'gte',\n 'value' => $rangeMin,\n ]);\n\n // maximum\n $this->addAdvFilter([\n 'field' => $field,\n 'op' => 'lt',\n 'value' => $rangeMax,\n ]);\n\n break;\n }\n }\n\n if (isset($filterInfo['join'])) {\n $this->joins[] = $filterInfo['join'];\n $field = $filterInfo['join']['table'] . \".{$field}\";\n } elseif (!is_int(strpos($field, '.'))) {\n $field = \"main.{$field}\";\n }\n\n $whereConditions[] = \"{$field} = ?\";\n $filterParams[] = $value;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'number':\n // todo : make this better\n $bindTypes[$x] = \\PDO::PARAM_INT;\n break;\n case 'string':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n break;\n }\n\n $x++;\n break;\n }\n }\n }\n }\n\n // handle fulltext search first\n\n // note : use setFulltextIds() if you search somewhere else first eg SOLR / Elasticsearch\n if ($this->getFulltextIds()) {\n // ensure IDs are sanitized before you set them\n $whereConditions[] = \"main.id in (\" . implode(',', $this->getFulltextIds()) . \")\";\n } else if ($this->getQuery()\n && $this->getSearchField()\n && $this->getSearchMethod()) {\n\n if (is_array($this->getSearchField())) {\n if (count($this->getSearchField()) > 1) {\n\n $cond = '';\n foreach($this->getSearchField() as $searchField) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n\n $tbl = 'main';\n\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n } else {\n continue;\n }\n }\n\n // cond is empty, add a leading parentheses\n if (!$cond) {\n $cond .= \"({$tbl}.{$searchField} like ?\";\n } else {\n $cond .= \" OR {$tbl}.{$searchField} like ?\";\n }\n $x++;\n }\n $cond .= ')';\n $whereConditions[] = $cond;\n } else {\n\n $fields = $this->getSearchField();\n $searchField = $fields[0];\n if (is_array($searchField)) {\n if (isset($searchField['table']) && isset($searchField['column'])) {\n $tbl = $searchField['table'];\n $searchField = $searchField['column'];\n\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"{$tbl}.{$searchField} like ?\";\n $x++;\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$searchField} like ?\";\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $whereConditions[] = \"main.{$this->getSearchField()} like ?\";\n $x++;\n }\n }\n\n // handle \"advanced\" filters\n // eg filter_field[x], filter_op[x], filter_val[x]\n // specifies a field, value, and operator ie (id > 100)\n $advFilterParams = [];\n if ($this->getAdvFilters()) {\n foreach($this->getAdvFilters() as $advFilter) {\n\n $field = $advFilter['field'];\n $op = $advFilter['op'];\n $value = $advFilter['value'];\n $table = isset($advFilter['table'])\n ? $advFilter['table']\n : 'main';\n\n $found = false;\n foreach($filterable as $filterInfo) {\n if ($field == $filterInfo[CartRepositoryInterface::CODE]) {\n $found = true;\n\n switch($filterInfo[CartRepositoryInterface::DATATYPE]) {\n case 'boolean':\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n break;\n case 'number':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_INT;\n $x++;\n }\n break;\n case 'string':\n if ($op == 'in') {\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n if ($value) {\n foreach($value as $dummy) {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n }\n } else {\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n }\n\n break;\n case 'date':\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n default:\n $bindTypes[$x] = \\PDO::PARAM_STR;\n $x++;\n break;\n }\n\n\n break;\n }\n }\n\n if (!$found || !in_array($op, ['contains', 'starts', 'ends', 'equals', 'gt', 'gte', 'lt', 'lte', 'in'])) {\n continue;\n }\n\n // example:\n // $and->add($qb->expr()->eq('u.id', 1));\n\n switch($op) {\n case 'contains':\n $advFilterParams[] = '%'. $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'starts':\n $advFilterParams[] = $value . '%';\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'ends':\n $advFilterParams[] = '%'. $value;\n $whereConditions[] = \"{$table}.{$field} like ?\";\n break;\n case 'equals':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} = ?\";\n break;\n case 'notequal':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} != ?\";\n break;\n// todo: this is messing up the counter, but it should be implemented\n// case 'null':\n// $advFilterParams[] = 'NULL';\n// $whereConditions[] = \"{$table}.{$field} IS ?\";\n// break;\n// case 'notnull':\n// $advFilterParams[] = $value;\n// $whereConditions[] = \"{$table}.{$field} IS NOT NULL\";\n// break;\n case 'gt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} > ?\";\n break;\n case 'gte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} >= ?\";\n break;\n case 'lt':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} < ?\";\n break;\n case 'lte':\n $advFilterParams[] = $value;\n $whereConditions[] = \"{$table}.{$field} <= ?\";\n break;\n case 'in':\n if (!is_array($value)) {\n $value = explode(',', $value);\n }\n\n if ($value) {\n foreach($value as $val) {\n $advFilterParams[] = $val;\n }\n $paramStr = implode(',', $value);\n $whereConditions[] = \"{$table}.{$field} in ({$paramStr})\";\n }\n\n break;\n default:\n\n break;\n }\n }\n }\n\n // handle category filter with products\n if ($this->getCategoryId()\n && $this->getObjectType() == EntityConstants::PRODUCT) {\n\n $categoryTable = $this->getEntityService()->getTableName(EntityConstants::CATEGORY_PRODUCT);\n $bindTypes[$x] = \\PDO::PARAM_INT;\n // todo : sometime in the future , add a category 'anchor', connecting multiple categories\n $whereConditions[] = \"main.id in (select product_id from {$categoryTable} where category_id = ?)\";\n $x++;\n }\n\n // handle stock, visibility filters with products\n\n\n // handle facet filters\n // ie filters on EAV tables, child tables\n $facetFilterParams = [];\n if ($this->getFacetFilters()) {\n foreach($this->getFacetFilters() as $facetCode => $value) {\n\n $itemVar = $this->getVarByCode($facetCode);\n\n $tblValue = $objectType . '_' . EntityConstants::getVarDatatype($itemVar->getDatatype());\n $values = explode($this->valueSep, $value);\n $joinTbl = $tables[$itemVar->getDatatype()];\n $joinTblPre = 'ivo';\n\n if (count($values) > 1) {\n $conditions = [];\n foreach($values as $itemVarValue) {\n $conditions[] = \"({$pre}.value = ? OR {$joinTblPre}.url_value = ?)\";\n $facetFilterParams[] = $itemVarValue;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n }\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND (\".implode(' OR ', $conditions).\"))\";\n } else {\n $dqlFilters[] = \"({$pre}.item_var_id={$itemVar->getId()} AND ({$pre}.value = ? OR {$joinTblPre}.url_value = ?))\";\n $facetFilterParams[] = $value;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n\n $bindTypes[$x] = $pdoBindTypes[$itemVar->getDatatype()];\n $x++;\n }\n\n $whereConditions[] = \"main.id in (select parent_id from {$tblValue} {$pre} left join {$joinTbl} {$joinTblPre} on {$pre}.item_var_option_id={$joinTblPre}.id where \". implode(' AND ', $dqlFilters).\")\";\n $dqlFilters = [];\n\n }\n }\n\n // assemble where conditions\n $conditionsSql = implode(' AND ', $whereConditions);\n if (!$conditionsSql) {\n $conditionsSql = '1=1';\n }\n\n // assemble group by\n $groupSql = $this->getGroupBy()\n ? 'group by ' . implode(', ', $this->getGroupBy())\n : '';\n\n // assemble select columns\n $colSql = '';\n if ($this->getColumns()) {\n $cols = [];\n foreach($this->getColumns() as $colData) {\n // add select\n $select = $colData['select'];\n $alias = $colData['alias'];\n if ($alias) {\n $select .= \" as {$alias}\";\n }\n\n $cols[] = $select;\n }\n $colSql = ',' . implode(',', $cols);\n }\n\n // assemble joins\n $joinSql = '';\n if ($this->getJoins()) {\n $joins = [];\n foreach($this->getJoins() as $join) {\n $type = $join['type'];\n $table = $join['table'];\n $column = $join['column'];\n $joinAlias = $join['join_alias'];\n $joinColumn = $join['join_column'];\n $joins[] = \"{$type} join {$table} on {$joinAlias}.{$joinColumn}={$table}.{$column}\";\n }\n $joinSql = implode(' ', $joins);\n }\n\n // main data query without sorting and grouping\n $this->filtersSql = \"select distinct(main.id) from {$mainTable} main {$joinSql} where {$conditionsSql}\";\n // main data query\n $this->mainSql = \"select distinct(main.id), main.* {$colSql} from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n // main count query, for all rows, not just the current page\n $this->countSql = \"select count(distinct(main.id)) as count from {$mainTable} main {$joinSql} where {$conditionsSql} {$groupSql}\";\n $this->bindTypes = $bindTypes;\n $this->filterParams = $filterParams;\n $this->advFilterParams = $advFilterParams;\n $this->facetFilterParams = $facetFilterParams;\n\n $this->setExecutedFilters(true);\n return $this;\n }", "public function scopeFilter($query)\n {\n $request = request();\n\n if ($request->has('clinic_type_id')) {\n $query->where('clinic_type_id', $request->clinic_type_id);\n }\n\n if ($request->has('sort_by')) {\n $column = $request->sort_by;\n $order = $request->has('order') ? $request->order : 'ASC';\n $query->orderBy($column, $order);\n }\n\n if ($request->has('search')) {\n $keyword = $request->search;\n $query->where('name', 'like', '%'.$keyword.'%')\n ->orWhereHas('clinicType', function ($query) use ($keyword) {\n $query->where('name', 'like', '%'.$keyword.'%');\n });\n }\n }", "public function filter($filter) {\n $exists = array_search($filter, $this->filters, true);\n if ($exists === false) {\n $this->filters[] = $filter;\n }\n return $this;\n }", "public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }", "public function orFilterWhere(string $leftOperand): SimpleFilterBuilder {\n return new SimpleFilterBuilder($this, $leftOperand, 'or');\n }", "public function addFilter($filterName, $displayText, $matchingCol, $filterType) {\r\n $this->crudFilter[$filterName] = array(\"displayText\" => $displayText,\r\n \"matchingCol\" => $matchingCol,\r\n \"filterType\" => $filterType);\r\n return $this;\r\n }", "public function addCondition($attribute, $values, $operator = ComparisonOperator::EQ);" ]
[ "0.67890674", "0.676203", "0.67125326", "0.6012253", "0.5715738", "0.570245", "0.5677074", "0.565882", "0.5634796", "0.5632327", "0.5619332", "0.5617523", "0.5592255", "0.55638254", "0.55524576", "0.55404896", "0.553675", "0.551311", "0.5509672", "0.5506203", "0.54880255", "0.54772687", "0.5470691", "0.54497135", "0.5443271", "0.5443074", "0.54309034", "0.5425207", "0.5370873", "0.5357937", "0.53290373", "0.5323152", "0.5315244", "0.53132814", "0.5308762", "0.5250214", "0.52434874", "0.5240668", "0.5232931", "0.5224485", "0.52217156", "0.52195275", "0.52143943", "0.5214154", "0.5209495", "0.5209169", "0.5200899", "0.52006483", "0.5198194", "0.5195667", "0.5194687", "0.5191012", "0.51873887", "0.5184294", "0.5173507", "0.51721996", "0.5166309", "0.5161754", "0.5155566", "0.51415426", "0.5139451", "0.51377374", "0.5134388", "0.513255", "0.51272863", "0.51155597", "0.509948", "0.5097395", "0.5093995", "0.50930834", "0.50911623", "0.5089577", "0.50888765", "0.5086109", "0.5076104", "0.5069706", "0.5061864", "0.5056589", "0.5052448", "0.504959", "0.5048083", "0.50475717", "0.5034453", "0.50324225", "0.50240505", "0.5016821", "0.5015434", "0.50101054", "0.50081027", "0.5004192", "0.49995217", "0.49988845", "0.4994629", "0.49888048", "0.49881822", "0.49825507", "0.49815798", "0.49813402", "0.49800026", "0.49794933" ]
0.5948487
4
Fetch a given column from pagination column map.
protected function getColumn(string $column): Column { if ($this->columnsMap->get($column) === null) { throw new LogicException("The given column name '$column' is not known."); } return $this->columnsMap->get($column); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fetchColumn(int $column = 0);", "public function fetchColumn($columnIndex = 0);", "private function fetchColumn($table, $column) {\n\t\t$sql = 'select ' .$column .' from ' .$table;\n\t\t$query = $this->getDB()->prepare($sql);\n\t\tif(!$query->execute()) {\n\t\t\t$info = $query->errorInfo();\n\t\t\tl($info[2]);\n\t\t\treturn false;\n\t\t}\n\t\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n\t}", "public function col($columnname)\n\t{\n\t\n\treturn $this->res[$this->pos][$columnname];\n\t/*\n\t\t$type = 0;\n\t\t\n\t\t\n\t\tif($columnname == 'value')$type = 1;\t\n\t\n\t\tif($columnname == 'URI')\n\t\t{\n\t\t$add_SID = '';\n\t\tif(false)$add_SI = 'PHPSESSID=' . htmlspecialchars(session_id()) . '&';\n\t\t\n\t\tif(count($this->jump_address[$type]) > $this->pos)\n\t\treturn '?' . $add_SI . 'i=' . $this->jump_address[0][$this->pos];\n\t\telseif(count($this->jump_address[$type]) == $this->pos)\n\t\treturn '?' . $add_SI . 'i=' . $this->jump_address[$type + 2];\n\t\t}\n\t\t\n\n\t\t\n\t\tif(count($this->jump_address[$type]) > $this->pos)\n\t\t return $this->jump_address[$type][$this->pos];\n\t\telseif(count($this->jump_address[$type]) == $this->pos)\n\t\t return $this->jump_address[$type + 2];\n\t\n\t return null; */\n\t}", "public function fetchColumn($column_number = false)\n {\n }", "public function fetchColumn($column_number = 0) {\n\t\t$row = $this->fetch(PDO::FETCH_NUM);\n\t\tif( empty($row) || empty($row[$column_number])) return false;\n\t\treturn $row[$column_number];\n\t}", "public function fetchCol($columnName);", "public function fetchColumn(int $column = 0) : ?string\n\t{\n\t\treturn $this->handle->fetchColumn($this->result, $column);\n\t}", "public function findColumn(string $column);", "function get_column( $query, $col_offset = 0 )\n\t{\n\t\t$num_rows = $this->query( $query );\n\t\t\n\t\tif( $num_rows === FALSE )\n\t\t\treturn FALSE;\n\t\t\n\t\t//grab handle of the call we just made\n\t\t$handle = $this->get_handle();\n\t\t\n\t\t//init final output array\n\t\t$rows = array();\n\t\t\n\t\twhile( ($row = mysql_fetch_row($handle)) !== FALSE )\n\t\t\tarray_push( $rows, $row[$col_offset] );\n\t\t\n\t\t//clean up the query in memory\n\t\tmysql_free_result( $handle );\n\t\t\n\t\t//return the result\n\t\treturn $rows;\n\t}", "public function findColumn(string $column)\n {\n $column = null;\n try {\n $column = $this->model->all()->pluck($column);\n } catch (PDOException $exception) {\n $this->handleException($exception);\n } finally {\n return $column;\n }\n }", "function Get($col)\n {\n return $this->row ? $this->row[$col] : NULL;\n }", "public static function get_column($col)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$devices = DB::table('devices')->get($col);\n\t\t\treturn $devices;\n\t\t}\n\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::write('error', $e->getMessage());\n\t\t\tthrow $e;\t\t\t\n\t\t}\n\t}", "function Get($col)\n {\n return isset($this->row) ? $this->row[$col] : null;\n }", "public function testQueryFetchCol() {\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25]);\n $column = $result->fetchCol();\n $this->assertCount(3, $column, 'fetchCol() returns the right number of records.');\n\n $result = $this->connection->query('SELECT [name] FROM {test} WHERE [age] > :age', [':age' => 25]);\n $i = 0;\n foreach ($result as $record) {\n $this->assertSame($column[$i++], $record->name, 'Column matches direct access.');\n }\n }", "public function readCol($column, $row_start = 0, $row_end = null) {\n\t}", "public function column($query, $params = NULL, $key = 0)\n\t{\n\t\tif($statement = $this->query($query, $params))\n\t\t\treturn $statement->fetchColumn($key);\n\t}", "public function fetchColumn($column_number = 0)\r\n\t{\r\n\t\tif($this->executed == true)\r\n\t\t{\r\n\t\t\tif(!$this->resource && $this->isFetched == false)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new LikePDOStatement(\"There is no active statement\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$result = NULL;\r\n\t\t\r\n\t\tif($this->isFetched == true)\r\n\t\t{\r\n\t\t\tif($this->isFetchAll == true)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(isset($this->columns[$column_number]))\r\n\t\t\t\t{\r\n\t\t\t\t\tswitch($this->fetchResultMode)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase LikePDO::FETCH_ASSOC :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$this->columns[$column_number]]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$this->columns[$column_number]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_BOTH :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$this->columns[$column_number]]))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$this->columns[$column_number]];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_BOUND :\r\n\t\t\t\t\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_CLASS :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_INTO :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_LAZY :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_NAMED :\r\n\t\t\t\t\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_NUM :\r\n\t\t\t\t\t\t\tif(isset($this->fetch[$column_number]))\r\n\t\t\t\t\t\t\t\treturn $this->fetch[$column_number];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase LikePDO::FETCH_OBJ :\r\n\t\t\t\t\t\t\tif(isset($this->fetch->{$this->columns[$column_number]}))\r\n\t\t\t\t\t\t\t\treturn $this->fetch->{$this->columns[$column_number]};\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}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!$this->fetchColumn)\r\n\t\t\t\t$this->fetchColumn = $this->pdo->driver->fetch($this->resource, LikePDO::FETCH_NUM);\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(isset($this->fetchColumn[$column_number]))\r\n\t\t\t\treturn $this->fetchColumn[$column_number];\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "public function fetchColumn(int $column = 0): array\n {\n $result = $this->_getResult()->fetchCol($column); // Returns an array on success and an \\PEAR_Error object on failure\n return is_array($result) ? $result : array();\n }", "public function get(array $columns = ['*'], int $limit = 0, int $offset = 0);", "public function getColumn($query, $col = 0) {\n\t\t$return = array();\n\t\t$result = $this->query($query);\n\t\twhile ($row = $result->fetch_array()) {\n\t\t\t$return[] = $row[$col];\n\t\t}\n\t\t$result->free();\n\t\treturn $return;\n\t}", "function getColumn($table, $column, $compare_column, $id) {\n //get mysql object\n $mysql = new my_mysql();\n $query = \"SELECT $column FROM $table WHERE $compare_column='$id';\";\n $res = $mysql->readQuery($query);\n if ($res) {\n return $res->fetch_assoc()[$column];\n }else {\n return false;\n }\n}", "public function fetchColumn($columnNumber = 0)\n {\n $row = $this->fetch();\n if ($row) {\n return $row[$columnNumber];\n }\n\n return false;\n }", "public function fetchColumn() {\r\n\t\t$result = array();\r\n\r\n\t\twhile ($data = $this->fetch()) {\r\n\t\t\t$result[] = current($data);\r\n\t\t}\r\n\r\n\t\t$this->freeResult();\r\n\r\n\t\treturn $result;\r\n\t}", "public function get_col($query = \\null, $x = 0)\n {\n }", "public function fetchColumn(\\PDO $pdo, $sql, array $params = array())\n\t{\n\t\treturn $this->runStatement($pdo, $sql, $params)->fetchColumn();\t\t\n\t}", "public function fetchColumn($column_number = 0)\n {\n $result = oci_fetch_array($this->sth, OCI_NUM + OCI_RETURN_NULLS);\n\n if ($result === false || !isset($result[$column_number])) {\n return false;\n }\n return $result[$column_number];\n }", "function GetRowColumn($row,$column){\n\t\t\treturn @mysql_result($this->result,$row,\"$column\");\n\t\t}", "public function value($column)\r\n {\r\n $rs = (array) $this->first();\r\n return $rs[$column];\r\n }", "public function get(array $data, $column)\n {\n if (!$this->has($data, $column)) {\n return null;\n }\n if (strpos($column, '.')) {\n list($model, $column) = explode('.', $column);\n if (isset($data[$model][$column])) {\n return $data[$model][$column];\n }\n return $data[\"{$model}.{$column}\"];\n }\n if (isset($data[$this->model->alias][$column])) {\n return $data[$this->model->alias][$column];\n }\n if (isset($data[\"{$this->model->alias}.{$column}\"])) {\n return $data[\"{$this->model->alias}.{$column}\"];\n }\n return $data[$column];\n }", "public function get($column): Column\n {\n if (!$this->exists($column)) {\n throw new Exception\\ColumnNotFoundException(__METHOD__ . \" Column '$column' not present in column model.\");\n }\n\n return $this->columns->offsetGet($column);\n }", "public function getColumn($column)\n {\n return $this->allColumns[$column];\n }", "function get_col($query=null,$x=0) {\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query ) {\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; $i < count($this->last_result); $i++ ) {\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function getBy(string $column, $value)\r\n {\r\n $stmt = $this->conn->prepare(\"SELECT * FROM $this->table WHERE $column = '$value'\");\r\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function offsetGet($columnName)\n {\n $row = current($this->_rows);\n return $row !== false? $row[$columnName] : null;\n }", "public function getPageIdColumnName() {}", "public function getColumns(){\n $url = $this->urlWrapper() . URLResources::COLUMN;\n return $this->makeRequest($url, \"GET\", 2);\n }", "public function column(mixed $column): Collection;", "public function getColumn($column_id)\n {\n return $this->db->table(self::TABLE)->eq('id', $column_id)->findOne();\n }", "public function getCol($col)\n {\n if (!$this->checkRange(0, $col)) {\n throw new \\OutOfRangeException();\n }\n\n return array_column($this->_data, $col);\n }", "public static function queryCol($sql)\n\t{\n\t\t$tempResults = self::$link->query($sql);\n\t\t\n\t\tif(!$tempResults)\n\t\t{\n\t\t\tself::handleError($sql);\n //TODO should probably return here\n\t\t}\n\t\t\n\t\t$column = array();\n\t\t\n\t\twhile(!is_null($row = $tempResults->fetch_row()))\n\t\t{\n\t\t\t$column[] = $row[0];\n\t\t}\n\t\t\n\t\t$tempResults->close();\n\t\t\n\t\t//return $tempResults->fetchCol();\n\t\treturn $column;\n\t}", "function get_col($query=null,$x=0)\n\t\t{\n\n\t\t\t$new_array = array();\n\n\t\t\t// If there is a query then perform it if not then use cached results..\n\t\t\tif ( $query )\n\t\t\t{\n\t\t\t\t$this->query($query);\n\t\t\t}\n\n\t\t\t// Extract the column values\n\t\t\tfor ( $i=0; is_array($this->last_result) && $i < count($this->last_result); $i++ )\n\t\t\t{\n\t\t\t\t$new_array[$i] = $this->get_var(null,$x,$i);\n\t\t\t}\n\n\t\t\treturn $new_array;\n\t\t}", "public function get($column)\n {\n $this->initialize();\n if (array_key_exists($column, $this->columns)) {\n $accessor = '__get' . str_replace(' ', '', ucwords(str_replace(array('-', '_'), ' ', $column)));\n return method_exists($this, $accessor) ? $this->{$accessor}() : $this->data[$column];\n }\n throw new Exception\\InvalidArgumentException('Not a valid column in this row: ' . $column);\n }", "public function getBy($col, $cols = '*')\r\n\t{\r\n\t\tif (!isset($this->fields[$col]))\r\n\t\t\tthrow new Exception(\"You have to set a value for selecting by column '$col' in method getBy().\");\r\n\r\n\t\t$cols = $this->toSqlCols($cols);\r\n\t\t$mod = self::$structure->getModificator($this->table, $col);\r\n\t\t$res = Db::fetch(\"SELECT $cols FROM %c WHERE %c = $mod LIMIT 1\", $this->table, $col, $this->fields[$col]);\r\n\t\tif (isset($res[$this->primaryKey]))\r\n\t\t\t$this->primaryKeyValue = $res[$this->primaryKey];\r\n\r\n\t\treturn $res;\r\n\t}", "public function getDataFromColumn($col)\n {\n return $this->attributes[app()->getLocale() == 'ar' ? 'ar_'.$col : $col] ?? $this->attributes[$col];\n }", "public function fetchColumn($sql, $params = [])\n {\n $stmt = $this->dbConn->prepare($sql, [PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY]);\n $stmt->execute($params);\n\n return $stmt->fetchColumn();\n }", "public function columnOffset();", "function adleex_resource_list_column_row( $column_name, $id ) {\nglobal $current_screen;\n\n\tif ($current_screen->post_type!='resource') return;\n\n\tswitch ($column_name) {\n\t\tcase 'post_title':\n\t\tcase 'title' : \n\t\tcase 'date':\n\t\tbreak;\n\t\tcase 'post_author':\n\t\t\techo get_post($id)->post_author;\n\t\tbreak;\n\t\tcase 'post_status':\n\t\t\techo get_post($id)->post_status;\n\t\tbreak;\n\t\tdefault:\n\t\t\t//@TODO va completato quello che ritorno perchè potrebbe essere anche una select e quindi devo restituire il valore associato, \t\n\t\t\techo get_post_meta($id,$column_name,true);\t\t\t\n\t\tbreak;\n\t}\n\n}", "public function column($query,$params = null)\n {\n $this->Init($query,$params);\n $Columns = $this->sQuery->fetchAll(PDO::FETCH_NUM);\n $column = null;\n foreach($Columns as $cells) {\n $column[] = $cells[0];\n }\n return $column;\n\n }", "public function column(string $sql, $params = null)\n\t{\n\t\t$columnValue = null;\n\t\t\n\t\ttry {\n\t\t\t$preparedStatement = $this->_instance->prepare($sql);\n\t\t\t$preparedStatement->execute($params);\n\t\t\t$resultSet = $preparedStatement->fetch(PDO::FETCH_ASSOC);\n\t\t\t$columnValue = $resultSet[0];\n\t\t} catch(PDOException $e) {\n\t\t\tthrow new Exception('Could not fetch a record:<br>' . $e->getMessage());\n\t\t}\n\t\t\n\t\treturn $columnValue;\n\t}", "public function getColumn() { return $this->column; }", "public static function columns_data($table, $column) {\n $columns = static ::columns($table);\n foreach($columns as $_column) {\n if (strtolower($_column['Field']) == strtolower($column)) {\n return $_column;\n }\n }\n throw new Exception(\"No Column Found\");\n }", "public function result_cell($column)\n {\n if (is_bool($this->result))\n {\n return NULL;\n }\n\n $line = $this->result->fetch_assoc();\n\n $this->free_result();\n\n return isset($line[$column]) ? $line[$column] : NULL;\n }", "public function queryColumn($params = array())\n {\n return $this->queryInternal('fetchAll',\\PDO::FETCH_COLUMN,$params);\n }", "private function getColumn($columnName)\n {\n $columns = array_filter(\n $this->columns,\n function ($column) use ($columnName) {\n return $column->name == $columnName;\n } // end anonymous array filter function\n ); // end arrayfilter\n\n return array_shift(\n $columns\n ); // end array_shift\n }", "public static function locate($column, $value)\n {\n $table = new static();\n $select = $table->select()\n ->where(\"{$table->getAdapter()->quoteIdentifier($column)} = ?\", $value)\n ->limit(1);\n\n return $table->fetchRow($select);\n }", "public function col($column)\n {\n $lang = config('app.locale');\n $column = \"$column\".\"_\".\"$lang\";\n return $this->$column;\n }", "public function get($key) {\n if (!array_key_exists($key, $this->mapping))\n return null;\n\n return $this->mapping[$key]['column_name'];\n }", "public function fetchColumn($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_COLUMN, 0);\r\n }", "public function FindCol($col) {\n\t\t$crawler = $this->tail->Next();\n\n\t\tif ($this->tail->Column() === $col) {\n\t\t\treturn $this->tail;\n\t\t}\n\n\t\tif ($this->head->Column() === $col) {\n\t\t\treturn $this->head;\n\t\t}\n\n\t\tfor ($i = 0; $i < $this->count - 1; $i++) {\n\t\t\tif ($crawler->Column() === $col)\n\t\t\t\treturn $crawler;\n\t\t\t$crawler = $crawler->Next();\n\t\t}\n\t\treturn null;\n\t}", "public function getLatest($column);", "public function getSortColumn();", "public function testResultGetColumn()\n {\n \t$result = $this->conn->query(\"SELECT * FROM test WHERE status='ACTIVE'\");\n \t$this->assertEquals(array('first row', 'next row'), $result->getColumn(2), \"Get column 2\");\n \t$this->assertEquals(array('first row', 'next row'), $result->getColumn('title'), \"Get column 'title'\");\n \t$this->assertEquals(array(1, 2), $result->getColumn(0), \"Get column 0\");\n }", "public function getColumnData($column = null)\n\t{\n\t\tif (!in_array($column, $this->productColumns)) return \"Request not a tablecolumn\";\n\t\n\t\t$results = [];\n\n\t\t$stmt = $this->pdo->prepare(\"SELECT DISTINCT $column FROM product LIMIT 10\");\n\n\t\ttry {\n\t\t\t$stmt->execute();\n\t\t\t$db_column_select = $stmt->fetchAll();\n\t\t\tforeach ($db_column_select as $k => $row) {\n\t\t\t\t$results['columnData'][] = $row[$column];\n\t\t\t}\n\t\t\treturn $results; \n\t\t} catch (PDOException $Exception) {\n\t\t\tthrow new MyDatabaseException( $Exception->getMessage(), (int)$Exception->getCode() );\n\t\t}\n\n\t}", "public function getColumn($get)\n\t{\n\t\tif (!array_key_exists($get, $this->row))\n\t\t\tthrow new InternalException(\"row $get doesn't exist\");\n\t\treturn $this->row[$get];\n\t}", "function sql_fetch_field($res,$offset = 0)\n {\n $results = array();\n $obj = NULL;\n $results = $res->getColumnMeta($offset);\n foreach($results as $key=>$value) {\n $obj->$key = $value;\n }\n return $obj;\n }", "function getCol($sql){\n\t\t$res_array = $this->query($sql);\n\t\tif (array_key_exists(0, $res_array) AND array_key_exists(0, $res_array[0])){\n\t\t\treturn $res_array[0][0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function sortUrl(string $column): string;", "function getCategoriaCol($col, $ref, $rel)\n{\n global $conn;\n /*\n *query da disciplina\n */\n $sql = \"SELECT cat_{$col} FROM \".TABLE_PREFIX.\"_categoria WHERE cat_{$ref}=?\";\n if(!$qry = $conn->prepare($sql))\n echo divAlert($conn->error, 'error');\n\n else {\n\n $qry->bind_param('s', $rel);\n $qry->execute();\n $qry->bind_result($$col);\n $qry->fetch();\n $qry->close();\n\n return $$col;\n }\n\n}", "public function get_col($query=null, $x=0) {\n\n\t\t// If there is a query then perform it if not then use cached results..\n\t\tif ($query)\n\t\t\t$this->query($query);\n\n\t\t// Extract the column values\n\t\tfor ($i=0; $i < count($this->last_result); $i++)\n\t\t\t$new_array[$i] = $this->get_var(null, $x, $i);\n\n\t\treturn $new_array;\n\t}", "public function getByColumn($item, $column, array $columns = ['*'])\n {\n }", "function getColumn($arr, $x){\n\treturn array_map(function($y)use($x){ return $y[$x]; }, $arr);\n}", "public function getValueByColumnName($column){\n foreach (self::$excelLabelList as $attribute=>$labels) {\n\n if (in_array($column,$labels,false)){\n return $this->$attribute;\n }\n }\n\n return null;\n }", "public function queryColumn($sql, $columnNumber = 0) {\n\t\ttry {\n\t\t\t$statement = $this->query($sql);\n\t\t\treturn $statement->fetchColumn($columnNumber);\n\t\t} catch(\\PDOException $e) {\n\t\t\t$this->logError($e->getMessage());\n\t\t\tthrow new QueryColumnException($e->getMessage());\n\t\t}\n\t}", "public function __get($column) {\n\t\tif ($column == 'search') {\n\t\t\tif (isset($this->_related[$column])) {\n\t\t\t\treturn $this->_related[$column];\n\t\t\t}\n\n\t\t\t$model = $this->_related($column);\n\n\t\t\t// Use this model's primary key value and foreign model's column\n\t\t\t$col = $model->_object_name.'.'.$this->_belongs_to[$column]['foreign_key'];\n\t\t\t$val = $this->guid;\n\n\t\t\t$model->where($col, '=', $val)->find();\n\t\t}\n\n\t\treturn parent::__get($column);\n\t}", "public function queryFetchColAssoc($statement) {\n return $this->connection->query($statement)->fetchColumn(); \n }", "function gttn_tpps_parse_file_column($fid, $column, $no_header = FALSE) {\n $content = array();\n $options = array(\n 'no_header' => $no_header,\n 'columns' => array($column),\n 'content' => &$content,\n );\n gttn_tpps_file_iterator($fid, 'gttn_tpps_parse_file_column_helper', $options);\n return $content;\n}", "public function result_column($column)\n {\n $output = array();\n\n if (is_bool($this->result))\n {\n return $output;\n }\n\n while ($row = $this->result->fetch_assoc())\n {\n $output[] = $row[$column];\n }\n\n $this->free_result();\n\n return $output;\n }", "public function value($column)\n {\n $result = (array) $this->first([$column => 1]);\n\n return count($result) > 0 ? $result[$column] : null;\n }", "function getColumn( $n, $lookup = array(), $quickTest = false ){ \r\n $count = count($lookup);\r\n if( $n > 0 && empty($count) ){\r\n return array(); // can not get column without search query \r\n };\r\n \r\n $col = array();\r\n $lastValue = $lookup[ $count - 1 ];\r\n $flatLookup = join( '|', $lookup );\r\n // when using ajax GET method, use utf8 to encoude the lookup query. otherwise, some special chars like France characters might not work \r\n if( !$this->isPost() ){\r\n $lastValue = utf8_encode( $lastValue );\r\n $flatLookup = utf8_encode( $flatLookup );\r\n };\r\n \r\n foreach( $this->fields['data'] as $r ){\r\n \r\n if( !isset($r[$n]) )\r\n continue;\r\n\r\n $value = trim($r[$n]);\r\n if( $value == '' )\r\n continue;\r\n \r\n if( $n == 0 ){ \r\n $col[] = $value;\r\n \r\n }else{\r\n \r\n //if( trim($r[$n-1]) == $lastValue ){ // quick check to improve performance \r\n if( $r[$n-1] == $lastValue ){ // quick check the last value to improve performance\r\n $leftCols = array_slice( $r, 0, $n );\r\n $flatLeftValues = join( '|', $leftCols );\r\n if( $flatLeftValues == $flatLookup ){ // show value only by lookuping by joining all its parents' values\r\n $col[] = $value;\r\n };\r\n }; // if\r\n \r\n }; // if $n == 0\r\n \r\n if( $quickTest && count($col) > 0 ) break;\r\n \r\n }; // foreach\r\n\r\n return array_unique($col);\r\n }", "public function getColumnMeta($column)\r\n\t{\r\n\t\t$field = $this->pdo->driver->fetchField($this->resource, $column);\r\n\t\t$field = (array)$field;\r\n\t\t\r\n\t\treturn $field;\r\n\t}", "public static function getDoctrineColumn($table, $column)\n {\n }", "function spr_exclude_column_found($column) {\nglobal $spr_exclude_db_debug;\n\n\t$rs = safe_query('SELECT * FROM '.safe_pfx('txp_section'),$spr_exclude_db_debug);\n\t$a = nextRow($rs);\n\treturn array_key_exists($column, $a);\n}", "public function getColumn($name)\n {\n return $this->columns[$name];\n }", "function get_col( $query = null , $x = 0 ) {\n\t\tif ( $query )\n\t\t\t$this->dbcr_query( $query );\n\n\t\t$new_array = array();\n\t\t// Extract the column values\n\t\tfor ( $i = 0, $j = count( $this->dbcr_wpdb->last_result ); $i < $j; $i++ ) {\n\t\t\t$new_array[$i] = $this->get_var( null, $x, $i );\n\t\t}\n\t\treturn $new_array;\n\t}", "function wtr_events_locations_custom_columns($column){\r\n\r\n\tglobal $post;\r\n\r\n\tswitch ($column) {\r\n\t\tcase \"event_locatio_address\":\r\n\t\t\techo get_post_meta( $post->ID, '_wtr_events_locations_address', true );\r\n\t\tbreak;\r\n\t}\r\n}", "private static function getColumnConstant($node_class, $column, $skip_table_name_prefix = false)\n {\n $conf_directive = sprintf('propel_behavior_'.sfConfig::get('app_actasnestedset_behavior_name', 'actasnestedset').'_%s_columns', $node_class);\n $columns = sfConfig::get($conf_directive);\n\n return $skip_table_name_prefix ? substr($columns[$column], strpos($columns[$column], '.') + 1) : $columns[$column];\n }", "public function column($sql, $params = [])\n {\n $result = $this->query($sql, $params);\n return $result->fetchColumn();\n }", "public function columnMaps();", "public function getColumnsMap(): PaginationColumns|null\n {\n return $this->columnsMap;\n }", "function getProdutoCol($col, $ref, $rel)\n{\n global $conn;\n /*\n *query da disciplina\n */\n $sql = \"SELECT pro_{$col} FROM \".TABLE_PREFIX.\"_produto WHERE pro_{$ref}=?\";\n if(!$qry = $conn->prepare($sql))\n echo divAlert($conn->error, 'error');\n\n else {\n\n if (!apenasNumeros($rel))\n $qry->bind_param('s', $rel);\n else\n $qry->bind_param('i', $rel);\n\n $qry->execute();\n $qry->bind_result($$col);\n $qry->fetch();\n $qry->close();\n\n return $$col;\n }\n\n}", "public function getColumn($name)\n {\n foreach ($this->getColumns() as $column) {\n if ($column->getName() === $name) {\n return $column;\n }\n }\n\n }", "public function get_col($query, $data = null, $format = null, $col = 0)\n {\n $data = $this->query($query, $data, $format);\n $output = array();\n foreach ($data as $row) {\n if (property_exists($row, $col)) {\n $output[] = $row->$col;\n } elseif (is_numeric($col)) {\n $vars = array_keys(get_object_vars($row));\n $varname = $vars[ $col ];\n $output[] = $row->$varname;\n }\n }\n $query->closeCursor();\n unset($query);\n return $output;\n }", "public function getColumn(): string;", "public function fetchColumn() {\n if ($this->result === true) {\n return false;\n }\n\n // Are we running PHP >=8.1?\n if (PHP_VERSION_ID >= 80100) {\n $value = $this->result->fetch_column();\n return ($value === null || $value === false) ? $value : (string) $value;\n }\n\n // Fallback to traditional approach\n $row = $this->result->fetch_row();\n return $row ? $row[0] : false;\n }", "public function getCol($sql, $data)\n {\n if (!is_array($data)) {\n $data = array($data);\n }\n $result = $this->doQuery($sql, $data)->fetch(PDO::FETCH_ASSOC);\n $this->freeStmt();\n return empty($result) ? NULL : current($result);\n }", "function array_column(&$arr, $col) {\n $column = array();\n foreach ($arr as $row) {\n $column[] = $row[$col];\n }\n return $column;\n}", "private function findColumn($key)\n\t\t{\n\t\t\tif($this->_columns === null || $key == null)\n\t\t\t\treturn null;\n\n\t\t\tforeach($this->_columns as $col)\n\t\t\t\tif($col->getName() == $key)\n\t\t\t\t\treturn $col;\n\n\t\t\treturn null;\n\t\t}", "public function extractColumnName($column);", "public function get_site_column( $blog_id, $column )\n\t{\n\t\tglobal $wpdb;\n\t\treturn $wpdb->get_var( \n\t\t\t$wpdb->prepare( \n\t\t\t\t\"SELECT $column FROM \".self::$site_table.\" WHERE blog_id=%d\",\n\t\t\t\tintval( $blog_id )\n\t\t\t)\n\t\t);\n\t}" ]
[ "0.72089046", "0.66481227", "0.6470256", "0.63133883", "0.6229791", "0.6225132", "0.62251174", "0.61710507", "0.61617786", "0.61587", "0.6130535", "0.6110269", "0.601072", "0.59614164", "0.5954793", "0.59542084", "0.5906114", "0.58920354", "0.58838415", "0.587977", "0.5836539", "0.5807377", "0.5781186", "0.57773834", "0.5761712", "0.5743752", "0.5727436", "0.57235295", "0.56935763", "0.5688887", "0.56726295", "0.5666703", "0.56626433", "0.56430864", "0.56284845", "0.5622558", "0.5577499", "0.55481964", "0.55462724", "0.55360717", "0.5533408", "0.5531622", "0.5527895", "0.5517833", "0.55126864", "0.5507363", "0.55059254", "0.55002093", "0.5485751", "0.5470737", "0.54668367", "0.54437745", "0.54411685", "0.54377705", "0.5419426", "0.54154503", "0.5401205", "0.539833", "0.5396689", "0.5396673", "0.5388719", "0.5385302", "0.53798133", "0.5374196", "0.5371518", "0.5370474", "0.5369267", "0.53672785", "0.5363449", "0.5361865", "0.53598756", "0.5359551", "0.53567815", "0.5353239", "0.5343377", "0.5336423", "0.53302145", "0.5330066", "0.5329129", "0.5327667", "0.5318648", "0.5285378", "0.52819973", "0.52786124", "0.5277859", "0.5272995", "0.5268899", "0.526473", "0.52556354", "0.52516574", "0.52478355", "0.52392924", "0.5238387", "0.5236025", "0.5235755", "0.523482", "0.5229553", "0.5223736", "0.52228975", "0.5219774" ]
0.52472967
91
Adds order column to query.
public function addOrder(string $column, string $order = 'ASC'): void { if (empty($this->columnsMap) === true) { $this->query->addOrder($column, $order); return; } if ($this->getColumn($column)->isSortable() === false) { throw new LogicException("The given sort column '$column' is not sortable."); } $this->query->addOrder($this->getColumn($column)->toSql(), $order); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrderColumn()\n {\n return 'order';\n }", "protected function setOrder() {\r\n if( $this->sqlOrderBy ) {\r\n $this->sql .= ' ORDER BY ' . $this->sqlOrderBy;\r\n }\r\n }", "public function addOrder($ord) {\n $this->sql .= \" ORDER BY $ord\";\n }", "public function orderBy() {\n $this->_orderBy = \"\";\n foreach ($this->_columns as $tableName => $table) {\n if (array_key_exists('order_bys', $table)) {\n foreach ($table['order_bys'] as $fieldName => $field) {\n $this->_orderBy[] = $field['dbAlias'];\n }\n }\n }\n $this->_orderBy = \"ORDER BY \" . implode(', ', $this->_orderBy) . \" \";\n }", "public static function order( $column, $order, $use_alias = true ) {\n\t\t\tif( self::$query_open ) {\n self::$current_query->order( $column, $order, $use_alias );\n }\n\t\t}", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "public function queryAllOrderBy($orderColumn);", "function orderByClause( $orderby ) {\n\t global $wpdb;\n\t return \"dm.meta_value+0 {$this->order}, $wpdb->posts.post_title ASC\";\n\t}", "public function getOrderingColumn()\n {\n return $this->orderingColumn;\n }", "public function getOrder()\n {\n return $this->orderingColumnOrder;\n }", "public function getQueryOrderby() {\n return '`'.$this->name.'`';\n }", "public function order($column, $order = null)\r\n {\r\n $columns = $order == null ? $column : func_get_args();\r\n\r\n $this->order[] = $columns;\r\n\r\n return $this;\r\n }", "public function order($field, $order = 'desc');", "private function sql_orderBy()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $arr_order = null;\n $arr_order = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'order.' ];\n\n // Order field\n switch ( true )\n {\n case( $arr_order[ 'field' ] == 'uid' ):\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n break;\n case( $arr_order[ 'field' ] == 'value' ):\n default:\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n break;\n }\n // Order field\n // Order flag\n switch ( true )\n {\n case( $arr_order[ 'orderFlag' ] == 'DESC' ):\n $orderFlag = 'DESC';\n break;\n case( $arr_order[ 'orderFlag' ] == 'ASC' ):\n default:\n $orderFlag = 'ASC';\n break;\n }\n // Order flag\n // Get ORDER BY statement\n $orderBy = $orderField . ' ' . $orderFlag;\n\n // RETURN ORDER BY statement\n return $orderBy;\n }", "protected function orderBy(array $order){\n $query = \" ORDER BY \";\n foreach ($order as $v){\n $query .= $this->genTableVar($v) . \", \";\n }\n $query = substr($query, 0, -2);\n $this->query .= $query . \" \";\n }", "function orderBy($orderBy, $order)\n {\n if (empty($orderBy)) {\n return false;\n }\n \n $columns = $this->to_string($orderBy);\n \n $order = (in_array(strtoupper($order), array( 'ASC', 'DESC'))) ? strtoupper($order) : 'ASC';\n \n return 'ORDER BY '.$columns.' '. $order;\n }", "public function setOrder($order = Table::DIRECTION_DOWN)\n {\n $this->orderingColumnOrder = $order;\n }", "function ajan_esc_sql_order( $order = '' ) {\n\t$order = strtoupper( trim( $order ) );\n\treturn 'DESC' === $order ? 'DESC' : 'ASC';\n}", "function click_sort($order) {\n if (isset($this->real_field)) {\n // Since fields should always have themselves already added, just\n // add a sort on the field.\n $params = array('type' => 'numeric');\n $this->query->add_orderby($this->table_alias, $this->real_field, $order, $this->field_alias, $params);\n }\n }", "abstract protected function _buildOrderBy( $order );", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "function Trigger_SetOrderColumn(&$tNG) {\r\n $orderFieldObj = new tNG_SetOrderField($tNG);\r\n $orderFieldObj->setFieldName(\"sort\");\r\n return $orderFieldObj->Execute();\r\n}", "public function order(Closure $order): Column\n {\n $order = Closure::bind($order, $this);\n $this->order = $order;\n\n return $this;\n }", "public function orderBy($order = \"\"){\n\t\t\tif(is_string($order) && strlen($order) > 0){\n\t\t\t\t$this->orderBy = \" ORDER BY \" . $order;\n\t\t\t}else{\n\t\t\t\t$this->orderBy = false;\n\t\t\t}\n\t\t\treturn $this;\n\t\t}", "public function orderBy($direction = \"ASC\",$column);", "protected function _appendOrderByClause(Zend_Db_Select $query)\n {\n $order = strtoupper($this->_getParam($this->_orderKey, $this->_defaultOrderDirection));\n $orderBy = $this->_getParam($this->_orderByKey, $this->_defaultOrderColumn);\n \n if (in_array($orderBy, $this->_getTable()->info('cols'))) {\n $this->view->order = $order;\n $this->view->orderBy = $orderBy;\n \n $query->order($orderBy . ' ' . $order);\n }\n \n return $query;\n }", "public function getOrderingColumn()\n {\n return $this->config->getOrderingColumn();\n }", "public function custom_column_orderby( $query ) {\n\n\t\tif ( ! isset( $_GET['post_type'] ) || 'ticket' !== $_GET['post_type'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$fields = $this->get_custom_fields();\n\t\t$orderby = $query->get( 'orderby' );\n\n\t\tif ( ! empty( $orderby ) && array_key_exists( $orderby, $fields ) ) {\n\n\t\t\tif ( 'taxonomy' != $fields[ $orderby ]['args']['field_type'] ) {\n\t\t\t\t$query->set( 'meta_key', '_dev_' . $orderby );\n\t\t\t\t$query->set( 'orderby', 'meta_value' );\n\t\t\t}\n\n\t\t}\n\n\t}", "public function addOrderClause(Zend_Db_Select &$select) {\n // Distill the WHERE class from the Select object\n $where = $select->getPart(Zend_Db_Select::WHERE);\n // Save the existing ORDER clause.\n $originalOrder = $select->getPart(Zend_Db_Select::ORDER);\n $select->reset(Zend_Db_Select::ORDER);\n \n $alias = '';\n if ($this->_modelAlias) {\n $alias = $this->_modelAlias . '.';\n }\n\n /**\n * If a registered foreign key (see self::_relationConfig) is found, this query is \n * considered to be a related fetch() command, and an ORDER BY clause is added with\n * the registered weight column.\n */\n foreach ($where as $w) {\n foreach ($this->_relationConfig as $model => $modelRelationConfig) {\n if (strpos($w, $modelRelationConfig[self::FOREIGN_KEY_COLUMN_KEY]) !== false) {\n $select->order($alias . $modelRelationConfig[self::WEIGHT_COLUMN_KEY].' DESC');\n }\n }\n }\n \n // Return the existing ORDER clause, only this time '<weight-column> DESC' will be in front of it\n foreach ($originalOrder as $order) {\n // [0] = column, [1] = direction\n if (is_array($order)) {\n $order = $order[0].' '.$order[1];\n }\n $select->order($order);\n } \n }", "public function order(string $order, bool $asc);", "protected function prepareOrderByQuery($order, $direction)\n {\n $this->orderBy = \"ORDER BY $order $direction\";\n }", "protected function addOrder(Builder $builder)\n {\n $builder->macro('order', function(Builder $builder, $things = []) {\n if ( count($things) == 0 ) {\n return $builder->applyScopes();\n }\n $builder = $builder->getModel()->newQueryWithoutScopes();\n foreach ( $this->getOrderByRules($builder) as $column => $rule ) {\n if ( is_numeric($column) ) {\n $column = $rule;\n $rule = \"DESC\";\n }\n if ( in_array($column, $things) ) {\n $builder->orderBy($column, $rule);\n }\n }\n\n return $builder;\n });\n }", "public function orderBy($column, $order = self::SORT_ASC)\n {\n $this->orderBy[] = array(\n 'column' => $column,\n 'order' => $order\n );\n return $this;\n }", "protected function getOrderByAttribute()\n {\n return $this->fetchData[self::ORDER_CLAUSE];\n }", "private function getOrderString() {\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $order = '';\r\n if (isset($this->resource->requestData['order']) && count($this->resource->requestData['order'])) {\r\n $orderBy = array();\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n for ($i = 0, $ien = count($this->resource->requestData['order']); $i < $ien; $i++) {\r\n // Convert the column index into the column data property\r\n $columnIdx = intval($this->resource->requestData['order'][$i]['column']);\r\n $requestColumn = $this->resource->requestData['columns'][$columnIdx];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['orderable'] == 'true') {\r\n $dir = $this->resource->requestData['order'][$i]['dir'] === 'asc' ? 'ASC' : 'DESC';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $orderBy[] = $fld[0] . '.' . $fld[1] . \" \" . $dir;\r\n } else {\r\n\r\n $orderBy[] = $column['db'] . \" \" . $dir;\r\n }\r\n }\r\n }\r\n $order = implode(', ', $orderBy);\r\n }\r\n return $order;\r\n }", "public function getOrderByClause() {\n\n\t\ttx_pttools_assert::isTrue($this->isSortable, array('message' => 'This column is not sortable'));\n\t\tswitch ($this->sortingState) {\n\t\t\tcase self::SORTINGSTATE_NONE: {\n\t\t\t\t$orderBy = '';\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_ASC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'ASC');\n\t\t\t} break;\n\n\t\t\tcase self::SORTINGSTATE_DESC: {\n\t\t\t\t$orderBy = sprintf('%s.%s %s', $this->table, $this->field, 'DESC');\n\t\t\t} break;\n\n\t\t\tdefault: {\n\t\t\t\tthrow new tx_pttools_exception('Invalid sorting state!');\n\t\t\t} break;\n\t\t}\n\t\treturn $orderBy;\n\t}", "public function orderBy($sql);", "protected function prepareOrderByStatement() {}", "protected static function addOrderBy(SugarQuery $q, array $orderByOption)\n {\n foreach ($orderByOption as $orderBy) {\n // ID and date_modified are used to give some order to the system\n if ($orderBy[0] != 'date_modified' && $orderBy[0] != 'id') {\n self::verifyField($q, $orderBy[0]);\n }\n $q->orderBy($orderBy[0], $orderBy[1]);\n }\n }", "protected function buildOrderClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_orders)>0) {\r\n\t\t\t$sql.=' ORDER BY '.implode(', ', $this->_salt_orders);\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}", "public function addOrderBy($value) {\n\t\t$this->query['order'] = ArrayHelper::merge($this->query['order'], $value);\n\t\treturn $this;\n\t}", "public function order(string $column, string $order)\n {\n $this->options['order']['column'] = $column;\n $this->options['order']['type'] = $order;\n \n return $this;\n }", "public function order($order) {\n\t\t$model = $this->model;\n\t\t// For each order field, it is added as an OrderField object\n\t\tforeach ($order as $field => $fieldOrder) {\n\t\t\t$this->order[] = new \\lulo\\query\\OrderField($this, $model, $field, $fieldOrder);\n\t\t}\n\t\treturn $this;\n\t}", "public function orderBy(){\r\n $this->orderBy = \"ORDER BY \";\r\n $args = func_get_args();\r\n foreach($args as $arg){\r\n $this->orderBy.= $this->db->formatTableName($arg);\r\n if(end($args) !== $arg){\r\n $this->orderBy.=\", \";\r\n } \r\n\r\n }\r\n return $this;\r\n }", "public function scopeOrdered(Builder $query)\n {\n if (! Schema::hasColumn($this->getTable(), 'order')) {\n return;\n }\n\n $query->orderBy('order');\n }", "public function orderBy($column, $direction = 'asc');", "function dhali_sort_order_column( $columns ) {\n\n\t$columns['sort_order_column'] = __( 'Sort Order', 'dhali' );\n\treturn $columns;\n\n}", "public function orderBy($column, $direction = 'asc')\n {\n\n }", "function get_sql_sort() {\n $order = parent::construct_order_by($this->get_sort_columns());\n\n $defaultorder = array(\n 'problem_label' => 'ASC',\n 'difficulty_points' => 'ASC'\n );\n\n if ($order == '') {\n foreach ($defaultorder as $key => $value) {\n if (strpos($order, $key) === false) {\n $order = \"$key $value, $order\";\n }\n }\n }\n\n return trim($order, \", \");\n }", "function pafd_filter_order_columns( $order ) {\n\t\n\t// Make sure variable are defined\n\tif( empty( $order ) ) {\n\t\t$order = array();\n\t}\n\t$order_normal = K::get_var( 'normal', $order, '' );\n\n\tif( empty( $order_normal ) ) {\n\t\t$order[ 'normal' ] = 'customdiv-pafd-file';\n\t}\n\n\treturn $order;\n}", "public function getOrder()\n {\n return $this->getAdditionalParam('orderBy');\n }", "protected static function _orderby($field, $order)\n {\n if ($field == \"\") {\n self::$orderby = null;\n } else {\n self::$orderby = sprintf(\" ORDER BY %s %s\", $field, $order);\n }\n }", "private function _order($orderData) \n\t{\n\t\t// if no order is supplied, default to DESC\n\t\tisset ( $orderData ['order'] ) || $orderData ['order'] = 'DESC';\n\t\t\n\t\t$this->_query .= \" ORDER BY \" . implode ( ',', $orderData ['fields'] ) . ' ' . $orderData ['order'];\n\t}", "private function _buildOrderClause()\n {\n $order = array();\n\n switch ( $this->orderby ) {\n case self::ORDERBY_DATE:\n $order[] = 'date_enreg' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_BEGIN_DATE:\n $order[] = 'date_debut_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_END_DATE:\n $order[] = 'date_fin_cotis' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_MEMBER:\n $order[] = 'nom_adh' . ' ' . $this->ordered;\n $order[] = 'prenom_adh' . ' ' . $this->ordered;\n break;\n case self::ORDERBY_TYPE:\n $order[] = ContributionsTypes::PK;\n break;\n case self::ORDERBY_AMOUNT:\n $order[] = 'montant_cotis' . ' ' . $this->ordered;\n break;\n /*\n Hum... I really do not know how to sort a query with a value that\n is calculated code side :/\n case self::ORDERBY_DURATION:\n break;*/\n default:\n $order[] = $this->orderby . ' ' . $this->ordered;\n break;\n }\n\n return $order;\n }", "public function orderBy($column, $orderType)\n {\n $this->order = $column;\n $this->orderType = $orderType;\n }", "public function addAltOrderByColumn($column, $op = 'ASC')\n {\n $this->_secondary_order[] = array(\n 'column' => $column,\n 'order' => $op\n );\n }", "public function orderBy($key, $order='asc');", "function get_sql_order(){\r\n\r\n\t\tif(stripos($this->sql_query,' ORDER BY ')!==false){\r\n\t\t\tif(stripos($this->sql_query,' LIMIT ')!==false)\r\n\t\t\t\t$order_str_ini=substr($this->sql_query,stripos($this->sql_query,' ORDER BY '),stripos($this->sql_query,' LIMIT ')-stripos($this->sql_query,' ORDER BY '));\r\n\t\t\telse\r\n\t\t\t\t$order_str_ini=substr($this->sql_query,stripos($this->sql_query,' ORDER BY '));\r\n\t\t}else{\r\n\t\t\t$order_str_ini='';\r\n\t\t}\r\n\r\n\t\t$order_str='';\r\n\t\t$arr_new_cols=array();\r\n\r\n\t\t// adds the extra columns in consideration\r\n\t\t$arr_sql_fields=$this->sql_fields;\r\n\t\tfor($i=0; $i<count($this->extra_cols); $i++){\r\n\t\t\tarray_splice($arr_sql_fields, $this->extra_cols[$i][0]-1, 0, '');\r\n\t\t\t$arr_new_cols[]=$this->extra_cols[$i][0];\r\n\t\t}\r\n\r\n\t\t$arr_sort=explode('_',$this->sort);\r\n\t\tasort($arr_sort);\r\n\r\n\t\tforeach($arr_sort as $key => $value){\r\n\r\n\t\t\tif(!in_array($key+1,$arr_new_cols)){\r\n\r\n\t\t\t\tif(substr($arr_sort[$key],-1)=='a')\r\n\t\t\t\t\t$order_str.=(($order_str_ini or $order_str) ? ', ' : ' ORDER BY ').$arr_sql_fields[$key].' ASC';\r\n\r\n\t\t\t\tif(substr($arr_sort[$key],-1)=='d')\r\n\t\t\t\t\t$order_str.=(($order_str_ini or $order_str) ? ', ' : ' ORDER BY ').$arr_sql_fields[$key].' DESC';\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn $order_str_ini.$order_str;\r\n\t}", "function orderBy($columns, $direction = \"\") {\n\t\t\n\t\tif (gettype($columns) == 'array') {\n\t\t\t$cols = array();\n\t\t\tforeach ($columns as $col => $dir) {\n\t\t\t\t$cols[] = \"`$col` $dir\";\n\t\t\t}\n\t\t\t$cols = implode($cols, \",\");\n\t\t} else {\n\t\t\tif (!preg_match(\"/\\\\)$/\", $columns)) $cols = \"`$columns` $direction\";\n\t\t\telse $cols = \"$columns $direction\";\n\t\t\t// $cols = \"`\" . implode(\"` `\", preg_split(\"/\\s/i\", $columns)) . \"` $direction\";\n\t\t\t// $cols = \"`$columns` $direction\";\n\t\t}\n\t\t\n\t\tif (!isset($this->stmts['orderBy']))\n\t\t\t$cols = \"ORDER BY $cols\";\n\t\t\n\t\t$this->appendStmt('orderBy', \"$cols\");\n\n\t\treturn $this;\n\t}", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = $this->fields_arr['orderby_field'].' '.$this->fields_arr['orderby'];\n\t\t\t}", "protected function compileOrderByStatement()\n {\n if (is_array($this->builderCache->orderBy) && count($this->builderCache->orderBy) > 0) {\n for ($i = 0, $c = count($this->builderCache->orderBy); $i < $c; $i++) {\n if ($this->builderCache->orderBy[ $i ][ 'escape' ] !== false\n && ! $this->isLiteral(\n $this->builderCache->orderBy[ $i ][ 'field' ]\n )\n ) {\n $this->builderCache->orderBy[ $i ][ 'field' ] = $this->conn->protectIdentifiers(\n $this->builderCache->orderBy[ $i ][ 'field' ]\n );\n }\n\n $this->builderCache->orderBy[ $i ] = $this->builderCache->orderBy[ $i ][ 'field' ]\n . $this->builderCache->orderBy[ $i ][ 'direction' ];\n }\n\n return $this->builderCache->orderBy = \"\\n\" . sprintf(\n 'ORDER BY %s',\n implode(', ', $this->builderCache->orderBy)\n );\n } elseif (is_string($this->builderCache->orderBy)) {\n return $this->builderCache->orderBy;\n }\n\n return '';\n }", "public function compileOrders(Builder $query, $orders)\n {\n return 'ORDER BY '.implode(', ', array_map(function ($order) {\n return $this->wrap($order['column']).' '.mb_strtoupper($order['direction']);\n }, $orders));\n }", "public function setOrderField($x) { $this->orderField = $x; }", "public function order($column, $mode)\n {\n if(!$this->query)\n {\n return false;\n }\n \n $mode = strtoupper($mode);\n \n // Check mode\n if($mode != 'DESC' && $mode != 'ASC')\n {\n // Do nothing silently.\n return $this;\n }\n \n // Make column safe\n $column = $this->san($column);\n \n $this->query .= \"ORDER BY {$column} {$mode} \";\n \n // Return a ref. to this object for chainability\n return $this;\n }", "private function orderBy($param) {\n if (isset($param['column']) && isset($param['type'])) {\n $this->sql .= 'ORDER BY ' . $param['column'] . ' ' . $param['type'] . ' ';\n }\n }", "protected function _compile_order_by()\n\t{\n\t\tif (is_array($this->qb_orderby) && count($this->qb_orderby) > 0)\n\t\t{\n\t\t\tfor ($i = 0, $c = count($this->qb_orderby); $i < $c; $i++)\n\t\t\t{\n\t\t\t\tif ($this->qb_orderby[$i]['escape'] !== FALSE && ! $this->_is_literal($this->qb_orderby[$i]['field']))\n\t\t\t\t{\n\t\t\t\t\t$this->qb_orderby[$i]['field'] = $this->protect_identifiers($this->qb_orderby[$i]['field']);\n\t\t\t\t}\n\n\t\t\t\t$this->qb_orderby[$i] = $this->qb_orderby[$i]['field'].$this->qb_orderby[$i]['direction'];\n\t\t\t}\n\n\t\t\treturn $this->qb_orderby = \"\\nORDER BY \".implode(', ', $this->qb_orderby);\n\t\t}\n\t\telseif (is_string($this->qb_orderby))\n\t\t{\n\t\t\treturn $this->qb_orderby;\n\t\t}\n\n\t\treturn '';\n\t}", "protected function buildOrders(Query $query)\n {\n return count($query->getOrder()) > 0 ? ' ORDER BY '.implode(',', $query->getOrder()) : '';\n }", "public function getDefaultOrderCol() ;", "function set_order($value) {\n $this->set_mapped_property('order', $value);\n }", "private function setCustomOrderBy()\n\t{\n\t\tif (!$this->useDataProvider && $this->customQuery->orderBy) {\n\t\t\t$this->orderBy = $this->customQuery->orderBy;\n\t\t} else {\n\t\t\t$this->sort = $this->customQuery->orderBy; //set $this->sort property for dataProvider sorting\n\t\t}\n\n\t\treturn $this;\n\t}", "private function makeOrderingSQL($order_by) {\n $all_columns = \"\";\n if (is_array($order_by))\n {\n foreach ($order_by as $column_name)\n\t{\n\t $all_columns .= $column_name . ', ';\n\t}\n $all_columns = rtrim($all_columns, ', ');\n }\n else\n {\n $all_columns = $order_by;\n }\n return 'ORDER BY ' . $all_columns;\n}", "public function setOrderBy(array $orderBy);", "private function getOrdering()\n {\n return [[\n 'column' => 0,\n 'dir' => 'asc',\n ]];\n }", "private function buildOrderBy() {\n\t\t$hasorderby = false;\n\t\tforeach($this->ordergroup as $key=>$extra) {\n\t\t\tif(strpos(strtoupper($extra), 'ORDER BY') !== false) {\n\t\t\t\t$this->orders[] = str_replace('ORDER BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'LIMIT') !== false) {\n\t\t\t\t$this->limit = $extra;\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t\tif(strpos(strtoupper($extra), 'GROUP BY') !== false) { \n\t\t\t\t$this->groups[] = str_replace('GROUP BY', \"\", strtoupper($extra));\n\t\t\t\tunset($this->ordergroup[$key]);\n\t\t\t}\n\t\t}\n\t}", "public function order();" ]
[ "0.76830095", "0.7228716", "0.71566635", "0.70954823", "0.70034057", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.6784857", "0.675158", "0.66498977", "0.65832245", "0.6509132", "0.6453752", "0.64513415", "0.64287084", "0.6409641", "0.6402409", "0.63821787", "0.63754535", "0.6362477", "0.63546073", "0.6346416", "0.6346416", "0.6346416", "0.6334957", "0.63260454", "0.6309679", "0.62999696", "0.6291434", "0.6289635", "0.6283927", "0.628196", "0.6264989", "0.6252501", "0.62124676", "0.62031627", "0.6197521", "0.61767685", "0.6161907", "0.61328036", "0.61256015", "0.6122215", "0.61107534", "0.6070351", "0.6055523", "0.6052557", "0.6052001", "0.6048216", "0.60340625", "0.6024709", "0.59929794", "0.59755754", "0.5965063", "0.5960273", "0.5948215", "0.59460074", "0.5945238", "0.59411615", "0.59295404", "0.5919682", "0.59158164", "0.5915205", "0.59079504", "0.5893398", "0.58808666", "0.5857318", "0.58553964", "0.5850893", "0.5833593", "0.5824681", "0.58177114", "0.5816984", "0.58148384", "0.58128905", "0.5801737", "0.57997155", "0.579849" ]
0.58141243
96
Get the current pagination request.
public function getRequest(): PaginationParameters { return $this->parameters; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCurrentPage()\n {\n return $this->request->param('paging.' . $this->pagingType . '.page');\n }", "protected function getQueryCurrentPage($request)\n {\n $data = $request->query->all();\n if (isset($data['_page'])) {\n return ($data['_page']);\n }\n\n return 1;\n }", "public function getCurrentRequest()\n\t\t{\n\t\t\treturn $this->currentRequest;\n\t\t}", "function getRequest()\n {\n return $this->current_request;\n }", "protected function _getCurrentPage() {\r\n\r\n // determine which object the current request belongs\r\n $currentPage = null;\r\n\r\n // perform \"polling\" to get who can manage this request\r\n foreach ($this->getItems() as $item) {\r\n if (($item instanceof Page) && $item->isResponsibleFor($this->_request)) {\r\n $currentPage = $item;\r\n break;\r\n }\r\n }\r\n\r\n return $currentPage;\r\n }", "public function getCurrentPageSize()\n {\n static $p;\n if ($p) {\n return $p;\n }\n return $p = $this->request->param('pagenum') ?: $this->pageLimit;\n }", "public function getCurrentRequest()\n {\n return $this->container['request'];\n }", "public function request() {\n return $this->requestStack->getCurrentRequest();\n }", "public function getPage()\n {\n return $this->getRequest()->get('page', 1);\n }", "public function getPaginationCurrentPage(): int\n {\n return $this->pagination['page'];\n }", "protected function getCurrentPage(){\n \n $request = $this->getRequest();\n $user = $this->getUser(); \n $page = 1;\n // Manage the current page\n if($request->hasParameter('page'))\n {\n $page = $request->getParameter('page');\n $user->setAttribute('page', $page, 'project/list');\n }\n elseif($user->hasAttribute('page', 'project/list'))\n {\n $page = $user->getAttribute('page', $page, 'project/list');\n } \n \n return $page;\n }", "public function getPagination() {\n return $this->pagination_;\n }", "public function getPagination()\n {\n return $this->pagination;\n }", "public function getPagination()\n {\n return $this->pagination;\n }", "protected function currentPage()\n {\n return $this->paginator->currentPage();\n }", "protected function currentPage()\n {\n return $this->paginator->currentPage();\n }", "protected function currentPage()\n {\n return $this->paginator->currentPage();\n }", "public function getCurrentPage()\n {\n return $this->currentPage;\n }", "function getPageFromRequest() {\n\t\t$oFilter = utilityInputFilter::filterInt();\n\t\t$page = $oFilter->doFilter($this->getActionFromRequest(false, 2));\n\t\t\n\t\tif ( !$page || !is_numeric($page) || $page < 1 ) {\n\t\t\t$page = 1;\n\t\t}\n\n\t\treturn $page;\n\t}", "public function currentPage()\n {\n return $this->paginator->currentPage();\n }", "public function pagingRequest(): PagingRequests\n {\n return $this->pagingRequests;\n }", "public function getCurrentPage() {\n\t\treturn $this->currentPage;\n\t}", "public function getRequest()\n {\n if (null === $this->lastRequest) {\n $this->lastRequest = $this->requestStack->getMasterRequest();\n }\n\n\n return $this->lastRequest;\n }", "public function getCurrentPage()\r\n {\r\n return $this->_currentPage;\r\n }", "public function getCurrentPage() {\n return $this->_currentPage;\n }", "public static function current()\n\t{\n\t\treturn Request::$current;\n\t}", "public function getCurrentPage() {\r\n\t\treturn $this->_currentPage;\r\n\t}", "public function getRequest()\r\n {\r\n return Mage::registry('current_request');\r\n }", "protected function getCurrentRequest() {\n return \\Drupal::request();\n }", "public static function current(Request $request = null)\n {\n if ($request !== null) {\n // Act as a setter\n Request::$initial = $request;\n }\n \n return Request::$current;\n }", "private function getCurrentPageParameter() {\n if (is_null($this->_currentPage)) {\n switch ($this->_mode) {\n case self::MODE_OFFSET :\n $this->setCurrentOffset(\n $this->papaya()->request->getParameter(\n (string)$this->_parameterName, 0, new PapayaFilterInteger(0)\n )\n );\n break;\n default :\n $this->setCurrentPage(\n $this->papaya()->request->getParameter(\n (string)$this->_parameterName, 1, new PapayaFilterInteger(1)\n )\n );\n break;\n }\n }\n return $this->_currentPage;\n }", "public function getCurrentPage() {\r\n\t\treturn $this->__currentPage;\r\n\t}", "private function getRequest()\n {\n if ($this->request === null) {\n $this->request = $this->container->get('request_stack')->getCurrentRequest();\n }\n return $this->request;\n }", "public function getCurrentPage()\n\t{\n\t\treturn $this->_currentPage;\n\t}", "public function getPagination()\n {\n return $this->get(self::pagination);\n }", "protected function paginationInformation($request)\n {\n $paginated = $this->resource->resource->toArray();\n\n $default = [\n 'links' => $this->paginationLinks($paginated),\n 'meta' => $this->meta($paginated),\n ];\n\n if (method_exists($this->resource, 'paginationInformation')) {\n return $this->resource->paginationInformation($request, $paginated, $default);\n }\n\n return $default;\n }", "public function getRequest() {\r\n\t\treturn $this->context->getState('request');\r\n\t}", "public function getCurrentPage()\n {\n return min($this->current_page, $this->getNumberOfTotalPages());\n }", "public function getCurrentPage() {\n $this->getCurrentPageParameter(TRUE);\n if (is_null($this->_lastPage)) {\n $this->calculate();\n }\n return $this->_currentPage;\n }", "public function getPager() \n {\n \n return ( isset ( $_REQUEST[\"{$this->_paginator}\"] ) ) \n ? (int) $_REQUEST[\"{$this->_paginator}\"] \n : 0 \n ; \n \n }", "function getCurrentPage() {\n return $this->current_page;\n }", "public function getCurrentPage()\n {\n return $this->_currentpage;\n }", "public function getRequest()\n {\n return $this->data->request;\n }", "public function getPage()\n {\n return $this->getParameter('page');\n }", "public function current()\n {\n return current($this->requests);\n }", "function getCurrentPage() { return $this->m_currentPage; }", "public function get_paginate(Request $request)\n {\n }", "public function getCurrentPage()\r\n\t{\r\n\t\treturn $this->current_page;\r\n\t}", "public function request()\n {\n return $this->context->getRequest();\n }", "public function getCurrentPage()\n {\n return $this->getData('current_page') ? $this->getData('current_page') : 1;\n }", "public function page() { return $this->paginating ? $this->page : 1; }", "public function getRequest() {\n return $this->request;\n }", "public function getCurrentPage() \n { \n\t/*\n $total_of_pages = $this->getTotalOfPages();\n $pager = $this->getPager();\n \n if ( isset( $pager ) && is_numeric( $pager ) ) { \n $currentPage = $pager; \n } else { \n $currentPage = 1; \n } \n\n if ( $currentPage > $total_of_pages ) { \n $currentPage = $total_of_pages; \n } \n\n if ($currentPage < 1) { \n $currentPage = 1; \n } \n\t\t*/\n \n\t\tif (empty($_GET['page'])){$currentPage = 1;}\n\t\t\telse {$currentPage = $_GET['page'];}\n return (int) $currentPage; \n \n }", "public function get_request()\n\t{\n\t\treturn $this->request;\n\t}", "public function get_request()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest() {\n\t\treturn $this->request;\n\t}", "public function get_pagination() {\n\t\treturn $this->pagination();\n\t}", "public function getRequest() {\n return $this->request;\n }", "public function getRequest()\n {\n return isset($this->request) ? $this->request : null;\n }", "protected function paginationInformation($request)\n {\n $paginated = $this->resource->resource->toArray();\n\n return [\n 'pagination' => $this->pagination($paginated),\n ];\n }", "protected function getRequest() {\n return $this->request;\n }", "public function getRequest() {\n return $this->_request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getRequest()\n {\n return $this->request;\n }", "public function getCurrentPage(): int\n {\n return $this->currentPage;\n }", "protected function getRequest()\n {\n return $this->request;\n }", "protected function getRequest()\n {\n return $this->request;\n }", "protected function getRequest()\n {\n return $this->request;\n }", "public function getPage() {\n if (isset($_REQUEST['page'])) {\n return $_REQUEST['page'];\n } else\n return 0;\n }", "function getRequest() {\n return $this->request;\n }", "public function getNextRequest()\n\t\t{\n\t\t\treturn $this->nextRequest;\n\t\t}", "public function getRequest()\n {\n return $this->_request;\n }", "public function getRequest()\n {\n return $this->_request;\n }", "public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }", "public function getRequest()\n {\n return $this->get('request');\n }" ]
[ "0.7708109", "0.73574805", "0.7309714", "0.72296107", "0.7107274", "0.7085283", "0.70560074", "0.7054881", "0.70429474", "0.70305866", "0.69261926", "0.68236226", "0.68142265", "0.6813787", "0.66460735", "0.66460735", "0.66460735", "0.6645666", "0.6625889", "0.66227686", "0.6615903", "0.65907806", "0.65840644", "0.65626985", "0.65515095", "0.65463114", "0.6543115", "0.65421754", "0.6540846", "0.6538854", "0.653841", "0.65180457", "0.6502177", "0.64960027", "0.6484139", "0.6479104", "0.6466711", "0.64589834", "0.64506215", "0.64295304", "0.6410725", "0.6408754", "0.6402179", "0.6392117", "0.63820916", "0.6379858", "0.6379858", "0.63762105", "0.6358455", "0.6338011", "0.63373864", "0.6321114", "0.6311798", "0.63019615", "0.63019615", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.6300352", "0.62951493", "0.6294424", "0.6277734", "0.6267252", "0.62642986", "0.6254376", "0.6252888", "0.62519836", "0.62519836", "0.62509185", "0.62458545", "0.62458545", "0.62458545", "0.62440145", "0.62410176", "0.6237985", "0.62333405", "0.62333405", "0.622951", "0.622951", "0.622951", "0.6226116", "0.6226116", "0.6226116" ]
0.70009696
10
Get the pagination columns map if set.
public function getColumnsMap(): PaginationColumns|null { return $this->columnsMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function columnMaps();", "function mappingColumns()\n {\n $mapped_columns = array(\n \"id\" => 0,\n \"url\" => 2,\n \"iframe\" => false,\n \"preview\" => false,\n \"thumbs\" => 1,\n \"title\" => 3,\n \"tags\" => 5,\n \"categories\" => 4,\n \"pornstars\" => 6,\n \"duration\" => 7,\n \"views\" => false,\n \"likes\" => false,\n \"unlikes\" => false,\n );\n\n return $mapped_columns;\n }", "public function columnMap()\n {\n return [\n 'imageid' => 'imageid',\n 'galleryid' => 'galleryid',\n 'visible' => 'visible'\n ];\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'users_id' => 'users_id',\n 'secret_key' => 'secret_key',\n 'hmac' => 'hmac',\n 'created' => 'created'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'level' => 'level',\n 'name' => 'name',\n 'sort' => 'sort',\n 'type' => 'type',\n 'value' => 'value',\n 'token' => 'token',\n 'pid' => 'pid'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'ragionesociale' => 'ragionesociale',\n 'indirizzo' => 'indirizzo',\n 'cap' => 'cap',\n 'citta' => 'citta',\n 'provincia' => 'provincia',\n 'telefono' => 'telefono',\n 'emailaziendale' => 'emailaziendale',\n 'piva' => 'piva',\n 'codfisc' => 'codfisc',\n 'pec' => 'pec',\n 'codicesdi' => 'codicesdi',\n 'referentenome' => 'referentenome',\n 'referentetelefono' => 'referentetelefono',\n 'referenteemail' => 'referenteemail',\n 'prodottiesposti' => 'prodottiesposti',\n 'fasciadiprezzo' => 'fasciadiprezzo',\n 'numerocoespositore' => 'numerocoespositore',\n 'nomecoespositore' => 'nomecoespositore',\n 'catalogonome' => 'catalogonome',\n 'catalogoindirizzo' => 'catalogoindirizzo',\n 'catalogocap' => 'catalogocap',\n 'catalogocitta' => 'catalogocitta',\n 'catalogoprovincia' => 'catalogoprovincia',\n 'catalogotelefono' => 'catalogotelefono',\n 'catalogoemail' => 'catalogoemail',\n 'catalogositoweb' => 'catalogositoweb',\n 'catalogofacebook' => 'catalogofacebook',\n 'catalogoinstagram' => 'catalogoinstagram',\n 'catalogotwitter' => 'catalogotwitter',\n 'catalogodescrizione' => 'catalogodescrizione'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'id_user' => 'id_user',\n 'ip' => 'ip',\n 'user_agent' => 'user_agent'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'user_id' => 'user_id',\n 'session_id' => 'session_id',\n 'goods_id' => 'goods_id',\n 'goods_sn' => 'goods_sn',\n 'goods_name' => 'goods_name',\n 'market_price' => 'market_price',\n 'goods_price' => 'goods_price',\n 'member_goods_price' => 'member_goods_price',\n 'goods_num' => 'goods_num',\n 'spec_key' => 'spec_key',\n 'spec_key_name' => 'spec_key_name',\n 'bar_code' => 'bar_code',\n 'selected' => 'selected',\n 'add_time' => 'add_time',\n 'prom_type' => 'prom_type',\n 'prom_id' => 'prom_id',\n 'sku' => 'sku'\n ];\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id', \n 'name' => 'name', \n 'class_name' => 'class_name', \n 'description' => 'description', \n 'logo' => 'logo',\n 'delsign' => 'delsign'\n );\n }", "public function columnMap()\n {\n return array(\n 'idconfig' => 'idconfig',\n 'ip' => 'ip',\n 'usuario' => 'usuario',\n 'senha' => 'senha',\n 'dominio' => 'dominio',\n 'criado' => 'criado',\n 'modificado' => 'modificado',\n 'classe_usuario' => 'classe_usuario'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'nickname' => 'nickname',\n 'realname' => 'realname',\n 'username' => 'username',\n 'openid' => 'openid',\n 'phone' => 'phone',\n 'passwd' => 'passwd',\n 'avatar' => 'avatar',\n 'sex' => 'sex',\n 'province' => 'province',\n 'city' => 'city',\n 'area' => 'area',\n 'address' => 'address',\n 'cardsn' => 'cardsn',\n 'recommend' => 'recommend',\n 'level' => 'level',\n 'groupid' => 'groupid',\n 'vip' => 'vip',\n 'add_at' => 'add_at',\n 'active' => 'active',\n 'integral' => 'integral',\n 'money' => 'money',\n 'update_at' => 'update_at'\n ];\n }", "public function columnMap()\n {\n return [\n 'id_categoria' => 'id_categoria',\n 'titulo' => 'titulo',\n 'descripcion' => 'descripcion'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'user_id' => 'user_id',\n 'create_time' => 'create_time',\n 'money' => 'money',\n 'bank_name' => 'bank_name',\n 'account_bank' => 'account_bank',\n 'account_name' => 'account_name',\n 'remark' => 'remark',\n 'status' => 'status'\n ];\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'username' => 'username',\n 'hash' => 'hash',\n 'email' => 'email',\n 'created' => 'created'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'parent_id' => 'parentId',\n 'name' => 'name',\n 'order' => 'order',\n 'store_id' => 'storeId',\n 'user_id' => 'userId',\n 'url' => 'url',\n 'depth' => 'depth',\n 'created_at' => 'createdAt',\n 'updated_at' => 'updatedAt',\n 'deleted_at' => 'deletedAt',\n 'is_deleted' => 'isDeleted'\n ];\n }", "public function columnMap()\n {\n return array(\n 'sess_id' => 'sess_id',\n 'created' => 'created',\n 'changed' => 'changed',\n 'ip' => 'ip',\n 'vars' => 'vars'\n );\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'title' => 'title',\n 'source_id' => 'source_id',\n 'abstract' => 'abstract',\n 'Personal_Author' => 'Personal_Author',\n 'Corporate_Author' => 'Corporate_Author',\n 'parent_literature' => 'parent_literature',\n 'conference_title' => 'conference_title',\n 'conference_date' => 'conference_date',\n 'conference_place' => 'conference_place',\n 'host_unit' => 'host_unit',\n 'keywords' => 'keywords',\n 'publishDate' => 'publishDate',\n 'file_id' => 'file_id'\n );\n }", "public function columnMap()\n {\n // the values their names in the application\n return array(\n 'id' => 'id',\n 'enabled' => 'enabled',\n 'suspended' => 'suspended',\n 'gender' => 'gender',\n 'info' => 'info',\n 'password' => 'password',\n 'roles' => 'roles',\n 'first_name' => 'firstName',\n 'last_name' => 'lastName',\n 'email' => 'email',\n 'created_at' => 'created_at',\n 'expires_at' => 'expires_at',\n );\n }", "public function columnMap()\n {\n return array(\n 'name' => 'name', \n 'description' => 'description', \n );\n }", "public function columnMap()\n {\n return [\n 'id_comentario' => 'id_comentario',\n 'comentario' => 'comentario',\n 'fecha_comentario' => 'fecha_comentario',\n 'id_reporte' => 'id_reporte',\n 'id_usuario' => 'id_usuario'\n ];\n }", "public function columnMap()\n {\n //the values their names in the application\n return array(\n 'id' => 'code' ,\n 'the_name' => 'theName' ,\n 'the_type' => 'theType' ,\n 'the_year' => 'theYear'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'name' => 'name',\n 'type' => 'type',\n 'expression' => 'expression',\n 'description' => 'description',\n 'start_time' => 'start_time',\n 'end_time' => 'end_time',\n 'is_close' => 'is_close',\n 'group' => 'group',\n 'prom_img' => 'prom_img',\n 'goods_ids' => 'goods_ids'\n ];\n }", "public function columnMap()\n {\n //the values their names in the application\n return array(\n 'id' => 'ID',\n 'item_id' => 'Item_ID',\n 'des' => 'Des',\n 'depts_id' => 'Depts_ID',\n 'application_id' => 'Application_ID',\n 'module_id' => 'Module_ID',\n );\n\n\n }", "public function columnMap()\n {\n return array(\n 'bank_id' => 'bank_id',\n 'title' => 'title',\n 'name' => 'name',\n 'shorten' => 'shorten',\n 'logo' => 'logo',\n 'home' => 'home',\n 'epay' => 'epay',\n 'bankcode' => 'bankcode',\n 'status' => 'status'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'purchase_invoices_id' => 'purchase_invoices_id',\n 'product_id' => 'product_id',\n 'quantity' => 'quantity',\n 'price' => 'price',\n 'total' => 'total',\n 'created_at' => 'created_at'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'pole_id' => 'pole_id',\n 'worker_id' => 'worker_id',\n 'notice' => 'notice'\n ];\n }", "protected function initializeColumnMapping() {\n\t\t// add always available cols for filemetadata\n\t\tforeach ($this->metaColMapping as $damColName => $metaColName) {\n\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t}\n\n\t\t// add additional cols if ext:for filemetadata is installed\n\t\tif (ExtensionManagementUtility::isLoaded('filemetadata')) {\n\t\t\tforeach ($this->additionalMetaColMapping as $damColName => $metaColName) {\n\t\t\t\t$this->columnMapping[$damColName] = $metaColName;\n\t\t\t}\n\t\t}\n\t}", "public function columnMap()\n {\n return array(\n 'id' => 'sfafba_id',\n\t\t\t'partner_id' => 'sfafba_partner_id',\n\t\t\t'name' => 'sfafba_name',\n\t\t\t'size' => 'sfafba_size',\n\t\t\t'lang' => 'sfafba_lang',\n\t\t\t'html_code' => 'sfafba_html_code',\n\t\t\t'keywords' => 'sfafba_keywords',\n\t\t\t'is_active' => 'sfafba_is_active',\n\t\t\t'created_at' => 'sfafba_created_at',\n\t\t\t'updated_at' => 'sfafba_updated_at'\n );\n }", "public function columnMap()\n {\n return array(\n 'cd_historico' => 'cd_historico',\n 'cd_template' => 'cd_template',\n 'cd_unidade' => 'cd_unidade',\n 'email' => 'email',\n 'status' => 'status',\n 'codigoMandrill' => 'codigoMandrill',\n 'motivoRejeicao' => 'motivoRejeicao',\n 'lido' => 'lido',\n 'clique' => 'clique',\n 'enviado' => 'enviado',\n 'modificado' => 'modificado'\n );\n }", "public function columnMap(){\n\t\treturn array(\n\t\t\t'id'=> 'id',\n\t\t\t'name'=> 'name',\n\t\t\t'content'=> 'content' \n\t\t);\n\t}", "public function paginate($perPage = null, $columns = ['*']);", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'area_name' => 'area_name',\n 'area_short_name' => 'area_short_name',\n 'area_parent_id' => 'area_parent_id',\n 'area_sort' => 'area_sort',\n 'area_deep' => 'area_deep',\n 'area_region' => 'area_region'\n ];\n }", "public function columnMap()\n {\n return array(\n 'idmov' => 'idmov',\n 'cd_unidade' => 'cd_unidade',\n 'usuario_responsavel' => 'usuario_responsavel',\n 'requerente' => 'requerente',\n 'cd_ordem_servico_reparo' => 'cd_ordem_servico_reparo',\n 'tipo' => 'tipo',\n 'obs' => 'obs',\n 'criado' => 'criado',\n 'centro_armazenagem_entrada' => 'centro_armazenagem_entrada',\n 'centro_armazenagem_saida' => 'centro_armazenagem_saida'\n );\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'producer_id' => 'producer_id',\n 'description_id' => 'description_id',\n 'product_detail_id' => 'product_detail_id',\n 'quantity' => 'quantity',\n 'import_price' => 'import_price',\n 'sale_price' => 'sale_price',\n 'discount' => 'discount',\n 'view' => 'view',\n 'hot' => 'hot',\n 'created_at' => 'created_at'\n ];\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'notice_id' => 'notice_id',\n 'worker_id' => 'worker_id'\n ];\n }", "public function columnMap()\n {\n return array(\n 'rec_id' => 'rec_id',\n 'user_id' => 'user_id',\n 'email' => 'email',\n 'link_man' => 'link_man',\n 'tel' => 'tel',\n 'goods_id' => 'goods_id',\n 'goods_desc' => 'goods_desc',\n 'goods_number' => 'goods_number',\n 'booking_time' => 'booking_time',\n 'is_dispose' => 'is_dispose',\n 'dispose_user' => 'dispose_user',\n 'dispose_time' => 'dispose_time',\n 'dispose_note' => 'dispose_note'\n );\n }", "public function columnMap()\n {\n return array(\n 'id' => 'id',\n 'classification_name' => 'classification_name'\n );\n }", "public function columnMap()\n {\n return array(\n 'mandatary_id' => 'mandatary_id',\n 'phone' => 'phone',\n 'real_name' => 'real_name',\n 'id_card' => 'id_card',\n 'id_card_image' => 'id_card_image',\n 'business_id' => 'business_id',\n 'status' => 'status',\n 'user_id' => 'user_id',\n 'update_time' => 'update_time'\n );\n }", "protected function getMappableColumns()\n {\n return $this->component->getLoader($this->gridField)\n ->getMappableColumns();\n }", "public function columnMap()\n {\n return array(\n 'diaMesAno' => 'diaMesAno'\n );\n }", "public function paginate($limit = null, $columns = ['*']);", "public function columnMap()\n {\n return [\n 'id_rol' => 'id_rol',\n 'rol' => 'rol'\n ];\n }", "public function columnMap()\n {\n return array(\n 'idprodutoArea' => 'idprodutoArea',\n 'cd_tabela' => 'cd_tabela',\n 'precoBase' => 'precoBase',\n 'produto_cd_produto' => 'produto_cd_produto',\n 'referencia' => 'referencia',\n 'area_cd_area' => 'area_cd_area',\n 'unidade_negocio_cd_unidade' => 'unidade_negocio_cd_unidade',\n 'markup_minimo' => 'markup_minimo',\n 'pedido_minimo' => 'pedido_minimo',\n 'aplicar_desconto_cliente' => 'aplicar_desconto_cliente',\n 'observacao' => 'observacao',\n 'old_id' => 'old_id'\n );\n }", "public function get_columns() {\n\t\t$columns = [\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'uri' => esc_html__( 'URI', 'rank-math' ),\n\t\t\t'referer' => esc_html__( 'Referer', 'rank-math' ),\n\t\t\t'user_agent' => esc_html__( 'User-Agent', 'rank-math' ),\n\t\t\t'times_accessed' => esc_html__( 'Hits', 'rank-math' ),\n\t\t\t'accessed' => esc_html__( 'Access Time', 'rank-math' ),\n\t\t];\n\n\t\tif ( 'simple' === Helper::get_settings( 'general.404_monitor_mode' ) ) {\n\t\t\tunset( $columns['referer'], $columns['user_agent'] );\n\t\t\treturn $columns;\n\t\t}\n\n\t\tunset( $columns['times_accessed'] );\n\t\treturn $columns;\n\t}", "public function getColumns($page)\n {\n switch ($page) {\n case 'index':\n return [\n ['class' => 'yii\\grid\\SerialColumn'],\n // 'id',\n 'label',\n // 'summary:ntext',\n // 'directions:ntext',\n 'published:boolean',\n 'position',\n ['class' => 'yii\\grid\\ActionColumn'],\n ];\n break;\n case 'view':\n return [\n 'id',\n 'label',\n [\n 'attribute' => 'summary',\n 'format' => 'html',\n ],\n [\n 'attribute' => 'directions',\n 'format' => 'html',\n ],\n 'published:boolean',\n 'position',\n ];\n break;\n }\n\n return [];\n }", "public function columnMap()\n {\n return array(\n 'cd_upload' => 'cd_upload',\n 'nome_original' => 'nome_original',\n 'nome_servidor' => 'nome_servidor',\n 'criacao' => 'criacao',\n 'cd_unidade' => 'cd_unidade'\n );\n }", "public function columnMap()\n {\n return array(\n 'cd_desconto' => 'cd_desconto',\n 'cd_caixa' => 'cd_caixa',\n 'cd_produto' => 'cd_produto',\n 'cd_unidade_negocio' => 'cd_unidade_negocio',\n 'cd_usuario_criacao' => 'cd_usuario_criacao',\n 'data_criacao' => 'data_criacao',\n 'percentual' => 'percentual',\n 'status' => 'status',\n 'tipo_desconto' => 'tipo_desconto'\n );\n }", "public function paginate( $perPage, array $columns = ['*'] );", "public function paginate($limit = null, $columns = ['*'], $method = \"paginate\");", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "public static function getColumns()\n {\n return array('title', 'bindingId', 'minYear', 'maxYear',\n 'preciseDate', 'placePublished', 'publisher', 'printVersion',\n 'firstPage', 'lastPage');\n }", "function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function columnMap()\n {\n return [\n 'id' => 'id',\n 'jobId' => 'jobId',\n 'workerPid' => 'workerPid',\n 'queueId' => 'queueId',\n 'userId' => 'userId',\n 'messageId' => 'messageId',\n 'categoryId' => 'categoryId',\n 'groupId' => 'groupId',\n 'emailId' => 'emailId',\n 'createAt' => 'createAt',\n 'modifyAt' => 'modifyAt',\n 'attempts' => 'attempts',\n 'errors' => 'errors',\n 'lock' => 'lock',\n 'status' => 'status'\n ];\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "protected function getParameterMap()\n {\n return $this->_parameterMap;\n }", "protected function getParameterMap()\n {\n return $this->_parameterMap;\n }", "protected function getParameterMap()\n {\n return $this->_parameterMap;\n }", "protected function getParameterMap()\n {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "public function getColumns() {\n $columns = array();\n foreach($this->mapping as $key => $value) {\n array_push($columns, $value);\n }\n return $columns;\n }", "public function columnMap()\n {\n return array(\n 'cd_item' => 'cd_item',\n 'Cd_produto' => 'Cd_produto',\n 'cd_etapa' => 'cd_etapa',\n 'descricao' => 'descricao',\n 'qtdAtendida' => 'qtdAtendida',\n 'qtdEstimada' => 'qtdEstimada'\n );\n }", "public function columnMap()\n {\n return array(\n 'bonus_id' => 'bonus_id',\n 'bonus_type_id' => 'bonus_type_id',\n 'bonus_sn' => 'bonus_sn',\n 'user_id' => 'user_id',\n 'used_time' => 'used_time',\n 'order_id' => 'order_id',\n 'emailed' => 'emailed'\n );\n }", "public function getColumns(){\n $url = $this->urlWrapper() . URLResources::COLUMN;\n return $this->makeRequest($url, \"GET\", 2);\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "protected function getParameterMap() {\n return $this->_parameterMap;\n }", "function _get_fields_map_simple() {\n\t\t$cache_name = \"fields_map_simple\";\n\t\t// Get from local cache\n\t\tif ($this->CACHE_IN_MEMORY && isset($this->$cache_name)) {\n\t\t\treturn $this->$cache_name;\n\t\t}\n\t\t// Create array of fields in tables\n\t\tif (main()->USE_SYSTEM_CACHE) {\n\t\t\t$db_cols = cache_get($cache_name);\n\t\t}\n\t\tif (empty($db_cols)) {\n\t\t\t$Q = db()->query(\"SHOW COLUMNS FROM \".db('user').\"\");\n\t\t\twhile ($A = db()->fetch_assoc($Q)) {\n\t\t\t\tif ($A[\"Field\"] == \"id\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\n\t\t\t\t$db_cols[$A[\"Field\"]] = $A[\"Field\"];\n\t\t\t}\n\t\t\tif (main()->USE_SYSTEM_CACHE) {\n\t\t\t\tcache_set($cache_name, $db_cols);\n\t\t\t}\n\t\t}\n\t\t// Put to local cache\n\t\tif ($this->CACHE_IN_MEMORY && !isset($this->$cache_name)) {\n\t\t\t$this->$cache_name\t= $db_cols;\n\t\t}\n\n\t\treturn $db_cols;\n\t}", "public function columnMap()\n {\n return array(\n 'cd_item' => 'cd_item',\n 'cd_nfservico' => 'cd_nfservico',\n 'num_item' => 'num_item',\n 'descricao' => 'descricao',\n 'qtde' => 'qtde',\n 'valor' => 'valor',\n 'desconto' => 'desconto',\n 'ind_mov' => 'ind_mov',\n 'cfop' => 'cfop',\n 'tipo_item' => 'tipo_item',\n 'unidadeMedida' => 'unidadeMedida',\n 'ncm' => 'ncm',\n 'cod_genero' => 'cod_genero',\n 'cod_servico' => 'cod_servico',\n 'cst_pis' => 'cst_pis',\n 'baseCalculoPis' => 'baseCalculoPis',\n 'aliquotaPis' => 'aliquotaPis',\n 'qtdeBaseCalculoPis' => 'qtdeBaseCalculoPis',\n 'aliquotaReaisPis' => 'aliquotaReaisPis',\n 'valorPis' => 'valorPis',\n 'cst_cofins' => 'cst_cofins',\n 'baseCalculoCofins' => 'baseCalculoCofins',\n 'aliquotaCofins' => 'aliquotaCofins',\n 'qtdeBaseCalculoCofins' => 'qtdeBaseCalculoCofins',\n 'aliquotaReaisCofins' => 'aliquotaReaisCofins',\n 'valorCofins' => 'valorCofins'\n );\n }", "public function getPerPage();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function get_page_permastruct()\n {\n }", "public function getColumnConfig();", "static function getColumns()\n {\n }", "public function get_pagination() {\n\t\treturn $this->pagination();\n\t}", "public function get_columns() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_columns();\n\n }", "public static function getColumns() {\n\t\tif (empty(self::$columns === false)) {\n\t\t\treturn self::$columns; \n\t\t}\n\t\t$columns = new WireData();\n\t\t$columns->tag = Document::aliasproperty('tag');\n\t\t$columns->reference1 = Document::aliasproperty('reference1');\n\t\t$columns->reference2 = Document::aliasproperty('reference2');\n\t\tself::$columns = $columns;\n\t\treturn self::$columns;\n\t}", "public function getColumns()\r\n {\r\n }", "static function get_column_info( $page = '' ) {\n\n\t\t$columns = array(\n\t\t\t'posts' => array(\n\t\t\t\t'author' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-posts-author',\n\t\t\t\t\t\t'title' => _x( 'Author', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'categories' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-posts-categories',\n\t\t\t\t\t\t'title' => _x( 'Categories', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'tags' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-posts-tags',\n\t\t\t\t\t\t'title' => _x( 'Tags', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'comments' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-posts-comments',\n\t\t\t\t\t\t'title' => _x( 'Comments', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'date' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-posts-date',\n\t\t\t\t\t\t'title' => _x( 'Date', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0\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'pages' => array(\n\t\t\t\t'author' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-pages-author',\n\t\t\t\t\t\t'title' => _x( 'Author', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'comments' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-pages-comments',\n\t\t\t\t\t\t'title' => _x( 'Comments', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'date' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-pages-date',\n\t\t\t\t\t\t'title' => _x( 'Date', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0\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'media' => array(\n\t\t\t\t'icon' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-media-icon',\n\t\t\t\t\t\t'title' => _x( 'File icon / thumbnail preview', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'author' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-media-author',\n\t\t\t\t\t\t'title' => _x( 'Author', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'parent' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-media-parent',\n\t\t\t\t\t\t'title' => _x( 'Uploaded to', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'comments' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-media-comments',\n\t\t\t\t\t\t'title' => _x( 'Comments', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'date' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-media-date',\n\t\t\t\t\t\t'title' => _x( 'Date', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0\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'users' => array(\n\t\t\t\t'username' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-users-username',\n\t\t\t\t\t\t'help' => __( 'The user\\'s username and avatar', 'clientside' ),\n\t\t\t\t\t\t'title' => __( 'Username' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author',\n\t\t\t\t\t\t\t'editor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0,\n\t\t\t\t\t\t\t'editor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-users-name',\n\t\t\t\t\t\t'title' => _x( 'Name', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'help' => __( 'The user\\'s full name', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author',\n\t\t\t\t\t\t\t'editor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0,\n\t\t\t\t\t\t\t'editor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'email' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-users-email',\n\t\t\t\t\t\t'title' => _x( 'E-mail', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author',\n\t\t\t\t\t\t\t'editor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0,\n\t\t\t\t\t\t\t'editor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'role' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-users-role',\n\t\t\t\t\t\t'title' => _x( 'Role', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author',\n\t\t\t\t\t\t\t'editor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0,\n\t\t\t\t\t\t\t'editor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'posts' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-users-posts',\n\t\t\t\t\t\t'title' => _x( 'Posts', 'Admin column title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'help' => __( 'The user\\'s post count', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'disabled-for' => array(\n\t\t\t\t\t\t\t'subscriber',\n\t\t\t\t\t\t\t'contributor',\n\t\t\t\t\t\t\t'author',\n\t\t\t\t\t\t\t'editor'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => array(\n\t\t\t\t\t\t\t'clientside-default' => 1,\n\t\t\t\t\t\t\t'subscriber' => 0,\n\t\t\t\t\t\t\t'contributor' => 0,\n\t\t\t\t\t\t\t'author' => 0,\n\t\t\t\t\t\t\t'editor' => 0\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// WooCommerce columns\n\t\tif ( class_exists( 'WooCommerce' ) ) {\n\t\t\t$columns['woocommerce-products'] = array(\n\t\t\t\t'thumb' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-thumb',\n\t\t\t\t\t\t'title' => __( 'Product image', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'name' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-name',\n\t\t\t\t\t\t'title' => __( 'Product title', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'sku' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-sku',\n\t\t\t\t\t\t'title' => __( 'SKU', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'is_in_stock' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-is_in_stock',\n\t\t\t\t\t\t'title' => __( 'Stock', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'price' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-price',\n\t\t\t\t\t\t'title' => __( 'Price', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'product_cat' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-product_cat',\n\t\t\t\t\t\t'title' => __( 'Categories', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'product_tag' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-product_tag',\n\t\t\t\t\t\t'title' => __( 'Tags', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'featured' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-featured',\n\t\t\t\t\t\t'title' => __( 'Featured product', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'product_type' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-product_type',\n\t\t\t\t\t\t'title' => __( 'Product type', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'date' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-products-date',\n\t\t\t\t\t\t'title' => __( 'Date', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['woocommerce-orders'] = array(\n\t\t\t\t'order_status' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-order_status',\n\t\t\t\t\t\t'title' => __( 'Order status', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'order_title' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-order_title',\n\t\t\t\t\t\t'title' => __( 'Order', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'order_items' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-order_items',\n\t\t\t\t\t\t'title' => __( 'Order items', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'billing_address' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-billing_address',\n\t\t\t\t\t\t'title' => __( 'Billing address', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'shipping_address' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-shipping_address',\n\t\t\t\t\t\t'title' => __( 'Shipping address', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'customer_message' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-customer_message',\n\t\t\t\t\t\t'title' => __( 'Customer message', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'order_notes' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-order_notes',\n\t\t\t\t\t\t'title' => __( 'Order notes', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'order_date' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-order_date',\n\t\t\t\t\t\t'title' => __( 'Order date', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'order_total' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-order_total',\n\t\t\t\t\t\t'title' => __( 'Order total', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'order_actions' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-orders-order_actions',\n\t\t\t\t\t\t'title' => __( 'Order actions', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['woocommerce-coupons'] = array(\n\t\t\t\t'coupon_code' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-coupons-coupon_code',\n\t\t\t\t\t\t'title' => __( 'Coupon code', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'type' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-coupons-type',\n\t\t\t\t\t\t'title' => __( 'Coupon type', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'amount' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-coupons-amount',\n\t\t\t\t\t\t'title' => __( 'Coupon value', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-coupons-description',\n\t\t\t\t\t\t'title' => __( 'Description', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'products' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-coupons-products',\n\t\t\t\t\t\t'title' => __( 'Product IDs', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'usage' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-coupons-usage',\n\t\t\t\t\t\t'title' => __( 'Usage / Limit', 'woocommerce' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t'expiry_date' => array(\n\t\t\t\t\t'field' => array(\n\t\t\t\t\t\t'name' => 'admin-column-manager-woocommerce-coupons-expiry_date',\n\t\t\t\t\t\t'title' => __( 'Expiry date', 'clientside' ),\n\t\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t\t'default' => 1\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t// Yoast columns\n\t\tif ( defined( 'WPSEO_FILE' ) ) {\n\n\t\t\t// Yoast: Posts\n\t\t\t$columns['posts']['wpseo-links'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-posts-wpseo-links',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Internal links', 'clientside' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['posts']['wpseo-score'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-posts-wpseo-score',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'SEO score', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['posts']['wpseo-score-readability'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-posts-wpseo-score-readability',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Readability score', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['posts']['wpseo-title'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-posts-wpseo-title',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'SEO Title', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['posts']['wpseo-metadesc'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-posts-wpseo-metadesc',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Meta Desc.', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['posts']['wpseo-focuskw'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-posts-wpseo-focuskw',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Focus KW', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['posts']['wpseo-links'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-posts-wpseo-links',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Internal links', 'clientside' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t// Yoast: Pages\n\t\t\t$columns['pages']['wpseo-links'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-pages-wpseo-links',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Internal links', 'clientside' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['pages']['wpseo-score'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-pages-wpseo-score',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'SEO score', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['pages']['wpseo-score-readability'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-pages-wpseo-score-readability',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Readability score', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['pages']['wpseo-title'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-pages-wpseo-title',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'SEO Title', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['pages']['wpseo-metadesc'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-pages-wpseo-metadesc',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Meta Desc.', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['pages']['wpseo-focuskw'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-pages-wpseo-focuskw',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Focus KW', 'wordpress-seo' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\t\t\t$columns['pages']['wpseo-links'] = array(\n\t\t\t\t'field' => array(\n\t\t\t\t\t'name' => 'admin-column-manager-pages-wpseo-links',\n\t\t\t\t\t'title' => sprintf( __( 'Yoast SEO: %s', 'clientside' ), __( 'Internal links', 'clientside' ) ),\n\t\t\t\t\t'secondary-title' => __( 'Enable for %s', 'clientside' ),\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'role-based' => true,\n\t\t\t\t\t'default' => 1\n\t\t\t\t)\n\t\t\t);\n\n\t\t}\n\n\t\t// Return\n\t\tif ( $page ) {\n\t\t\treturn isset( $columns[ $page ] ) ? $columns[ $page ] : array();\n\t\t}\n\t\treturn $columns;\n\n\t}", "public function getPaginated();", "public function columns()\n {\n return $this->get('columns', []);\n }", "function getPagingParameters()\n {\n }", "public function get_columns_information() {\n return $this->columns_information;\n }" ]
[ "0.65263075", "0.6346436", "0.6327529", "0.61343306", "0.61223966", "0.6075078", "0.6067894", "0.5973507", "0.59717077", "0.5965933", "0.59626806", "0.5959635", "0.5931301", "0.58776164", "0.5875707", "0.58456033", "0.58279276", "0.5825386", "0.58237946", "0.58132446", "0.5799056", "0.57680166", "0.57502425", "0.5734573", "0.57307416", "0.5727601", "0.57167506", "0.57017064", "0.5695804", "0.56908625", "0.5680094", "0.5675021", "0.567291", "0.56580377", "0.56498426", "0.56478024", "0.56383765", "0.56381196", "0.5632156", "0.5624485", "0.559497", "0.5594802", "0.5581457", "0.55811065", "0.55758464", "0.5573592", "0.556205", "0.5504558", "0.55022305", "0.54987574", "0.5495453", "0.54897875", "0.5489121", "0.5489121", "0.5489121", "0.5489121", "0.5487982", "0.5487755", "0.5487755", "0.5472163", "0.54662156", "0.5449317", "0.5449317", "0.5448121", "0.5448121", "0.5448121", "0.5448121", "0.5448121", "0.5448121", "0.5448121", "0.5448121", "0.5448121", "0.5446142", "0.54459465", "0.54330474", "0.54263836", "0.5398866", "0.5398866", "0.53975606", "0.5396026", "0.539282", "0.53927535", "0.53927535", "0.53927535", "0.53927535", "0.53927535", "0.53927535", "0.53927535", "0.53759193", "0.5363819", "0.53621805", "0.5331556", "0.5329862", "0.5304935", "0.53042966", "0.52841526", "0.5270838", "0.5269249", "0.52500445", "0.52457327" ]
0.8139857
0
Add a product from a requisition list to cart.
public function execute(CartInterface $cart, CartItemInterface $cartItem) { $product = $cartItem->getData('product'); $productOptions = $this->cartItemOptionProcessor->getBuyRequest($product->getTypeId(), $cartItem); $cart->addProduct($product, $productOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }", "public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}", "function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }", "public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }", "public function addProduct(Product $product, $quantity);", "private function add($product){\n $cart = ['qty'=>0,'price' => 0, 'product' => $product];\n if($this->items){\n if(array_key_exists($product->prod_id, $this->items)){\n $cart = $this->items[$product->prod_id];\n }\n }\n $cart['qty']++;\n $cart['price'] += $product->price;\n $this->items[$product->prod_id] = $cart;\n $this->totalQty++;\n $this->totalPrice += $product->price;\n }", "public function addAction() {\r\n $cart = $this->_getCart();\r\n $params = $this->getRequest()->getParams();\r\n try {\r\n if (isset($params['qty'])) {\r\n $filter = new Zend_Filter_LocalizedToNormalized(\r\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\r\n );\r\n $params['qty'] = $filter->filter($params['qty']);\r\n }\r\n\r\n $product = $this->_initProduct();\r\n $related = $this->getRequest()->getParam('related_product');\r\n\r\n /**\r\n * Check product availability\r\n */\r\n if (!$product) {\r\n $this->_goBack();\r\n return;\r\n }\r\n\r\n $cart->addProduct($product, $params);\r\n if (!empty($related)) {\r\n $cart->addProductsByIds(explode(',', $related));\r\n }\r\n\r\n $cart->save();\r\n\r\n $this->_getSession()->setCartWasUpdated(true);\r\n\r\n /**\r\n * @todo remove wishlist observer processAddToCart\r\n */\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\r\n );\r\n\r\n if (!$this->_getSession()->getNoCartRedirect(true)) {\r\n if (!$cart->getQuote()->getHasError()) {\r\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\r\n $this->_getSession()->addSuccess($message);\r\n }\r\n $this->_goBack();\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n\r\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\r\n $json_messages = array();\r\n foreach ($messages as $message) {\r\n $json_messages[] = Mage::helper('core')->escapeHtml($message);\r\n }\r\n\r\n $_response->setMessages($json_messages);\r\n\r\n $url = $this->_getSession()->getRedirectUrl(true);\r\n\r\n $_response->send();\r\n } catch (Exception $e) {\r\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\r\n Mage::logException($e);\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot add the item to shopping cart.'));\r\n $_response->send();\r\n }\r\n }", "function uc_order_edit_products_add($form, &$form_state) {\n $form_state['products_action'] = 'products_select';\n $form_state['refresh_products'] = TRUE;\n $form_state['rebuild'] = TRUE;\n $order = $form_state['build_info']['args'][0];\n\n $data = module_invoke_all('uc_add_to_cart_data', $form_state['values']['product_controls']);\n $product = uc_product_load_variant(intval($form_state['values']['product_controls']['nid']), $data);\n $product->qty = isset($form_state['values']['product_controls']['qty']) ? $form_state['values']['product_controls']['qty'] : $product->default_qty;\n\n drupal_alter('uc_order_product', $product, $order);\n uc_order_product_save($order->order_id, $product);\n $order->products[] = $product;\n\n uc_order_log_changes($order->order_id, array('add' => t('Added (@qty) @title to order.', array('@qty' => $product->qty, '@title' => $product->title))));\n\n // Decrement stock.\n if (module_exists('uc_stock')) {\n uc_stock_adjust_product_stock($product, 0, $order);\n }\n\n // Add this product to the form values for accurate tax calculations.\n $form_state['values']['products'][] = (array) $product;\n}", "public static function add($product)\n {\n session()->push('cart', $product);\n }", "public function add()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$parent_accessory_productid = $post['product_id'];\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$producthelper = new producthelper;\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call add method of modal to store product in cart session\n\t\t$userfiled = JRequest::getVar('userfiled');\n\n\t\tJPluginHelper::importPlugin('redshop_product');\n\t\t$dispatcher = JDispatcher::getInstance();\n\t\t$dispatcher->trigger('onBeforeAddProductToCart', array(&$post));\n\n\t\t$result = $this->_carthelper->addProductToCart($post);\n\n\t\tif (is_bool($result) && $result)\n\t\t{\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errmsg = ($result) ? $result : JText::_(\"COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART\");\n\n\t\t\tif (AJAX_CART_BOX == 1)\n\t\t\t{\n\t\t\t\techo \"`0`\" . $errmsg;\n\t\t\t\tdie();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);\n\n\t\t\t\tif (count($ItemData) > 0)\n\t\t\t\t{\n\t\t\t\t\t$prdItemid = $ItemData->id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$prdItemid = $redhelper->getItemid($post['product_id']);\n\t\t\t\t}\n\n\t\t\t\t$link = JRoute::_(\"index.php?option=\" . $option . \"&view=product&pid=\" . $post[\"product_id\"] . \"&Itemid=\" . $prdItemid, false);\n\t\t\t\t$app->Redirect($link, $errmsg);\n\t\t\t}\n\t\t}\n\n\t\t$session = JFactory::getSession();\n\t\t$cart = $session->get('cart');\n\n\t\tif (isset($cart['AccessoryAsProduct']))\n\t\t{\n\t\t\t$attArr = $cart['AccessoryAsProduct'];\n\n\t\t\tif (ACCESSORY_AS_PRODUCT_IN_CART_ENABLE)\n\t\t\t{\n\t\t\t\t$data['accessory_data'] = $attArr[0];\n\t\t\t\t$data['acc_quantity_data'] = $attArr[1];\n\t\t\t\t$data['acc_attribute_data'] = $attArr[2];\n\t\t\t\t$data['acc_property_data'] = $attArr[3];\n\t\t\t\t$data['acc_subproperty_data'] = $attArr[4];\n\n\t\t\t\tif (isset($data['accessory_data']) && ($data['accessory_data'] != \"\" && $data['accessory_data'] != 0))\n\t\t\t\t{\n\t\t\t\t\t$accessory_data = explode(\"@@\", $data['accessory_data']);\n\t\t\t\t\t$acc_quantity_data = explode(\"@@\", $data['acc_quantity_data']);\n\t\t\t\t\t$acc_attribute_data = explode(\"@@\", $data['acc_attribute_data']);\n\t\t\t\t\t$acc_property_data = explode(\"@@\", $data['acc_property_data']);\n\t\t\t\t\t$acc_subproperty_data = explode(\"@@\", $data['acc_subproperty_data']);\n\n\t\t\t\t\tfor ($i = 0; $i < count($accessory_data); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$accessory = $producthelper->getProductAccessory($accessory_data[$i]);\n\t\t\t\t\t\t$post = array();\n\t\t\t\t\t\t$post['parent_accessory_product_id'] = $parent_accessory_productid;\n\t\t\t\t\t\t$post['product_id'] = $accessory[0]->child_product_id;\n\t\t\t\t\t\t$post['quantity'] = $acc_quantity_data[$i];\n\t\t\t\t\t\t$post['category_id'] = 0;\n\t\t\t\t\t\t$post['sel_wrapper_id'] = 0;\n\t\t\t\t\t\t$post['attribute_data'] = $acc_attribute_data[$i];\n\t\t\t\t\t\t$post['property_data'] = $acc_property_data[$i];\n\t\t\t\t\t\t$post['subproperty_data'] = $acc_subproperty_data[$i];\n\n\t\t\t\t\t\t$result = $this->_carthelper->addProductToCart($post);\n\n\t\t\t\t\t\t$cart = $session->get('cart');\n\n\t\t\t\t\t\tif (is_bool($result) && $result)\n\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$errmsg = ($result) ? $result : JText::_(\"COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART\");\n\n\t\t\t\t\t\t\tif (JError::isError(JError::getError()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$error = JError::getError();\n\t\t\t\t\t\t\t\t$errmsg = $error->message;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (AJAX_CART_BOX == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo \"`0`\" . $errmsg;\n\t\t\t\t\t\t\t\tdie();\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$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);\n\n\t\t\t\t\t\t\t\tif (count($ItemData) > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prdItemid = $ItemData->id;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prdItemid = $redhelper->getItemid($post['product_id']);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$link = JRoute::_(\"index.php?option=\" . $option . \"&view=product&pid=\" . $post[\"product_id\"] . \"&Itemid=\" . $prdItemid, false);\n\t\t\t\t\t\t\t\t$app->Redirect($link, $errmsg);\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\n\t\t\tif (!DEFAULT_QUOTATION_MODE || (DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE))\n\t\t\t{\n\t\t\t\t$this->_carthelper->carttodb();\n\t\t\t}\n\n\t\t\t$this->_carthelper->cartFinalCalculation();\n\t\t\tunset($cart['AccessoryAsProduct']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!DEFAULT_QUOTATION_MODE || (DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE))\n\t\t\t{\n\t\t\t\t$this->_carthelper->carttodb();\n\t\t\t}\n\n\t\t\t$this->_carthelper->cartFinalCalculation();\n\t\t}\n\n\t\tif (!$userfiled)\n\t\t{\n\t\t\tif (AJAX_CART_BOX == 1 && isset($post['ajax_cart_box']))\n\t\t\t{\n\t\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&ajax_cart_box=' . $post['ajax_cart_box'] . '&tmpl=component&Itemid=' . $Itemid, false);\n\t\t\t\t$app->Redirect($link);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (ADDTOCART_BEHAVIOUR == 1)\n\t\t\t\t{\n\t\t\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t\t\t$app->Redirect($link);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$link = JRoute::_($_SERVER['HTTP_REFERER'], false);\n\n\t\t\t\t\tif ($cart['notice_message'] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg = $cart['notice_message'] . \"<br>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$msg .= JTEXT::_('COM_REDSHOP_PRODUCT_ADDED_TO_CART');\n\t\t\t\t\t$app->Redirect($link, $msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=product&pid=' . $post['p_id'] . '&Itemid=' . $Itemid, false);\n\t\t\t$app->Redirect($link);\n\t\t}\n\t}", "public function rapidAdd($id){\n $product=Products::find($id);\n $cart= Cart::add([\n'id'=>$product->id,\n'name'=>$product->pro_name,\n'qty'=>1,\n'price'=>$product->pro_price,\n ]);\n Cart::associate($cart->rowId, 'App\\Models\\Products');\nreturn redirect('/cart')->with('info', 'Product added in cart');\n }", "public function redq_add_to_cart()\n {\n wc_get_template('single-product/add-to-cart/redq_rental.php', $args = array(), $template_path = '', REDQ_PACKAGE_TEMPLATE_PATH);\n }", "public function add_to_cart(Request $request){\n $product = Product::find($request->input('product_id'));\n //On s'assure qu'il y'a bien un produit qui est retourne\n if($product){\n //On enregistre la session cart dans une variable\n $cart = $request->session()->get('cart');\n //On verifie si la cle du produit est deja dans les produits dans la session avant de l'ajouter\n if(!isset($cart['products'][$product->id])){\n //On prepare comment ajouter le produit dans les sessions. Chaque produit dans la sessoin set enregistre dans une cle cart. cette cle contient un\n $cart['products'][$product->id] = ['name' => $product->name, 'price' => $product->price, 'quantite' => 1, \"total\" => $product->price];\n //On ajoute la variable $cart dans les sessions\n $request->session()->put('cart',$cart);\n }\n }\n return response()->json(['success' => true,], 200);\n }", "public function addAction()\n {\n /** @var $session */\n $session = $this->get('session');\n\n $cart = $session->get('cart');\n\n $productID = $_POST['product_id'];\n $quantity = $_POST['quantity'];\n\n // First addition to the shopping cart\n if (empty($cart)) {\n $cart[] = array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n } else {\n $existingItem = false;\n\n foreach ($cart as &$cartItem) {\n // If product already exists in cart\n if ($cartItem['product_id'] == $productID) {\n $existingItem= true;\n\n // add to existing quantity\n $cartItem['quantity'] += $quantity;\n }\n }\n\n // if brand new item\n if ($existingItem == false) {\n $cart[]= array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n }\n }\n\n $session->set('cart', $cart);\n\n\n return new RedirectResponse('/cart');\n }", "public function add(ProductInterface $product, $quantity = 1);", "public function add_to_cart() {\n if ( ! is_single() ) {\n return;\n }\n\n global $product;\n\n WC_Gokeep_JS::get_instance()->add_to_cart( $product , '.single_add_to_cart_button' );\n }", "public function add() {\n\t\t$this->load->language('checkout/cart');\n\n\t\t$json = array();\n\n\t\tif (isset($this->request->post['product_id'])) {\n\t\t\t$product_id = (int)$this->request->post['product_id'];\n\t\t} else {\n\t\t\t$product_id = 0;\n\t\t}\n\n\t\t$this->load->model('catalog/product');\n\n\t\t$product_info = $this->model_catalog_product->getProduct($product_id);\n\n\t\tif ($product_info) {\n\t\t\tif (isset($this->request->post['quantity']) && ((int)$this->request->post['quantity'] >= $product_info['minimum'])) {\n\t\t\t\t$quantity = (int)$this->request->post['quantity'];\n\t\t\t} else {\n\t\t\t\t$quantity = $product_info['minimum'] ? $product_info['minimum'] : 1;\n\t\t\t}\n\t\t\tif (isset($this->request->post['option'])) {\n\t\t\t\t$option = array_filter($this->request->post['option']);\n\t\t\t} else {\n\t\t\t\t$option = array();\n\t\t\t}\n\n\t\t\t$product_options = $this->model_catalog_product->getProductOptions($this->request->post['product_id']);\n\n\t\t\tforeach ($product_options as $product_option) {\n\t\t\t\tif ($product_option['required'] && empty($option[$product_option['product_option_id']])) {\n\t\t\t\t\t$json['error']['option'][$product_option['product_option_id']] = sprintf($this->language->get('error_required'), $product_option['name']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($this->request->post['recurring_id'])) {\n\t\t\t\t$recurring_id = $this->request->post['recurring_id'];\n\t\t\t} else {\n\t\t\t\t$recurring_id = 0;\n\t\t\t}\n\n\t\t\t$recurrings = $this->model_catalog_product->getProfiles($product_info['product_id']);\n\n\t\t\tif ($recurrings) {\n\t\t\t\t$recurring_ids = array();\n\n\t\t\t\tforeach ($recurrings as $recurring) {\n\t\t\t\t\t$recurring_ids[] = $recurring['recurring_id'];\n\t\t\t\t}\n\n\t\t\t\tif (!in_array($recurring_id, $recurring_ids)) {\n\t\t\t\t\t$json['error']['recurring'] = $this->language->get('error_recurring_required');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$json) {\n\t\t\t\tif(isset($this->session->data['cart'])) {\n$oldCart = $this->session->data['cart']; \n}\n$this->cart->add($this->request->post['product_id'], $quantity, $option, $recurring_id);\n\t\t\t\t/*\n\t\t\t\t // BOF - Betaout Opencart mod\n $this->load->model('tool/betaout');\n //$this->model_tool_betaout->track();\n $this->model_tool_betaout->trackEcommerceCartUpdate();\n // EOF - Betaout Opencart mod\n\t\t\t\t*/\n\n\t\t\t\t$json['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']), $product_info['name'], $this->url->link('checkout/cart'));\n\n$this->load->model('setting/setting');\n$giftTeaser = $this->model_setting_setting->getSetting('giftteaser', $this->config->get('config_store_id'));\nif (empty($giftTeaser['giftteaser']['Enabled']) || $giftTeaser['giftteaser']['Enabled'] == 'no') { } else {\n$this->load->language('extension/module/giftteaser');\n$addition = '';\nforeach ($this->cart->getProducts() as $key => $val) {\nif (!empty($val['gift_teaser']) && $val['gift_teaser']==true ) {\nif (!isset($this->session->data['success_addition'])) {\n$addition = $this->language->get('gift_added_to_cart');\n}\n}\n}\t\n$json['success'] .= $addition;\t\n}\n\n$this->register_abandonedCarts();\n\t\t\t\t// Unset all shipping and payment methods\n\t\t\t\tunset($this->session->data['shipping_method']);\n\t\t\t\tunset($this->session->data['shipping_methods']);\n\t\t\t\tunset($this->session->data['payment_method']);\n\t\t\t\tunset($this->session->data['payment_methods']);\n\n\t\t\t\t// Totals\n\t\t\t\t$this->load->model('extension/extension');\n\n\t\t\t\t$totals = array();\n\t\t\t\t$taxes = $this->cart->getTaxes();\n\t\t\t\t$total = 0;\n\t\t\n\t\t\t\t// Because __call can not keep var references so we put them into an array. \t\t\t\n\t\t\t\t$total_data = array(\n\t\t\t\t\t'totals' => &$totals,\n\t\t\t\t\t'taxes' => &$taxes,\n\t\t\t\t\t'total' => &$total\n\t\t\t\t);\n\n\t\t\t\t// Display prices\n\t\t\t\tif ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {\n\t\t\t\t\t$sort_order = array();\n\n\t\t\t\t\t$results = $this->model_extension_extension->getExtensions('total');\n\n\t\t\t\t\tforeach ($results as $key => $value) {\n\t\t\t\t\t\t$sort_order[$key] = $this->config->get($value['code'] . '_sort_order');\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_multisort($sort_order, SORT_ASC, $results);\n\n\t\t\t\t\tforeach ($results as $result) {\n\t\t\t\t\t\tif ($this->config->get($result['code'] . '_status')) {\n\t\t\t\t\t\t\t$this->load->model('extension/total/' . $result['code']);\n\n\t\t\t\t\t\t\t// We have to put the totals in an array so that they pass by reference.\n\t\t\t\t\t\t\t$this->{'model_extension_total_' . $result['code']}->getTotal($total_data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$sort_order = array();\n\n\t\t\t\t\tforeach ($totals as $key => $value) {\n\t\t\t\t\t\t$sort_order[$key] = $value['sort_order'];\n\t\t\t\t\t}\n\n\t\t\t\t\tarray_multisort($sort_order, SORT_ASC, $totals);\n\t\t\t\t}\n\n\t\t\t\t$json['total'] = sprintf($this->language->get('text_items'), $this->cart->countProducts() + (isset($this->session->data['vouchers']) ? count($this->session->data['vouchers']) : 0), $this->currency->format($total, $this->session->data['currency']));\n\t\t\t} else {\n\t\t\t\t$json['redirect'] = str_replace('&amp;', '&', $this->url->link('product/product', 'product_id=' . $this->request->post['product_id']));\n\t\t\t}\n\t\t}\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}", "public function addProduct($product)\n {\n \n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if(is_null($cart))\n {\n $this->product()->save($product);\n }\n else\n {\n\n $quantity = $cart->pivot->quantity;\n\n $quantity++;\n\n $cart->pivot->update(compact('quantity'));\n }\n\n }", "public function add($product, $quantity = 1)\n\t{\n\t\t$item = [\n\t\t\t'id' => $product->id,\n\t\t\t'name' => $product->name,\n\t\t\t'price' => ($product->promotionprice != 0) ? $product->promotionprice : $product->unitprice,\n\t\t\t'image' => $product->image,\n\t\t\t'quantity' => $quantity,\n\t\t];\n\n\t\tif(isset($this->items[$product->id])){\n\t\t\t$this->items[$product->id]['quantity'] += $quantity;\n\t\t}else{\n\t\t\t$this->items[$product->id] = $item;\n\t\t}\n\t\t\n\t\tsession(['cart' => $this->items]);\n\t\t//dd($this->items);\n\t}", "private function addProduct($product) \r\n\t{\r\n\t\t$this->newProducts[] = $product;\r\n\t}", "function addToCart($proID){\n $product = $this->product->getRows($proID);\n \n // Add product to the cart\n $data = array(\n 'id' => $product['pro_id'],\n 'qty' => 1,\n 'price' => $product['price'],\n 'name' => $product[\"name\"],\n 'image' => $product['image']\n );\n $this->cart->insert($data);\n \n // Redirect to the cart page\n redirect(base_url().'index.php/CCart');\n }", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function addToCart($product, $qtt){\n $this->lines[] = [\"product\" => $product, \"qtt\" => $qtt];\n }", "public function add($product, $quantity)\n {\n $this->loadItems();\n if (isset($this->items[$product->{$this->params['productFieldId']}])) {\n $this->plus($product->{$this->params['productFieldId']}, $quantity);\n } else {\n $this->items[$product->{$this->params['productFieldId']}] = new CartItem($product, $quantity,\n $this->params);\n ksort($this->items, SORT_NUMERIC);\n $this->saveItems();\n }\n }", "function AddToCart($token, $product_name, $product_id, $purchased_amount)\n {\n $order_number = $this->GetOrderNumber();\n $id = $this->GetUserId($token);\n // die();\n $order_number = md5($order_number . $id);\n $this->AddOrdertoCart($id, $order_number);\n $product_data = $this->CheckProductAvailability($product_name, $product_id, $purchased_amount);\n $product_remain = $product_data[0];\n $product_id = $product_data[1];\n if ($product_remain > -1) {\n $this->AddProducttoCart($order_number, $product_id, $purchased_amount, $product_remain, $token);\n } else {\n echo \" Required product is not available!\";\n }\n }", "function addToCart(){\n\t\tif(!isset($_POST['id'])) header(sprintf(\"Location: %s\", $this->Files['Cart']));\n\t\t// ---------- These are our posted variables --------------\t\t\n\t\t$TmpCart=array();\n\t\t$TmpCart['type'] \t= 1;\n\t\t$TmpCart['name'] \t= clean_variable($_POST['name'],true);\n\t\t$TmpCart['id']\t \t= clean_variable($_POST['id'],true);\n\t\t$TmpCart['qty'] \t= (is_int($_POST['qty']) && isset($_POST['qty']))?clean_variable($_POST['qty'],true):'1';\n\t\t$TmpCart['price'] = clean_variable($_POST['price'],true);\n\t\t\n\t\t// Process Products Specs and Attributes\n\t\t$SPC = \t\t\t(isset($_POST['spec'])) ? \n\t\t\t\t\t\t\t\t\t((!is_array($_POST['spec'])) ? array( $_POST['spec'] ) : $_POST['spec']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SPC)) foreach($SPC as &$v) clean_variable($v,true);\n\t\t\n\t\t$TmpStrg = '';\n\t\tif(count($SPC) > 0){ /* // Check the Specs of the product and get the price for that spec. If differant use that price\n\t\t\tforeach($SPC as $k => $v){ \n\t\t\t\t$getSpecs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getSpecs->mysql(\"SELECT `att_price`, `att_sale`, `att_sale_exp` FROM `prod_link_prod_att` WHERE `att_id` = '$v' AND `prod_id` = '\".$TmpCart['id'].\"';\");\n\t\t\t\t$getSpecs->mssql(\"SELECT att_price, att_sale, att_sale_exp FROM prod_link_prod_att WHERE att_id = '$v' AND prod_id = '\".$TmpCart['id'].\"';\");\n\t\t\t\t$getSpecs = $getSpecs->Rows();\n\t\t\t\tif($getSpecs[0]['att_price'] > 0){\n\t\t\t\t\t$attSaleExp = ereg('[^A-Za-z0-9]', $getSpecs[0]['att_sale_exp']);\n\t\t\t\t\tif($attSaleExp == \"00000000000000\") $attprices += $getSpecs[0]['att_price'];\n\t\t\t\t\telse if ($attSaleExp > date(\"YmdHis\")) $attprices += $getSpecs[0]['att_sale'];\n\t\t\t\t\telse $attprices += $getSpecs[0]['att_price'];\n\t\t\t\t} else { $attprices = 0; }\n\t\t\t\t$TmpStrg .= ($TmpStrg == \"\") ? ($v.\".\".$attprices) : (\":\".$v.\".\".$attprices);\n\t\t\t} */\n\t\t}\n\t\t$TmpCart['spec'] = $TmpStrg;\n\t\t\n\t\t// Process Products Special Options\n\t\t$SPCL = \t\t(isset($_POST['special'])) ?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['special'])) ? array( $_POST['special'] ) : $_POST['special']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SPCL)) foreach($SPCL as &$v) clean_variable($v,true);\n\t\t$TmpCart['special'] = (is_array($SPCL) && count($SPCL) > 0) ? implode(\":\",$SPCL) : $SPCL;\n\t\t\n\t\t\n\t\t$SLCT = \t\t(isset($_POST['selections'])) ?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['selections'])) ? array( $_POST['selections'] ) : $_POST['selections']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SLCT)) foreach($SLCT as &$v) clean_variable($v,true);\n\t\t$TmpCart['selections'] = (is_array($SLCT) && count($SLCT) > 0) ? implode(\":\",$SLCT) : $SLCT;\n\t\t\n\t\t// Process Products Messages and Comments, mainly used for gift cards\n\t\t$MSG = \t\t\t(isset($_POST['message'])) \t\t\t? clean_variable($_POST['message'],true):'';\n\t\t$MSGTo = \t\t(isset($_POST['message_to'])) \t? clean_variable($_POST['message_to'],true):'';\n\t\t$MSGFrm = \t(isset($_POST['message_from'])) ? clean_variable($_POST['message_from'],true):'';\n\t\t\n\t\t$MSGEng = \t(isset($_POST['message']))?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['engraving']))? array( $_POST['engraving'] ) : $_POST['engraving'] ):\n\t\t\t\t\t\t\t\t'';\n\t\tif(is_array($MSGEng)) foreach($MSGEng as &$v) clean_variable($v,true);\n\t\t/*\n\t\t$getMsgs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t$getMsgs->mysql(\"SELECT `prod_msg_type` FROM `prod_products` WHERE `prod_id` = '\".$TmpCart['id'].\"';\");\n\t\t$getMsgs->mssql(\"SELECT prod_msg_type FROM prod_products WHERE prod_id = '\".$TmpCart['id'].\"';\");\n\t\t$getMsgs = $getMsgs->Rows();\n\t\t$Msgs = $getMsgs[0]['prod_msg_type'];\n\t\t*/\n\t\t$Msgs='';\n\t\tif(strlen(trim($Msgs)) > 0) $Msgs = unserialize(urldecode($Msgs));\n\t\telse $Msgs = array(); $Tarray = array();\n\t\tif(count($Msgs) > 0){\n\t\t\tforeach($Msgs as $k => $v){\n\t\t\t\tswitch($k){\n\t\t\t\t\tcase \"Cmnts\": if(strlen(trim($MSG)) > 0) $Tarray['Cmnts'][0] = $MSG; break; // Straight Comment for the Product\n\t\t\t\t\tcase \"ToFrm\":\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// To From comments for Gift Cards Ect.\n\t\t\t\t\t\tif(strlen(trim($MSGTo)) > 0){\n\t\t\t\t\t\t\t$Tarray['ToFrm'][0] = $MSGTo;\n\t\t\t\t\t\t\t$Tarray['ToFrm'][1] = $MSGFrm;\n\t\t\t\t\t\t} break;\n\t\t\t\t\tcase \"Engv\":\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Engravings for the product allows for multiple lines\n\t\t\t\t\t\tif(intval($v)>1){ if(strlen(trim($MSGEng)) > 0) $Tarray['Engv'][0] = $MSGEng;\n\t\t\t\t\t\t} else { $n=0; foreach($MSGEng as $v){\n\t\t\t\t\t\t\t\tif(strlen(trim($v)) > 0) $Tarray['Engv'][$n] = $v; $n++;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t} break;\n\t\t\t\t}\n\t\t\t} $TmpCart['msgs'] = $Tarray;\n\t\t} else { $TmpCart['msgs'] = 0; }\n\t\t\n\t\t$TmpCart['attnd']\t= \t(isset($_POST['attendee']))? array(clean_variable($_POST['attendee'],true)) : array(0);\n\t\t\n\t\t$this->updateCart($TmpCart); // Update our cart with our new information\n\t\t\n\t\theader(sprintf(\"Location: %s\", $this->Files['Cart'] )); // Go to page to dispaly Cart -- Do this to prevent double insertion of product via refresh button\n\t}", "public function testAddProductToCart()\n {\n $this->browse(function (Browser $browser) {\n // Home Page\n $browser->visit(new HomePage);\n\n // Get Collection Name\n $collectionName = $browser->text('.thumbnail .caption a');\n\n // Products Page\n $browser->clickLink($collectionName)\n ->assertSee($collectionName);\n\n // Get Product Name\n $productName = $browser->text('.thumbnail .caption a');\n\n $browser->clickLink($productName)\n // Product Page\n ->assertSee($productName)\n ->press('Add To Cart')\n ->assertSee('Product has been added to your cart.')\n // Cart Page\n ->visit('/cart')\n ->assertSee($productName);\n });\n }", "public function addProduct(Product $product): CurrentCart;", "public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }", "public function add_to_cart($params) {\n if ($params[0]) {\n $_REQUEST['id_item'] = $params[0];\n $_REQUEST['quantity'] = 1;\n }\n\n $hash = self::getHash();\n $cart = $this->NeoCartModel->getCart($hash);\n\n //hai sa bagam produsul in shopping cart\n $this->NeoCartModel->addToCart($_REQUEST, $cart);\n\n controller::set_alert_message(\"<br/>Produsul a fost adaugat in cos\");\n header(\"Location: \" . $this->getRefPage());\n exit();\n }", "function add_product($voucher_id, $prod_id, $seq=NULL)\n\t{\n\t\t// get the next seq\n\t\tif(is_null($seq))\n\t\t{\n\t\t\t$seq = $this->get_next_sequence($voucher_id);\n\t\t}\n\t\t\t\n\t\t\t\n\t\t$this->db->insert('vouchers_products', array('voucher_id'=>$voucher_id, 'product_id'=>$prod_id, 'sequence'=>$seq));\t\n\t}", "public function addItem($id){\n \t$product = Product::findOrFail($id);\n \tCart::add($id, $product->product_name, 1, $product->product_price, 550, ['img'=>$product->image, \"stock\" => $product->stock]);\n \treturn back();\n }", "public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}", "public function add()\n {\n // get request\n $request = $this->getRequest()->request;\n // get product ID from request\n $product_id = $request['a'];\n // get product ids from session\n $compareProducts = $this->View()->getSession('compare')?$this->View()->getSession('compare'):array();\n\n if (!in_array($product_id, $compareProducts)) {\n $compareProducts[] = $product_id;\n }\n // set products to session\n $this->View()->setSession('compare', $compareProducts);\n\n // for ajax request\n if ($request['XHR']) {\n die(json_encode([\n 'success' => true,\n 'message' => $this->View()->translating('compare_item_set'),\n 'count' => count($compareProducts),\n ]));\n }\n\n Router::redirect('compare');\n }", "public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }", "public function store(Request $request)\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n\n if(empty($cart)) {\n $order = new Order;\n $order->user_id = $user->id;\n $order->status_id = 1;\n $order->save();\n\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $order->id;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n } else {\n // if you already have this product in your cart just add the next quantity to the same line item\n if (OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->exists() ){\n $repeatOrderProduct = OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->first();\n $orderProduct = OrderProduct::find($repeatOrderProduct->id);\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity + $orderProduct->quantity;\n $orderProduct->save();\n }\n // else make a new line item for this new item\n else {\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $cart;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n }\n }\n\n Activity::log('Saved an item to their cart.', $user->id);\n\n $request->session()->flash('status', 'Product was saved to cart.');\n\n return Redirect::action('CartController@index');\n\n }", "function old_pushCart($product_id,$quantity,$transport) \n {\n $conn=connect();\n $query= \"INSERT INTO shopping_cart(user_id,delivery,product_id,quantity) VALUES (\".$this->user_id.\",\".$transport.\",\".$product_id.\",\".$quantity.\")\"; //obtain information about a product\n if($results = mysqli_query($conn, $query)) //to add to the cart\n {\n $last_id =mysqli_insert_id($conn);\n $this->cart->addProduct($last_id, $product_id,$transport,$quantity);\n }\n mysqli_close($conn);\n \n \n }", "public function addselectedtocartAction() {\n $messages = array();\n $urls = array();\n $wishlistIds = array();\n $notSalableNames = array(); // Out of stock products message\n\n\t\t$ids = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('ids'));\n\t\t$qtys = Mage::helper('core')->htmlEscape($this->getRequest()->getParam('qtys'));\n\t\t\n\t\t$ids_arr = explode(',', $ids);\n\t\t$qtys_arr = explode(',', $qtys);\n\t\t\n\t\t$i=0;\n\t\tforeach($ids_arr as $id)\n\t\t{\n\t\t\t$id = intval($id);\n\t\t\t$qty = intval($qtys_arr[$i]);\n\t\t\tif($id != '' && $qty != '')\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\t$product = Mage::getModel('catalog/product')\n\t\t\t\t\t\t->load($id)\n\t\t\t\t\t\t->setQty($qty);\n\t\t\t\t\tif ($product->isSalable()) {\n\t\t\t\t\t\tMage::getSingleton('checkout/cart')->addProduct($product,$qty);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$notSalableNames[] = $product->getName();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(Exception $e)\n\t\t\t\t{\n\t\t\t\t\t$url = Mage::getSingleton('checkout/session')->getRedirectUrl(true);\n\t\t\t\t\tif ($url)\n\t\t\t\t\t{\n\t\t\t\t\t\t$url = Mage::getModel('core/url')\n\t\t\t\t\t\t\t->getUrl('catalog/product/view', array(\n\t\t\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t\t\t'wishlist_next' => 1\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t$urls[] = $url;\n\t\t\t\t\t\t$messages[] = $e->getMessage();\n\t\t\t\t\t\t$wishlistIds[] = $id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//$item->delete();\n\t\t\t\t\t}\n\t\t\t\t}\n }\n\t\t\t$i++;\n\t\t}\n\t\tMage::getSingleton('checkout/cart')->save();\n\n if (count($notSalableNames) > 0) {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Following product(s) is currently out of stock:'));\n array_map(array(Mage::getSingleton('checkout/session'), 'addNotice'), $notSalableNames);\n }\n\n if ($urls) {\n Mage::getSingleton('checkout/session')->addError(array_shift($messages));\n $this->getResponse()->setRedirect(array_shift($urls));\n\n Mage::getSingleton('checkout/session')->setWishlistPendingUrls($urls);\n Mage::getSingleton('checkout/session')->setWishlistPendingMessages($messages);\n Mage::getSingleton('checkout/session')->setWishlistIds($wishlistIds);\n }\n else {\n Mage::getSingleton('checkout/session')\n ->addNotice($this->__('Product(s) Added successfully'));\n $this->_redirect('wishlist/index');\n }\n }", "function add($product_id)\n\t{\n\t\t$product = $this->database->getProductbyId($product_id);\n\n\t\tif($product)\n\t\t{\n\t\t\t$this->_add_to_cart($product);\n\t\t}\n\t\t\n\t\t$this->_show_add_to_cart_comment($product['add_to_cart_comment']);\n\t\t\n\t\tredirect('cart');\n\t}", "public static function addItem($id_product, $id_item, $qty)\n {\n }", "public function add($product_id)\n {\n $product = Product::find($product_id);\n if(!$product)\n {\n abort(404);\n }\n Cart::associate('Product','App\\Models')->add($product_id, $product->name, 1, $product->price);\n return redirect()->route('cart.index');\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function addProduct($productInfo, $quantity, $request)\n { \n if (empty($this->cart[$productInfo->id])) {\n $product = ['product_id' => $productInfo->id, 'quantity' => $quantity, 'product_name' => $productInfo->product_name, 'product_desc' => $productInfo->product_description, 'product_price' => $productInfo->product_price];\n $this->cart[$productInfo->id] = $product;\n } else {\n $this->addProductCount($productInfo->id, $quantity);\n }\n\n $this->saveCart($request);\n }", "public function add_to_cart_quote($quote_request_id)\n {\n $this->load->model('bidding_model');\n $quote_request = $this->bidding_model->get_quote_request($quote_request_id);\n\n if (!empty($quote_request)) {\n $product = $this->product_model->get_product_by_id($quote_request->product_id);\n if (!empty($product)) {\n $cart = $this->session_cart_items;\n $item = new stdClass();\n $item->cart_item_id = generate_unique_id();\n $item->product_id = $product->id;\n $item->product_type = $product->product_type;\n $item->product_title = $quote_request->product_title;\n $item->options_array = array();\n $item->quantity = $quote_request->product_quantity;\n $item->unit_price = $quote_request->price_offered / $quote_request->product_quantity;\n $item->total_price = $quote_request->price_offered;\n $item->currency = $quote_request->price_currency;\n $item->product_vat = 0;\n $item->shipping_cost = $quote_request->shipping_cost;\n $item->is_stock_available = 1;\n $item->purchase_type = 'bidding';\n $item->quote_request_id = $quote_request->id;\n array_push($cart, $item);\n\n $this->session->set_userdata('mds_shopping_cart', $cart);\n return true;\n }\n }\n return false;\n }", "public function actionAddProductList()\n {\n\n $order_id = Yii::app()->request->getQuery('id');\n $model = $this->_loadModel($order_id);\n if ($order_id) {\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/update', 'id' => $order_id));\n }\n }\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/index'));\n }\n\n $dataProvider = new ShopProduct('search');\n\n if (isset($_GET['ShopProduct']))\n $dataProvider->attributes = $_GET['ShopProduct'];\n\n $this->renderPartial('_addProduct', array(\n 'dataProvider' => $dataProvider,\n 'order_id' => $order_id,\n 'model' => $model,\n ));\n }", "public function add_item($data)\n {\n $required = array(\n 'id' => 'Product id not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n $cart = $this->getService()->getSessionCart();\n\n $product = $this->di['db']->getExistingModelById('Product', $data['id'], 'Product not found');\n\n //reset cart by default\n if (!isset($data['multiple']) || !$data['multiple']) {\n $this->reset();\n }\n\n return $this->getService()->addItem($cart, $product, $data);\n }", "public function addProduct($prod) {\n\t\t\t$this->products[$this->pid] = $prod;\n\t\t\t$this->pid ++;\n\t\t}", "public function addToCart($prod_id){\n\t\t$product = Product::find($prod_id);\n $this->cartConstruct();\n $this->add($product);\n Session::put('cart',$this);\n return redirect()->route('cart');\n\t}", "public function add(Product $product) {\n\t\t$this->products[] = $product;\n\t}", "public function addProduct($coupon_id, $prod_id, $seq=NULL)\n {\n // get the next seq\n if(is_null($seq))\n {\n $seq = $this->getNextSequence($coupon_id);\n }\n \n \n CI::db()->insert('coupons_products', array('coupon_id'=>$coupon_id, 'product_id'=>$prod_id, 'sequence'=>$seq)); \n }", "function add() {\n\t\tif (True) {\n\n\t\t\t// create an empty product.\n\t\t\t$o =& new ufo_product(0);\n\t\t\t$this->addedObject =& $o;\n\t\t\n\t\t\t// create an entry in the db.\n\t\t\t$o->initialize();\n\t\t\t$o->create();\n\t\t\t$o->edit();\n\n\t\t\t// add it to the product array.\n\t\t\t$this->product[] = $o;\n\t\t}\n\t}", "public function AddProduct () {\n $piece1 = '(';\n \t$piece2 = '';\n\t\t\n\t\tif(isset($SKU)) {\n\t\t\t$piece1 .= 'ProductSKU,';\n\t\t\t$piece2 .= \"'\" . $this->SKU . \"'\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: SKU Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$productTable = 'Products';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $productResults = OrderData::InsertData($productTable, $productPiece);\n\t\t\n\t\tif($productResults === false)\n\t\t\treturn false;\n\t\t\n\t\t\n\t\tif(isset($Qty)) {\n\t\t\t$piece1 .= 'TotalAMT,';\n\t\t\t$piece2 .= \"\" . $this->initialquantityStock . \"\";\n $piece2 .= ',';\n\t\t}\n\t\telse {\n\t\t\techo \" \\n Error: Quantity Field Empty \\n \";\n\t\t\treturn false;\n }\n\t\t\n\t\t$piece1 .= 'CommittedAMT,';\n\t\t$piece2 .= $this->committedStock . ',';\n\n \t\t$piece1 .= 'AvailableAMT';\n $piece2 .= $this->availableStock . ')';\n\t\t\n\t\t$piece1 .= ') VALUES (';\n\n $inventoryPiece = $piece1 . $piece2;\n\t\t\n\t\t$inventoryTable = 'Inventory';\n\t\t$productPiece = \" (SKU) VALUES ('\" . $this->SKU . \"')\";\n\t\t\n\t\n $inventoryResults = OrderData::InsertData($inventoryTable, $inventoryPiece);\n\t\t\n\t\tif($inventoryResults === false)\n\t\t\treturn false;\n\t\t\t\n\t\treturn true;\n\t}", "function get_list_product_add_to_cart() {\n\n global $product; \n \n echo apply_filters( 'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.\n \tsprintf( '<div><a href=\"%s\" data-quantity=\"%s\" class=\"uk-button uk-width-1-1 uk-button-primary %s\" %s>%s</a></div>',\n \t\tesc_url( $product->add_to_cart_url() ),\n \t\tesc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),\n \t\tesc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),\n \t\tisset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',\n \t\tesc_html( $product->add_to_cart_text() )\n \t),\n $product, $args );\n\n }", "function gc_template_loop_add_to_cart( $args = array() ) {\n\t\tglobal $product;\n\n\t\tif ( $product ) {\n\t\t\t$defaults = array(\n\t\t\t\t'quantity' => 1,\n\t\t\t\t'class' => implode( ' ', array_filter( array(\n\t\t\t\t\t\t'btn btn-outline-secondary gc-add-to-cart',\n\t\t\t\t\t\t'product_type_' . $product->get_type(),\n\t\t\t\t\t\t$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',\n\t\t\t\t\t\t$product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '',\n\t\t\t\t) ) ),\n\t\t\t);\n\n\t\t\t$args = apply_filters( 'woocommerce_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product );\n\n\t\t\twc_get_template( 'loop/add-to-cart.php', $args );\n\t\t}\n\t}", "public function addItemToCart(Request $request,$id){\n \n //get product\n $product=Product::with('get_images')->findOrFail($id);\n\n\n //check if the quantity entered is null or 0\n\n if($request->quantity==null || $request->quantity==0){\n return back()->withInput($request->input())->withErrors('Min unit needs to be 1');\n }\n //to check if the product exists in cart \n\n $cart_product=Cart::content()->groupBy('id')->get($id);\n\n //if not present check the quantity requested with the entered one. If present then compare with quantity requested and entered.\n\n if($cart_product==null){\n if($request->quantity>$product->quantity){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n }\n else if(($request->quantity+($cart_product->first()->qty))>$product->quantity ){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n if($product->special_price_from && $product->special_price_to){\n $date=date('Y-m-d');\n if($date<=$product->special_price_to && $date>=$product->special_price_from){\n \n $product->price=$product->special_price;\n\n }\n }\n Cart::add(['id'=>$product->id,'name'=>$product->name,'qty'=>$request->quantity,'price'=>$product->price,'options'=>['image'=>$product->get_images->first()->image_name]]);\n session(['cart_total'=>round((float)str_replace(',', '', Cart::total()),2)]);\n\n Session::flash('success','Item added to cart!');\n return back();\n\n }", "function uc_order_edit_products_add_blank($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n $form_state['rebuild'] = TRUE;\n\n $order = $form_state['build_info']['args'][0];\n\n $product = new stdClass();\n $product->qty = 1;\n $product->order_id = $order->order_id;\n uc_order_product_save($order->order_id, $product);\n\n $order->products[] = $product;\n\n uc_order_log_changes($order->order_id, array('add' => t('Added new product line to order.')));\n}", "public function addToSession($product)\n {\n $session = $this->session;\n\n if ($session->has('cart')) {\n $products = (array)$session->get('cart');\n array_push($products, $product->getHash());\n $session->set('cart', $products);\n } else {\n $products = array($product->getHash());\n $session->set('cart', $products);\n }\n }", "public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&amp;tab=buy&amp;area=cart\" );\n\t}", "public function add()\n {\n if (Request::isMethod('post')) {\n\n $product_id = Request::get('id');\n $product = Product::find($product_id);\n Cart::add(\n [\n 'id' => $product_id,\n 'name' => $product->name,\n 'image' => $product->image,\n 'qty' => 1,\n 'price' => $product->price\n ]\n );\n }\n return redirect('/products');\n }", "public function addItemToCart($account_id, $item_id, $quantity = false);", "public function addProductToCart(Request $request): JsonResponse\n {\n\n // Check if request includes the product\n $product_id = $request->get('product');\n if (!$product_id) {\n return $this->errorResponse('You need to provide a product!', Response::HTTP_BAD_REQUEST);\n }\n\n // Check if product exists in the db\n $product = Product::find($product_id);\n if (!$product) {\n return $this->errorResponse('Couldnt find product', Response::HTTP_NOT_FOUND);\n }\n\n $this->orderHandler->updateCartProductSession($product_id);\n return $this->successResponse([], Response::HTTP_OK);\n }", "public function agregarProducto(){\n array_push($_SESSION['carrito'], array($this -> producto, $this -> cantidad));\n }", "public function addCartItem($rateplanId, $quantity){\r\n\t\terror_log('cart.php rateplanId is: ' . $rateplanId, 0);\r\n\t\terror_log('cart.php quantity is: ' . $quantity, 0);\r\n\t\t//$newCartItem = new Cart_Item($rateplanId, $quantity, $this->latestItemId);\r\n\r\n\r\n\r\n\t\t$newCartItem = new Cart_Item();\r\n\t\t$newCartItem->ratePlanId = $rateplanId;\r\n\t\terror_log('cart.php ratePlanId2 is: ' . $newCartItem->ratePlanId, 0);\r\n\t\t$newCartItem->itemId = $this->latestItemId++;\r\n\t\terror_log('cart.php itemId is: ' . $newCartItem->itemId, 0);\r\n\t\t$newCartItem->quantity = $quantity;\r\n\r\n\t\t//$plan = Catalog::getRatePlan($newCartItem->ratePlanId);\r\n\t\t$rpId = $newCartItem->ratePlanId;\r\n\r\n\t\r\n\r\n\r\n\t\t$catalog_groups = self::readCache();\t//should be in associative array already.\r\n\r\n\t\t$catalog_products = $catalog_groups->products;\t//returns enture product array.\r\n\t\t//error_log(print_r($catalog_products, true));\r\n\t\t//error_log(print_r($catalog_products[2], true));\t//returns a product array with productrateplan and productrateplancharges arrays embedded inside.\r\n\t\t$catalog_rateplans = $catalog_products[0]->productRatePlans;\r\n\t\t//error_log(print_r($catalog_rateplans, true));\r\n\r\n\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// foreach($catalog_groups as $group){\r\n\t\t// \t\r\n\t\t// \tforeach($group->products as $product){\r\n\t\t// \t\t\r\n\t\t// \t\tforeach($product->productRatePlans as $ratePlan){\r\n\t\t// \t\t\tif($ratePlan->id == $rpId){\r\n\t\t// \t\t\t\t$plan = $ratePlan;\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// $plan = NULL;\r\n\r\n\t/**\r\n\t * Given a RatePlan ID, retrieves all rateplan information by searching through the cached catalog file\r\n\t * @return RatePlan model\r\n\t */\r\n\t// public static function getRatePlan($rpId){\r\n\t// \t$catalog_groups = self::readCache();\r\n\t// \tforeach($catalog_groups as $group){\r\n\t// \t\tforeach($group->products as $product){\r\n\t// \t\t\tforeach($product->ratePlans as $ratePlan){\r\n\t// \t\t\t\tif($ratePlan->Id == $rpId){\r\n\t// \t\t\t\t\treturn $ratePlan;\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// \treturn NULL;\r\n\t// }\r\n\r\n\r\n/*\t\t//Not needed? no Uom. \r\n\t\tif(isset($plan->Uom)){\r\n\t\t\t$newCartItem->uom = $plan->Uom;\r\n\t\t} else {\r\n\t\t\t$newCartItem->uom = null;\t\t\t\r\n\t\t}\r\n*/\t\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->Name : 'Invalid Product';\r\n\t\t// $newCartItem->ProductName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->name : 'Invalid Product';\r\n\t\t// $newCartItem->productName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\t\tarray_push($this->cart_items, $newCartItem);\r\n\t}", "public function addToCart($product, $qty = 1){\n // Create Cart\n // if Product has in Cart, add + qty\n if(isset($_SESSION['cart'][$product->id])){\n $_SESSION['cart'][$product->id]['qty'] += $qty;\n } else { // if not in Cart, create\n $_SESSION['cart'][$product->id] = [\n 'qty' => $qty,\n 'name' => $product->name,\n 'price' => $product->price,\n 'img' => $product->img\n ];\n }\n // Total Qty\n // if isset Qty or if not\n $_SESSION['cart.qty'] = isset( $_SESSION['cart.qty'])\n ? $_SESSION['cart.qty'] + $qty\n : $qty;\n // Total Sum\n $_SESSION['cart.sum'] = isset($_SESSION['cart.sum'])\n ? $_SESSION['cart.sum'] + $qty * $product->price\n : $qty * $product->price;\n\n }", "public function addToCart()\n {\n $product = Cart::firstOrNew([\n 'user_id' => $this->student->id,\n 'product_id' => $this->id,\n 'product_type' => Enrollment::class\n ]);\n\n $product->save();\n return $product->id;\n }", "public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}", "public function addItem(string $sku, int $qty): Cart;", "public function add_to_cart($cartid=0, $prodid=0, $qty=0) {\n\t\t// otherwise create a new entry in cart for this prodid.\n\t\t\n\t\t$query = \"SELECT * FROM pivot_order-products WHERE order_id = ? AND product_id = ?\";\t\t\t\n\t\t$values = array($cartid,$prodid);\n\t\t$results = $this->db->query($query,$values);\n\n\t\tif($results) {\n\t\t\t$total = $results('quantity') + $qty;\n\t\t\t$query = \"UPDATE pivot_order-products SET quantity = ?, SET modified_on = NOW() WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($total, $cartid, $prodid);\n\n\t\t} else {\n\t\t\t$query = \"INSERT INTO pivot_order-products (order_id,product_id,quantity,created_on,modified_on) VALUES \";\n\t\t\t$query = \"(?,?,?,NOW(),NOW())\";\n\t\t\t$values = array($cartid, $prodid, $qty);\n\n\t\t}\n\t\treturn $this->db->query($query, $values);\n\t}", "public function add_product($project_id, $product_id, $quantity, $price)\n\t{\n\t\tif($this->projects_model->add_product($project_id, $product_id, $quantity, $price))\n\t\t{\n\t\t\tredirect('edit-project/'.$project_id);\n\t\t}\n\t}", "public function add($id_plate){\n\n $product = array_key_exists($id_plate,$this->cart) ? $this->cart[$id_plate] : new product([\n\n 'plate' => Plate::where('id', $id_plate)->get(),\n 'count' => 0,\n ]);\n $product->put('count',$product->get('count') + 1);\n //dd(json_decode($product['plate'],true));\n $this->cart['sum'] += json_decode($product['plate'],true)[0]['price'];\n $this->cart[$id_plate] = $product;\n return $this;\n }", "function addToCart($id, $format, $finition, $cadre, $prix) {\n $item = [\n 'id' => $id,\n 'format' => $format,\n 'finition' => $finition,\n 'cadre' => $cadre,\n 'prix' => $prix,\n 'quantity' => 1,\n ];\n\n $_SESSION['cart'][] = $item;\n}", "function add(&$d) {\r\n\t\t$cart \t\t\t\t= $_SESSION[\"cart\"];\r\n\t\t$quantity \t\t= $this->check_quantity($d[\"product_id\"],$d[\"quantity\"]);\r\n\t\t$updated \t\t\t= false;\r\n\t\t\r\n\t\t// Check for duplicate\r\n\t\tfor ($idx=0; $idx<sizeof($cart); $idx++) {\r\n\t\t\tif ($cart[$idx][\"product_id\"] == $d[\"product_id\"]){\r\n\t\t\t\t// update;\r\n\t\t\t\t$cart[$idx][\"quantity\"] = $quantity;\r\n\t\t\t\t$updated = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (!$updated) {\r\n\t\t // add\r\n\t\t $idx = sizeof($cart);\r\n\t\t\t$cart[$idx][\"quantity\"] \t= $quantity;\r\n\t\t\t$cart[$idx][\"product_id\"] = $d[\"product_id\"];\r\n\t\t\t$cart[$idx][\"label\"] \t\t\t= $d[\"label\"];\r\n\t\t\t$cart[$idx][\"company\"] \t\t= $d[\"company\"];\r\n\t\t\t$cart[$idx][\"region\"] \t\t= $d[\"region\"];\r\n\t\t}\r\n\t\t\r\n\t\t$_SESSION[\"cart\"][$idx] = $cart[$idx];\r\n\t\treturn True; \r\n\t}", "public function actionAdd() {\n $id = Yii::$app->request->get('id');\n $qty = (int)Yii::$app->request->get('qty');\n $qty = !$qty ? 1 : $qty;\n\n $product = Product::findOne($id);\n if (empty($product)) return false;\n $session = $this->session;\n $cart = new Cart();\n $cart->addToCart($product, $qty);\n if (!Yii::$app->request->isAjax) { // works if js is off and ajax request did not occur\n return $this->redirect(Yii::$app->request->referrer);\n }\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }", "public function store(Request $request)\n {\n $request->validate([\n 'pid' => 'required|integer',\n\n ]);\n\n $pid = Product::find($request->pid);\n\n Cart::add([\n 'id'=> $pid->id,\n 'name'=> $pid->product,\n 'price'=> $pid->price,\n 'quantity' => $request->qty,\n 'attributes' => [\n 'image'=> $pid->image,\n ]\n\n ]);\n\n\n\n\n return redirect()->route('cart.show');\n\n }", "public function addToCart($request)\n\t{\n // Validation \n $this->attributes = $request;\n $this->user_id = 1;\n\n if(!$this->validate()){\n return false;\n }\n\n // Validation: Check Product Exist in Product Table \n $productModel = Products::findOne($this->product_id);\n if(!$productModel){\n $this->addError(\"Failed to Add\",\"Given Product (\".$this->product_id.\") is not Available\");\n return false;\n }\n\n // Check Product Already Exist. If already exist then update other wise add\n $cartProduct = Cart::find()->where([\"product_id\"=>$this->product_id])->one();\n\n if($cartProduct){\n $cartProduct->quantity = $cartProduct->quantity + $this->quantity; \n $isSaved = $cartProduct->save();\n return $isSaved ? $cartProduct->id : false; \n }else{\n $isSaved = $this->save(); \n return $isSaved ? $this->id : false; \n }\n }", "public function addtocartAction()\n\t{\n\t\trequire_once './app/Mage.php';\n\t\tMage::app('default');\n\n $params = array();\n\t\t$uid = $this->getRequest()->getPost('uid');\n $pid = $this->getRequest()->getPost('pid');\n\t\t$pqty = $this->getRequest()->getPost('qty');\n $size = $this->getRequest()->getPost('size');\n $params['cptions']['size_clothes'] = $size;\n\n $token = $this->getRequest()->getPost('token');\n\n if($this->tokenval() != $token)\n {\n $response['msg'] = 'You are not authorized to access this';\n $response['status'] = '1';\n echo json_encode($response);\n exit;\n }\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $selectrows = \"SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE customer_id= \".$uid.\" AND is_active = '1' AND COALESCE(reserved_order_id, '') = ''\";\n\n $rowArray = $connectionRead->fetchRow($selectrows);\n\n $entity_id = $rowArray['entity_id'];\n\n $select = $connectionRead->select()\n ->from('sales_flat_quote_item', array('*'))\n ->where('quote_id=?', $entity_id)\n ->where('product_id=?', $pid);\n\n $rowItems = $connectionRead->fetchAll($select);\n\n $qtycount = 0;\n $items = array();\n foreach ($rowItems as $item) {\n if ($item['price'] != 0) {\n $qty2 = number_format($item['qty'],0);\n $qtycount += $qty2;\n }\n }\n\n $_product = Mage::getModel('catalog/product')->load($pid);\n\n $qty = 0;\n $min = (float)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getNotifyStockQty();\n\n if ($_product->isSaleable()) {\n if ($_product->getTypeId() == \"configurable\") {\n $associated_products = $_product->loadByAttribute('sku', $_product->getSku())->getTypeInstance()->getUsedProducts();\n foreach ($associated_products as $assoc){\n $assocProduct = Mage::getModel('catalog/product')->load($assoc->getId());\n $qty += (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($assocProduct)->getQty();\n }\n } elseif ($_product->getTypeId() == 'grouped') {\n $qty = $min + 1;\n } elseif ($_product->getTypeId() == 'bundle') {\n $associated_products = $_product->getTypeInstance(true)->getSelectionsCollection(\n $_product->getTypeInstance(true)->getOptionsIds($_product), $_product);\n foreach($associated_products as $assoc) {\n $qty += Mage::getModel('cataloginventory/stock_item')->loadByProduct($assoc)->getQty();\n }\n } else {\n $qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();\n }\n }\n\n $response = array();\n\n $checkqty = $qtycount + $pqty;\n\n /*if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }*/\n\n $params['product_id'] = $pid;\n $params['qty'] = $pqty;\n\n if ($_product->getTypeId() == \"configurable\" && isset($params['cptions'])) {\n\n // Get configurable options\n $productAttributeOptions = $_product->getTypeInstance(true)\n ->getConfigurableAttributesAsArray($_product);\n\n foreach ($productAttributeOptions as $productAttribute) {\n $attributeCode = $productAttribute['attribute_code'];\n\n if (isset($params['cptions'][$attributeCode])) {\n $optionValue = $params['cptions'][$attributeCode];\n\n foreach ($productAttribute['values'] as $attribute) {\n if ($optionValue == $attribute['store_label']) {\n $params['super_attribute'] = array(\n $productAttribute['attribute_id'] => $attribute['value_index']\n );\n //$params['options'][$productAttribute['attribute_id']] = $attribute['value_index'];\n }\n }\n }\n else{\n foreach ($productAttribute['values'] as $attribute) {\n if (trim($size) == $attribute['store_label']) {\n $params['super_attribute'] = array(\n $productAttribute['attribute_id'] => $attribute['value_index']\n );\n }\n }\n }\n }\n }\n\n unset($params['cptions']);\n\n //$childProduct = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes(151, $_product);\n\n try {\n\n $customerData = Mage::getModel('customer/customer')->load($uid)->getData();\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $selectrows = \"SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE customer_id= \".$uid.\" AND is_active = '1' AND COALESCE(reserved_order_id, '') = ''\";\n\n $rowArray = $connectionRead->fetchRow($selectrows);\n\n if(!empty($rowArray))\n {\n $entity_id = $rowArray['entity_id'];\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_read');\n $sqlQuerys = \"SELECT * FROM sales_flat_quote_item WHERE quote_id =\".$rowArray['entity_id'].\" AND product_id = \".$pid.\" ORDER BY item_id DESC\";\n $rowArrays = $db_write->fetchRow($sqlQuerys);\n\n if(!empty($rowArrays))\n {\n if($rowArrays['product_type'] == 'configurable')\n {\n $sqlQueryss = \"SELECT * FROM sales_flat_quote_item WHERE parent_item_id =\".$rowArrays['item_id'];\n $rowArrayss = $db_write->fetchRow($sqlQueryss);\n\n //check Quantity count\n //$sqlQuantity = \"SELECT * FROM sales_flat_quote_item WHERE item_id =\".$rowArrays['parent_item_id'];\n //$rowArrayqnt = $db_write->fetchRow($sqlQuantity);\n\n $checkqty = number_format($rowArrays['qty']) + $pqty;\n\n $oldsize = explode('(', $rowArrayss['name']);\n if(isset($oldsize[1])) {\n $newsize = str_replace(' )', '', $oldsize[1]);\n }\n else{\n $oldsize = explode('-', $rowArrayss['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $oldsize[1];\n }\n else\n {\n $oldsize = explode('\\'', $rowArrayss['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $size[1];\n }\n }\n }\n\n if(trim($newsize) == trim($size))\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='configurable'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n else\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n\n if($rowArrays['product_type'] == 'simple')\n {\n if($rowArrays['parent_item_id'] != NULL)\n {\n //check Quantity count\n $sqlQueryss = \"SELECT * FROM sales_flat_quote_item WHERE item_id =\".$rowArrays['parent_item_id'];\n $rowArrayss = $db_write->fetchRow($sqlQueryss);\n\n $checkqty = number_format($rowArrayss['qty']) + $pqty;\n\n $oldsize = explode('(', $rowArrays['name']);\n if(isset($oldsize[1])) {\n $newsize = str_replace(' )', '', $oldsize[1]);\n }\n else{\n $oldsize = explode('-', $rowArrays['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $oldsize[1];\n }\n else\n {\n $oldsize = explode('\\'', $rowArrays['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $size[1];\n }\n }\n }\n\n if(trim($newsize) == trim($size))\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='configurable'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n else\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n else\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='simple'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n\n }\n }\n else\n {\n if($_product->getTypeId() == \"configurable\")\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n //$connectionWrit->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$name.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`=\".$price.\",`base_price`=\".$price.\",`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`=\".$price.\",`base_row_total`=\".$price.\",`row_total_with_discount`='0',`row_weight`='1.0000',`product_type`='configurable',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`=\".$price.\",`base_price_incl_tax`=\".$price.\",`row_total_incl_tax`=\".$price.\",`base_row_total_incl_tax`=\".$price.\",`hidden_tax_amount`=0,`base_hidden_tax_amount`=0,`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n //$connectionWri->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$sname.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`='0',`base_price`='0',`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`='0',`base_row_total`='0',`row_total_with_discount`='0',`row_weight`='0.0000',`product_type`='simple',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`='',`base_price_incl_tax`='',`row_total_incl_tax`='',`base_row_total_incl_tax`='',`hidden_tax_amount`='',`base_hidden_tax_amount`='',`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n }\n\n if($_product->getTypeId() == \"simple\")\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','simple',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n //$connectionWrit->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$name.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`=\".$price.\",`base_price`=\".$price.\",`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`=\".$price.\",`base_row_total`=\".$price.\",`row_total_with_discount`='0',`row_weight`='1.0000',`product_type`='configurable',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`=\".$price.\",`base_price_incl_tax`=\".$price.\",`row_total_incl_tax`=\".$price.\",`base_row_total_incl_tax`=\".$price.\",`hidden_tax_amount`=0,`base_hidden_tax_amount`=0,`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n }\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n else\n {\n $cart = Mage::getModel('checkout/cart');\n $cart->init();\n $cart->addProduct($_product, $params);\n $cart->save();\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_read');\n $sqlQuery = \"SELECT quote_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArray = $db_write->fetchRow($sqlQuery);\n $entity_id = $rowArray['quote_id'];\n\n $connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n //Update customer Id\n $date = date('Y-m-d h:i:s');\n $connectionWrite->query(\"update sales_flat_quote set customer_id = '\".$uid.\"', customer_email = '\".$customerData['email'].\"',customer_firstname = '\".$customerData['firstname'].\"',customer_lastname = '\".$customerData['lastname'].\"',customer_gender = '\".$customerData['gender'].\"', updated_at = '\".$date.\"' WHERE entity_id = \".$entity_id);\n }\n\n $connectionWrites = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $connectionWrites->query(\"update sales_flat_quote_address set customer_id = '\".$uid.\"', email = '\".$customerData['email'].\"',firstname = '\".$customerData['firstname'].\"',lastname = '\".$customerData['lastname'].\"' WHERE quote_id = \".$entity_id);\n\n $response['msg'] = 'Product added in cart';\n $response['status'] = 1;\n }\n catch (Exception $e) {\n\n $response['msg'] = $e->getMessage();\n $response['status'] = 0;\n }\n\n\n\t\techo json_encode($response);\n\t}", "public function addToCart() : void\n {\n $this->VIEW = false;\n $this->Cart->addToCart($_SESSION['Auth']->id, $_POST);\n }", "public function actionAddProductList()\n\t{\n\t\t$order_id=Yii::app()->request->getQuery('id');\n\t\t$model = $this->_loadModel($order_id);\n\t\t$dataProvider = new StoreProduct('search');\n\n\t\tif(isset($_GET['StoreProduct']))\n\t\t\t$dataProvider->attributes = $_GET['StoreProduct'];\n\n\t\t$this->renderPartial('_addProduct', array(\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'order_id' => $order_id,\n\t\t\t'model' => $model,\n\t\t));\n\t}", "function add_to_cart(item $item) {\n \\Cart::session(auth()->id())->add(array(\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'quantity' => 1,\n 'attributes' => array(),\n 'associatedModel' => $item\n ));\n return redirect('/cart');\n }", "function uc_order_pane_products_add($form, &$form_state) {\n $form_state['products_action'] = 'add_product';\n $form_state['node'] = node_load($form_state['values']['product_controls']['nid']);\n unset($form_state['refresh_products']);\n $form_state['rebuild'] = TRUE;\n}", "public function addToCart($product_row_id) { \n\t\t//echo date('Y-F/j h:i:s a');\n\t\t\n $tracking_number = Session::getId();\n\t\t\t\n\t\t$data['product_details'] = DB::table('products')->where('product_row_id', $product_row_id)->first();\n\n\t \n\t //$count = DB::table('temp_orders')->where([ ['product_row_id', $product_row_id], ['tracking_number', $tracking_number] ])->count();\n\t\t\n\t\n\t DB::table('temp_orders')->insert([ 'product_row_id' => $data['product_details']->product_row_id, 'tracking_number' => $tracking_number, 'product_price' => $data['product_details']->product_price, 'product_qty' => 1, 'product_total_price' => $data['product_details']->product_price, 'created_at' => date('Y-m-d H:i:s'), ]);\n\t\t\n \n return redirect('/mycart'); \n \n }", "public function add(Product $product)\n\t{\t\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t//\tSi el producto ya esta en el carro se le suma 1 a la cantidad.\n \tif (array_key_exists($product->id, $cart)){\n \t\t$ops = $cart[$product->id]->cantidad;\n \t\t$product->cantidad = $ops+1;\n \t}\n \t//\tSi el producto no estaba su cantidad es 1.\n \telse{\n \t $product->cantidad = 1;\t\n \t}\n \t$cart[$product->id] = $product;\n \t//\tAgregando el producto.\n\t\t\\Session::put('cart',$cart);\n\n\t\treturn redirect()->route('cart-show');\n\n\t}", "public function add($product_id, $quantity)\n {\n $product = Product::find((int) $product_id);\n if (!$product) {\n return back()->with('error', self::ERROR_ITEM_NOT_EXISTS);\n }\n\n $quantity = (int) $quantity;\n // Check availability\n if (!$product->isQuantityAvailable($quantity)) {\n return back()->with('error', 'The product is not available in the specified quantity.');\n }\n\n $cart_item = Cart::add($product->id, $product->name, $quantity, $product->unit_price);\n $cart_item->associate(Product::class);\n\n return back()->with('success', 'The product has been added to your invoice.');\n }", "public function addNewItem($product, $buyRequest = null, $forciblySetQty = false)\n {\n /*\n * Always load product, to ensure:\n * a) we have new instance and do not interfere with other products in wishlist\n * b) product has full set of attributes\n */\n if ($product instanceof Mage_Catalog_Model_Product) {\n $productId = $product->getId();\n // Maybe force some store by wishlist internal properties\n $storeId = $product->hasWishlistStoreId() ? $product->getWishlistStoreId() : $product->getStoreId();\n } else {\n $productId = (int) $product;\n if ($buyRequest->getStoreId()) {\n $storeId = $buyRequest->getStoreId();\n } else {\n $storeId = Mage::app()->getStore()->getId();\n }\n }\n\n /* @var $product Mage_Catalog_Model_Product */\n $product = Mage::getModel('catalog/product')\n ->setStoreId($storeId)\n ->load($productId);\n\n if ($buyRequest instanceof Varien_Object) {\n $_buyRequest = $buyRequest;\n } elseif (is_string($buyRequest)) {\n $_buyRequest = new Varien_Object(unserialize($buyRequest));\n } elseif (is_array($buyRequest)) {\n $_buyRequest = new Varien_Object($buyRequest);\n } else {\n $_buyRequest = new Varien_Object();\n }\n\n $cartCandidates = $product->getTypeInstance(true)\n ->processConfiguration($_buyRequest, $product);\n\n /**\n * Error message\n */\n if (is_string($cartCandidates)) {\n return $cartCandidates;\n }\n\n /**\n * If prepare process return one object\n */\n if (!is_array($cartCandidates)) {\n $cartCandidates = array($cartCandidates);\n }\n\n $errors = array();\n $items = array();\n\n foreach ($cartCandidates as $candidate) {\n if ($candidate->getParentProductId()) {\n continue;\n }\n $candidate->setWishlistStoreId($storeId);\n\n $qty = $candidate->getQty() ? $candidate->getQty() : 1; // No null values as qty. Convert zero to 1.\n $item = $this->_addCatalogProduct($candidate, $qty, $forciblySetQty);\n $items[] = $item;\n\n // Collect errors instead of throwing first one\n if ($item->getHasError()) {\n $errors[] = $item->getMessage();\n }\n }\n\n Mage::dispatchEvent('wishlist_product_add_after', array('items' => $items));\n\n return $item;\n }", "public function addToCart($id)\n {\n $product = Product::find($id);\n if (!$product) {\n abort(404);\n }\n $cart = session()->get('cart');\n\n // if cart is empty then this the first product\n if (!$cart) {\n $cart = [\n $id => [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ]\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if cart not empty then check if this product exist then increment quantity\n if (isset($cart[$id])) {\n $cart[$id]['quantity']++;\n\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if item not exist in cart then add to cart with quantity = 1\n $cart[$id] = [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }", "function add_product_to_order($id_order,$id_product,$sauce){\r\n $bdd = Database3Splus::getinstance();//connexion();\r\n $amount = 1;\r\n $req = \"INSERT INTO order_details VALUES (:id_order, :id_product, :amount, :sauce)\";\r\n $result = $bdd->prepare($req);\r\n $result->bindParam(':id_order', $id_order);\r\n $result->bindParam(':id_product', $id_product);\r\n $result->bindParam(':amount', $amount);\r\n $result->bindParam(':sauce', $sauce);\r\n $result->execute();\r\n $count = $result->rowCount();\r\n\t\tif($count != 0){return TRUE;}\r\n\t\telse{return FALSE;}\r\n\t}", "public function addProduct(Mage_Catalog_Model_Product $product)\n {\n $this->_products[$product->getId()] = $product;\n }", "public function addItem(Cart $cart, CartItem $item);", "public function addToCart($id){\n $produk=Product::findOrFail($id);\n Auth::loginUsingId(1);\n $user = Auth::user()->id;\n $addToCart = Cart::create(['product_id'=>$produk->id,\n 'user_id'=>$user]);\n return 'Berhasil Memasukan data ke cart list';\n }", "function add_to_cart() {\n\t\n\tglobal $cxn;\n\t\n\t$the_count= $_POST['the_count'];\n\t$part_id=$_POST['part_id'];\n\t$product_id=$_POST['product_id'];//id of the product in the database\n\t$product_name=$_POST['product_name'];\n\t$price=$_POST['price'];\n\t$the_session_id=$_POST['session_id'];\n\t$door_id=$_POST['feature_door_id'];\n\t$door_cost=$_POST['door_price'];\n\tif(isset($_POST['quantity'])&&trim($_POST['quantity']==\"\"))\n\t{\n\t\t$quantity=1;\n\t}\n\telse\n\t{\n\t\t$quantity=trim($_POST['quantity']);\n\t}\n\t\n\t$the_product_cost=$price * $quantity;\n\n\t$sql=\"select id from cart where session_id='$the_session_id'\";\n\t$query=$cxn->query($sql);\n\t$cart_count=mysqli_num_rows($query);\n\t\n\t//brand new user and item\n\tif($cart_count==0)\n\t{\n\t\t\n\t\t//add what's just been posted to the cart under current session id\n\t\t//start with the basics (door_id, session_id, etc. be aware of if the door is on sale)\n\t\t//your first entry is the door_id and the door_cost irrespective of the product_id. That way you can delete any product and still be able to define the color\n\t\t\n\t\t$sql_5=\"insert into cart(session_id, door_id, product_id, door_cost, sequence) values('$the_session_id', '$door_id', '$product_id', '$door_cost', '1')\";\n\t\t//echo $sql_5;\n\t\tif(!$query_5=$cxn->query($sql_5))\n\t\t{\n\t\t\t$err_5='your course list didn\\'t happen because: '\n\t\t\t.'ERRNO: '\n\t\t\t.$cxn->errno\n\t\t\t.' ERROR: '\n\t\t\t.$cxn->error\n\t\t\t.' for this query: '\n\t\t\t.$query_5\n\t\t\t.PHP_EOL;\n\t\t\ttrigger_error($err_5, E_USER_WARNING);\t\t\t\n\t\t}\n\t\n\t\t//insert your door_id alongside your product_id so you can keep track of those products that are the same, but have a different finish / color\n\t\t$sql_2=\"insert into cart (session_id, product_id, product_cost, door_id, quantity, sequence) values ('$the_session_id', '$product_id', '$the_product_cost', '$door_id', '$quantity','2')\";\n\t\t//echo $sql_2;\n\t\tif(!$query_2=$cxn->query($sql_2))\n\t\t{\n\t\t\t$err='your course list didn\\'t happen because: '\n\t\t\t.'ERRNO: '\n\t\t\t.$cxn->errno\n\t\t\t.' ERROR: '\n\t\t\t.$cxn->error\n\t\t\t.' for this query: '\n\t\t\t.$query_2\n\t\t\t.PHP_EOL;\n\t\t\ttrigger_error($err, E_USER_WARNING);\n\t\t}\n\t\t\n\t\t//now you're going through all of the features that were just posted\n\t\t\n\t\tfor($x=1; $x<=$the_count; $x++)\n\t\t{\n\t\t\tif(isset($_POST['select_'.$x])&&trim($_POST['select_'.$x])<>\"\")\n\t\t\t{\n\t\t\t\t$pieces=explode(\"_\", $_POST['select_'.$x]);\n\t\t\t\t//$pieces[0] - this is the option_name_id in your feature table, if there's a cost, it will show up here\n\t\t\t\t//$pieces[1] - this is the id of of the option as it appears in the features table\n\t\t\t\t//$pieces[2] - this is the cost including any adjustment that's been made if the corresponding door is on sale\n\t\t\t\t$sql_3=\"insert into cart (session_id, product_id, option_id, feature_id, feature_cost, door_id) VALUES ('$the_session_id', '$product_id', '$pieces[0]', '$pieces[1]', '$pieces[2]', '$door_id')\"; \n\t\t\t\tif(!$query_3=$cxn->query($sql_3))\n\t\t\t\t{\n\t\t\t\t\t$err_3='your course list didn\\'t happen because: '\n\t\t\t\t\t.'ERRNO: '\n\t\t\t\t\t.$cxn->errno\n\t\t\t\t\t.' ERROR: '\n\t\t\t\t\t.$cxn->error\n\t\t\t\t\t.' for this query: '\n\t\t\t\t\t.$query\n\t\t\t\t\t.PHP_EOL;\n\t\t\t\t\ttrigger_error($err, E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t//next is what happens when the user's session id is already in the cart\n\t}\n\telse\n\t{\n\t//figure out what the sequence number needs to be \n\t$sql_8=\"select sequence from cart where session_id='$the_session_id' and quantity>'0' order by sequence DESC LIMIT 1\";\n\t$query_8=$cxn->query($sql_8);\n\t$row_8=$query_8->fetch_object();\n\t$new_sequence=$row_8->sequence+1;\n\n\t//figure out if user is adding a different door. If so, add it here\n\n\t\t$sql_3=\"insert into cart (session_id, door_id, product_id, door_cost, sequence) values ('$the_session_id', '$door_id', '$product_id', '$door_cost', '$new_sequence')\";\n\t\tif(!$query_3=$cxn->query($sql_3))\n\t\t{\n\t\t\t$err_3='your course list didn\\'t happen because: '\n\t\t\t.'ERRNO: '\n\t\t\t.$cxn->errno\n\t\t\t.' ERROR: '\n\t\t\t.$cxn->error\n\t\t\t.' for this query: '\n\t\t\t.$query\n\t\t\t.PHP_EOL;\n\t\t\ttrigger_error($err, E_USER_WARNING);\n\t\t}\n\t\t//increase the sequence value by 10px\n\t\t$new_sequence=$new_sequence+1;\n\t\t\n\t\t//the user is adding another door, so go ahead and enter whatever products they just inserted according to the same sequence number\t\n\t\t$sql_5=\"insert into cart (session_id, product_id, product_cost, quantity, sequence, door_id) values ('$the_session_id', '$product_id', '$the_product_cost','$quantity', '$new_sequence', '$door_id')\";\n\t\t//echo $sql_5;\n\t\tif(!$query_5=$cxn->query($sql_5))\n\t\t{\n\t\t\t$err_5='your course list didn\\'t happen because: '\n\t\t\t.'ERRNO: '\n\t\t\t.$cxn->errno\n\t\t\t.' ERROR: '\n\t\t\t.$cxn->error\n\t\t\t.' for this query: '\n\t\t\t.$query\n\t\t\t.PHP_EOL;\n\t\t\ttrigger_error($err, E_USER_WARNING);\n\t\t}\n\t\t//features\n\t\tfor($x=1; $x<=$the_count; $x++)\n\t\t{\n\t\t\tif(isset($_POST['select_'.$x])&&trim($_POST['select_'.$x])<>\"\")\n\t\t\t{\n\t\t\t\t$pieces=explode(\"_\", $_POST['select_'.$x]);\n\t\t\t\t//$pieces[0] - this is the option_name_id in your feature table, if there's a cost, it will show up here\n\t\t\t\t//$pieces[1] - this is the id of of the option as it appears in the features table\n\t\t\t\t//$pieces[2] - this is the cost including any adjustment that's been made if the corresponding door is on sale\n\t\t\t\t//we don't worry about sequence here because all of the options/features are tied to a product id\n\t\t\t\t\t\n\t\t\t\t//option doesn't exist\n\t\t\t\t$sql_7=\"insert into cart (session_id, product_id, option_id, feature_id, feature_cost, door_id) VALUES ('$the_session_id', '$product_id', '$pieces[0]', '$pieces[1]', '$pieces[2]', '$door_id')\"; \n\t\t\t\tif(!$query_7=$cxn->query($sql_7))\n\t\t\t\t{\n\t\t\t\t\t$err_7='your course list didn\\'t happen because: '\n\t\t\t\t\t.'ERRNO: '\n\t\t\t\t\t.$cxn->errno\n\t\t\t\t\t.' ERROR: '\n\t\t\t\t\t.$cxn->error\n\t\t\t\t\t.' for this query: '\n\t\t\t\t\t.$query\n\t\t\t\t\t.PHP_EOL;\n\t\t\t\t\ttrigger_error($err, E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} \n}", "public function store(Request $request)\n {\n \n $duplicata=Cart::search(function ($cartItem, $rowId) use($request) {\n return $cartItem->id == $request->pid;\n });\n if($duplicata->isNotEmpty()){\n return redirect()->back()->with('success','Sorry the item is already added');\n }\n $product=Product::find($request->pid);\n Cart::add($product->pid,$product->name,1,$product->price)\n ->associate('card/store');\n return redirect('/')->with('success','the product added to card succesfully');\n }", "private function addProduct($productId, $quantity = 1) {\n $this->_registry->checkVarInSession('productPage', 'products');\n if (!$this->_model->isChecked() == true) {\n $this->_model->checkBasket();\n }\n // calling addProduct method from basket model and make note of the response it returns\n $response = $this->_model->addProduct($productId, $quantity);\n if ($response == 'success') {\n $this->_session->flash('message', '<p class=\"stock success\">The product has been added to your basket.</p>');\n $this->_registry->redirectToProduct();\n } elseif ($response == 'stock') {\n $this->_session->flash('message', '<p class=\"stock\">Product is currently out of stock!</p>');\n $this->_registry->redirectToProduct();\n } elseif ($response == 'noproduct') {\n $this->_session->flash('message', '<p class=\"stock\">Product not found.</p>');\n $this->_registry->redirectTo();\n }\n }", "public function createCartProduct($request, $product_id)\n {\n $cart = Cart::create([\n 'user_id' => $request->input('user_id'),\n 'quantity' => $request->input('quantity'),\n ]);\n $cart_item = Cart::find($cart->id);\n $cart_item->state = 'direct-buy';\n $cart_item->save();\n DB::table('product_cart')->insert([\n 'product_id' => $product_id,\n 'cart_id' => $cart->id,\n ]);\n }", "function add_to_cart($id,$qty){\r\n\r\n $row = $this->Web_model->get_by_id($id);\r\n $kategori = $this->Web_model->get_by_idkat($row->id_kategori);\r\n if ($row) {\r\n $datas= array(\r\n 'id' => $row->id_menu,\r\n 'name' => $row->nama_menu,\r\n 'price' => $row->harga,\r\n 'qty' => $qty, \r\n 'id_kategori' => $row->id_kategori,\r\n 'gambar' => $row->foto_menu,\r\n 'nama_kategori' => $kategori->nama_kategori,\r\n );\r\n $this->cart->product_name_rules = '[:print:]';\r\n $this->cart->insert($datas);\r\n echo(count($this->cart->contents()));\r\n }\r\n }", "public function addToCart()\n {\n $id = intval($_GET[\"id\"]);\n if ($id > 0) {\n if ($_SESSION['cart'] != \"\") {\n $cart = json_decode($_SESSION['cart'], true);\n $found = false;\n for ($i = 0; $i < count($cart); $i++)\n {\n if ($cart[$i][\"product\"] == $id)\n {\n $cart[$i][\"quantity\"] = $cart[$i][\"quantity\"] + 1;\n $found = true;\n break;\n }\n }\n if (!$found)\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n }\n $_SESSION['cart'] = json_encode($cart);\n }\n else\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n $_SESSION['cart'] = json_encode($cart);\n }\n }\n }", "public function addProduct(Product $product)\n {\n $this->products[] = $product;\n $this->price += $product->getPrice();\n if($this->hasPromotion()){\n $this->applyPromotion();\n }\n }", "public function add_inventory($productName,$quantity){\r\n // math\r\n $conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n $preSql = \"Select quantity from inventory where productName = '$productName'\";\r\n $preResult = $conn->query($preSql);\r\n $preRow = $preResult->fetch_assoc();\r\n $total = $preRow[\"quantity\"] + $quantity;\r\n // query\r\n $sql = \"Update inventory SET quantity = '$total' WHERE productName = '$productName'\";\r\n $conn->query($sql);\r\n }", "public function add(\\Webshop\\Products\\Product $product)\n {\n $this->redis->zAdd('prd', $product->getId(), serialize($product));\n }", "public function addItemToCart($id)\n {\n\n //$this->db->query(\"insert into koszyk (id_produktu, id_klienta, ilosc)\");\n\n return $this->getProductById($id);\n }", "public function addCart($id, Request $request)\n {\n $carts = empty(Session::get('carts')) ? [] : Session::get('carts');\n //dd($carts);\n // trùng product\n $quantity = $request->quantity;\n if (!empty($carts)) {\n foreach ($carts as $cart) {\n if($cart['id'] == $id){\n $newQuantity = $cart['quantity'];\n $quantity += $newQuantity;\n }\n }\n }\n else{\n $quantity = $request->quantity;\n }\n // dd( $quantityNew);\n\n //// get quantity from Form Request\n // $quantity = $request->quantity;\n\n // get quantity from data\n $product = Product::findOrFail($id);\n $quantityDB = $product->quantity;\n\n if ($quantity <= $quantityDB) {\n $Product = [\n 'id' => $id,\n 'quantity' => $quantity,\n 'price_id' => $request->price_id,\n 'promotion_id' => $request->promotion_id\n ];\n\n $carts[$id] = $Product;\n // set data for SESSION\n session(['carts' => $carts]);\n //dd($carts);\n return redirect()->route('cart.cart-info')\n ->with('success', 'Add Product to Cart successful!');\n\n }else{\n return redirect()->back()->with('error','Please re-enter the quantity!');\n }\n }" ]
[ "0.6837725", "0.68042034", "0.6762044", "0.6730841", "0.6720118", "0.6691639", "0.6686748", "0.66257656", "0.6623876", "0.65297955", "0.6489165", "0.64818424", "0.6475925", "0.64712316", "0.6450172", "0.6448853", "0.6429642", "0.6410168", "0.6398312", "0.6350874", "0.6345695", "0.63335615", "0.63105327", "0.629241", "0.62830484", "0.6278295", "0.62463576", "0.6237373", "0.62031657", "0.6187469", "0.615669", "0.6145828", "0.6145097", "0.6139855", "0.6137399", "0.612926", "0.6123802", "0.610915", "0.61002946", "0.607025", "0.6065231", "0.60607725", "0.60607725", "0.60567963", "0.60477555", "0.60393685", "0.6036547", "0.6021413", "0.60091233", "0.6002584", "0.6001148", "0.5993664", "0.59886354", "0.5988285", "0.5984688", "0.5984589", "0.5972566", "0.5966961", "0.5964353", "0.5951353", "0.5946291", "0.5941902", "0.5939566", "0.59352165", "0.59347725", "0.59340805", "0.5923465", "0.591614", "0.5913098", "0.590696", "0.5903115", "0.58954346", "0.5869667", "0.58603436", "0.5858724", "0.5838001", "0.5832034", "0.5829958", "0.5828607", "0.5818772", "0.581619", "0.5809677", "0.58095527", "0.5809136", "0.58052737", "0.58000326", "0.57957846", "0.578892", "0.57866365", "0.57863647", "0.57846266", "0.57822835", "0.57806265", "0.57802683", "0.577733", "0.5775017", "0.5755387", "0.5742855", "0.5729946", "0.5715979", "0.57125974" ]
0.0
-1
Display a listing of the resource.
public function index() { return GrupoResource::collection(Grupo::paginate()); }
{ "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) { $datosPOST = json_decode($request->getContent(), true); $user = $request->user(); if(!$user->isSuperAdmin()){ $datosPOST['creador'] = Auth::id(); } $grupo = Grupo::create($datosPOST); return new GrupoResource($grupo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Grupo $grupo) { return new GrupoResource($grupo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Grupo $grupo) { $grupo->update(json_decode($request->getContent(), true)); return new GrupoResource($grupo); }
{ "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(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(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(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);", "public function update($request, $id);", "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 }", "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 }", "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 }", "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 }", "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 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 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 static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "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(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($id);", "public function update($id);", "public function put($path, $data = null);", "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 }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\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(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() {\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 $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 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 $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public function update($request, $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.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Grupo $grupo) { $grupo->delete(); }
{ "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
Display a listing of the Vehiculo. Datatables by xs Templates
public function index(VehiculoDataTable $vehiculoDataTable) { return $vehiculoDataTable->render('vehiculos.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Index() {\n\t\t\t$Plantilla = new NeuralPlantillasTwig('Tienda');\n\t\t\t$Plantilla->Parametro('Consulta', $this->Modelo->Listado());\n\t\t\t$Plantilla->Filtro('HexASCII', function ($Parametro) { return AppHexAsciiHex::ASCII_HEX($Parametro); });\n\t\t\techo $Plantilla->MostrarPlantilla('Proveedor/Listado.html');\n\t\t}", "public function index()\n {\n $data = $this->Invoice_model->where(array('piutang >'=>0))->order_by('no_invoice','DESC')->find_all();\n $cabang = $this->Cabang_model->order_by('kdcab','ASC')->find_all();\n $this->template->title('Report Piutang');\n $this->template->set('cabang', $cabang);\n $this->template->set('results', $data);\n $this->template->render('list');\n }", "private function viewListagem()\n {\n if (count($camposDefinidos = array_map('trim', explode(';', $this->colunas))) > 0) {\n $listagem = File::get(base_path($this->templates['listagem']));\n $stringHeader = \"\";\n $stringBody = \"\";\n foreach ($camposDefinidos as $c) {\n if (count($c_ = array_map('trim', explode(':', $c))) == 2) {\n $stringHeader .= \"<th>\" . $c_[1] . \"</th>\";\n $stringBody .= '<td>{{ $dado->' . $c_[0] . ' }}</td>';\n } else {\n echo \"#LISTA# Campo {$c} ignorado, por nao estar descrito corretamente... forma correta -> campo:label\\n\";\n }\n }\n\n $listagem = str_replace('[{colunas_lista}]', $stringHeader, $listagem);\n $listagem = str_replace('[{colunas_lista_print}]', $stringBody, $listagem);\n $listagem = str_replace('[{route_as}]', $this->routeAs, $listagem);\n File::put(base_path('resources/views/' . $this->tabela . \"/listagem.blade.php\"), $listagem);\n }\n }", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function tablaIndex(){\n $listado = IngresosB3::orderBy('fecha', 'ASC')->get();\n\n foreach ($listado as $l){\n $l->fecha = date(\"d-m-Y h:i A\", strtotime($l->fecha));\n $servicio = ServiciosB3::where('id', $l->id_servicios)->pluck('nombre')->first();\n $l->servicio = $servicio;\n }\n\n return view('backend.bodega3.verificacion.tabla.tablaverificacion', compact('listado'));\n }", "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 index() // listado\n {\n $products = Product::all();\n //return view('products.index')->with(compact('products'));\n return Datatables::of(Product::query())->make(true);\n\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora decolare</th>\";\n\t\techo \"<th>Destinatia</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_decolare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"destinatia\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "public function index()\n {\n $data['row'] = $this->items_m->get();\n $this->template->load('template', 'product/item/item_data', $data);\n }", "public function getindex() {\n return $this->render('mantenimiento/paises/index.twig',[\n 'company_name' => $this->config['company_name'],\n 'company_name_min' => $this->config['company_name_min'],\n 'title' => 'Listado de Paises',\n 'paises' => (new PaisRepository())->Listar()\n ]);\n }", "function view() {\n\t\tif (!is_blank($this->params['cod_curso'])){\n $cod_curso = $this->params['cod_curso'];\n $cod_programa = $this->TSubgrupo->programa($cod_curso);\n $this->vista->set('cod_programa', $cod_programa);\n }\n \n\t\t$this->vista->addJS(\"jquery.dataTable\");\n\t\t\n\t\t$estudiantes = null;\n\t\tif($this->TPrograma->esta_activo($cod_programa))\n {\n\t\t\t$estudiantes = $this->TSubgrupo->inscritosActivos($cod_curso);\n\t\t}\n else\n {\n\t\t\t$estudiantes = $this->TSubgrupo->inscritosEgresados($cod_curso);\n }\n \n\t\t$this->vista->set('nombre_curso', $this->TSubgrupo->nombre($cod_curso));\n\t\t$this->vista->set('estudiantes', $estudiantes);\n\t\t$this->vista->display();\n\t }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora aterizare</th>\";\n\t\techo \"<th>De la</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_aterizare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"de_la\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\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 lista()\n {\n $lista = Lista::listar('disp','sw_rpta1');\n return view('admin.disp.lista')\n ->with('lista', $lista)\n ->with('tipo', 'dhora')\n ->with('title', 'Disponibilidad de Horarios');\n }", "public function listtabelAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('%');\n }", "public function index()\n {\n if(request()->ajax())\n {\n return DataTables::of(TipoItem::latest()->get())\n ->addColumn('action', function($data){\n $button = '<button type=\"button\" name=\"edit\" id=\"'.$data->id.'\" class=\"edit btn btn-primary btn-sm\">Editar</button>';\n $button .= '&nbsp;&nbsp;';\n $button .= '<button type=\"button\" name=\"delete\" id=\"'.$data->id.'\" class=\"delete btn btn-danger btn-sm\">Eliminar</button>';\n return $button;\n })->addColumn('flujoTrabajo',function($data){\n $flujoTrabajo=FlujoTrabajo::find($data->flujoTrabajo_id);\n \n if( $flujoTrabajo!=null){\n return $flujoTrabajo->nombre;\n }\n return 'Vacio';\n })->addColumn('categoria',function($data){\n $categoria=Categoria::find($data->categoria_id);\n if( $categoria!=null){\n return $categoria->nombre;\n }\n return 'Vacio';\n \n })->addColumn('medida',function($data){\n $medida=Medida::find($data->medida_id);\n \n if( $medida!=null){\n return $medida->nombre;\n }\n return 'Vacio';\n })\n ->rawColumns(['action'])\n ->make(true);\n }\n \n \n \n $medidas=Medida::all();\n $flujosTrabajos=FlujoTrabajo::all();\n $categorias=Categoria::all();\n \n \n return view('tipoItem.index',compact('medidas','flujosTrabajos','categorias'));\n }", "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 index()\n {\n if ($request->ajax()) {\n return \\DataTables::of(Inventario::\n join('categorias','categorias.id','inventario.categoria_id')\n join('productos','productos.id','inventario.producto_id')\n ->select('inventario.id', 'inventario.existencia', 'categorias.categoria', 'productos.producto', 'productos.precio_compra', 'productos.precio_venta')\n ->get()\n )->make(true);\n }else{\n return view('configuracion.productos.index');\n }\n }", "public function listView(): void\n {\n $this->_data = $this->_entity->fetch();\n if (!$this->special) {\n $newData = $this->_builder->submitCreate();\n if ($newData) {\n array_push($this->_data, $newData);\n }\n }\n require VF . \"{$this->route}/list.php\";\n require VF . \"{$this->route}/create.php\";\n }", "public function actionIndex() {\n $ventas = new Ventas();\n\n $ventasTotales = new CArrayDataProvider($ventas->Ingresadas(), array(\n 'id' => 'PLAZA',\n 'sort' => array(\n 'attributes' => array(\n 'PLAZA', 'INGRESADAS', 'INSTALADAS'\n ),\n ),\n 'pagination' => array(\n 'pageSize' => 100,\n ),\n ));\n \n $ventas = new Ventas();\n $ventasIngresadas = $ventas->get_Ingresadas(1);\n $ventasInstaladas = $ventas->get_Instaladas(1);\n\n $this->render('indexs', array('ventas' => $ventasTotales,'ventasIngresadas'=>$ventasIngresadas,'ventasInstaladas'=>$ventasInstaladas));\n }", "public function index()\n {\n return view('servicos.list', ['servicos' => Servico::paginate(10),\n 'produtos' => Produto::all(),\n 'clientes' => Cliente::all(),\n ]);\n }", "public function liste()\n {\n $discs = $this->LoadModel('Disc');\n $discDetail = $discs->info_record();\n $this->render('liste', [\n 'discs' => $discDetail\n ]);\n }", "public function index()\n {\n return view('backend.civil_servant.index')->withCivilServants($this->civil_servants->getForDataTable(1,false)->paginate(10));\n }", "function index(){\n\t\t$list = $this->user->ambil_semua_data();\n\n\t\t/* hasil data */\n\t\t$data['result'] = $list;\n\n\t\t/* Load view */\n\t\t$this->template->write_view('list', $data);\n\t}", "public function listtabelTAPAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('TATA PERSURATAN');\n }", "public function listtabelSDMAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('SDM');\n }", "public function index()\n {\n $data['row'] = $this->categorys_m->get();\n $this->template->load('template', 'product/category/category_data', $data);\n }", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }", "public function index()\n {\n return view('list_wrapper', [\n 'entityType' => 'qbd',\n 'datatable' => new QBDDatatable(),\n 'title' => mtrans('qbd', 'qbd_list'),\n ]);\n }", "public function index()\n\t{\n\t\t$tc = TipoComunicacion::all();\n\t\t$comunicacion = Comunicaciones::Tipo_comunicacion_Disponibles();\n $this->layout->titulo = 'Listado de Comunicaciones';\n $this->layout->nest(\n 'content',\n 'comunicaciones.index',\n array(\n \t'tipoComunicaciones' => $tc,\n 'comunicaciones' => $comunicacion\n )\n );\n\t}", "public function lista()\n {\n\n $veiculos = Veiculo::join('clientes', 'clientes.id', 'veiculos.cliente_id')\n ->where('clientes.status', 1)\n ->select(\n 'veiculos.id',\n 'veiculos.modelo',\n 'veiculos.placa',\n 'veiculos.cor',\n DB::raw('clientes.id as cliente_id'),\n DB::raw('clientes.nome as cliente_nome')\n )\n ->get();\n\n return view('veiculo.lista', [\n 'veiculos' => $veiculos,\n ]);\n }", "public function index()\n {\n /*$plancuentas=sfp_plancuenta::orderBy('id_plancuenta')->paginate(8);*/\n /*ESTO DEBE IR EN LISTAR\n </table>\n {{ $centrocostos->links() }}\n @endsection*/\n\n $plancuentas=sfp_plancuenta::orderBy('id_plancuenta')->get();\n return view('sfp_plancuenta_listar',compact('plancuentas'));\n }", "public function index()\n {\n // admin.dashboard.regulasi.dokumen\n $data = Regulasi::all();\n if (request()->ajax()) {\n return DataTables()->of($data)\n ->addColumn('link', function($link){\n return '<a target=\"_blank\" href=\"'. route('landing.regulasi.dokumen', $link->id) .'\">Lihat Dokumen</a>';\n })\n ->addColumn('action', function($row){\n $btn = '<a class=\"btn btn-xs btn-info mr-2 edit-regulasi\" href=\"'. route('regulasi.edit', $row->id) .'\" id=\"'. $row->id .'\">\n <i class=\"fa fa-edit\"></i> Edit </a>';\n $btn .= '<a class=\"btn btn-xs btn-info delete-confirm\" id=\"'. $row->id .'\" href=\"javascript:void(0)\">\n <i class=\"fa fa-trash\"></i> Hapus </a>';\n\n return $btn;\n })\n ->rawColumns(['action', 'link'])\n ->addIndexColumn()\n ->make(true);\n }\n return view('dashboard.admin.regulasi.index');\n }", "public function listar()\n {\n $lin_pedidos_model = new Lineas_pedidos_Model();\n session_start();\n //Le pedimos al modelo todos los Piezas\n $lin_pedidos = $lin_pedidos_model->readAll();\n\n //Pasamos a la vista toda la información que se desea representar\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n $variables = array();\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n $variables['articulos'] = $lin_pedidos;\n\n //Finalmente presentamos nuestra plantilla\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"listar.php\", $variables);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\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}", "function index(){\n $alumnos=$this->model->get();\n $this->view->alumnos=$alumnos;\n $this->view->render('alumno/index');\n }", "public function action_index() {\r\n $count = ORM::factory('documentos')->where('original', '=', 1)->and_where('id_user', '=', $this->user->id)->count_all();\r\n $pagination = Pagination::factory(array(\r\n 'total_items' => $count,\r\n 'current_page' => array('source' => 'query_string', 'key' => 'page'),\r\n 'items_per_page' => 50,\r\n 'view' => 'pagination/floating',\r\n ));\r\n $oNur = New Model_Hojasruta();\r\n $result = $oNur->hojasruta($this->user->id, $pagination->offset, $pagination->items_per_page);\r\n $page_links = $pagination->render();\r\n $oDoc = New Model_Tipos();\r\n $documentos = $oDoc->misTipos($this->user->id);\r\n $options = array();\r\n foreach ($documentos as $d) {\r\n $options[$d->id] = $d->tipo;\r\n }\r\n $this->template->title .= ' | Lista de HR creadas';\r\n $this->template->styles = array('media/css/tablas.css' => 'all', 'media/css/modal.css' => 'screen');\r\n $this->template->scripts = array('media/js/jquery.tablesorter.min.js');\r\n $this->template->content = View::factory('hojaruta/index')\r\n ->bind('result', $result)\r\n ->bind('page_links', $page_links)\r\n ->bind('count', $count)\r\n ->bind('options', $options);\r\n }", "public function actionLista()\n {\n $model = Cliente::findall();\n\n// Criação do provider para uso no grid view\n\n if ($model) {\n\n $provider = new ArrayDataProvider([\n 'allModels' => $model,\n 'sort' => [\n// 'attributes' => ['cpf_cliente', 'nome', 'telefone'],\n ],\n 'pagination' => [\n 'pageSize' => 10,\n ],\n ]);\n }\n else\n $provider = null;\n return $this->render('cliente/lista', ['dataProvider' => $provider]);\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 if(Auth::user()->role == 'Admin'){\n $posisiSurat = 'Verifikasi Operator';\n }else{\n $posisiSurat = 'Verifikasi Sekertaris';\n }\n\n $data = Surat::select('*','surat.id as pid')\n ->where('tipe','Keluar')\n ->where('posisi_surat',$posisiSurat)\n ->join('disposisi','disposisi.surat_id','=','surat.id')\n ->where('disposisi.ke_user',Auth::user()->id)\n ->groupBy('surat.id')\n ->get();\n $form = $this->form();\n $template = (object) $this->template;\n return view('admin.disposisi.index',compact('data','form','template'));\n }", "public function show()\n {\n\t\t//$result = $a->selectAll();\n include(\"view/bureau.html\");\n }", "public function index()\n {\n $datas = Penerbit::orderBy('created_at','decs')->paginate(10);\n\t\treturn view('admin.penerbit.table',compact('datas'));\n }", "public function listtabelKeuAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('KEUANGAN');\n }", "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 index()\n {\n \t$data['consulta_productos']=producto::\n \tjoin('categoria','producto.id_categoria','=','categoria.id')\n ->join('unidad','producto.id_unidad','=','unidad.id')\n\t->paginate(5);\n\n \treturn view('paginas.administrar_productos',$data);\n }", "function index() {\n $data['titulo'] = 'Real Equipe Lista';\n $data['menu_ativo'] = 'real_equipe';\n \n $this->load->model('real_equipe/real_equipe_model');\n $data['equipes'] = $this->real_equipe_model->equipes($this->session->userdata('id_cliente'));\n \n $this->load->view('header', $data);\n $this->load->view('menu', $data);\n $this->load->view('real_equipe/lista', $data);\n $this->load->view('footer');\n }", "public function index()\n {\n $titulo = array('pageTitle' => \"Comuna\");\n $results = array();\n $results[\"comunas\"] = DB::table('comuna')->paginate(5);\n \n return view('admin.listarComuna',$titulo)->with(['results'=>$results]);\n\n\n }", "public function index()\n {\n return view('admin.examples.datatables');\n }", "public function index()\n {\n\n $total_surat = SuratMasuk::whereHas('disposisi', function ($query) {\n $query->where('status', '>=', '3');\n })->count();\n $surat_data = SuratMasuk::whereHas('disposisi', function ($query) {\n $query->where('status', '>=', '3');\n })->paginate(5);\n\n return view('disposisi.index', compact('total_surat', 'surat_data'));\n }", "public function index()\n { \n //recupera todos os dados da tabela contas\n $data = $this->repository->paginate();\n\n \n //chama a view index para listagem dos dados\n return view('admin.contas.index', compact('data'));\n }", "public function rep_list_operaciones_pi_2019($com_id,$tp){\n $obj_est=$this->model_producto->list_oestrategico($com_id); /// Objetivos Estrategicos\n $componente=$this->model_componente->get_componente_pi($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $tabla='';\n\n if($tp==1){\n $tab='table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:100%;\"';\n }\n elseif($tp==2){\n $tabla .='<style>\n table{font-size: 9px;\n width: 100%;\n max-width:1550px;\n overflow-x: scroll;\n }\n th{\n padding: 1.4px;\n text-align: center;\n font-size: 9px;\n }\n </style>';\n $tab='table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\"';\n }\n \n $tabla.='<'.$tab.'>\n <thead>\n <tr class=\"modo1\" style=\"height:45px;\">\n <th style=\"width:1%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">#</font></th>\n <th style=\"width:6%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ACCI&Oacute;N ESTRATEGICA</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OPERACI&Oacute;N</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">RESULTADO</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ACTIVIDAD</font></th>\n <th style=\"width:4%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">INDICADOR</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">LINEA BASE</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">META</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ENE.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">FEB.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAR.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ABR.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAY.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUN.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUL.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">AGO.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">SEP.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OCT.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">NOV.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">DIC.</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">VERIFICACI&Oacute;N</font></th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n if(count($obj_est)!=0){\n foreach($obj_est as $rowo){\n $tabla.='<tr class=\"modo1\" bgcolor=\"#c3efea\">';\n $tabla.='<td colspan=\"21\" style=\"height:15px;\">OBJ. EST. '.$rowo['obj_codigo'].'.- '.$rowo['obj_descripcion'].'</td>';\n $tabla.='</tr>';\n $productos=$this->model_producto->list_producto_programado_oestrategico($com_id,$this->gestion,$rowo['obj_id']); /// Productos\n \n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $monto=$this->model_producto->monto_insumoproducto($rowp['prod_id']);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest']+$rowp['prod_linea_base'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $ptto=0;\n if(count($monto)!=0){\n $ptto=$monto[0]['total'];\n }\n\n $nro++;\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\" style=\"height:40px;\">';\n $tabla.='<td style=\"height:30px;\">'.$nro.'</td>\n <td>'.$rowp['acc_codigo'].'.- '.$rowp['acc_descripcion'].'</td>\n <td>'.$rowp['prod_producto'].'</td>\n <td>'.$rowp['prod_resultado'].'</td>\n <td></td>\n <td>'.$rowp['prod_indicador'].'</td>\n <td align=\"right\">'.$rowp['prod_linea_base'].'</td>\n <td align=\"right\">'.$rowp['prod_meta'].'</td>\n <td align=\"right\">'.$rowp['enero'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['febrero'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['marzo'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['abril'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['mayo'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['junio'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['julio'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['agosto'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['septiembre'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['octubre'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['noviembre'].''.$tp.'</td>\n <td align=\"right\">'.$rowp['diciembre'].''.$tp.'</td>\n <td>'.$rowp['prod_fuente_verificacion'].'</td>'; \n $tabla.='</tr>';\n $tabla.=''.$this->actividades_2019($rowp['prod_id'],$nro).'';\n }\n }\n }\n else{\n $tabla.='<tr><td colspan=\"22\">No existen operaciones alineadas, Verifique Operaciones</td></tr>';\n }\n \n $tabla .=\n '</tbody>\n </table>';\n\n return $tabla;\n }", "public function index(Request $request)\n {\n //Load dos volumes é feito por datatable no index.blade.php\n return view('volumes.index');\n }", "public function index(Request $request)\n {\n if ($request->ajax()) {\n $data = Monhoc1::latest()->get();\n return Datatables::of($data)\n ->addIndexColumn()\n ->addColumn('action', function($row){\n $btn = '<a href=\"javascript:void(0)\" data-toggle=\"tooltip\" data-id=\"'.$row->id.'\" data-original-title=\"Edit\" class=\"edit btn btn-primary btn-sm editItem\">Edit</a>';\n \n $btn = $btn.' <a href=\"javascript:void(0)\" data-toggle=\"tooltip\" data-id=\"'.$row->id.'\" data-original-title=\"Delete\" class=\"btn btn-danger btn-sm deleteItem\">Delete</a>';\n return $btn;\n })\n ->rawColumns(['action'])\n ->make(true);\n }\n $dskhoa = DB::table('khoa')->select('id', 'tenkhoa')->get();\n return view('monhoc1',compact('monhoc1s'))->with('dskhoa', $dskhoa);\n }", "public function index()\n\t{\n\t\tif(Datatable::shouldHandle())\n\t\t{\n\t\t\treturn Datatable::collection(Koperasi::all(array('id','nama_koperasi','alamat','telp','fax','email')))\n\t\t\t\t\t->showColumns('id','nama_koperasi','alamat','telp','fax','email')\n\t\t\t\t\t->addColumn('',function($model){\n\t\t\t\t\t\treturn '<a href=\"koperasi/'.$model->id.'\" class=\"btn btn-success btn-sm\"><span class=\"glyphicon glyphicon-search\" aria-hidden=\"true\"></span> Show</a> \n\t\t\t\t\t\t\t\t<a href=\"koperasi/'.$model->id.'/edit\" class=\"btn btn-info btn-sm\"><span class=\"glyphicon glyphicon-edit\" aria-hidden=\"true\"></span> Edit</a> \n\t\t\t\t\t\t <form method=\"post\" action=\"koperasi/'.$model->id.'\" class=\"pull-right\" >\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"_method\" value=\"DELETE\">\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<button id=\"delete_row\" type=\"submit\" class=\"btn btn-warning btn-sm \" ><span class=glyphicon glyphicon-remove\" aria-hidden=\"true\"></span> Delete</button>\n\t\t\t\t\t\t\t\t</form>';\n\t\t\t\t\t})\n\t\t\t\t\t->searchColumns('nama_koperasi','alamat')\n\t\t\t\t\t->orderColumns('nama_koperasi','alamat')\n\t\t\t\t\t->make();\n\t\t}\n\t\treturn View::make('usp.koperasi.index')->withTitle('Koperasi');\n\t}", "public function index()\n {\n //\n $contecos = conteco_ddt38::orderBy('nom_conteco')->paginate(10);\n return view('contecos.index')->with('contecos', $contecos);\n }", "public function actionIndex()\n {\n\n $query = Daodien::find();\n $pagination = new Pagination([\n 'defaultPageSize' => 5,\n 'totalCount' => $query->count(),\n ]);\n $listDaoDien = $query->orderBy(['created_at' => SORT_DESC])\n ->offset($pagination->offset)\n ->limit($pagination->limit)->all();\n $data = ObjDaoDien::getListObject($listDaoDien);\n return $this->render('index',[\n 'listDaoDien' => $data,\n 'pagination' => $pagination]);\n }", "public function liste() {\n // Charger la vue liste compteur\n $this->loadView('liste', 'content');\n // Lire les compteurs à partir de la bd et formater\n //$reglements = $this->em->selectAll('reglement');\n //$reglements = $this->em->getRefined($reglements);\n $liste = $this->em->selectAll('facture');\n $html = '';\n foreach ($liste as $key => $entity) {\n $state = 'impayée';\n if ($entity->getPaye()) {\n $state = 'payée';\n }\n $consommation = $this->em->selectById('consommation', $entity->getId());\n $compteur = $this->em->selectById('compteur', $consommation->getIdCompteur());\n $html .= '<tr>';\n $html .= '<td>' . $entity->getId() . '</td>';\n $html .= '<td><a href=\"reglements/facture/' . $entity->getNumero() . '\">' . $entity->getNumero() . '</a></td>';\n $html .= '<td>' . $compteur->getNumero() . '</td>';\n $html .= '<td>' . $consommation->getQuantiteChiffre() . ' litres</td>';\n $html .= '<td>' . $entity->getMontant() . ' FCFA</td>';\n $html .= '<td>' . $state . '</td>';\n $html .= '</tr>';\n }\n // Ajouter les compteurs à la vue\n $this->loadHtml($html, 'list');\n }", "public function listdataAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('%');\n }", "public function lists()\t{\n\t\tCheckAdminLoginSession();\n\t\t$per_page = 20;\n if($this->uri->segment(4)){\n \t$page = ($this->uri->segment(4)) ;\n }\n else {\n \t$page = 1;\n }\n $start = ($page-1)*$per_page;\n $limit = $per_page;\n $totalCount = $this->admin_model->totalRecord($this->optional_warranty);\n\t\t$data[\"dataCollection\"] = $this->admin_model->getDataCollection($this->optional_warranty,$limit,$start);\n $totalResult = count($data['dataCollection']);\n\t\t$data[\"pagination\"] = Jpagination($totalCount,$limit,$start);\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/optional_warranty/list',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "public function index()\n\t{ \n\t\t// Get data\n\n\t $entries = ProductService::where('type','product')->paginate(10); \n\n\t $this->layout->title = 'Proizvodi | BillingCRM';\n\t \n\t $this->layout->content = View::make('backend.product.index', compact('entries'));\n\n\t}", "public function ListaTravels()\n\t{\t\n\t\t$filter = DataFilter::source(new Travels);\n\t\t/*Header*/\n $filter->link('travels/create', 'Crear Nuevo', 'TR');\n /*Header*/\n\n\t\t$filter->attributes(array('class'=>'form-inline'));\n\t\t$filter->add('name','Buscar por Nombre', 'text');\n\t\t$filter->add('code','Buscar por Código', 'text');\n\t\t$filter->submit('Buscar');\n\t\t$filter->reset('Limpiar');\n\n\t\t$grid = DataGrid::source($filter);\n $grid->attributes(array(\"class\"=>\"table table-striped\"));\n $grid->add('name','Nombre', true);\n $grid->add('code','Código', true);\n $grid->add('viaticum','Viático', true);\n $grid->add('hotel','Hotel', true);\n $grid->add('gasoline','Pasaje/Bencina', true);\n $grid->add('taxi','Pasajes/Taxi', true);\n $grid->add('km','Kilometros', true);\n $grid->edit(url().'/travels/edit', 'Editar/Borrar','modify|delete'); \n $grid->paginate(10);\n\n\t\treturn view('travels/lista', compact('filter', 'grid'));\n\t}", "function index(){\n //Obtenemos todos los registros de la tabla alumno\n $alumnos=$this->model->get();\n //Convertimos el resultado a formato JSON y se lo asignamos a una variable para poder mostrarlo en la vista\n // $this->view->alumnos= json_encode($alumnos);\n $this->view->alumnos= $alumnos;\n $this->view->render('alumno/index2');\n }", "public function index()\n {\n /*\n $title = \"All\";\n $type = 1;\n $properties = array('title' => $title, 'type' => $type);\n return view('admin.signups.datatable')->with($properties);\n */\n return view('admin.signups.all-datatable');\n }", "public function index()\n {\n $dispositivo = DB::table('dispositivos')\n ->join('clientes', 'dispositivos.cliente_id', '=', 'clientes.id')\n ->join('tipos', 'dispositivos.tipo_id', '=', 'tipos.id')\n ->select('dispositivos.marca', 'dispositivos.anticipo',\n 'tipos.nombre as tipo','clientes.nombre as cliente')\n ->get();\n return view('admin.pagos',[\n 'dispositivos' => $dispositivo,\n ]);\n }", "public function vistaPagosPublicosController()\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</tr>';\n\t\t\t$counter++;\n\t\t\t}\n\t\t}", "public function listarvehiculos() {\n View::template('');\n if (Auth::is_valid()) {\n $arreglo[\"data\"] = Load::model('vehiculos')->find_all_by_sql(\"select vehi.id, vehi.marca, vehi.modelo, vehi.patente, tv.nombre as tvehiculo, p.nombre as propietario, vehi.rinde, vehi.delta, vehi.tmarcador, vehi.limite, vehi.conteo from vehiculos as vehi\njoin tvehiculos as tv on tv.id=vehi.tvehiculos_id\njoin propietario as p on p.id=vehi.propietario_id\norder by vehi.patente asc\");\n $this->data = $arreglo; \n } else {\n Redirect::to(\"/\");\n }\n }", "public function loadTable() {\n $data = JenisProduk::All();\n return view('jenisproduk.partials.tables', ['data' => $data]);\n }", "public function index()\n {\n $this->paginate = array(\n 'all',\n 'conditions' => array('$or' => array(\n array('table' => null),\n array('table' => array('$exists' => false))\n ))\n );\n $contentVariables = $this->paginate('ContentVariable');\n $this->set(compact('contentVariables', $contentVariables));\n }", "public function index()\n {\n $data['list'] = $this->Etapas->listar()->etapas->etapa;\n $temp = $this->Etapas->listarEtapas()->etapas->etapa;\n $data['procesosProductivos'] = $this->Procesos->listarProcesos()->procesos->proceso;\n //reforma las url segun id\n foreach ($temp as $value) {\n if ($value->tiet_id == 'prd_tipos_etapaFraccionamiento') {\n $urlComp = 'general/Etapa/fraccionar?op=' . $value->id;\n $value->link = $urlComp;\n } else {\n $urlComp = 'general/Etapa/nuevo?op=' . $value->id;\n $value->link = $urlComp;\n }\n }\n $data['etapas'] = $temp;\n $this->load->view('etapa/list', $data);\n }", "public function indexAction()\r\n {\r\n $cursos = $this->getEntityManager()\r\n ->getRepository(\"Application\\Model\\Curso\")\r\n ->findAll(array(), array(\r\n 'descricao' => 'ASC'\r\n ));\r\n // adiciona o arquivo jquery.dataTable.min.js\r\n // ao head da p�gina\r\n $renderer = $this->getServiceLocator()->get('Zend\\View\\Renderer\\PhpRenderer');\r\n $renderer->headScript()->appendFile('/js/jquery.dataTables.min.js');\r\n return new ViewModel(array(\r\n 'cursos' => $cursos\r\n ));\r\n }", "public function index()\n {\n // $title = \"Danh Sách WorkTask\";\n // $worktask = DB::table(\"qlsv_worktasks\")->where('deleted_at', 0)->paginate(2);\n // $monhoc = DB::table(\"qlsv_monhocs\")->where('deleted_at', 0)->pluck(\"tenmonhoc\", \"id\");\n // $worktaskdetail = DB::table(\"qlsv_worktaskdetails\")->get();\n // return view(\"admin/WorkTask/dsworktask1\", ['worktask' => $worktask, 'monhoc' => $monhoc, 'worktaskdetail' => $worktaskdetail, 'title' => $title]);\n }", "public function index()\r\n\t{\r\n\t\t$data['sangsi'] = $this->M_sangsi->tampil();\r\n\t\t$this->template->utama('sangsi/data_sangsi',$data);\r\n\t}", "public function index()\n {\n return view('dashboard.pages.recep.rec_table');\n }", "public function index()\n {\n $comunity = Comunity::all();\n return view('admin.modul-komunitas.komunitas-table',compact('comunity'));\n }", "public function listaProductos(){\n\n $respuesta = Datos::mdlListaProductos(\"productos\");\n $cont =0;\n\n foreach ($respuesta as $row => $item){\n \t$cont ++;\n\n\n echo '<tr>\n <td>'.$cont.'</td>\n <td>'.$item[\"codProducto\"].'</td>\n <td>'.$item[\"nombre\"].'</td>\n <td>'.$item[\"tipo\"].'</td>\n <td><a href=\"updtProducto.php?idEditar='.$item[\"idProducto\"].'\"><button class=\"btn btn-warning\">Editar</button></a></td>\n <td><a href=\"listaProductos.php?idBorrar='.$item[\"idProducto\"].'\" ><button class=\"btn btn-danger\">Borrar</button></a></td>\n </tr>';\n }\n\n }", "public function data(Request $request)\n {\n\n $locale = $request->locale;\n $list = Service::where('locale', $locale)->get();\n\n return Datatables::of($list)\n\n ->addColumn('title', function ($item) {\n return $item->title;\n })\n ->addColumn('image1', function ($item) {\n return \" <a href='/{$item->image_landing_1}' target='_blank'> \" . \"<img style='height: 50px;' src='/{$item->image_landing_1}' />\" . \" </a> \";\n })\n ->addColumn('image2', function ($item) {\n return \" <a href='/{$item->image_landing_2}' target='_blank'> \" . \"<img style='height: 50px;' src='/{$item->image_landing_2}' />\" . \" </a> \";\n })\n ->addColumn('locale', function ($item) {\n return Config::get('app.locales')[$item->locale];\n })\n ->addColumn('action', function ($item) {\n $url1 = route('services.edit', $item->id);\n $modifyurl = \" <a href='{$url1}'> \" . __('Detail') . \" </a> \";\n return $modifyurl;\n })\n ->rawColumns(['action', 'image1', 'image2'])\n ->make(true);\n }", "public function index()\n\t{\n\t\t$data = $this->crud->select()->orderBy('crud_id', 'desc')->get();\n\t\t$this->template('crud/index', $data);\n\t}", "public function index()\n\t{\n\t\t//\n\t\t$dados = DB::table('DadosClinicos')->orderBy('nome', 'asc')->lists('nome', 'id');\n\n\t\t$especialidades = DB::table('Especialidade')->lists('nome','id');\n\n\t\t$vistas = DB::table('Vista')->lists('nome','id');\n\t\t\n\t\treturn View::make('dadosclinicos.index', compact('dados','especialidades','vistas'));\n\t}", "public function indexApi(){\n return datatables(Categorie::query())\n ->setRowClass('filasTable')\n ->editColumn('slugCategoria','adminviews.categories.actions')\n ->rawColumns(['slugCategoria'])\n ->toJson();\n }", "public function getListView()\n {\n $warehouse_id = auth()->user()->current_warehouse_id;\n $client_id = auth()->user()->current_client_id;\n\n //if not set, then we need to make the user set it first\n if( $warehouse_id === null || $client_id === null )\n {\n\n }\n\n //get the list data with the default sort set the same as in the angular table\n $data = $this->getList();\n\n //we need to send the url to do Ajax queries back here\n $url = url('/product');\n\n //build the list data\n $product_type = new ProductType();\n $product_type_data = ProductType::orderBy('name')->get();\n $default_uom_data = $product_type->getDefaultUomList();\n\n //build UOM and variant array - This is so we don't have to do variable assignments in the template and control\n //the number of each items here in the controller.\n for( $i = 1; $i < 9; $i++ ) { $uom[$i] = 'uom' . $i; }\n\n return response()->view('pages.product', ['main_data' => $data,\n 'url' => $url,\n 'my_name' => $this->my_name,\n 'uom' => $uom,\n 'default_uom_data' => $default_uom_data,\n 'product_type_data' => $product_type_data]);\n }", "public function listar()\n {\n $Articulos_model = new Articulos_Model();\n session_start();\n //Le pedimos al modelo todos los Piezas\n $articulos = $Articulos_model->readAll();\n\n //Pasamos a la vista toda la información que se desea representar\n $variables = array();\n $usuario[\"usuario\"] = $_SESSION[\"usuario\"];\n $variables['articulos'] = $articulos;\n if (isset($_SESSION['cliente'])) {\n $usuario[\"cliente\"] = $_SESSION['cliente'];\n }\n //Finalmente presentamos nuestra plantilla\n $this->view->show(\"cabecera.php\");\n $this->view->show(\"plantilla_header.php\", $usuario);\n $this->view->show(RUTA_VISTAS . \"listar_header.php\");\n $this->view->show(RUTA_VISTAS . \"listar.php\", $variables);\n $this->view->show(\"plantilla_pie.php\");\n $this->view->show(\"pie.php\", $usuario);\n }", "public function action_index(){\n $this->title .= 'Portfolio/catalog';\n\n $goods = SQL::Instance()->SelectWithKey(\"goods\");\n $this->content = $this->Template('views/index.php', [\"goods\"=>$goods, ]);//'test'=>$test\n }", "public function index()\n {\n $number_of_items = $this->calculate->getTotalOfItemsAdmin();\n if (null != $this->request->ifParameter(\"id\")) {\n $items_current_page = $this->request->getParameter(\"id\");\n } else {\n $items_current_page = 1;\n }\n $items = $this->item->getItemsForAdmin($items_current_page);\n $page_previous_items = $items_current_page - 1;\n $page_next_items = $items_current_page + 1;\n $number_of_items_pages = $this->calculate->getNumberOfPagesOfExtAdmin();\n $this->generateadminView(array(\n 'items' => $items,\n 'number_of_items' => $number_of_items,\n 'items_current_page' => $items_current_page,\n 'page_previous_items' => $page_previous_items,\n 'page_next_items' => $page_next_items,\n 'number_of_items_pages' => $number_of_items_pages\n ));\n }", "public function index()\n {\n $servico = Servico::all();\n\n //\n return view(\"{$this->nameFolder}/list\", [\"listaServico\"=>$servico]);\n }", "function lists()\n {\n $data[\"data\"] = $this->RapatModel->get();\n $this->load->view('rapat/lists', $data);\n }", "public function index()\n {\n $tramites = Tramite::orderBy('id', 'asc')->paginate(5);\n $catalogos= CatalogoTramite::all();\n\n return view('Cruds.Tramite.index',compact('tramites', 'catalogos'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n \n }", "public function index()\n {\n $especialidad = especialidad::orderBy('id', 'ASC')->paginate(5);\n \n return view('pagina.funcionalidad.admin.especialidad.especialidad')->with('especialidad', $especialidad);\n }", "public function index()\n {\n\n $alumnos = Alumnos::orderBy('id', 'asc')->where('activo', '1')->get();\n $listaN = Nivel::where('activo', 1)->groupBy('nombre')->orderBY('nombre', 'ASC')->pluck('nombre', 'nombre');\n $listaH = Nivel::where('activo', 1)->orderBY('horario', 'ASC')->pluck('horario', 'id');\n\n $alumnos->each(function ($alumnos) {\n $alumnos->nivelAl;\n });\n\n return view('usuarios.lista')->with('alumnos', $alumnos)->with('listaN', $listaN)->with('listaH', $listaH);\n }", "public function index()\n {\n $productos = Producto::skip(10)->take(5)->get();\n $categories = Category::all();\n return view('livewire.admin.producto', [\"categories\" => $categories, \"productos\" => $productos]);\n }", "public function index()\n\t{\n\t\treturn View::make('productos.listado');\n\t}", "public function index()\n {\n $jenisobjekwisata = Jenisobjekwisata::all();\n $halaman = 'objekwisata';\n return view('admin.jenisobjekwisata.index', compact('halaman','jenisobjekwisata'));\n\n // if($request->ajax()){\n // $jenisobjekwisata = Jenisobjekwisata::all();\n // return Datatables::of($jenisobjekwisata)->make(true);\n // }\n // //kolom-kolom yang akan ditampilkan\n // $html = $htmlBuilder\n // ->addColumn(['data'=>'jenis_objekwisata','name'=>'jenis_objekwisata','title'=>'Jenis Objekwisata']);\n \n\n // return view('admin.jenisobjekwisata.index',compact('html'));\n }", "public function index() \n {\n //consultar de acuerdo a los filtros \n\n $terminoss = $this->M_politicas->listar_terminos()->result();\n $num_filas = $this->M_politicas->contar_terminos();\n $this->data['politicas'] = $terminoss;\n\n $this->_vista('index'); \n }", "public function admin_index() {\r\n \r\n $sucursales = $this->Sucursal->find(\"all\");\r\n $this->set(compact('sucursales'));\r\n \r\n }", "public function index()\n {\n \t$tables = DB::select('SHOW TABLES');\n $tabelPilihan = '';\n $hasilSementara = '';\n return view('datasource.index', compact('tables', 'hasilSementara', 'tabelPilihan'));\n }", "public function rep_list_operaciones_2018($com_id,$tp){\n // $productos = $this->model_producto->list_prod($com_id); // Lista de productos\n $productos=$this->model_producto->list_producto_programado($com_id,$this->gestion);\n $componente=$this->model_componente->get_componente($com_id);\n $fase=$this->model_faseetapa->get_fase($componente[0]['pfec_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($fase[0]['proy_id']); //// DATOS PROYECTO\n $tabla='';\n\n if($tp==1){\n $tab='table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\" style=\"width:98%;\"';\n }\n elseif($tp==2){\n $tabla .='<style>\n table{font-size: 9px;\n width: 100%;\n max-width:1550px;\n overflow-x: scroll;\n }\n th{\n padding: 1.4px;\n text-align: center;\n font-size: 9px;\n }\n </style>';\n $tab='table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabla\"';\n }\n \n $tabla.='<'.$tab.'>\n <thead>\n <tr class=\"modo1\" style=\"height:45px;\">\n <th style=\"width:1%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">#</font></th>\n <th style=\"width:7%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">PRODUCTO</font></th>\n <th style=\"width:7%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ACTIVIDAD</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">TIP.</font></th>\n <th style=\"width:4%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">INDICADOR</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">LINEA BASE</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">META</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ENE.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">FEB.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAR.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">ABR.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">MAY.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUN.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">JUL.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">AGO.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">SEP.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">OCT.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">NOV.</font></th>\n <th style=\"width:2%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">DIC.</font></th>\n <th style=\"width:5%;\" bgcolor=\"#1c7368\"><font color=\"#ffffff\">VERIFICACI&Oacute;N</font></th>\n </tr>\n </thead>\n <tbody>';\n $nro=0;\n foreach($productos as $rowp){\n $sum=$this->model_producto->meta_prod_gest($rowp['prod_id']);\n $color=''; $tp='';\n if($rowp['indi_id']==1){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n elseif ($rowp['indi_id']==2) {\n $tp='%';\n if($rowp['mt_id']==3){\n if(($sum[0]['meta_gest'])!=$rowp['prod_meta']){\n $color='#fbd5d5';\n }\n }\n }\n\n $nro++;\n $tabla.='<tr class=\"modo1\" bgcolor=\"'.$color.'\" style=\"height:40px;\">';\n $tabla.=' <td>'.$nro.'</td>\n <td>'.$rowp['prod_producto'].'</td>\n <td></td>\n <td>'.$rowp['indi_abreviacion'].'</td>\n <td>'.$rowp['prod_indicador'].'</td>\n <td>'.$rowp['prod_linea_base'].'</td>\n <td>'.$rowp['prod_meta'].'</td>\n <td>'.$rowp['enero'].''.$tp.'</td>\n <td>'.$rowp['febrero'].''.$tp.'</td>\n <td>'.$rowp['marzo'].''.$tp.'</td>\n <td>'.$rowp['abril'].''.$tp.'</td>\n <td>'.$rowp['mayo'].''.$tp.'</td>\n <td>'.$rowp['junio'].''.$tp.'</td>\n <td>'.$rowp['julio'].''.$tp.'</td>\n <td>'.$rowp['agosto'].''.$tp.'</td>\n <td>'.$rowp['septiembre'].''.$tp.'</td>\n <td>'.$rowp['octubre'].''.$tp.'</td>\n <td>'.$rowp['noviembre'].''.$tp.'</td>\n <td>'.$rowp['diciembre'].''.$tp.'</td>\n <td>'.$rowp['prod_fuente_verificacion'].'</td>'; \n $tabla.='</tr>';\n if($proyecto[0]['proy_act']==1){\n $tabla.=''.$this->actividades_2018($rowp['prod_id'],$nro).'';\n }\n }\n $tabla .=\n '</tbody>\n </table>';\n\n return $tabla;\n }", "function showAllServiciosMVC()\n {\n $servicios = $this->serviciosModel->getServicios();\n $this->viewservices->showAllServicesPrint($servicios);\n }", "public function listtabelPrncAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('PERENCANAAN');\n }", "public function listtabelCSAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('CURRENT SYSTEM');\n }", "public function listdataSDMAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('SDM');\n }", "function index(){\n\t\t//oke faham\n\t\t$table = 'tbl_transaksi';\n\t\t\t\t\n\t\t$data['villa'] = '';\n\t\t$data['interface'] = array('data_transaksi');\t\t\n\t\t$data['template'] = 'satucolumn';\n\t\t$data['komponen_top'] = array('navbar','forcelogin');\n\t\t$data['dt_transaksi'] = $this->app_model->getAllData($table);\n\t\t//cari tahu nama2 kolom di table tsb.\n\t\t$data['list_field'] = $this->db->list_fields($table);\n\t\t$this->load->view('index',$data);\n\t}", "public function listView()\r\n {\r\n $data['page'] = lang('jobs');\r\n $data['menu'] = 'jobs';\r\n $pagedata['companies'] = objToArr($this->AdminCompanyModel->getAll());\r\n $pagedata['departments'] = objToArr($this->AdminDepartmentModel->getAll());\r\n $this->load->view('admin/layout/header', $data);\r\n $this->load->view('admin/jobs/list', $pagedata);\r\n }" ]
[ "0.7048129", "0.69743997", "0.6927924", "0.6890032", "0.6877464", "0.6848848", "0.67900944", "0.6787231", "0.6717559", "0.6712006", "0.6702403", "0.66899073", "0.6624969", "0.6605613", "0.660341", "0.65929776", "0.65843385", "0.65459615", "0.6542696", "0.65392774", "0.65343946", "0.6491884", "0.64845824", "0.648088", "0.64721304", "0.6467895", "0.6462852", "0.6436694", "0.6433602", "0.64300066", "0.6422537", "0.64219487", "0.64209217", "0.64101434", "0.6392569", "0.63863105", "0.63837206", "0.6383076", "0.6374566", "0.63743126", "0.63659364", "0.63632345", "0.63609177", "0.63608754", "0.6355626", "0.63457346", "0.633819", "0.63370717", "0.6332108", "0.6327545", "0.6322276", "0.63213557", "0.63181543", "0.6317446", "0.63151795", "0.6313255", "0.6306799", "0.6305922", "0.6305501", "0.63043785", "0.62981534", "0.6297205", "0.6291934", "0.6289059", "0.6285596", "0.6282253", "0.6276996", "0.6273872", "0.6270446", "0.62683773", "0.6264598", "0.6263064", "0.626149", "0.6261122", "0.6257776", "0.6251836", "0.6248643", "0.6248639", "0.62439334", "0.62411964", "0.62405735", "0.62403256", "0.6239679", "0.62361723", "0.62355554", "0.6232955", "0.6227966", "0.62246454", "0.62232846", "0.6222185", "0.6221301", "0.6213338", "0.6212086", "0.62079775", "0.62069494", "0.62011874", "0.61999536", "0.6198077", "0.61935675", "0.6191785", "0.6191035" ]
0.0
-1
Show the form for creating a new Vehiculo.
public function create() { $selectores = $this->selectoresComunes(); return view('vehiculos.create')->with(['selectores' => $selectores]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n\t{\n\t\treturn View::make('vehiculos.create');\n\t}", "public function create()\n {\n return view('contato.form');\n }", "public function create()\n {\n $page_title = 'Registrar Vehiculo';\n return view('cliente.vehiculo.create', ['page_title'=> $page_title]);\n }", "public function create()\n {\n\n return view('vehiculo.create');\n }", "public function create()\n {\n return view('vehiculos.create');\n }", "public function create()\n {\n return view('produto.form_produto');\n }", "public function create()\n {\n $articulo_id = null;\n $titulo = \"Agregar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function create()\n {\n return view('clientes.crear');\n }", "public function create()\n {\n \n $NivelEstudio = new NivelEstudio;\n return view('nivelestudio.form', compact('NivelEstudio'));\n }", "public function create()\n {\n //\n $edit = false;\n $uvas= Uva::orderBy('title','asc')->get();\n return view('vinicola.form',['edit'=>$edit,'uvas'=>$uvas]);\n }", "public function create()\n {\n $modelo = Modelo::find(Input::get('id_modelo'));\n\n // Si tiene una accion diferente para el envío del formulario\n $url_action = 'web';\n if ($modelo->url_form_create != '') {\n $url_action = $modelo->url_form_create.'?id='.Input::get('id').'&id_modelo='.Input::get('id_modelo');\n }\n\n $miga_pan = $this->get_miga_pan($modelo,'Crear nuevo');\n\n return view( 'pagina_web.secciones.create', compact('url_action', 'miga_pan') );\n }", "public function create()\n {\n //\n return view('cervezas.form');\n }", "public function create()\n {\n return view('produtos.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_cliente');\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 actionCreateForm()\n\t{\n\t\t$model=new TProducto;\n\t\t$modelInventario=new TInventario;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TProducto']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TProducto'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_almacen));\n\t\t}\n\t\tYii::app()->theme = 'admin';\n\t\t$this->layout ='//layouts/portalAdmin';\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'modelInventario'=>$modelInventario\n\t\t));\n\t}", "public function create()\n {\n return \"Formulário para cadastrar um novo cliente.\";\n }", "public function create()\n {\n $this->authorize('CADASTRAR_TABELAS_SISTEMA');\n return view('pages.tipo-entrada.form');\n }", "public function create(){\n \n $razas = Raza::get();\n include 'views/mascota/form_new.php';\n }", "public function create()\n {\n return view('programa.crear');\n }", "public function newAction()\n {\n $entity = new Servicio();\n $entity->setActivo(1);\n\n //Se carga una provincia por defecto\n $provincia = $this->getDoctrine()\n ->getRepository('sisconeeAppBundle:Provincia')\n ->find(2);\n //Se le establece la provincia por defecto al servicio (necesario para el funcionamiento de la programacion asociada\n //a los eventos PRE_SET_DATA y PRE_SUBMIT)\n //var_dump($provincia);\n $entity->setProvincia($provincia);\n\n $form = $this->createCreateForm($entity);\n\n return $this->render('sisconeeAdministracionBundle:Servicio:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $vehiculo = DB::table('vehiculos')->select('vehiculos.Placa', 'vehiculos.Id_Vehiculo')->get();\n return view('Ingreso_Vehiculos.create')->with('vehiculos', $vehiculo);\n }", "public function create()\n {\n return view('tipovehiculos.create');\n }", "public function create()\n {\n return view('catalogos.create');\n }", "public function create()\n {\n return view('resources.plata.marcas_de_cilindros.create');\n }", "public function create()\n {\n return view('ciclos.create');\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('manutencoes_civil_eletrica.create');\n }", "public function create()\n {\n\t\treturn view('divisi.add');\n }", "public function create()\n {\n $this->authorize('CADASTRAR_TABELAS_SISTEMA');\n $cidades = Cidade::all()->toArray();\n\n return view('pages.almoxarifado.form', compact('cidades'));\n }", "public function create()\n {\n return view('comercio.create');\n }", "public function newAction()\n {\n $entity = new Capacitador();\n $form = $this->createForm(new CapacitadorType(), $entity);\n\n /*** -Institucion ***/\n $institucion = new Institucioncapacitadora();\n $forminst = $this->createForm(new InstitucioncapacitadoraType(), $institucion);\n /** ---- **/\n \n // Incluimos camino de migas\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem(\"Inicio\", $this->get(\"router\")->generate(\"hello_page\"));\n $breadcrumbs->addItem(\"Capacitaciones\", $this->get(\"router\")->generate(\"pantalla_modulo\",array('id'=>3)));\n $breadcrumbs->addItem(\"Facilitadores\", $this->get(\"router\")->generate(\"pantalla_facilitadores\"));\n $breadcrumbs->addItem(\"Registrar facilitador\", $this->get(\"router\")->generate(\"hello_page\"));\n\n return $this->render('CapacitacionBundle:Capacitador:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'forminst'=>$forminst->createView(),\n ));\n }", "public function create()\n {\n return view('cadastro::create');\n }", "public function create()\r\n\t{\r\n\t\t//\r\n\r\n $form_data = array('route' => 'comercios.store', 'method' => 'POST');\r\n $action = 'Nuevo';\r\n\r\n return View::make(\"comercios.create\",compact(\"form_data\",\"action\"));\r\n\r\n\r\n\t}", "public function create()\n {\n return view('pages.cliente.create');\n }", "public function create()\n {\n //return view('marca.create');\n return 'Mostrando Formulario para crear Fabricantes';\n }", "public function create()\n {\n return view('admin.pages.forms.pengirim');\n }", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view ('proyecto.create');\n }", "public function create()\r\n {\r\n return view('catalogos.empleado.create');\r\n }", "public function create()\n {\n return view ('clientes.clientes-novo');\n }", "public function create()\n {\n $template = (object) $this->template;\n $form = $this->form();\n return view('admin.disposisi.create', compact('template','form'));\n }", "public function create()\n {\n return view('admin.provinsi.create');\n }", "public function create()\n {\n return view('efectivo.create');\n }", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function create()\n {\n // muestra el formulario creado diseñado en el index\n return view('Empleado.create');\n }", "public function create()\n\t{\n\t\treturn View::make('lotacoes.create');\n\t}", "public function create()\n {\n return view('medidas.apoyo_economico_crear');\n }", "public function create()\n {\n return view('comentario.create');\n }", "public function create()\n {\n return view('consortia.create');\n }", "public function create()\n { \n return view('tipoorden.create', ['titulo' => 'Formulario de Crear', 'titulo_pagina' => 'Crear Tipo de Orden']);\n }", "public function create()\n {\n return view('empresa.form_new_empresa')->with('empresas', Empresa::all());\n }", "public function create()\n {\n //\n return view('clientes.new');\n }", "public function create()\n {\n return view('profesores.crear');\n }", "public function create()\n {\n $prodi = $this\n ->prodiMasterRepo\n ->getAllData();\n\n return view('dasbor.pengguna.prodi.form_tambah', compact('prodi'));\n }", "public function create()\n {\n return view(\"produto.create\");\n }", "public function create() // formulario registro\n {\n return view(products.create);\n }", "public function create()\n {\n //mengarahkan ke form\n return view('pemilik.form');\n }", "public function create()\n {\n return view('servicios.crear');\n }", "public function create()\n {\n return view('gas_consumo.create');\n }", "public function create()\n {\n $vagas = Vaga::all();\n $moradores = Morador::all();\n return view('pages.admin.veiculos.create', compact('vagas', 'moradores'));\n }", "public function create()\n {\n return view('horario.create');\n }", "public function create()\n {\n return view('empresa.crear');\n }", "public function create()\n {\n return view('carros.create');\n }", "public function create()\n {\n return view('cadastro.create');\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 return view('admin.servicio.create');\n }", "public function create()\n {\n $cmp_id = Session::get('cmp_id');\n $gro_id = Session::get('gro_id');\n $tipos = Productype::getTipoProductos($gro_id);\n if ($gro_id ==1) {\n return view('product.gasolineras.form_create',compact('tipos'));\n }\n if ($gro_id ==2) {\n return view('product.farmacias.form_create',compact('tipos'));\n }\n }", "public function create(){\n \treturn view('cliente.create');\n }", "public function newAction()\n {\n $entity = new CarpetaEmprendimiento();\n $form = $this->createForm(new CarpetaEmprendimientoType(), $entity);\n\n return $this->render('IamSoftAndrethaBundle:CarpetaEmprendimiento:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n\t{\n return View::make('carros.create');\n\t}", "public function create()\n {\n return view('jogos.tecnicos.create');\n }", "public function create()\n {\n return view('groupes.formAjout');\n }", "public function create()\n {\n \n return view(\n 'components/forms/form-personne',\n [\n 'redirect' => 'ajouterPersonne',\n 'employe' => null\n ]\n );\n }", "public function create()\n {\n //\n return view('inventarios.create');\n }", "public function create()\n {\n return view('vacunas.create');\n }", "public function newAction()\n {\n $societe = new Societe();\n\n $form = $this->createCreateForm($societe);\n\n $pages = array();\n $pages['Sociétés'] = \"movibe_backend_societe\";\n $pages['Creation'] = \"\";\n $this->breadcrumb($pages);\n\n return $this->render('MovibeBackendBundle:Societe:new.html.twig', array(\n 'societe' => $societe,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('prodi.addProdi');\n }", "public function create()\n {\n //funcion para mostrar vista crear\n return view(\"productos.create\");\n }", "public function create()\n {\n return view('produto.create');\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create()\n {\n $data['title'] = 'Inserir página';\n return view('adm.pages.form', $data);\n }", "public function create()\n {\n return view('contato.create');\n }", "public function create()\n {\n //\n return view('pages.cadastrar-cliente');\n }", "public function create()\n {\n return view('marca.crear');\n }", "public function create()\n {\n return view(\"ubicaciones.create\");\n }", "public function create()\n {\n return view('compte_epargnes.create');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function actionCreate()\n {\n $model = new Nomina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n\n $circuitos = Circuito::get();\n\n return view('admin.escuelas.create', compact('circuitos'));\n }", "public function create()\n\t{\n\t\treturn View::make('usp.koperasi.create')->with('page','Koperasi')\n\t\t->with('modul','Create');\n\t}", "public function create()\n {\n return view('admin.activosFijos.create');\n }", "public function create()\n {\n return view('admin.petugas.form_tambah');\n }", "public function create()\n {\n return view('inventario.ingreso.create.create');\n }", "public function create()\n {\n return view('cliente.create');\n }", "public function create()\n {\n return view('cliente.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "function create(){\n\n \t$this->load->view('Kesma/VFormbenang');\n\n }", "public function create()\r\n {\r\n return view('surat_keluar.create');\r\n }" ]
[ "0.7784924", "0.77622896", "0.77344257", "0.7718348", "0.7717485", "0.7621918", "0.7590301", "0.75714934", "0.75567985", "0.75454026", "0.75291026", "0.75280094", "0.7516244", "0.7483173", "0.7470501", "0.7468153", "0.7467475", "0.7465244", "0.7458096", "0.74580663", "0.745206", "0.7448696", "0.7432835", "0.74308187", "0.742782", "0.74238825", "0.74219424", "0.7416", "0.7415625", "0.74144703", "0.7406747", "0.7401248", "0.7396154", "0.7391517", "0.7390607", "0.7384923", "0.7381575", "0.7377089", "0.73746717", "0.7374458", "0.7374285", "0.73661655", "0.73615724", "0.7358318", "0.73562986", "0.73514473", "0.73513454", "0.7350498", "0.7350328", "0.73434746", "0.7332684", "0.73289573", "0.7326863", "0.73254573", "0.73179674", "0.73171073", "0.7316242", "0.7314625", "0.7312098", "0.73074657", "0.7306479", "0.73015285", "0.72973764", "0.7296463", "0.7293251", "0.72926736", "0.72925615", "0.7291632", "0.72872555", "0.7285051", "0.72794634", "0.7275787", "0.7275409", "0.72748756", "0.7272965", "0.72725", "0.7272067", "0.7271291", "0.7270108", "0.7267601", "0.72662103", "0.726107", "0.72598165", "0.725854", "0.72568226", "0.72543687", "0.72539586", "0.7252997", "0.7250705", "0.72498065", "0.7246256", "0.72376746", "0.72365505", "0.7235557", "0.7234578", "0.72332597", "0.72332597", "0.72323", "0.7231056", "0.7229147" ]
0.7392683
33
Store a newly created Vehiculo in storage.
public function store(CreateVehiculoRequest $request) { $input = $request->all(); $input['user_id'] = Auth::id(); $input['placa'] = strtoupper($request->placa); $vehiculo = $this->vehiculoRepository->create($input); Flash::success('Vehículo registrado correctamente.'); return redirect(route('vehiculos.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(VehiculoCreateRequest $request)\n {\n Vehiculo::create($request->all());\n Session::flash('message','Vehiculo Creado Correctamente');\n return Redirect::to('/vehiculo');\n }", "public function store(){\n $validateactualite = $this->validate([\n 'titre'=>'required',\n 'sous_titre'=>'required',\n 'descri'=>'required'\n ]);\n $this->validate([\n 'photo'=>'required'\n ]);\n $record = actualite::create($validateactualite);\n $this->photo->storePubliclyAs('public/actualite/', $record->id.'.png');\n //$this->photos[$index]->storePubliclyAs('public/galleries/', $data->id.'.png' );\n session()->flash('message', 'actualite enregistré avec succès');\n $this->emit('Added');\n $this->dispatchBrowserEvent('Added');\n $this->resetFields();\n }", "public function store()\n\t{\n\t\t$data = Input::all();\n\t\t$data = array_add($data, \"residencia_id\", Auth::user()->residencia_id);\n\t\t$validator = Validator::make($data, Vehiculo::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn \"ERROR\";\n\t\t}\n\t\t$vehiculo = Vehiculo::create($data);\n\n\t\treturn $vehiculo;\n\t}", "public function store()\n\t{\n\t\t$fbf_historico_atleta_cameponato = new FbfHistoricoAtletaCameponato;\n\t\t$fbf_historico_atleta_cameponato->idcampeonato = Input::get('idcampeonato');\n$fbf_historico_atleta_cameponato->idatleta = Input::get('idatleta');\n$fbf_historico_atleta_cameponato->idtime = Input::get('idtime');\n$fbf_historico_atleta_cameponato->classificacao = Input::get('classificacao');\n$fbf_historico_atleta_cameponato->jogos = Input::get('jogos');\n$fbf_historico_atleta_cameponato->gols = Input::get('gols');\n\n\t\t$fbf_historico_atleta_cameponato->save();\n\n\t\t// redirect\n\t\tSession::flash('message', 'Registro cadastrado com sucesso!');\n\t\treturn Redirect::to('fbf_historico_atleta_cameponato');\n\t}", "public function store(Request $request)\n {\n \n $this->validate($request,['folio'=>'required|string', \n 'nombre'=>'required|string', \n 'apellido_p'=>'required|string', \n 'apellido_m'=>'required|string', \n 'telefono'=>'required|string',\n 'imagen'=>'required',\n 'id_puesto'=>'required']);\n \n $datos = Empleado::create([ \n 'folio'=> $request -> input('folio'),\n 'nombre' => $request -> input('nombre'),\n 'apellido_p' => $request -> input('apellido_p'),\n 'apellido_m'=> $request -> input('apellido_m'),\n 'telefono'=> $request -> input('telefono'),\n 'imagen'=> $request -> file('imagen') -> store('empleados','public'),\n 'id_puesto'=> $request -> input('id_puesto')\n ]);\n return redirect('empleados');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'nombre' => 'required|string',\n 'apellido' => 'required|string',\n 'fecha' => 'required',\n 'user_id' => 'required|integer'\n ]);\n\n try {\n DB::beginTransaction();\n\n $venta = new Venta();\n $venta->nombre = $request->nombre;\n $venta->apellido = $request->apellido;\n $venta->fecha = Carbon::parse($request->fecha)->format('Y-m-d');\n $venta->decuento = $request->descuento;\n $venta->total = $request->total;\n $venta->user_id = $request->user_id;\n $venta->operador_id = $request->operador_id;\n\n $venta->save();\n\n $productos = $request->productos ? $request->productos : [];\n // $venta->productos()->sync($productos);\n foreach($productos as $p){\n $venta->productos()->attach(1,['producto_id'=>$p[0], 'cantidad' =>$p[1], 'sub_total' =>$p[2]]);\n $this->descontarStock($p[0],$p[1]);\n }\n DB::commit();\n\n return response()->json([\n 'mensaje' => 'La venta se guardo exitosamente',\n 'categoria' => new VentaResource($venta)\n ], Response::HTTP_CREATED);\n\n } catch (\\Illuminate\\Database\\QueryException $e) {\n DB::rollBack();\n\n response()->json([\n 'mensaje' => 'Error al guardar, consulte al Administrador' . $e,\n ], Response::HTTP_FORBIDDEN);\n }\n }", "public function store(){\n \n // comprueba que llegue el formulario con los datos\n if(empty($_POST['guardar']))\n throw new Exception('No se recibieron datos');\n \n $mascota = new Mascotas(); //crear el nuevo usuario\n \n $mascota->nombre = DB::escape($_POST['nombre']);\n $mascota->sexo = DB::escape($_POST['sexo']);\n $mascota->biografia = DB::escape($_POST['biografia']);\n $mascota->fechanacimiento = DB::escape($_POST['fechanacimiento']);\n $mascota->fechafallecimiento = DB::escape($_POST['fechafallecimiento']);\n $mascota->idusuario = Login::get()->id;\n $mascota->idraza = intval($_POST['raza']);\n \n \n \n if(!$mascota->guardar())\n throw new Exception(\"No se pudo guardar $mascota->nombre\");\n \n $mensaje=\"Guardado la mascota $mascota->nombre\";\n include 'views/exito.php'; //mostrar éxito\n }", "public function store(CreateVertueRequest $request)\n {\n \n $input = $request->all();\n\n $vertue = $this->vertueRepository->create($input);\n $this->save($vertue);\n Flash::success('Vertue saved successfully.');\n\n // return redirect(route('vertues.index'));\n }", "public function store(Request $request)\n {\n \n $codigo_producto = rand(100000, 9999999);\n $codigo_venta = rand(100000, 9999999);\n //Se crea y se guarda el producto con los datos recibidos\n $producto = New Producto();\n\n $producto->id = $codigo_producto;\n $producto->name = $request->nombre_producto;\n $producto->caracteristicas = $request->caracteristicas;\n $producto->descripcion = $request->descripcion;\n $producto->precio = $request->precio;\n $producto->stock = $request->stock;\n $producto->estado = $request->condicion;\n $producto->categoria_id = $request->categoria;\n\n $producto->save();\n\n //Se crea y se guarda la venta con los datos recibidos\n\n $venta = New Venta();\n\n $venta->id = $codigo_venta;\n $venta->estado = 'activo';\n $venta->producto_id = $codigo_producto;\n $venta->user_id = Auth::user()->id;\n $venta->pago_id = $request->pago;\n $venta->envio_id = $request->envio;\n $venta->precio_envio = $request->precio_envio;\n\n $venta->save();\n\n //Se consulta el producto recien creado para retornar su \"Show\"\n\n $producto = Producto::findOrFail($codigo_producto);\n $producto = $producto->id;\n\n return redirect()->route('ventas.images', compact('producto'));\n }", "public function store(Request $request){\n\n $ivas = new Iva();\n $ivas->iva = $request->iva;\n $ivas->users_id = Auth::User()->nombres.' '.Auth::User()->apellidos;\n\n $ivas->save();\n\n //return view('welcome');\n $message = $ivas ? 'Se ha registrado ' . $request->tipo . 'de forma exitosa.' : 'Error al Registrar';\n\n //Session::flash('message', 'Te has registrado exitosamente ');\n return redirect()->route('manageIva-A')->with('message', $message);\n\n }", "public function store(Request $request)\n {\n $voleto = new voletos();\n $voleto->fk_eventos = $request->fk_evento;\n $voleto->nombre = $request->nombre;\n $voleto->costo = $request->costo;\n $voleto->fk_tipovoleto = $request->fk_tipovoleto;\n $voleto->cantidad = $request->cantidad;\n $voleto->fechacierre = $request->fechaCierre;\n $voleto->save();\n return back()->with('respuesta','Voleto creado con exito');\n }", "public function store(StoreEstimuloRequest $request)\n {\n try{\n $estimulos = new Estimulos();\n $estimulos->SC_Estimulos_Reporta = $request->SC_Estimulos_Reporta;\n $estimulos->SC_Estimulos_Razon = $request->SC_Estimulos_Razon;\n $estimulos->SC_Estimulos_Detalles = $request->SC_Estimulos_Detalles;\n $estimulos->SC_Estimulos_Fecha = $request->SC_Estimulos_Fecha;\n $estimulos->SC_Ficha_FK_ID = $request->SC_Ficha_FK_ID;\n $estimulos->SC_Aprendiz_FK_ID =$request->SC_Aprendiz_FK_ID;\n $estimulos->SC_TipoEstimulos_FK_ID = $request->SC_TipoEstimulos_FK_ID;\n $estimulos->save();\n return redirect()->route('estimulos.index')->with('status', 'Estimulo creado');\n }\n catch(\\Illuminate\\Database\\QueryException $e){\n return redirect()->route('estimulos.index')->with('status', 'No se ha podido crear el Estimulo');\n }\n }", "public function store(Request $request)\n {\n \n //die();\n\n $venta = Ventas::create([\n 'fecha_venta' => Carbon::now(),\n\n 'total_credito' => floatval($request->total_credito), \n 'total_contado'=> floatval($request->total_contado),\n 'id_cliente' => intval($request->id_cliente),\n 'id_vendedor' => intval($request->id_vendedor)\n ]);\n\n //print_r($venta->id_venta);\n //die();\n\n $detallesventa = DetallesVentas::create([\n 'cantidad' => $request->input('cantidad_producto'), \n 'valor_producto'=> $request->input('valor_producto'),\n 'descuento'=> $request->input('descuento'),\n 'iva'=> $request->input('iva'),\n 'id_producto' => $request->input('id_producto'),\n 'id_venta' => $venta->id_venta\n \n\n ]);\n\n\n return redirect()->route('ventas.index')->with('info','Venta creada');\n\n }", "public function store(createMovimiento $request)\n\t{\n\n\t\t$input = $request->all();\n\t\t$input['usu_alta_id'] = Auth::user()->id;\n\t\t$input['usu_mod_id'] = Auth::user()->id;\n\n\t\t//create data\n\t\tMovimiento::create($input);\n\n\t\t$this->actualizarExistencia(\n\t\t\t$input['plantel_id'],\n\t\t\t$input['articulo_id'],\n\t\t\t$input['cantidad'],\n\t\t\t$input['entrada_salida_id'],\n\t\t\t$input['ubicacion_art_id']\n\t\t);\n\n\t\treturn redirect()->route('movimientos.index')->with('message', 'Registro Creado.');\n\t}", "public function store(Request $request)\n {\n $salvo = Emprestimo::create([\n 'cliente_id' => $request->cliente_id,\n 'valor' => valorBanco($request->valor),\n 'valor_total' => valorBanco($request->valor_total),\n 'parcelas' => $request->parcela,\n 'status' => '2',\n 'corretor_id' => auth()->user()->id,\n 'comissao_corretor' => (valorBanco($request->valor_total) * (float) auth()->user()->comissao)/100,\n ]);\n\n if($salvo){\n foreach($request['guia'] as $parcela){\n $salvo->parcelas()->create([\n 'valor' => valorBanco($parcela['valor']),\n 'vencimento' => date('Y-m-d', strtotime($parcela['datavencimento'])),\n 'num' => $parcela['num_parcela'],\n ]);\n }\n\n return redirect()->route('painel.emprestimos.index')->with('salvo', 'Emprestimo cadastrado com sucesso!');\n }\n }", "public function store(Request $request)\n {\n // $datosVehiculo=request()->all();\n $datosVehiculo=request()->except('_token');\n if($request->hasFile('foto')){\n $datosVehiculo['foto']=$request->file('foto')->store('uploads','public');\n }\n Vehiculos::insert($datosVehiculo);\n // return response()->json($datosVehiculo);\n return redirect('vehiculos')->with('Mensaje','Empleados agergado con exito');\n }", "public function store()\n\t{\n\t\t$liceo = new Colegios;\n\n\t\t$liceo->nombre = Input::get('nombre');\n\t\t$liceo->desde = Input::get('desde');\n\t\t$liceo->hasta = Input::get('hasta');\n\t\t$liceo->comentario = Input::get('comentario');\n\t\t$liceo->estudiante_fk = input::get('estudiante');\n\t\t$liceo->funcionario_fk = input::get('funcionario');\n\t\t$liceo->docente_fk = input::get('docente');\n\n\t\tif ($liceo->save())\n\t\t{\n\t\t\tSession::flash('message','Establecimiento agregado correctamente!');\n\t\t\tSession::flash('class','succes');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSession::flash('message','Ups! ha ocurrido un error');\n\t\t\tSession::flash('class','danger');\n\t\t}\n\n\t\treturn Redirect::to('liceos/create');\n\t\t\n\t}", "public function _store()\n {\n try{\n if (count($this->data) == 0)\n {\n $this->data = $this->request->all();\n }\n $this->object = $this->model->create($this->data);\n\n Log::info('Guardado');\n return response()->json(['status'=>true,\n 'msj'=>$this->name. 'Guardado',\n $this->name=>$this->object], 200);\n\n }catch (\\Exception $e){\n Log::critical(\"Error, archivo del peo: {$e->getFile()}, linea del peo: {$e->getLine()}, el peo: {$e->getMessage()}\");\n return response()->json([\"msj\"=>\"Error de servidor\"], 500);\n }\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n\t\t\t'descripcion' => 'required'\n ]);\n \n //$requestData = $request->all();\n \n $servicio = new Servicio;\n $servicio->descripcion = $request->descripcion;\n $servicio->precio_estandar = $request->precio_estandar;\n $servicio->estado_servicio = \"1\";\n $servicio->estado = \"1\";\n $servicio->id_especialidad = $request->id_especialidad;\n $servicio->id_empleado = $request->id_empleado;\n $servicio->save();\n\n\n //Servicio::create($requestData);\n\n return redirect('trabajo/servicio')->with('flash_message', 'Servicio added!');\n }", "public function store(Request $request)\n {\n //\n $this->validate($request, [\n 'tramo' => 'required',\n ]);\n\n $colectivo = new Colectivo;\n $colectivo->tramo = $request->tramo;\n $colectivo->tarifa_id = 1;\n $colectivo->horario_id = 1;\n $colectivo->save();\n\n\n return response()->json([\n 'colectivo' => $colectivo,\n 'message' => 'Colectivo Creado Correctamente'\n ], 200);\n }", "public function store(Request $request)\n {\n if($request->tipo==null){\n return back()->with('error','Debe ingresar un tipo de incidente');; \n }\n $incidente = new Incidente;\n $incidente->nombre=$request->get('nombre');\n $incidente->detalle=$request->get('detalle');\n $incidente->estado= 'Pendiente'; //pendiente enproceso finalizado\n $incidente->caracter=$request->get('caracter');\n $incidente->reporter_id=Auth::user()->id;\n $incidente->tipo_id=$request->get('tipo');\n\n \n\n if($request->file('file')){\n $imagenOriginal = $request->file('file');\n $nombre = $imagenOriginal->getClientOriginalName();\n $path = Storage::putFileAs('Imagenes', $imagenOriginal, $nombre);\n \n\n $incidente->imagen= 'app/'.$path ;\n }\n\n $incidente->save();\n\n $detalleInci = new DetalleDeIncidente;\n $detalleInci->incidente_id = $incidente->id;\n $detalleInci->send_id = Auth::user()->id;\n $detalleInci->sector_id = $request->get('sector');\n $detalleInci->estado = 'Enviado';\n $detalleInci->observaciones = 'Incidente reportado';\n $detalleInci->save();\n return redirect()->route('incidente.index')->with('success','incidente creado correctamente');\n }", "public function persist();", "public function store(CreateTipovehiculoRequest $request)\n {\n $input = $request->all();\n\n $tipovehiculo = $this->tipovehiculoRepository->create($input);\n\n Flash::success('Tipovehiculo saved successfully.');\n\n return redirect(route('tipovehiculos.index'));\n }", "public function store(Request $request)\n {\n \n $requestData = $request->all();\n\n $evento = $request->evento;\n $statusiva = $request->statusiva;\n $iva = $request->tipoiva;\n $montante = $request->montante;\n\n $subtag = Subtag::where('id',$iva)->first();\n $perc = $subtag->taxa;\n $percentagem = $perc / 100;\n\n $valoriva = $montante * $percentagem;\n\n\n\n if($statusiva == \"1\"){\n $total = $montante;\n //$total = $montante - $iva;\n }else{\n $total = $montante;\n }\n \n $add = Encargo::create([\n 'titulo' => $request->titulo,\n 'fornecedor' => $request->fornecedor,\n 'descricao' => $request->descricao,\n 'data' => $request->data,\n 'montante' => $total\n ]);\n\n\n if($statusiva == \"1\"){\n $iva = ImpostoEncargo::create([\n 'descricao' => \"IVA do encargo nº \".$add->id,\n 'percentagem' => $perc,\n 'data' => $request->data,\n 'encargo' => $add->id,\n 'montante' => $valoriva\n ]);\n }\n \n\n // Guardando Histórico\n $ip = request()->ip();\n $log = Historico::create([\n 'utilizador' => Auth::user()->id,\n 'tipo' => \"encargo\",\n 'acao' => \"criou\",\n 'descricao' => \"O utilizador '\".Auth::user()->name.\"' criou o(a) encargo nº '\".$add->id.\"'.\",\n 'date' => date('Y-m-d'),\n 'ip' => $ip\n ]);\n // Guardando Histórico\n\n return redirect('encargo')->with('flash_message', 'Encargo added!');\n }", "public function store(Request $request)\n {\n if ($request->metodo == 1) {\n \n $articulo = new ModelArticulos();\n $articulo->id_designer = $request->designer;\n $articulo->nombre = $request->nombre;\n $articulo->sexo = $request->sexo;\n $articulo->tipo = $request->tipo;\n $articulo->contenido = $request->contenido;\n $articulo->presentacion = $request->presentacion;\n $articulo->precio_a = $request->precio_a;\n $articulo->precio_b = $request->precio_b;\n $articulo->precio_c = $request->precio_c;\n $articulo->precio_p = $request->precio_p;\n $articulo->descripcion = $request->descripcion;\n $articulo->existencia = $request->existencia;\n $articulo->estante = $request->estante;\n $articulo->codigo = $request->codigo;\n $articulo->codigoa1 = $request->codigoa1;\n $articulo->codigoa2 = $request->codigoa2;\n $articulo->codigoa3 = $request->codigoa3;\n $articulo->codigoa4 = $request->codigoa4;\n $articulo->codigoa5 = $request->codigoa5;\n $articulo->fecha_alta = $fecha_actual = date(\"Y-m-d\");\n $articulo->estado = 1;\n $articulo->save();\n\n $id_articulo = $articulo->id;\n\n if ($request->hasFile('imagen')) {\n //obtiene la extension\n $FotografiaExt = $request->file('imagen')->getClientOriginalExtension();\n //nombre que se guarad en ruta\n $FotografiaStore = $id_articulo.'.'.$FotografiaExt;\n //archivo guardado en ruta local\n Storage::disk('public_uploads')->put($FotografiaStore, fopen($request->file('imagen'), 'r+'));\n }\n\n return response()->json(array(\n 'status' => true,\n 'request' => $request->metodo,\n ));\n }\n\n else\n {\n $articulo = ModelArticulos::where('id', '=', $request->id)->update(array(\n 'id_designer' => $request->designer,\n 'nombre' => $request->nombre,\n 'sexo' => $request->sexo,\n 'tipo' => $request->tipo,\n 'contenido' => $request->contenido,\n 'existencia' => $request->existencia,\n 'presentacion' => $request->presentacion,\n 'precio_a' => $request->precio_a,\n 'precio_b' => $request->precio_b,\n 'precio_c' => $request->precio_c,\n 'precio_p' => $request->precio_p,\n 'descripcion' => $request->descripcion,\n 'estante' => $request->estante,\n 'codigo' => $request->codigo,\n 'codigoa1' => $request->codigoa1,\n 'codigoa2' => $request->codigoa2,\n 'codigoa3' => $request->codigoa3,\n 'codigoa4' => $request->codigoa4,\n 'codigoa5' => $request->codigoa5));\n\n if ($request->hasFile('imagen')) {\n //se elimina la imagen antigua\n Storage::disk('public_uploads')->delete($request->id);\n\n //obtiene la extension\n $FotografiaExt = $request->file('imagen')->getClientOriginalExtension();\n //nombre que se guarad en ruta\n $FotografiaStore = $request->id.'.'.$FotografiaExt;\n //archivo guardado en ruta local\n Storage::disk('public_uploads')->put($FotografiaStore, fopen($request->file('imagen'), 'r+'));\n }\n\n return response()->json(array(\n 'status' => true,\n 'request' => $request->metodo,\n ));\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store(MttnCorrectivoRequest $request)\n {\n\n Orden::create([\n 'nOrden'=>$request['nOrden'],\n ]);\n\n $idO=Orden::All();\n $id=$idO->last()->id;\n\n MantenimientoCorrectivoVeh::create([\n 'idOrden'=>$id,\n 'idMecanico'=>$request['mecanico'],\n 'idVehiculo'=>$request['idVehiculo'],\n 'idMotorista'=>$request['idMotorista'],\n 'numTrabajo'=>$request['numTrabajo'],\n 'fechaInicioMtt'=>$request['fechaInicioMtt'],\n 'fechaFinMtt'=>$request['fechaInicioMtt'],\n 'fallasVeh'=>$request['fallasVeh'],\n 'diagnosticoMec'=>\"\",\n ]);\n $v= Vehiculo::find($request['idVehiculo']);\n $v->semaforo =4; //el estado del vehiculo cambia a mantt Correctivo\n $v->save();\n Bitacora::bitacora(\"Registro de nuevo Mttn Correctivo al Vehiculo': \".$v->nPlaca);\n return redirect('/mantenimientoCorVeh')->with('create','• Mantenimiento correctivo ingresado correctamente');\n }", "public function store(Request $request)\n {\n $cancion = new Cancion;\n $cancion->titulo = $request->get('titulo');\n $cancion->numpista = $request->get('numpista');\n $cancion->duracion = $request->get('duracion');\n $cancion->fecha = $request->get('fecha');\n $cancion->album_id = $request->get('album_id');\n $cancion->save();\n\n $vocalista = $request->vocalista_id;\n\n $cancion->vocalist()->attach($vocalista);\n\n return redirect()->route('cancion.index');\n }", "public function store()\n\t{ \n $nextId = OrdenEsM::nextId();\n $input = Input::all();\n $ordenD = new OrdenEsD();\n $ordenD->upc = $input['upc'];\n $ordenD->epc = $input['epc'];\n $ordenD->quantity = $input['quantity'];\n $ordenD->created_at = $input['created_at'];\n $ordenD->updated_at = $input['updated_at'];\n $ordenD->orden_es_m_id = $nextId;\n $ordenD->save();\n\t}", "public function persist() {}", "public function store()\n {\n $this->validate();\n\n $cliente = Cliente::create([\n 'sexo_id' => $this->sexo_id,\n 'cedula' => $this->cedula,\n 'nombre_primero' => $this->nombre_primero,\n 'nombre_segundo' => $this->nombre_segundo,\n 'apellido_paterno' => $this->apellido_paterno,\n 'apellido_materno' => $this->apellido_materno,\n 'direccion' => $this->direccion,\n 'correo' => $this->correo,\n 'telefono' => $this->telefono,\n 'fecha_nacimiento' => $this->fecha_nacimiento,\n 'deuda' => $this->deuda,\n ]);\n\n $this->resetInput();\n $this->accion = 1;\n }", "public function store()\n\t{\n\t\t$reserva = new Reserva;\n\t\t$reserva->persona_id = Input::get('persona_id');\n\t\t$reserva->puesto_id = Input::get('puesto_id');\n\t\t$reserva->start_date = Input::get('start_date');\n\t\t$reserva->end_date = Input::get('end_date');\n\t\t$reserva->save();\n\t}", "public function store(StoreImmeuble $request)\n {\n //validateur = voir store immeuble\n\n\n //premiere methode pour ajouter dans la db\n $immeuble = new Immeuble();\n $immeuble->id_bloc = $request->input('bloc');\n $immeuble->Nom_Immeuble = $request->input('nom');\n $immeuble->Montant_Cotisation_Mensuelle = $request->input('cotisation');\n $immeuble->Montant_Disponible_En_Caisse = $request->input('caisse');\n $immeuble->save();\n\n return redirect('/syndic/Appartements');\n }", "public function store(Vidrio $vidrio)\n {\n request()->validate([\n 'cantidad' => ['required', 'min:1'],\n 'vidrio' => ['required', 'min:3']\n ]);\n\n $vidrio = Vidrio::create(request(['user_id', 'cantidad', 'vidrio']));\n\n flash('Gracias por reciclar el vidrio! El vidrio tarda millones de años en biodegradarse')->success();\n\n return redirect('/vidrio/' . $vidrio->id);\n }", "public function store(Request $request)\n {\n $this->validator($request->all())->validate();\n $chiesa = new Chiesa($request->all());\n $chiesa->abilitato = 1;\n $chiesa->id_comune = $request->input(\"comune\");\n $chiesa->id_congregazione = $request->input(\"congregazione\");\n $chiesa->id_denominazione = $request->input(\"denominazione\");\n\n\n $disk = Storage::disk('gcs');\n\n if ($request->hasFile('foto')) {\n $image = $request->file('foto');\n $name = time() . '.' . $image->getClientOriginalExtension();\n //$destinationPath = public_path('/img/chiese');\n $disk->putFileAs('public/img/chiese', $image, $name);\n //$image->move($destinationPath, $name);\n $chiesa->foto = $name;\n }\n\n auth()->user()->chiesa()->save($chiesa);\n\n return redirect()->to(\"chiesa/home\");\n }", "public function store() {\n \n }", "public function store(Request $request)\n {\n $fileName = 'variates_pisang-' . date('Ymdhis') . '.' . $request->gambar->getClientOriginalExtension();\n $request->gambar->move('gambar/', $fileName);\n Varietas::create([\n 'warna' => $request->warna,\n 'panjang' => $request->panjang,\n 'diameter' => $request->diameter,\n 'bentuk_buah' => $request->bentuk_buah,\n 'bentuk_daun' => $request->bentuk_daun,\n 'bentuk_pohon' => $request->bentuk_pohon,\n 'gambar' => $fileName,\n 'id_jenis' => $request->jenis_pisang\n ]);\n return redirect()->route('varietas.index');\n }", "public function store()\n {\n //$realizarDevolucionService = new RealizarDevolucionService($request, $venta);\n //return redirect()->route('ventas.index');\n }", "public function store(Request $request)\n {\n DB::beginTransaction();\n try{\n $tacNuevo = new Tac;\n $tacNuevo->nombre=$request->nombre;\n $tacNuevo->save();\n //Crear una categoria de servicio asociada a los examen\n $categoria_existe = CategoriaServicio::where('nombre','TAC')->first();\n\n if($categoria_existe==null){\n $categoria_existe = new CategoriaServicio;\n $categoria_existe->nombre = \"TAC\";\n $categoria_existe->save();\n }\n\n $servicio = new Servicio;\n $servicio->nombre = $request->nombre;\n $servicio->f_categoria = $categoria_existe->id;\n $servicio->precio = $request->precio;\n $servicio->f_tac = $tacNuevo->id;\n $servicio->save();\n }catch(\\Exception $e){\n DB::rollback();\n return $e;\n return redirect('/tacs')->with('mensaje', $e);\n }\n DB::commit();\n Bitacora::bitacora('store','tacs','tacs',$tacNuevo->id);\n return redirect('/tacs')->with('mensaje', '¡Guardado!');\n }", "public function store(CreatePeliculasRequest $request){\n //esta funcion sirve para almacenar los datos provenientes de la vista\n $pelicula = new Pelicula();\n $pelicula->nombre = $request->input('nombre');\n $pelicula->ano_lanzamiento = $request->input('ano_lanzamiento');\n $pelicula->descripcion = $request->input('descripcion');\n $pelicula->idioma = $request->input('idioma');\n $pelicula->Promedio_cal = $request->input('promedio_cal');\n $pelicula->precio = $request->input('precio');\n $pelicula->director_id = $request->input('director_id');\n //eso fue solamente para recibir los datos desde la vista, aun no guardamos\n $pelicula->save();\n Session::flash('flash_message','pelicula Creada Con exito!');\n return redirect()->to('pelicula');\n\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\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.6898949", "0.68969494", "0.6860854", "0.6747154", "0.67236966", "0.6691978", "0.6667118", "0.666706", "0.66650814", "0.6660805", "0.6653274", "0.6651254", "0.6650243", "0.662488", "0.6622043", "0.6597772", "0.65807134", "0.6558275", "0.65489846", "0.65489846", "0.65489846", "0.6546641", "0.6539812", "0.65279657", "0.65236396", "0.6518308", "0.6512147", "0.6501446", "0.6490776", "0.64897484", "0.64896643", "0.6486696", "0.6482912", "0.64822644", "0.6481519", "0.6481033", "0.647465", "0.64716303", "0.64690137", "0.6468446", "0.64675254", "0.646715", "0.64662206", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466", "0.64656466" ]
0.69969994
0
Display the specified Vehiculo.
public function show($id) { $vehiculo = $this->vehiculoRepository->findWithoutFail($id); $documentos = $this->centralRepository->validar_documentos_vehiculo($id); $sim_gasto = SimuladorGasto::where('min', '<=', $vehiculo->capacidad) ->where('max', '>=', $vehiculo->capacidad)->first(); $subtotal = $sim_gasto->inversion + $sim_gasto->llantas_completas + $sim_gasto->motor_caja_trasmision + $sim_gasto->ajuste_pintura + $sim_gasto->rodamiento + $sim_gasto->cojineria_vidrios + $sim_gasto->lavado + $sim_gasto->carroceria + $sim_gasto->salario_conductor + $sim_gasto->prestaciones_sociales + $sim_gasto->seguridad_social + $sim_gasto->soat + $sim_gasto->tecnicomecanica + $sim_gasto->revision_bimensual + $sim_gasto->contractual + $sim_gasto->extracontractual + ($sim_gasto->acpm_galon * $sim_gasto->galones_kilometro * 10) + $sim_gasto->aceites_filtros + $sim_gasto->aditivos + $sim_gasto->baterias + $sim_gasto->impuesto_rodamiento + $sim_gasto->impuesto_semaforizacion + $sim_gasto->parqueo + $sim_gasto->tramites_varios + $sim_gasto->administracion + $sim_gasto->plan_reposicion_equipo + $sim_gasto->sistema_comunicacion + $sim_gasto->gps + $sim_gasto->otros; $margen = $subtotal*$sim_gasto->margen/100; $total = $subtotal + ($subtotal*$sim_gasto->margen/100); $valores = []; $valores['subtotal'] = $subtotal; $valores['margen'] = $margen; $valores['total'] = $total; //dd($documentos); if (empty($vehiculo)) { Flash::error('Vehículo No se encuentra registrado.'); return redirect(route('vehiculos.index')); } return view('vehiculos.show')->with(['vehiculo' => $vehiculo, 'documentos' => $documentos, 'sim_gasto' => $sim_gasto, 'valores' => $valores]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Colectivo $colectivo)\n {\n //\n }", "public function show(Vente $vente)\n {\n //\n }", "public function show(Ciclo $ciclo)\n {\n //\n }", "public function show(comercio $idcomercio)\n {\n //\n }", "public function show(Carrinho $carrinho)\n {\n //\n }", "public function show(Vacuna $vacuna)\n {\n //\n }", "public function show($id_ejercicio)\n\t{\n\t\t//\n\t}", "public function show(Conta $conta)\n {\n //\n }", "public function show(OrdemServico $ordemServico)\n {\n //\n }", "public function show(Efectivo $efectivo)\n {\n //\n }", "public function show(Polo $polo)\n {\n //\n }", "public function show(Emploi $emploi)\n {\n //\n }", "public function show(Articulo $articulo)\n {\n //\n }", "public function show($tipo_producto)\n {\n \n }", "public function show(Venta $venta)\n {\n //\n }", "public function show(Venta $venta)\n {\n //\n }", "public function show(Puesto $puesto)\n {}", "public function show(Horario $horario)\n {\n //\n }", "public function show(Prueva $prueva)\n {\n //\n }", "public function show(Comida $comida)\n {\n //\n }", "public function show($codigo){\n $veiculo = Veiculo::where('codigoVeiculo', '=', $codigo)->first();\n if ($veiculo) {\n //SE ENCONTRAR\n return view('admin.veiculo.mostrarVeiculo', compact('veiculo'));\n }else{\n //SE NÃO ENCONTRAR\n return redirect()->route('veiculos');\n }\n }", "public function show(Trabalho $trabalho)\n {\n //\n }", "public function show(Tiempo $tiempo)\n {\n //\n }", "public function show(Comentario $comentario)\n {\n //\n }", "public function show(Comentario $comentario)\n {\n //\n }", "public function show(Cobro $cobro)\n {\n //\n }", "public function show(Feriado $feriado)\n {\n //\n }", "public function show($codigo){\n $livro = Livro::where('codigoLivro', '=', $codigo)->first();\n if ($livro) {\n //SE ENCONTRAR\n return view('livro.mostrarLivro', compact('livro')); \n }else{\n //SE NÃO ENCONTRAR\n return redirect()->route('livros'); \n }\n }", "public function show(Instituicao $instituicao)\n {\n //\n }", "public function show(Dependencia $dependencia)\n {\n //\n }", "public function show(Comprobante $comprobante)\n {\n //\n }", "public function show(Vinicola $vinicola)\n {\n //\n // dd($vinicola);\n return view('vinicola.show',['vinicola'=>$vinicola]);\n }", "public function show(Prato $Prato)\n {\n //\n }", "public function show(carrera_requisito $carrera_requisito)\n {\n //\n }", "public function show(Produto $produto)\n {\n //\n }", "public function show(Seguro $seguro)\n {\n //\n }", "public function show(Conferencia $conferencia)\n {\n //\n }", "public function show(Compras $compras)\n {\n //\n }", "public function show(Relevamiento $relevamiento)\n\t{\n\t\t//\n\t}", "public function show(Inventario $inventario)\n {\n //\n }", "function mostrar($id) {\r\n\r\n /* declarar e inicializar variables */\r\n $this->_vista->titulo = 'Curso-Mostrar';\r\n $this->_vista->curso = new Curso();\r\n $id = $this->filtrarEntero($id);\r\n\r\n /* logica */\r\n $this->_vista->curso->buscar($id);\r\n\r\n // comprobar que el registro exista\r\n if ($this->_vista->curso->getId() == '-1') {\r\n $this->redireccionar('error/tipo/Registro_NoExiste');\r\n }\r\n\r\n $this->_vista->render(\"curso/mostrar\");\r\n }", "public function show(evento $evento)\n {\n //\n }", "public function show(Pelicula $pelicula)\n {\n //\n }", "public function show(cliente $cliente) {\n\t\t//\n\t}", "public function show(Kavomati $kavomati)\n {\n //\n }", "public function showAction() {\n $model = new Application_Model_Compromisso();\n //busco o id que eu quero ver\n $comp = $model->find($this->_getParam('id'));\n //crio uma view para o id referente;\n $this->view->assign(\"compromisso\", $comp);\n }", "public function show(Venta $venta)\n {\n //\n return \"show\";\n //$venta=Venta::find($venta->id);\n //$description=Product::find($description->id);\n // return view('ventas.show',['venta'=>$venta]);\n }", "public function show(equipo $equipo)\n {\n //\n }", "public function show(Pessoa $pessoa)\n {\n //\n }", "public function show(Cour $cour)\n {\n //\n }", "public function show($consulta)\n {\n //\n }", "public function show(Parametre $parametre)\n {\n //\n }", "public function show(Modelo $modelo)\n {\n //\n }", "public function show(Modelo $modelo)\n {\n //\n }", "public function show(Archivo $archivo)\n {\n //\n }", "public function show(Archivo $archivo)\n {\n //\n }", "public function show(Empresa $empresa)\n {\n //\n }", "public function show()\n {\n $vehiculos = Vehiculo::all();\n return view('listar')->with('vehiculos', $vehiculos);\n }", "public function show(Tipo_Propiedad $tipo_Propiedad)\n {\n //\n }", "public function show(ClienteEnvio $clienteEnvio)\n {\n //\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function show(Labarugi $labarugi)\n {\n //\n }", "public function show(ResultAtividade $resultAtividade)\n {\n //\n }", "public function show(inscricao $inscricao)\n {\n //\n }", "public function mostrar(){\n\t\t\t\techo \"<p> Hola soy un $this->marca, modelo $this->modelo</php> \";\n\t\t\t}", "public function show(Vaksin $vaksin)\n {\n //\n }", "public function show(ubicacion $ubicacion)\n {\n //\n }", "public function mostrarVista($vista) {\n //$this->vistaData[TEMPLATE_BREADCUMBS] = $this->breadcumbs;\n $this->vistaData[TEMPLATE_VALORES_DEFECTO] = $this->valoresDefecto;\n //$this->vistaData[TEMPLATE_NOTIFICACION] = $this->notificacion;\n //$this->vistaData[TEMPLATE_MEMBRESIA] = $this->obtenerMembresiaSesion();\n\n // Transformacion de la vista al contenido del template\n $templateData[TEMPLATE_CONTENIDO] = $this->load->view($vista, $this->vistaData, true);\n\n $this->load->view('templates/backend', $templateData);\n return true;\n }", "public function show(contenido_anexo $contenido_anexo)\n {\n //\n }", "public function show()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'show',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/show', $data);\n }", "public function show(Cargos $cargos)\n {\n //\n }", "public function show(PhieuChi $phieuChi)\n {\n //\n }", "public function show(Cruzada $cruzada)\n {\n //\n }", "public function show(Equipe $equipe)\n {\n //\n }", "public function show(Conyugue $conyugue)\n {\n //\n }", "public function show(Venda $venda)\n {\n //\n }", "public function show(qlsv_tudanhgia $qlsv_tudanhgia)\n {\n //\n }", "public function show(factura $factura)\n {\n //\n }", "public function show($Id_Ingreso)\n {\n $ingreso = Ingreso_Vehiculos::find($Id_Ingreso);\n return view('Ingreso_Vehiculos.show',compact('Ingreso_Vehiculos'));\n }", "public function show(Vehicle $vechile)\n {\n //\n }", "public function show($ID_condominio)\n { \n //\n $datosVERMAS = condominio::find($ID_condominio); \n return view('condominio.show', compact('datosVERMAS'));\n }", "public function show(Fornecedores $fornecedores)\n {\n //\n }", "public function show(empresa $empresa)\n {\n //\n }", "public function show(Pedido $pedido)\n {\n //\n }", "public function show(Pedido $pedido)\n {\n //\n }", "public function show(Pedido $pedido)\n {\n //\n }", "public function show(Pedido $pedido)\n {\n //\n }", "public function show(Pedido $pedido)\n {\n //\n }", "public function show(Factura $factura)\n {\n //\n }", "public function show($id)\n {\n //\n $bacheo=Bacheo::find($id);\n //en $objeto tengo aquel que coincide con $id\n return 'Encontre el objeto, hacer algo luego';\n //return view('libro.show',compact('objeto'));\n }", "public function show(Loteria $loteria)\n {\n //\n }", "public function show(Tipo $tipo)\n {\n //\n }", "public function show(anteproyecto $anteproyecto)\n {\n //\n }", "public function show(Evento $evento)\n {\n //\n }", "public function show(Empleado $empleado)\n {\n //\n }", "public function show(Empleado $empleado)\n {\n //\n }", "public function show(Exercice $exercice)\n {\n //\n }", "public function show(Oficina $oficina)\n {\n //\n }", "public function show(Producto $producto)\n {\n //\n }", "public function visualizar()\n {\n //Pega o id da empresa a partir da URL\n $id = $this->uri->segment(3);\n\n //Utiliza o método getById para obter dados sobre a empresa em especifico\n $resultado = $this->EmpresasModel->getById($id);\n\n $dados = array(\"empresaid\" => $resultado);\n\n //Carrega a view passando os dados da query\n $this->load->view(\"Empresas/empresa\", $dados);\n }", "public function showAction(CargoSubDivisao $vaga)\n {\n $this->setBreadCrumb(['id' => $vaga->getId()]);\n\n $deleteForm = $this->createDeleteForm($vaga);\n\n return $this->render('RecursosHumanosBundle::Pessoal/GerenciarVagas/show.html.twig', array(\n 'vaga' => $vaga,\n 'delete_form' => $deleteForm->createView(),\n ));\n }" ]
[ "0.74154145", "0.74003047", "0.73906106", "0.7388134", "0.72750753", "0.7246162", "0.7242881", "0.72159284", "0.7202643", "0.7191979", "0.70558155", "0.70482373", "0.7041686", "0.7041634", "0.703082", "0.703082", "0.70301926", "0.699216", "0.6991406", "0.69889957", "0.6971843", "0.6968897", "0.69003534", "0.6888602", "0.6888602", "0.6863945", "0.68566126", "0.6845031", "0.68425864", "0.6838718", "0.6822917", "0.68164223", "0.67882514", "0.678773", "0.6772712", "0.67562747", "0.6754243", "0.67524546", "0.6739984", "0.67367834", "0.67367375", "0.67226374", "0.6720036", "0.67047745", "0.6697773", "0.6691861", "0.66895", "0.66849965", "0.6680297", "0.6672344", "0.6669013", "0.6663457", "0.6659067", "0.6659067", "0.6649134", "0.6649134", "0.6641282", "0.6640781", "0.6629342", "0.66254365", "0.6624748", "0.6620651", "0.6609877", "0.66055936", "0.6602409", "0.65999573", "0.65958565", "0.659186", "0.6591687", "0.6583184", "0.6581025", "0.6576285", "0.65706253", "0.65689015", "0.6565856", "0.6564501", "0.65598524", "0.6554999", "0.6543461", "0.6536794", "0.65367067", "0.65334624", "0.6531626", "0.65296346", "0.65296346", "0.65296346", "0.65296346", "0.65296346", "0.65285367", "0.6527731", "0.65246904", "0.652233", "0.6518868", "0.6512239", "0.6510058", "0.6510058", "0.65066665", "0.6500978", "0.64996666", "0.64978397", "0.64936477" ]
0.0
-1
Show the form for editing the specified Vehiculo.
public function edit($id) { $vehiculo = $this->vehiculoRepository->findWithoutFail($id); if (empty($vehiculo)) { Flash::error('Vehículo No se encuentra registrado.'); return redirect(route('vehiculos.index')); } $selectores = $this->selectoresComunes(); return view('vehiculos.edit')->with(['vehiculo' => $vehiculo, 'selectores' => $selectores]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit($id_ejercicio)\n\t{\n\t\t//\n\t\treturn view('admin.ejercicios.createUpdate')->with('ejercicios', \\App\\Ejercicios::find($id_ejercicio));\n\t}", "public function edit(Vinicola $vinicola)\n {\n //\n $edit = true;\n $uvas= Uva::orderBy('title','asc')->get();\n return view('vinicola.form',['vinicola'=>$vinicola,'edit'=>$edit,'uvas'=>$uvas]);\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 // return \"Mostrar aqui formulario para formapago con id $id\";\n $formaPagos = FormaPago::find( $id );\n return view('admin.formapago.edit')->with(compact('formaPagos')); //formulario de registro\n }", "public function edit($id=null){\n\t\t\t$pagina = page($this->dados['modulo'], 'form');\t\t\t\n\t\t\t//se formulário for submetido\n\t\t\tif($this->input->post()){\n\t\t\t\t//setando os valores a serem enviado ao bd\n\t\t\t\t$data = setData($this->input->post());\t\n\t\t\t\t$data['administrador_id'] = $this->administrador_id;\n\t\t\t\t//alteracao\n\t\t\t\tif($data['veiculo_id']>0){\n\t\t\t\t\t$this->veiculo->update($data['veiculo_id'], $data);\n\t\t\t\t}\n\t\t\t\t//cadastro\n\t\t\t\telse{\n\t\t\t\t\t$data['veiculo_data'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$this->veiculo->insert($data);\n\t\t\t\t}\n\t\t\t\tredirect('veiculo');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->load->model('computador_model');\n\t\t\t\t$this->dados['computadores'] = $this->computador_model->getAll(array('computador_status'=>1), array('computador_nome','asc'));\n\t\t\t\t//alteracao\n\t\t\t\tif(!is_null($id)){\n\t\t\t\t\t$this->dados['veiculo'] = $this->veiculo->getById($id);\n\t\t\t\t}\n\t\t\t\t//pagina do formulário\n\t\t\t\t$this->template->view($pagina, $this->dados);\n\t\t\t}\n\t\t}", "public function editarCarreraController(){\n $datosController = $_GET[\"id\"];\n //Enviamos al modelo el id para hacer la consulta y obtener sus datos\n $respuesta = Datos::editarCarreraModel($datosController, \"carreras\");\n //Recibimos respuesta del modelo e IMPRIMIMOS UNA FORM PARA EDITAR\n echo'<input type=\"hidden\" value=\"'.$respuesta[\"id\"].'\"\n name=\"idEditar\">\n <input type=\"text\" value =\"'.$respuesta[\"nombre\"].'\"\n name=\"carreraEditar\" required>\n <input type=\"submit\" value= \"Actualizar\">';\n }", "public function edit($id)\n {\n $jovenes=Jovenes::find($id);\n return view ('administrador.modificarjovenes')->with(['jovenes'=>$jovenes]); \n \n }", "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\t$vehiculo = Vehiculo::find($id);\n\n\t\treturn View::make('vehiculos.edit', compact('vehiculo'));\n\t}", "public function edit(EmpresaTipo $id)\n {\n return view('editar-ug0299', ['Empresa' => $id]);\n }", "public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }", "public function edit($idcomercio)\n {\n $admin= Comercio::findOrFail($idcomercio);\n\n return view('comercio.edit',compact('admin'));\n }", "public function edit($ID_condominio)\n {\n //\n $condominio=Condominio::findOrFail($ID_condominio);\n return view('condominio.edit', compact('condominio'));\n }", "public function edit($id_empresa)\n {\n $empresa=empresa::find($id_empresa);\n return view ('admin.empresa.edit', compact ('empresa'));\n }", "public function edit($id_cliente){}", "public function edit($id)\n {\n $cuestionario = Cuestionario::find($id);\n return view('admin.cuestionarios.edit',compact('cuestionario'));//muestra el formulario \n }", "public function edit($id)\r\n\t{\r\n\t\t//\r\n $form_data = array('route' => ['comercios.update',$id], 'method' => 'PATCH');\r\n $action = 'Modificar';\r\n $comercio = $this->comerciosRepo->find($id);\r\n return View::make(\"comercios.create\",compact(\"form_data\",\"action\",\"comercio\"));\r\n\r\n\t}", "public function edit($id)\n {\n $comentario = Comentario::find($id);\n return view('comentario.edit')->with('comentario', $comentario);\n }", "public function edit(Conta $conta)\n {\n //\n }", "public function edit($id)\n {\n $vehiculo=Vehiculos::findOrFail($id);\n return view('vehiculos.edit',compact('vehiculo'));\n }", "public function edit($id)\n {\n if(!$veiculo = $this->repositoryVeiculo->find($id))\n {\n return redirect()->back();\n }\n $vagas = Vaga::all();\n $moradores = Morador::all();\n return view('pages.admin.veiculos.edit',compact('veiculo', 'vagas', 'moradores'));\n }", "public function edit($id)\n {\n $user = auth()->user();\n\n if($user->perfil === 'cliente'){\n return redirect()->route('painel.index');\n }\n\n $editar = Emprestimo::with('cliente', 'parcelas')->find($id);\n\n if($editar){\n $cliente = $editar->cliente;\n return View('painel.emprestimos.form', compact('editar','cliente'));\n }else{\n return redirect()->back();\n }\n }", "public function editarmiperfil()\n {\n return view('formularios.formulariousuario');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function editar ()\n {\n try {\n // Define a ação de editar\n $acao = Orcamento_Business_Dados::ACTION_EDITAR;\n \n if ( $this->_requisicao->isGet () ) {\n // Retorna parâmetros informados via get, após validações\n $parametros = $this->trataParametroGet ( 'cod' );\n \n // Busca os dados a exibir, após validações\n $registro = $this->trataRegistro ( $acao, $parametros );\n \n // Cria o formulário populado com os dados\n $formulario = $this->popularFormulario ( $acao, $registro );\n \n // Faz transformações no formulário, se necessário\n $formulario = $this->transformaFormulario ( $formulario, $acao );\n \n // Bloqueia a edição de campos de chave primária (ou composta)\n $this->bloqueiaCamposChave ( $formulario );\n \n // Bloqueia todos os campos\n $this->bloqueiaCamposTodos ( $acao, $formulario, $registro );\n \n // Exibe o formulário\n $this->view->formulario = $formulario;\n } else {\n // Cria o formulário vazio\n $formulario = $this->retornaFormulario ( $acao );\n \n // Grava o novo registro\n $this->gravaDados ( $acao, $formulario );\n }\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "public function edit($id)\n\t{\n return View::make('carros.edit');\n\t}", "public function edit($id)\n {\n $datos['efectivo'] = Efectivo::findOrFail($id); \n return view('efectivo.edit', $datos);\n }", "public function action_editar() {\r\n\t\tif(!Session::instance()->GetUsuario())\r\n \treturn $this->redirect(\"/\");\r\n $links = new Model_Link();\r\n $template = View::factory(\"base/menu\");\r\n $template->set(\"usuario\", Session::instance()->GetUsuario());\r\n $template->set(\"links\", $links->ObtenerLinks(Session::instance()->GetUsuario()));\r\n\t\t/***************************************/\r\n\t\t$template->body = View::factory(\"compromiso/editar\");\r\n\t\t\r\n\t\t$compromisoId = $this->request->param('id');\r\n\t\t$compromiso = new Model_Compromiso($compromisoId);\r\n\t\t$template->body->set(\"compromiso\", $compromiso);\r\n\t\t$template->set(\"scripts\", $this->scripts);\r\n\t \t$template->set(\"styles\", $this->styles);\r\n\t\t\r\n\t\t$this->response->body($template);\r\n\t}", "public function edit($idReino)\n {\n $dominios = Dominio::all();\n $reinos = Reino::find($idReino);\n return view('reino.edit',compact('reinos','dominios'));\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_historico_atleta_cameponato\n\t\t$fbf_historico_atleta_cameponato = FbfHistoricoAtletaCameponato::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_historico_atleta_cameponato\n\t\t$this->layout->content = View::make('fbf_historico_atleta_cameponato.edit')\n->with('fbf_historico_atleta_cameponato', $fbf_historico_atleta_cameponato);\n\t}", "public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }", "public function editarAction () {\n // Título da tela (action)\n $this->view->telaTitle = 'Editar Exercício Orçamentário';\n\n // Instancia a regra de negócio\n $negocio = new Orcamento_Business_Negocio_Exercicio();\n\n // Fase\n $fase = new Orcamento_Model_DbTable_FaseAnoExercicio();\n\n $formulario = new $this->_formulario ();\n $this->view->formulario = $formulario;\n\n // Verifica o tipo de requisição Get / Post\n if ($this->getRequest()->isGet()) {\n // Busca dados para o preenchimento do formulário\n $cod = $this->_getParam('cod');\n\n if ($cod) {\n // Busca registro específico\n $registro = $negocio->retornaRegistro($cod);\n\n if ($registro) {\n // TODO Remover a linha a seguir\n // $contrato = $this->_CeoTbAnoExercicio->retornaRegistro($cod);\n\n $camposChave = $negocio->chavePrimaria();\n\n foreach ($camposChave as $chave) {\n $formulario->$chave->setAttrib('readonly', true);\n }\n $formulario->populate($registro);\n } else {\n $this->registroNaoEncontrado();\n }\n\n $this->view->fase = $dadosfase = $fase->fetchRow(\"FANE_NR_ANO = $cod\");\n } else {\n $this->codigoNaoInformado();\n }\n } else {\n // Busca dados do formulário\n $dados = $this->getRequest()->getPost();\n $chavePrimaria = $this->_getParam('cod');\n\n if ($formulario->isValid($dados)) {\n\n $dados = $formulario->getValues();\n\n $resultado = $negocio->editarExercicioFase($dados);\n\n if ($dados['FANE_ID_FASE_EXERCICIO'] == Trf1_Orcamento_Definicoes::FASE_EXERCICIO_EM_EXECUCAO) {\n\n $negocio->copiaValores($dados);\n }\n\n if( !$resultado [ 'sucesso' ] ) {\n // inclui na tabela de log do orçamento\n $this->_logdados->incluirLog( $dados[\"ANOE_AA_ANO\"] );\n // Mensagem sucesso\n $this->_helper->flashMessenger ( array ( message => Orcamento_Business_Dados::MSG_ALTERAR_ERRO . '<br />' . $resultado [ 'msgErro' ] ) );\n }\n\n // Salvo com sucesso\n $this->_helper->flashMessenger(array(message => Orcamento_Business_Dados::MSG_SUCESSO_EXERCICIO, 'status' => 'success'));\n\n // Limpa o cache para listagem na index\n $negocio->excluiCaches();\n\n // Redireciona para o modulo\n $this->voltarIndexAction();\n } else {\n // Reapresenta os dados no formulário para correção do usuário\n $formulario->populate($dados);\n }\n }\n }", "public function edit(){\n $factura = parent::find($_GET['id']);\n require_once 'views/employee/layouts/header.php';\n require_once 'views/employee/factura/edit.php';\n require_once 'views/employee/layouts/footer.php';\n\n }", "public function edit(Colectivo $colectivo)\n {\n //\n }", "public function edit($id)\n {\n //\n $servico = Servico::find($id);\n\n return view(\"{$this->nameFolder}/edit\", [\"servico\"=>$servico]);\n }", "public function edit(Articulo $articulo)\n {\n //\n }", "public function edit(Articulo $articulo)\n {\n //\n }", "public function edit(Producto $producto)\n {\n return view('producto.edit',compact('producto'));\n }", "public function edit(Venta $venta)\n {\n //\n }", "public function edit(Venta $venta)\n {\n //\n }", "public function edit(Venta $venta)\n {\n //\n }", "public function edit($id)\n {\n // busca regstro\n $this->repository->findOrFail($id);\n \n // autorizacao\n $this->repository->authorize('update');\n \n // breadcrumb\n $this->bc->addItem($this->repository->model->usuario, url('usuario', $this->repository->model->codusuario));\n $this->bc->header = $this->repository->model->usuario;\n $this->bc->addItem('Alterar');\n \n // retorna formulario edit\n return view('usuario.edit', ['bc'=>$this->bc, 'model'=>$this->repository->model]);\n }", "public function edit($id){\n $pelicula = Pelicula::find($id);\n return view('pelicula.edit',compact('pelicula', $pelicula));\n }", "public function edit($id)\n {\n return view('cadastro::edit');\n }", "public function edit($id)\n {\n // Localiza o registro pelo seu ID\n $cliente = Cliente::findOrFail($id);\n // Obtém todos os registros da tabela de classificação\n $clientes = Cliente::orderBy('CLI_ID', 'desc')->paginate(6);\n // Chama a view com o formulário para edição do registro\n return view(\n 'cadastros/clientes/editar',\n [\n 'cliente' => $cliente,\n 'clientes' => $clientes\n ]\n );\n }", "public function edit($idEspecie)\n {\n \n $generos = Genero::all();\n $especies = Especie::find($idEspecie);\n return view('especie.edit',compact('especies','generos'));\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 edit($id) {\n // Se obtiene el aviso por su ID\n $aviso = Aviso::find($id);\n $categorias = Categoria::all();\n //$user = User::find($aviso->idUsuario);\n\n // Se muestra una vista con los datos del aviso\n return view('usuario.edit')->with('aviso', $aviso)->with('categorias', $categorias);\n }", "public function edit(Kavomati $kavomati)\n {\n //\n }", "public function edit(Trabalho $trabalho)\n {\n //\n }", "public function edit($id)\n {\n $modelo = Modelo::find(Input::get('id_modelo'));\n\n // Si tiene una accion diferente para el envío del formulario\n $url_action = 'web';\n if ($modelo->url_form_create != '') {\n $url_action = $modelo->url_form_create.'?id='.Input::get('id').'&id_modelo='.Input::get('id_modelo');\n }\n\n $registro = app($modelo->name_space)->where('id',$id)->get()->first();\n\n $miga_pan = $this->get_miga_pan($modelo,$registro->descripcion);\n\n return view( 'pagina_web.secciones.edit', compact('registro', 'url_action', 'miga_pan') );\n }", "public function edit(Empresa $empresa)\n {\n \n }", "public function edit($id)\n {\n $prodi = $this\n ->prodiRepo\n ->getSingleData($id);\n\n $prodiMaster = $this\n ->prodiMasterRepo\n ->getAllData();\n\n return view('dasbor.pengguna.prodi.form_ubah', compact(\n 'prodi', 'prodiMaster'\n ));\n }", "public function edit($id)\n {\n $empresa = Empresa::find($id);\n return view('empresas.edit')\n ->with(['edit' => true, 'empresa' => $empresa]);\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function edit(Producto $producto)\n { \n return view('producto.edit', compact('producto'));\n }", "public function edit($id)\n {\n $Secteur = Secteur::all();\n \n $Entreprise = Entreprise::find($id);\n \n\n \n return view('Entreprise.ModifierEntreprise')->with('Entreprise',$Entreprise)->with('Secteur',$Secteur);\n \n }", "public function edit($id)\n {\n //mengarahkan ke halaman form edit\n $data = DB::table('pemilik')->where('id', $id)->get();\n\n return view('pemilik.form_edit', compact('data'));\n }", "public function edit(Feriado $feriado)\n {\n //\n }", "public function edit(Articulo $articulo)\n {\n $categoria=Categoria::all();\n $marca=Marca::all();\n return view('website.backend.articulo.update', compact('articulo','categoria','marca'));\n\n\n }", "public function edit($id)\n {\n $carrera = Carrera::findOrFail($id);\n \n return view('carrera.formulario.edit', compact('carrera'));\n \n \n }", "public function editar_usuario($codigo_usuario){\n $data['usuario_editar'] = $this->model_admin->form_usuario($codigo_usuario);\n $this->load->view('view_librerias');\n $this->load->view('view_form_nuevo',$data);\n }", "public function edit(producto $producto)\n {\n //\n }", "public function edit($id)\n {\n return view(\n 'components/forms/form-personne',\n [\n 'redirect' => 'modifierPersonne',\n 'personne' => Personne::find($id),\n ]\n );\n }", "public function edit($id)\n {\n $Filiere = Filiere::all();\n \n $etudiant = Etudiant::find($id);\n \n return view('Etudiants.ModifierEtudiant')->with('etudiant',$etudiant)->with('Filiere',$Filiere);\n\n\n \n }", "public function edit(MataKuliah $matakuliah)\n {\n return view('matakuliah.edit',compact('matakuliah'));\n }", "public function edit($id)\n\t{\n\t\t$data = Koperasi::find($id);\n\t\treturn View::make('usp.koperasi.edit')->with('data',$data)\n\t\t->with('page','Koperasi')->with('modul','Edit');\n\t}", "public function editar(){\n\t\t\n\t\t$this->form_validation->set_rules('resposta', 'RESPOSTA', 'trim');\n\t\tif ($this->form_validation->run()==TRUE):\n\t\t$dados = elements(array('resposta'), $this->input->post());\n\t\t$this->Comentarios->do_update($dados, array('id_comentario'=>$this->input->post('idcomentario')));\n\t\tendif;\n\t\tset_tema('titulo', 'Resposta de Coment&aacute;rio');\n\t\tset_tema('conteudo', load_modulo('Comentarios', 'editar'));\n\t\tload_template();\n\t}", "public function edit($id)\n {\n if(Papel::find($id)->nome == \"admin\"){\n return redirect()->route('papeis.index');\n }\n\n $registro = Papel::find($id);\n\n return view('painel.gerenciamento.modal.editarPapel',compact('registro'));\n }", "public function edit($id)\n {\n $miembro = Miembro::find($id);\n\n return View::make('miembros.edit')->with(array('miembro' => $miembro));\n }", "public function edit(Cliente $cliente)\n {\n //\n return view ('clientes.edit',compact('cliente'));\n \n\n //---- A EDITAR EL CLIENTE \n }", "public function edit($id)\n {\n $contato = Contatos::find($id);\n return view('contatos.edit')->with('contato', $contato);\n }", "public function edit($id)\n\t{\n\t\t$tercero = Tercero::findOrFail($id);\t\n\n\t\treturn view('terceros.editar', compact('tercero'));\n\t\t\n\t}", "public function edit()\n {\n $user = Auth::user();\n $id = $user->id;\n $usuario = Usuario::find($id);\n\n // Conseguir id del estudiante\n $id_estudiante = $usuario->estudiante->id;\n $estudiante = Estudiante::find($id_estudiante);\n\n return view('estudiante.edit', [\n 'generos' => $this->generos,\n 'estudiante' => $estudiante\n ]);\n }", "public function edit($id)\n\t{\n $sociosCombo = $this->sociosRepo->getComboNroLegajo();\n $prestamo = $this->prestamosRepo->find($id);\n $action = \"Editar\";\n $form_data = array('route' =>'prestamos.actualizar', 'method' => 'PATCH','id' => 'prestamoForm');\n return View::make(\"prestamos.create\",compact(\"sociosCombo\",\"action\",\"form_data\",\"prestamo\"));\n\t}", "public function edit(Producto $producto)\n {\n \n }", "public function edit($id)\n {\n return view('inmobiliario.oficina.edit',[\"oficina\" => oficina::find($id), 'edificio' => edificio::get(['id', 'nombre', 'vigencia'])->where('vigencia',1)]);\n }", "public function edit($id)\n {\n $NivelEstudio = NivelEstudio::find($id);\n return view('nivelestudio.form', compact('NivelEstudio'));\n }", "public function edit($id)\n {\n $cliente = Cliente::find($id);\n return view('admin.clientes.edit')->with('cliente', $cliente);\n }", "public function edit($Id_Ingreso)\n {\n $ingreso = Ingreso_Vehiculos::find($Id_Ingreso);\n $vehiculos_id_vehiculos = DB::table('ingreso_vehiculos')->select('ingreso_vehiculos.Id_Ingreso', 'Ingreso_Vehiculos.Vehiculo_Id_Vehiculo')->get();\n return view('Ingreso_Vehiculos.edit', compact('ingreso'))->with('Vehiculos_Id_Vehiculos',$vehiculos_id_vehiculos);\n\n }", "public function edit()\n\t{\n\t\t\t$id = Auth::id();\n\t\t\n\t\t $userCardio = User::find($id)->UserCardio;\n\n\n // show the edit form and pass the userStat\n return View::make('userCardio.edit')\n ->with('userCardio', $userCardio);\n\t\t\n\t}", "public function edit($id)\n {\n $producto=DivisionProducto::find($id);\n $lotes=DivisionProducto::lotes($id);\n return view('Inventarios.edit',compact('producto','lotes'));\n }", "public function edit(Emploi $emploi)\n {\n //\n }", "public function edit(Produto $produto)\n {\n //\n }", "public function edit($id)\n {\n $cliente = Cliente::findOrFail($id); //Busca al cliente utilizando su id \n\n return view('clientes.edit',compact('cliente'));//Redirecciona a la pagina de editar y pasa como parametro el cliente \n }", "public function edit($id)\n {\n $contrato= Contrato::find($id);\n return view('pig.contratos.edit')->with('contrato',$contrato);\n \n\n\n }", "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 edit(Carrinho $carrinho)\n {\n //\n }", "public function edit()\n {\n $id = $_GET['id'];\n $encargo = Encargo::where('id',$id)->first();\n\n return view('encargo.edit', compact('encargo'));\n }", "public function edit($id)\n {\n //\n $cliente = $this->cliente;\n return view('clientes.edit', compact('cliente'));\n }", "public function edit($id_cliente,$id)\n\n {\n\n $nombre = Cliente::find($id_cliente);\n $grasa = Grasa::findOrfail($id);\n $id_cliente = Cliente::findOrFail($id_cliente);\n return view('botongrasaeditar')->with(\"grasa\", $grasa)->with(\"id\", $id_cliente)->with(\"nombre\",$nombre);\n\n }", "public function edit(Empresa $empresa)\n {\n //\n }", "public function edit($id)\n {\n $park = Parqueadero::find($id);\n $tipo_park = Tipo_park::all();\n $ubicacion = Ubicacion::all()->where('tipo', '2');\n return view('superadmin.parqueadero.formEditParkSuperAdmin', compact('park', 'tipo_park', 'ubicacion'));\n \n }", "public function editarEmpleado($id)\n {\n if($id){\n $empleado = $this->empleadorepo->buscar($id);\n $cargo = $this->empleadorepo->editar();\n }\n return view('empleado.editar', compact('empleado', 'cargo'));\n }", "public function editar(){\n $cedula = $_GET['cedula'];\n //2. usar el modelo para traer de la BD el estudiante\n $estudiante = $this->model->buscarEstudiante($cedula);\n //3. llamar a la vista de editar\n require_once 'view/include/header.php';\n require_once 'view/estudiante/editar.php';\n require_once 'view/include/footer.php';\n }", "public function edit($id){\n $coleccion = Coleccion::findOrFail($id);\n return view('panel.colecciones.edit', compact('coleccion'));\n }", "public function edit($id)\n {\n //\n $cliente = Cliente::find($id);\n return view('pages.edit-cliente', compact('cliente'));\n }", "public function edit($id)\n {\n return view(\"revolution.empresa.edit\",[\"empresa\"=>Empresa::findOrFail($id)]);\n }", "public function editarPagoController()\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t{\n\t\t\t\t$datosController = $_GET[\"id\"];\n\t\t\t\t$respuesta = Datos::editarPagoModel($datosController, \"pagos\");\n\t\t\t\t$actualDate = $respuesta['fecha_envio'];\n\t\t\t\t$newDate = date('Y-m-d\\TH:i:s', strtotime($actualDate));\n\n\t\t\t\t//Se crea el formulario donde iran los respectivos datos del pago que se pretende modificar\n\t\t\t\techo'<div class=\"card card-success\">\n \t\t\t<div class=\"card-header\">\n \t\t\t<h3 class=\"card-title\">Editar Producto</h3>\n \t\t\t</div>\n \t\t\t<div class=\"card-body\">\n \t\t\t\t<input name=\"idEditar\" class=\"form-control form-control-lg\" type=\"hidden\" placeholder=\".input-lg\" value = \"'.$respuesta[\"id_pago\"].'\">\n \t\t\t\t<br>\n\n \t\t\t<input name=\"mamaEditar\" class=\"form-control form-control-lg\" type=\"text\" placeholder=\".input-lg\" value = \"'.$respuesta[\"nombre_mama\"].'\">\n \t\t\t<br>\n \t\t\t<input name=\"fecha_pago\" class=\"form-control form-control-lg\" type=\"date\" placeholder=\".input-lg\" value = \"'.$respuesta['fecha_pago'].'\">\n \t\t\t<br>\n\n \t\t\t<input name=\"fecha_envio\" class=\"form-control form-control-lg\" type=\"datetime-local\" placeholder=\".input-lg\" value = \"'.$newDate.'\">\n \t\t\t<br>\n \t\t\t<input name=\"folioEditar\" class=\"form-control form-control-lg\" type=\"text\" placeholder=\".input-lg\" value = \"'.$respuesta[\"folio\"].'\">\n \t\t\t<br>\n \t<br>\n \t\t\t<button type=\"submit\" name=\"btn_actualizar\" id=\"btn\" class=\"btn btn-block btn-outline-primary\" onclick=\"confirmarUpdate();\" style=\"float:right;\">Guardar cambios</button>\n \t\t\t</div>\n \t\t</div>';\n\t\t\t}\n\n\t\t}", "public function edit($id)\n {\n $cliente = Cliente::find($id);\n return view('admin.clientes.edit',['cliente'=>$cliente]);\n }", "public function edit($id)\n {\n $m = new MataKuliah;\n $subheader = 'Edit Mata Kuliah '.$m->findOrFail($id)->prodi->findOrFail($m->findOrFail($id)->prodi_id)->deskripsi;\n $prodi = $m->findOrFail($id)->prodi->findOrFail($m->findOrFail($id)->prodi_id)->deskripsi;\n $prodi_id = $m->findOrFail($id)->prodi->findOrFail($m->findOrFail($id)->prodi_id)->id;\n $data = $m->findOrFail($id);\n return view('matakuliah.edit', compact('subheader','prodi','prodi_id', 'data'));\n }" ]
[ "0.78680384", "0.77241254", "0.7597861", "0.7463906", "0.7440688", "0.7434401", "0.74077845", "0.7400581", "0.7376437", "0.7372395", "0.7369678", "0.73598033", "0.73469", "0.7346142", "0.7326849", "0.73184943", "0.7307884", "0.7299717", "0.7298198", "0.7286557", "0.7285396", "0.72849035", "0.7284203", "0.72795975", "0.727472", "0.72626877", "0.7231841", "0.7227948", "0.72228974", "0.72226864", "0.72223663", "0.72211105", "0.7221036", "0.7209895", "0.72064316", "0.7194756", "0.7194756", "0.71941555", "0.71939516", "0.71939516", "0.71939516", "0.7192955", "0.7191358", "0.71878356", "0.71854585", "0.7181943", "0.7179845", "0.7175865", "0.7170316", "0.7169086", "0.7169069", "0.7161319", "0.7160064", "0.715835", "0.7157243", "0.7153962", "0.7153427", "0.7151653", "0.7150232", "0.71482205", "0.71417147", "0.7138137", "0.7130767", "0.71305454", "0.7130309", "0.7129429", "0.7128393", "0.7124574", "0.71244", "0.7122908", "0.711621", "0.7114391", "0.71132565", "0.71131194", "0.71131015", "0.7112123", "0.71107817", "0.71100813", "0.71094894", "0.7107437", "0.71029264", "0.71025556", "0.7101678", "0.70971113", "0.7096071", "0.7092306", "0.70919645", "0.7090105", "0.70894426", "0.7086623", "0.7086411", "0.7085051", "0.7084765", "0.70844674", "0.7083681", "0.70821047", "0.70818627", "0.70801157", "0.7080073", "0.70800453", "0.7079299" ]
0.0
-1
Update the specified Vehiculo in storage.
public function update($id, UpdateVehiculoRequest $request) { $vehiculo = $this->vehiculoRepository->findWithoutFail($id); if (empty($vehiculo)) { Flash::error('Vehículo No se encuentra registrado.'); return redirect(route('vehiculos.index')); } $input = $request->all(); $input['user_id'] = Auth::id(); $vehiculo = $this->vehiculoRepository->update($input, $id); Flash::success('Vehículo actualizado correctamente.'); return redirect(route('vehiculos.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(Request $request, $id) {\n //actualizamos el articulo\n //buscamos el producto\n try {\n $producto = \\App\\Producto::find($id);\n\n $producto->category_projects_id = $request->category_id;\n $producto->title = $request->title;\n $producto->subtitle = $request->subtitle;\n $producto->year = $request->year;\n $producto->medida = $request->medida;\n $producto->position = $request->position;\n\n if($request->hasFile('pintura')){\n /*$split = explode(\"/\",$producto->img);\n $path = storage_path(\"app/public/\".$split[1]);\n unlink($path);\n\n $fileUpdate = $request->file(\"pintura\");\n $directory = Storage::putFile('public', new File($fileUpdate));\n $directorySubString = explode(\"/\",$directory); \n $nameOfFile = 'storage/'.$directorySubString[1];*/\n \n $pathToSave = env(\"PATH_SAVE_IMAGES\");\n \n //eliminamos archivo anterior\n $directorySubStringLastFile = explode(\"/\",$producto->img); \n //dd($pathToSave.$directorySubStringLastFile[1]);\n unlink($pathToSave.$directorySubStringLastFile[1]);\n\n $fileUpdate = $request->file(\"pintura\");\n $directory = Storage::putFile('public', new File($fileUpdate), \"public\");\n\n //initial posicion\n $initialPath = storage_path(\"app/\".$directory);\n //dd($initialPath);\n\n //final position\n $directorySubString = explode(\"/\",$directory); \n $nameOfFile = 'storage/'.$directorySubString[1];\n $finalpath = $pathToSave.$directorySubString[1];\n \n\n if(!file_exists($pathToSave)){\n mkdir($pathToSave,0777,true);\n }\n\n if(!rename($initialPath, $finalpath)){\n return redirect(\"admin/producto?tipo=error&mensaje=Ocurrio Un error guardando el archivo, intentelo nuevamente; \".$ex->getMessage());\n }\n\n $producto->img = $nameOfFile;\n $producto->modal = $nameOfFile;\n }\n \n if ($producto->save()) {\n return redirect(\"admin/producto?mensaje=Se modifico el producto con exito&tipo=success\");\n } else {\n return redirect(\"admin/producto?mensaje=No se modifico el producto con exito&tipo=warning\");\n }\n } catch (\\Exception $ex) {\n dd($ex);\n return redirect(\"admin/producto?mensaje=Error&tipo=error\");\n }\n }", "public function update(StoreEstimuloRequest $request, $id)\n {\n try{\n $estimulos = Estimulos::find($id);\n $estimulos->SC_Estimulos_Reporta = $request->SC_Estimulos_Reporta;\n $estimulos->SC_Estimulos_Razon = $request->SC_Estimulos_Razon;\n $estimulos->SC_Estimulos_Detalles = $request->SC_Estimulos_Detalles;\n $estimulos->SC_Estimulos_Fecha = $request->SC_Estimulos_Fecha;\n $estimulos->SC_Ficha_FK_ID = $request->SC_Ficha_FK_ID;\n $estimulos->SC_Aprendiz_FK_ID =$request->SC_Aprendiz_FK_ID;\n $estimulos->SC_TipoEstimulos_FK_ID = $request->SC_TipoEstimulos_FK_ID;\n $estimulos->save();\n return redirect()->route('estimulos.index')->with('status', 'Estimulo actualizado');\n }\n catch(\\Illuminate\\Database\\QueryException $e){\n return redirect()->route('estimulos.index')->with('status', 'No se ha podido actualizar');\n }\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function updated(Request $request, $id)\n {\n $servicio = Servicio::find($id);\n $servicio->titulo = strtoupper($request->titulo);\n $servicio->descripcion = $request->descripcion;\n $servicio->disposicion = $request->disposicion;\n $servicio->configuracionfuente_id = $request->configuracionfuente_id;\n $tipo_fondo = $servicio->tipo_fondo;\n if ($request->tipo_fondo == '') {\n $servicio->tipo_fondo = $tipo_fondo;\n }\n if ($request->tipo_fondo != '') {\n if ($request->tipo_fondo == 'IMAGEN') {\n if (isset($request->fondo)) {\n //el fondo es una imagen\n $file = $request->file('fondo');\n $name = time() . $file->getClientOriginalName();\n $filename = \"img/\" . $name;\n $flag = file_put_contents($filename, file_get_contents($file->getRealPath()), LOCK_EX);\n if ($flag !== false) {\n $servicio->fondo = $filename;\n $servicio->tipo_fondo = 'IMAGEN';\n $servicio->repetir = $request->repetir;\n $servicio->direccion = $request->direccion;\n } else {\n $message = 'Error inesperado al intentar guardar la imagen de fondo, por favor intente nuevamente mas tarde';\n return redirect()->back()->withInput($request->input())\n ->with('mensaje_error', $message);\n }\n }\n } else {\n $servicio->fondo = $request->fondo;\n $servicio->tipo_fondo = \"COLOR\";\n }\n }\n $result = $servicio->save();\n if ($result) {\n $message = 'La sección fue modificada correctamente.';\n $variables_url = $request->variables_url;\n return redirect(url('seccion/' . $request->widget_id) . $variables_url)->with('flash_message', $message);\n } else {\n $message = 'La sección no fue modificada de forma correcta.';\n $variables_url = $request->variables_url;\n return redirect(url('seccion/' . $request->widget_id) . $variables_url)->with('flash_message', $message);\n }\n }", "public function update($contenido);", "public function update(Request $request)\n {\n $this->validator($request->all())->validate();\n $chiesa = auth()->user()->chiesa;\n $chiesa->update($request->all());\n $chiesa = auth()->user()->chiesa;\n $chiesa->id_comune = $request->input(\"comune\");\n $chiesa->id_denominazione = $request->input(\"denominazione\");\n\n $chiesa->id_congregazione = $request->input(\"congregazione\");\n $disk = Storage::disk('gcs');\n if ($request->hasFile('foto')) {\n if ($disk->exists('public/img/chiese/' . $chiesa->foto))\n $disk->delete('public/img/chiese/' . $chiesa->foto);\n $image = $request->file('foto');\n $name = time() . $chiesa->id . '.Mihael.' . $image->getClientOriginalExtension();\n $disk->putFileAs('public/img/chiese', $image, $name);\n $chiesa->foto = $name;\n\n }\n\n $chiesa->save();\n\n return redirect()->to(\"chiesa/home\");\n }", "public function update(ProductosUpdateRequest $request, $id)\n {\n $producto=Productos::find($id);\n $proveedor=Proveedor::find($producto->codgo_prov); \n\n $producto->fill($request->all());\n\n $nameDirectory=\"/Farma/\".$proveedor->razonsocial.\"-\".$proveedor->nit;\n\n if ($request->pltlla_vtaplaza != \"\") {\n $nameFile=$request->pltlla_vtaplaza->getClientOriginalName();\n $directorio=$nameDirectory.\"/\".$nameFile;\n \\Storage::disk('farma')->put($directorio, \\File::get($request->pltlla_vtaplaza));\n $producto->plantlla_vtaplaza = $nameFile;\n }\n\n if ($request->pltlla_vtaimpprove != \"\") { \n $nameFile=$request->pltlla_vtaimpprove->getClientOriginalName();\n $directorio=$nameDirectory.\"/\".$nameFile;\n \\Storage::disk('farma')->put($directorio, \\File::get($request->pltlla_vtaimpprove));\n $producto->plantlla_vtaimpprove = $nameFile;\n }\n\n if ($request->pltlla_calbrcion != \"\") {\n $nameFile=$request->pltlla_calbrcion->getClientOriginalName();\n $directorio=$nameDirectory.\"/\".$nameFile;\n \\Storage::disk('farma')->put($directorio, \\File::get($request->pltlla_calbrcion));\n $producto->plantlla_calbrcion = $nameFile;\n }\n\n if ($request->pltlla_valdcion != \"\") { \n $nameFile=$request->pltlla_valdcion->getClientOriginalName();\n $directorio=$nameDirectory.\"/\".$nameFile;\n \\Storage::disk('farma')->put($directorio, \\File::get($request->pltlla_valdcion));\n $producto->plantlla_valdcion = $nameFile;\n }\n\n if ($request->pltlla_corrctvo != \"\") {\n $nameFile=$request->pltlla_corrctvo->getClientOriginalName();\n $directorio=$nameDirectory.\"/\".$nameFile;\n \\Storage::disk('farma')->put($directorio, \\File::get($request->pltlla_corrctvo));\n $producto->plantlla_corrctvo = $nameFile;\n }\n\n if ($request->pltlla_mantnmiento != \"\") { \n $nameFile=$request->pltlla_mantnmiento->getClientOriginalName();\n $directorio=$nameDirectory.\"/\".$nameFile;\n \\Storage::disk('farma')->put($directorio, \\File::get($request->pltlla_mantnmiento));\n $producto->plantlla_mantnmiento = $nameFile;\n }\n\n $producto->save();\n\n Session::flash('message','Producto Actualizado Correctamente');\n return Redirect::to('/productos');\n\n }", "public function update(Request $request, $id)\n {\n $articulo = \\App\\Models\\Articulo::find($id);\n $articulo->nombre = $request->get('nombre1');\n $articulo->descripcion = $request->get('descripcion1');\n $articulo->id_marca = $request->get('id_marca1');\n $articulo->categoria = $request->get('categoria1');\n $articulo->talla = $request->get('talla1');\n //$articulo->IDlocal = $request->get('IDlocal1');\n $temporal = $request->get('descuento1');\n $temporal2 = $articulo->precioOriginal;\n\n // en caso de que modifiquen el precio ya con descuento\n //restablecer el precio original\n //modificar el descuento\n if ($temporal != 0 || $temporal > 0) {\n $descuento = ($temporal * $temporal2) / 100;\n $articulo->precio = $temporal2 - $descuento;\n $articulo->descuento = $temporal;\n // $articulo->precioOriginal = $request->get('precio1');\n } else if ($temporal == 0) { //en caso de que descuento este en 0 restablece precio\n // no modificar nada\n $articulo->descuento = 0;\n $articulo->precio = $temporal2;\n }\n $articulo->imagena = $request->imagena;\n\n $articulo->imagenb = $request->imagenb;\n\n $articulo->imagenc = $request->imagenc;\n\n $articulo->imagend = $request->imagend;\n\n\n\n $articulo->existencia = $request->get('existencia1');\n $articulo->save();\n return back()->with('success', 'Articulo editado : ' . $articulo->nombre);\n }", "public function update( Request $request, $folio)\n {\n //busco el elemento\n $emple = Empleado::find($folio);\n\n //verificacion si la variable esta tiene dato seleciona la imagen y eliminalo\n if ($request -> file('imagen')) {\n $imagen_antigua = DB::select(\"SELECT imagen FROM empleados\");\n storage::delete('public/'.$imagen_antigua[0]->imagen);\n\n //si existe remplazo la imagen por la actual\n $emple->update([\n\n 'nombre' => $request -> input('nombre'),\n 'apellido_p' => $request -> input('apellido_p'),\n 'apellido_m'=> $request -> input('apellido_m'),\n 'telefono'=> $request -> input('telefono'), \n 'imagen'=> $request->file('imagen')->store('empleados','public'),\n 'id_puesto'=> $request -> input('id_puesto')\n ]);\n\n }\n\n //si no existe pues guardo la imagen con sus valores predefindos\n $emple->update([\n 'nombre' => $request -> input('nombre'),\n 'apellido_p' => $request -> input('apellido_p'),\n 'apellido_m'=> $request -> input('apellido_m'),\n 'telefono'=> $request -> input('telefono'), \n 'id_puesto'=> $request -> input('id_puesto')\n ]);\n //retorno\n return redirect('empleados');\n\n }", "public function update(Request $request, $id)\n {\n DB::beginTransaction();\n\n try {\n $empresa= Empresa::where('id',$id)->first();\n $empresa->nombre=$request->nombreempresa;\n $empresa->direccion=mb_strtoupper($request->direccionempresa);\n $empresa->telefono=$request->telefonoempresa;\n $empresa->email=$request->emailempresa;\n $empresa->ruc=$request->ruc;\n $nombre=$empresa->logo;\n if($request->file('file')!=\"\"){\n $file = $request->file('file');\n $extension=$file->getClientOriginalExtension();\n $nombre='item'.$empresa_id.'.'.$extension; \n Storage::disk('public/storage/logo/')->put($nombre, \\File::get($file));\n }\n $empresa->logo=$nombre;\n $empresa->codSeguridad='VesPro';\n $empresa->save();\n DB::commit();\n return response()->json([\n \"status\" => \"OK\",\n \"data\" => ($request->data==true) ? $empresa : \"Empresa actualizada\",\n ]);\n\n\n } catch (\\Exception $e) {\n DB::rollback();\n return response()->json([\n \"status\" => \"DANGER\",\n \"data\" => $e->getMessage()\n ]);\n }\n }", "public function update(Request $request,$id)\n {\n $publicidad = Publicidad::find($id);\n $publicidad->nombre = $request->input('nombre');\n $publicidad->zona = $request->input('zona');\n $publicidad->f_inicio = $request->input('f_inicio');\n $publicidad->f_final = $request->input('f_final');\n\n\n \n\n if ($request -> hasfile('horizontal')) {\n\n $file = $request->file('horizontal'); \n $extension = $file->getClientOriginalExtension(); // nombre de la imagen\n $filename = time().'.'.$extension;\n $file -> move('imagen/publicidad/',$filename);\n $publicidad->horizontal = $filename;\n }elseif ($request->hasfile('vertical')) {\n $file1 = $request->file('vertical');\n $extension1 = $file1->getClientOriginalExtension();\n $filename1 = time().'.'.$extension1;\n $file1->move('imagen/publicidad/',$filename1);\n $publicidad->vertical = $filename1;\n }\n $publicidad->save();//UPDATE\n $notificacion = 'Se edito la publicidad se ha actualizado correctamente';\n return redirect('/publicidad')->with(compact('notificacion'));\n }", "public function update(Request $request, Articulo $articulo)\n {\n $slug=Str::slug($request->product_name,'-');\n // $request->merge(['brand_name',$slug]);\n\n if($request->imagen){\n $image = time().'.'.$request->imagen->extension();\n $request->imagen->move(public_path('img'), $image);\n\n }\n else{\n $image=$articulo->imagen;\n }\n\n $articulo->update([\n 'nombre_articulo' =>$request->nombre_articulo,\n 'precio' =>$request->precio,\n 'descripcion' =>$request->descripcion,\n 'slug' =>$slug,\n 'status' =>$request->status,\n 'imagen' =>$image,\n ]);\n return redirect()->route('articulo.index');\n }", "public function update(Request $request, $id)\n {\n $veichle=Veichle::FindOrFail($id);\n\n $request->validate([\n 'model_id'=>'required|exists:carmodels,id',\n 'image'=>'image',\n 'car_number'=>'required',\n 'color'=>'required',\n 'price'=>'required|numeric',\n 'license_number'=>'required',\n 'license_end_date'=>'required|date',\n 'vin_number'=>\"required|unique:veichles,vin_number,$id\",\n 'owner_id_card'=>'required',\n ]);\n\n $previous=false;\n $data=request()->all();\n if($request->hasFile('image')){\n $file=$request->file('image');\n \n $image=$file->store('/image','uploads');\n \n $previous=$veichle->image; \n $data['image']=$image;\n \n }\n\n $veichle->update($data);\n\n if($previous){\n Storage::disk('uploads')->delete($previous);\n }\n \n\n return redirect()->route('veichles.index')->with('success','Veichle updated');\n }", "public function update(CuestionarioUpdateRequest $request, $id)\n {\n $cuestionario = Cuestionario::find($id); \n $cuestionario->fill($request->all())->save();\n //Image\n if($request->file('archivo')){\n\n $path = Storage::disk('public')->put('files',$request->file('archivo'));\n $cuestionario->fill(['archivo' => asset($path)])->save();\n }\n \n return redirect('/');\n }", "public function update(Request $request, $id)\n {\n \n $producto = Producto::findOrFail($id);\n $producto -> categoria_id = $request -> get('categoria_id');//este valor es el que se encuentra en el formulario\n $producto -> marca_id = $request -> get('marca_id');//este valor es el que se encuentra en el formulario\n $producto -> barcode = $request -> get('barcode');\n $producto -> descripcion = $request -> get('descripcion');\n $producto -> stock = $request -> get('stock');\n $producto -> precio_venta = $request -> get('precio_venta');\n $producto -> precio_compra = $request -> get('precio_compra');\n \n $producto -> estado = 'Activo';\n\n //revisar si hay imagen y subirla al server\n if(Input::hasFile('imagen'))\n {\n $file = Input::file('imagen');\n $file -> move(public_path().'/imagenes/productos', $file -> getClientOriginalName());\n $producto -> imagen = $file -> getClientOriginalName();\n }\n $producto -> update(); \n\n return Redirect::to('productos');\n }", "public function update()\n\t{\n\t\tif($this->checkauth(9)['err']==1){\n\t\t\treturn $this->checkauth(9)['view'];\n\t\t}\n\t\t\n\t\t$gambar = \"\";\n\n\n\t\t$divisi = Divisi::where('id',Input::get('id'))->first();\n\t\t$divisi->nama = Input::get('nama');\n\n\t\tif(Input::hasFile('gambar') and Input::file('gambar')->isValid()){\n\t\t\t$gambar = date(\"YmdHis\")\n\t\t\t\t.uniqid()\n\t\t\t\t.\".\"\n\t\t\t\t.Input::file('gambar')->getClientOriginalExtension();\n\t\t\n\t\t\tInput::file('gambar')->move(storage_path().'/gambardivisi',$gambar);\n\t\t\n\t\t\t$divisi->gambar = $gambar;\n\t\t}\n\t\t\n\t\t$divisi->keterangan = Input::get('keterangan');\n\t\t$divisi->save();\n\n\n\t\treturn redirect(url('admin/divisi'));\n\t}", "public function update(Request $request, $id)\n {\n \n $this->validate($request, [\n 'nombre' => 'required',\n 'descripcion' => 'required',\n 'cantidad'=> 'required|numeric', \n 'precio'=> 'required|numeric', \n 'categoria' => 'required', \n 'medida' => 'required', \n 'marca' => 'required', \n ]);\n\n $producto = Producto::find($id);\n $producto->nombre = $request->input('nombre');\n $producto->cantidad = $request->input('cantidad');\n $producto->descripcion = $request->input('descripcion');\n $producto->precio = $request->input('precio');\n $producto->categoria_id = $request->input('categoria');\n $producto->medida_id = $request->input('medida');\n $producto->marca_id = $request->input('marca');\n $producto->estado ='Disponible';\n if($request->hasFile('file'))\n {\n\n $filename= time().'_'.$request->file->getClientOriginalName(); \n $request->file->storeAs('public/upload',$filename);\n $producto->imagen=$filename;\n }\n $producto->save();\n\n return redirect()->route('productos.index')\n ->with('success','Producto Actualizado Exitosamente'); \n }", "public function update(StoreUpdateContatoRequest $request, $id)\n {\n $contato = $this->repository->find($id);\n if(!$contato){\n return redirect()->back();\n }\n\n $data = $request->only('nome', 'link');\n\n if($request->hasFile('foto') && $request->file('foto')->isValid()){\n\n if($contato->imagem && Storage::exists($contato->imagem)){\n Storage::delete($contato->imagem);\n }\n\n $image_path = ($request->file('foto')->store('contatos'));\n $data['imagem'] = $image_path;\n }\n\n $contato->update($data);\n return redirect()->route('contatos.index');\n }", "public function actualizar(Vehiculo $vehiculo)\n {\n }", "public function update1(Request $request, $id)\n {\n // return \"update\";\n try{\n\n $nombre='';\n $file = $request->file('input-b1');\n $contenido = ContenidoModel::findorFail($id);\n if($file){\n //obtenemos el nombre del archivo\n $nombre = $file->getClientOriginalName();\n\n if (Storage::exists($contenido->ruta ))\n {\n Storage::delete($contenido->ruta );\n }\n //indicamos que queremos guardar un nuevo archivo en el disco local\n Storage::disk('local')->put($nombre, \\File::get($file));\n }\n $contenido->id_plantilla = $request->idplantilla;\n $contenido->idhtml = $request->idhtml;\n $contenido->nombre = $request->nombre;\n $contenido->tamano = $request->tamano;\n $contenido->descripcion = $request->descripcion;\n $contenido->ruta = $nombre;\n $contenido->parrafo = $request->parrafo;\n $contenido->tiempo = $request->tiempo;\n $contenido->activo = $request->status;\n $contenido->color = $request->color;\n if (!($request->negrita)) {\n $request->negrita=0;\n }\n $contenido->negrita = $request->negrita;\n if (!($request->fin_s)) {\n $request->fin_s=0;\n }\n $contenido->fin_s = $request->fin_s;\n $contenido->id_tipo_con = $request->tipo_contenido;\n\n $contenido->save();\n\n return redirect()->route('contenido.index');\n\n }\n catch(Exception $e){\n return $e->getMessage();\n }\n }", "public function update(Request $request, Atractivo $hashid)\n {\n // $update = Atractivo::find($request->$id);\n\n $this->validate($request, [\n 'titulo' => 'required|max:80',\n 'descripcion' => 'required|max:300'\n ]);\n\n $hashid->fill($request->all());\n $hashid->save();\n return tap($hashid)->update($request->only('titulo',\n 'descripcion','detalle','direccion','ubicacion',\n 'longitud','latitud','horarios','foto_url','video_url','activo'));\n\n }", "public function update(Request $request, $id)\n {\n $idv=$request->idv;\n $f_estante=$request->f_estante;\n $nivel=$request->nivel;\n $cantidad=$request->cantidad;\n foreach($idv as $k => $valor){\n $detalle=DetalleTransacion::find($valor);\n $anterior=$detalle->cantidad;\n $nuevo=$cantidad[$k]+($request->cl[$k]-$request->ca[$k]);\n $detalle->cantidad=$nuevo;\n $detalle->f_estante=$f_estante[$k];\n $detalle->nivel=$nivel[$k];\n $detalle->save();\n $diferencia=$nuevo-$anterior;\n $ultimo=Inventario::where('f_divisionproducto',$detalle->f_producto)->where('localizacion',Transacion::tipoUsuario())->get()->last()->existencia_nueva;\n $ahora=$ultimo+$diferencia;\n if($diferencia > 0){\n Inventario::Actualizar($detalle->f_producto,Transacion::tipoUsuario(),14,abs($diferencia)); \n }else{\n Inventario::Actualizar($detalle->f_producto,Transacion::tipoUsuario(),15,abs($diferencia)); \n }\n // Inventario::Actualizar($detalle->f_producto,Transacion::tipoUsuario(),15,$ultimo); \n // Inventario::Actualizar($detalle->f_producto,Transacion::tipoUsuario(),14,$ahora); \n }\n CambioProducto::actualizarCambio($detalle->f_producto);\n Bitacora::bitacora('update','detalle_transacions','inventarios',$id);\n Return redirect('/inventarios')->with('mensaje', '¡Editado!');\n }", "public function update(Request $request, Vinicola $vinicola)\n {\n //\n // dd($request->all());\n // dd($vinicola);\n $rules = [\n // 'nombre'=> 'required|unique:vinicola',\n 'tipo' => 'required',\n 'inicio'=> 'required',\n 'filosofia'=> 'required',\n 'locacion'=> 'required',\n\n 'telefono'=> 'required'\n ];\n $validater = $this->validate($request,$rules);\n $vinicola->update([\n 'tipo'=>$request->tipo,\n 'distinciones'=>$request->distinciones,\n 'inicio'=>$request->inicio,\n 'filosofia'=>$request->filosofia,\n 'locacion'=>$request->locacion,\n 'lat'=>$request->lat,\n 'long'=>$request->long,\n 'contacto'=>$request->contacto,\n 'puesto'=>$request->puesto,\n 'correo'=>$request->correo,\n 'celular'=>$request->celular,\n 'telefono'=>$request->telefono,\n 'comentarios'=>$request->comentarios,\n 'hectareas'=>$request->hectareas\n ]);\n if ($request->uva[0] != null) {\n for ($i = 0; $i < sizeof($request->input('uva')) ; $i++) {\n UvaProducida::create([\n 'producidas_id'=>$vinicola->id,\n 'producidas_type'=>\"App\\Vinicola\",\n 'nombre'=>$request->uva[$i],\n 'hectarea'=>$request->hectarea[$i],\n 'costo'=>$request->costo[$i]\n\n ]);\n \n }\n }\n \n // $vinicola->save();\n return redirect()->route('vinicolas.index');\n }", "public function update(Request $request, $id)\n {\n $emprestimo = Emprestimo::find($id);\n\n if($emprestimo){\n $emprestimo->valor = $request->valor;\n $emprestimo->valor_total = valorBanco($request->valor_total);\n $emprestimo->parcelas = $request->parcela;\n $emprestimo->comissao_corretor = (valorBanco($request->valor_total) * (float) auth()->user()->comissao)/100;\n\n $salvo = $emprestimo->save();\n\n if($salvo){\n $emprestimo->parcelas()->delete();\n foreach($request['guia'] as $parcela){\n $emprestimo->parcelas()->create([\n 'valor' => valorBanco($parcela['valor']),\n 'vencimento' => date('Y-m-d', strtotime($parcela['datavencimento'])),\n 'num' => $parcela['num_parcela'],\n ]);\n }\n return redirect()->route('painel.emprestimos.edit',$id)->with('salvo', 'Emprestimo atualizado com sucesso!');\n }\n }else{\n return redirect()->route('painel.emprestimos.index');\n }\n }", "public function update(GaleriaRequest $request, $id)\n {\n $obra = Obra::with('fotoObra')->findOrFail($id);\n $obra->titulo = $request->titulo;\n $obra->descricao = $request->descricao;\n $update = $obra->update();\n\n \n if($update)\n {\n $imagemobra = $obra->fotoObra;\n if ($request->hasFile('caminho')) \n {\n Storage::delete('obras/'.$request->caminho); \n\n $path = $request->file('caminho')->store('obras', 'public');\n\n $imagemobra->each(function ($imagemobra) use ($path) {\n $imagemobra->caminho = $path;\n $imagemobra->save();\n\n });\n\n }\n \n }\n\n return redirect()\n ->route('admin.galeria.index')\n ->with('status', 'success')\n ->with('retornomensagem', 'COnfigurações alteradas com sucesso');\n\n }", "public function update(Vuelo $vuelo) {\n try {\n $this->vueloDao->update($vuelo);\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function update(Request $request, $id)\n {\n //\n $equipo = ProductoServicio::find($id);\n $equipo->nombre = $request->nombre;\n $equipo->precio = $request->precio;\n $equipo->save();\n\n foreach ($equipo->inventarioEquipos as $inventario){\n $inventario->cantidad = $request->cantidad;\n $inventario->existencia = $request->cantidad;\n $inventario->save();\n }\n\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'nm_servico' => 'required',\n 'ds_servico' => 'required',\n 'vl_servico' => 'required',\n ]);\n\n // Adiciona e salva\n $servico = Servico::find($id);\n $servico->nm_servico = $request->nm_servico;\n $servico->ds_servico = $request->ds_servico;\n //$servico->vl_servico = $request->vl_servico;\n $servico->vl_servico = money2float($request->vl_servico);\n $servico->save();\n\n // Redireciona\n return redirect(\"servico/$id\")->with('message', 'Serviço salvo com sucesso!');\n }", "public function updateAction(Request $request, $id)\n{\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('gemaBundle:Productosprogramas')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Productosprogramas entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n $accion = ' ';\n $this->get(\"gema.utiles\")->traza($accion);\n $em->flush();\n\n \n \n\n \n return $this->redirect($this->generateUrl('admin_productosprogramas_edit', array('id' => $id)));\n \n}", "public function update(Request $request, $id)\n {\n $datosVista=request()->all();\n\n $datosExpediente=[\n 'idOficinaEmisora'=>$datosVista['idOficinaEmisora'],\n 'idOficinaReceptora'=>$datosVista['idOficinaReceptora'],\n 'asunto'=>$datosVista['asunto'],\n 'descripcion'=>$datosVista['descripcion'],\n ];\n\n switch ($datosVista['tipo']) {\n case '1':\n $datosExpediente['tipo']=\"Oficio\";\n break;\n case '2':\n $datosExpediente['tipo'] =\"Carta\";\n break;\n default:\n $datosExpediente['tipo']=\"No especificado\";\n break;\n }\n\n $expediente = Expedientes::where('nroRegistro','=',$id);\n\n try {\n $expediente->update($datosExpediente);\n return redirect('expedientes')->with('Mensaje','Modificado con exito');\n } catch (\\Throwable $th) {\n printf($th);\n return redirect('expedientes')->with('Mensaje','Error al Modificar');\n }\n }", "public function update(Request $request, $id)\n {\n //\n $sertifikasis = Sertifikasi::find($id);\n if (!$sertifikasis) {\n abort(404);\n }\n\n $sertifikasis->deskripsi = $request->isi;\n $sertifikasis->nama = $request->nama;\n\n if($request->gambar) {\n $images = $request->file('gambar');\n $file = $images->getRealPath();\n $filename = $images->getClientOriginalName();\n Storage::put('public/sertifikasi/' . $filename, file_get_contents($file));\n\n $sertifikasis->logo = $filename;\n }\n\n $sertifikasis->save();\n\n return redirect(url('/admin/sertifikasi'));\n }", "public function update(Request $request,$id)\n {\n\n $docente=Docente::findOrFail($id);\n $docente->fill($request->all())->save();\n if ($request->hasfile('imagen')) {\n\n $path=Storage::disk('public')->put('imagenes', $request->file('imagen'));\n $docente->fill(['imagen' => asset($path)])->save();\n\n\n }\n\n //$docente->update($request->all());\n //$docente->turnos()->sync($request->get('turnos'));\n\n Session::flash('info_message', 'Docente actualizado con éxito');\n return redirect()->route('docentes.index',compact('docente'));\n }", "public function update(Request $request, $id)\n {\n //\n $request->validate([\n 'nome'=>'required|string',\n 'descricao'=> 'required|string',\n 'status' => 'required|integer'\n ]);\n \n $prova = Provas::find($id);\n $prova->nome = $request->get('nome');\n $prova->descricao = $request->get('descricao');\n $prova->status = $request->get('status');\n $prova->save();\n \n return redirect('/planos')->with('success', 'Stock has been updated');\n }", "public function update(Request $request)\n {\n $dados = $request->all();\n\n\n $salvar = atividade::find($dados['id']);\n\n\n $salvar->descricao = $dados['descricao'];\n $salvar->medicao = $dados['tipo_medicao'];\n $salvar->tipo = $dados['tipo_atividade'];\n \n $salvar->save();\n\n \\Session::flash('mensagem',['msg'=>'Atualização realizada com SUCESSO']);\n \n return redirect()->route('atividade.inicio');\n }", "public function update(Request $request, Vuelo $vuelo)\n {\n //\n }", "public function update(ProductoERequest $request, $id)\n {\n\n $producto = Producto::findOrFail($id);\n $producto->codigo = strtoupper($request->cod_producto);\n $producto->nombre = strtoupper($request->nom_producto);\n $producto->presentacion = strtoupper($request->presen_producto);\n $producto->cant_minima = $request->cant_minima;\n $producto->descripcion = strtoupper($request->des_producto);\n $producto->categorias_id = $request->categoria;\n $producto->estado = $request->est_producto;\n $producto->user_ing = Auth::user()->id;\n // **** COMPROBAR IMAGEN ****\n if ($request->file('img_producto') == null) {\n $producto->rutaimagen = $producto->rutaimagen;\n } else {\n $producto->rutaimagen = $request->file('img_producto')->store('productos');\n }\n $producto->save();\n toastr()->success('Registro actualizado correctamente.');\n return redirect('productos');\n }", "public function update(Request $request, $id)\n { //$employee = Employee::findOrFail($id);\n $copPlaza = copPlazas::findOrFail($id);\n //$this->validateInput($request);\n // Upload image\n /*$keys = ['lastname', 'firstname', 'middlename', 'address', 'city_id', 'state_id', 'country_id', 'zip',\n 'age', 'birthdate', 'date_hired', 'department_id', 'department_id', 'division_id'];*/\n $keys = ['sede', 'dependencia', 'rotulo', 'modalidad'];\n $input = $this->createQueryInput($keys, $request);\n\n copPlazas::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/copPlazas-management');\n }", "public function update(Request $request, $id)\n {\n Alert::success('Data successfully Changed','Good Job')->autoclose(1700);\n $this->validate($request,[\n 'nama' => 'required|max:255',\n 'kategorifasilitas_id' => 'required|'\n \n ]);\n $fasilitas=fasilitas::findOrFail($id);\n $fasilitas->nama = $request->nama;\n \n if ($request->hasFile('poto')) {\n $file = $request->file('poto');\n $destinationPath = public_path().'/assets/img/gambarweb/';\n $filename = str_random(6).'_'.$file->getClientOriginalName();\n $uploadSuccess = $file->move($destinationPath, $filename);\n \n // hapus poto lama, jika ada\n if ($fasilitas->poto) {\n $old_poto = $fasilitas->poto;\n $filepath = public_path() . DIRECTORY_SEPARATOR . '/assets/img/gambarweb'\n . DIRECTORY_SEPARATOR . $fasilitas->poto;\n try {\n File::delete($filepath);\n } catch (FileNotFoundException $e) {\n // File sudah dihapus/tidak ada\n }\n }\n $fasilitas->poto = $filename;\n}\n \n // edit upload poto\n $fasilitas->kategorifasilitas_id = $request->kategorifasilitas_id;\n $fasilitas->save();\n return redirect()->route('fasilitas.index'); \n \n }", "public function update(Request $request, Vechile $vechile)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'nombre'=>'max:20 | regex:/^[a-zA-Z \\s]+$/',\n 'puntaje'=>' regex:/^[0-90-9 \\s]+$/',\n 'foto'=> 'max:10000|mimes:jpg,png,jpeg'\n ]);\n\n $datosProducto = request()->except(['_token','_method']);\n\n if($request->hasFile('foto')){\n $producto =Producto::findOrFail($id);\n storage::delete('public/'.$producto->foto);\n $datosProducto['foto']=$request->file('foto')->store('uploads','public');\n }\n\n Producto::where('id','=',$id)->update($datosProducto);\n\n $producto =Producto::findOrFail($id);\n //return view('producto.edit',compact('producto'));\n return redirect()->route('producto.index')->with('editar','true');\n }", "public function update(Request $request, $id)\n {\n $registro_productos = request()->except(\"_token\", \"_method\");\n\n if ($request->hasFile('imagen')) {\n $producto = tb_producto::FindOrFail($id);\n storage::delete('public/' . $producto->imagen);\n\n $registro_productos['imagen'] = $request->file('imagen')->store('uploads_producto', 'public');\n }\n\n tb_producto::where('id', '=', $id)->update($registro_productos);\n return redirect('admin_productos');\n }", "public function update(Request $request, $id)\n {\n $datos=request()->except('_token', '_method');\n $producto = producto::findOrFail($id);\n if ($request->hasFile('imgMain')) {\n $datos['imgMain']=$request->file('imgMain')->store('uploads','public');\n Storage::delete('public/'.$producto->imgMain);\n } \n if ($request->hasFile('img0')) {\n $datos['img0']=$request->file('img0')->store('uploads','public');\n Storage::delete('public/'.$producto->img0);\n } \n if ($request->hasFile('img1')) {\n $datos['img1']=$request->file('img1')->store('uploads','public');\n Storage::delete('public/'.$producto->img1);\n } \n if ($request->hasFile('img2')) {\n $datos['img2']=$request->file('img2')->store('uploads','public');\n Storage::delete('public/'.$producto->img2);\n } \n if ($request->hasFile('img3')) {\n $datos['img3']=$request->file('img3')->store('uploads','public');\n Storage::delete('public/'.$producto->img3);\n } \n producto::where('id','=',$id)->update($datos);\n return redirect('cms/tienda/productos/create');\n }", "public function update(Request $request, $id)\n {\n //\n $vale = EmpresaDepartamentoUser::findOrFail($id);\n $departamento=$request->departamentos;\n $vale->departamento_id=$departamento;\n $vale->total_product=$request->totalproduct;\n $vale->fill(Reque::all());\n $vale->save();\n $details=array();\n $i=0;\n foreach($request->codproducto as $producto){\n $cantidad=\"cantidad\".$i;\n $precioproduct=\"precioproduct\".$i;\n $precio=$request->$cantidad*$request->$precioproduct;\n $details[$producto]=[\n 'cantidad'=>$request->$cantidad,\n 'precio'=>$precio,\n ];\n }\n $vale->details_product()->sync($details);\n\n $titulo='Se Actualizo con exito la Solicitud';\n $body= '</h4>La Solicitud ' .$vale->name_vale.' se actualizo con exito </h4>';\n return response()->json([\n 'titulo'=>$titulo,\n 'body'=>$body\n ]);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n\n 'product' => 'string|min:4',\n 'foto' => 'mimes:jpg,png,jpeg,gif|max:8000',\n 'jenis' => 'numeric',\n 'category' => 'numeric',\n 'harga' => 'numeric',\n 'size' => 'required',\n 'warna' => 'required',\n 'deskripsi' => 'string|min:3',\n\n ]);\n\n $data = Product::find($id);\n $data->product = $request->product;\n \n if ($request->foto) {\n\n $foto = $request->foto;\n $extension = $foto->getClientOriginalExtension();\n $folder = 'berkas/product/';\n $newName = rand(100000,1001238912).$extension;\n if (!is_dir($folder)) {\n File::makeDirectory($folder,0777,true);\n }\n $foto->move($folder, $newName);\n $data->foto = $folder.$newName;\n } \n\n $data->jenis = $request->jenis;\n $data->category = $request->category;\n $data->harga = $request->harga;\n $data->warna = $request->warna;\n $data->deskripsi = $request->deskripsi;\n $data->save();\n\n $data->pilihSize()->detach();\n\n if ($request->size) {\n foreach ($request->size as $key => $value) {\n $data->pilihSize()->attach($value);\n }\n }\n\n return redirect()->route('product.index')->with('success', 'Data Berhasil Ditambahkan');\n }", "public function update(Request $request, $id)\n {\n //\n\n $validacion = [\n 'nombre' => 'required|string|max:15',\n 'apellidoPaterno' => 'required|string|max:15',\n 'apellidoMaterno' => 'required|string|max:15',\n 'correo' => 'required|email'\n ];\n\n $mensajeValidacion = [\n 'required' => 'El :attribute es requerido',\n ];\n\n if ($request->hasFile('foto')) {\n $validacion=['foto' => 'required|max:10000|mimes:jpeg,png,jpg'];\n $mensajeValidacion = ['foto.required' => 'Favor de subir una foto'];\n }\n\n $this->validate($request, $validacion, $mensajeValidacion);\n\n $datosEstudiante = request()->except(['_token', '_method']);\n if ($request->hasFile('foto')) {\n # code...\n $estudiante = Estudiante::findOrFail($id);\n Storage::delete('public/'.$estudiante->foto);\n\n $datosEstudiante['foto'] = $request->file('foto')->store('uploads', 'public');\n }\n\n Estudiante::where('id', '=', $id)->update($datosEstudiante);\n $estudiante = Estudiante::findOrFail($id);\n\n //return view('estudiante.edit', compact('estudiante'));\n return redirect('estudiante')->with('mensaje', 'Estudiante modificado');\n }", "public function update($aluno) {\n\t}", "public function updateVoto($id,$voto)\n {\n try\n {\n self::execQuery(\"UPDATE voto SET v_valoracion\".$voto->getValoracion().\"\\' WHERE id=\".$voto->getId());\n\n return true; \n }\n catch(PDOException $e)\n {\n echo $e->getMessage(); \n return false;\n }\n }", "public function update(Request $request, $id)\n {\n /* $habtipo = HabitacionTipo::find($id);\n\n if($habtipo->update($request->all())){\n return redirect('supercategorias')->with('msj', 'Datos guardados');\n } else {\n return back()->with('errormsj', 'Los datos no se guardaron');\n } */\n $request->user()->authorizeRoles(['Admin']);\n $habtipo = HabitacionTipo::find($id);\n $habtipo->nombre = $request->nombre;\n $habtipo->tarifainicial = $request->tarifainicial;\n\n $file = Input::file('urlimg');\n $img = $request->file('urlimg');\n\n if (Input::hasFile('urlimg')) {\n\n $file_route = time().'_'.$img->getClientOriginalName();\n // se guarga en el disco la imagen\n Storage::disk('imgHabitaciones')->put($file_route, file_get_contents( $img->getRealPath() ));\n\n // eliminar la imagen que estaba en el disco\n Storage::disk('imgHabitaciones')->delete($request->img);\n\n $habtipo->urlimg = $file_route;\n\n }\n\n if($habtipo->save()){\n return redirect('habitaciontipos')->with('msj', 'Datos guardados');\n } else {\n return back()->with('errormsj', 'Los datos no se guardaron');\n }\n }", "public function update(Request $request, $id)\n {\n\n $egresado = Egresados::where('user_id',$id)->first();\n if($egresado != null) {\n $egresado->nombre = $request->get('nombre');\n $egresado->sexo = $request->get('sexo');\n $egresado->estado_civil = $request->get('estado_civil');\n $egresado->nacimiento = $request->get('nacimiento');\n $egresado->curp = $request->get('curp');\n $egresado->telefono = $request->get('telefono');\n $egresado->celular = $request->get('celular');\n $egresado->email = $request->get('email');\n $egresado->fecha_egreso = $request->get('fecha_egreso');\n $egresado->promedio = $request->get('promedio');\n $egresado->password = $request->get('no_control');\n\n $city=$request->get('ciudad_id');\n\n if(!is_numeric($city)){\n $newCity = Ciudades::firstOrCreate(['nombre' => ucwords($city)]);\n $egresado->ciudad_id = $newCity->id;\n }else{\n $egresado->ciudad_id = $city;\n }\n\n $carrera=$request->get('carrera_id');\n\n if(!is_numeric($carrera)){\n $newCarrera = Carreras::firstOrCreate(['nombre' => ucwords($carrera)]);\n $egresado->carrera_id = $newCarrera->id;\n }else{\n $egresado->carrera_id = $carrera;\n }\n\n if($request->hasFile('imagen')){\n $imagen = $request->file('imagen');\n $file = $imagen->store('imagenes/cursos');\n $egresado->imagen = $file;\n }\n\n $egresado->save();\n\n /*Idiomas */\n $idiomas = $request->get('idioma_id');\n $idiomas_eg = IdiomaDetalle::where('egresado_id',$egresado->id)->pluck('idioma_id');\n\n if($idiomas){\n IdiomaDetalle::where('egresado_id',$egresado->id)->delete();\n if(count($idiomas) != count($idiomas_eg)){\n foreach ($idiomas as $idioma){\n if(!is_numeric($idioma)){\n $newIdioma = Idiomas::firstOrCreate(\n [\n 'nombre' => ucwords($idioma)\n ]);\n\n IdiomaDetalle::firstOrCreate(\n [\n 'idioma_id' => $newIdioma->id,\n 'egresado_id' => $egresado->id\n ]);\n }else{\n IdiomaDetalle::firstOrCreate(\n [\n 'idioma_id' => $idioma,\n 'egresado_id' => $egresado->id\n ]);\n }\n }\n }\n }else{\n IdiomaDetalle::where('egresado_id',$egresado->id)->delete();\n }\n }\n $user = User::where('id',$id)->first();\n $carerras = Carreras::orderBy('nombre')->pluck('nombre','id');\n $state = Estados::orderBy('nombre')->pluck('nombre','id');\n $town = Ciudades::orderBy('nombre')->pluck('nombre','id');\n $egresado = Egresados::where('user_id',$id)->first();\n $idiomas = Idiomas::orderBy('nombre')->pluck('nombre','id');\n $idiomas_eg = IdiomaDetalle::where('egresado_id',$egresado->id)->pluck('idioma_id');\n return view('account.index',compact('user', 'id','egresado','carerras','state','town','idiomas','idiomas_eg'));\n }", "public function update(Request $request, $id)\n {\n if (empty($request->foto)) {\n Varietas::whereId($id)->update([\n 'warna' => $request->warna,\n 'panjang' => $request->panjang,\n 'diameter' => $request->diameter,\n 'bentuk_buah' => $request->bentuk_buah,\n 'bentuk_daun' => $request->bentuk_daun,\n 'bentuk_pohon' => $request->bentuk_pohon,\n 'id_jenis' => $request->jenis_pisang\n ]);\n return redirect()->route('varietas.index');\n }\n $fileName = 'variates_pisang-' . date('Ymdhis') . '.' . $request->foto->getClientOriginalExtension();\n $request->foto->move('gambar/', $fileName);\n Varietas::whereId($id)->update([\n 'warna' => $request->warna,\n 'panjang' => $request->panjang,\n 'diameter' => $request->diameter,\n 'bentuk_buah' => $request->bentuk_buah,\n 'bentuk_daun' => $request->bentuk_daun,\n 'bentuk_pohon' => $request->bentuk_pohon,\n 'gambar' => $fileName,\n 'id_jenis' => $request->jenis_pisang\n ]);\n return redirect()->route('varietas.index');\n }", "public function update(Request $request, Cubiculo $cubiculo)\n {\n $cubiculo->update($request->all());\n\n Session::flash('msj-success','Cubiculo Modificado');\n return redirect('cubiculos');\n }", "public function update(ArticuloFormRequest $request, $id)\n \t{\n \t\n \t\t$articulo = Articulo::findOrFail($id);\n \t\t$articulo -> id_categoria = $request -> get('id_categoria');//este valor es el que se encuentra en el formulario\n $articulo -> codigo = $request -> get('codigo');\n $articulo -> nombre = $request -> get('nombre');\n $articulo -> stock = $request -> get('stock');\n $articulo -> precio_venta = $request -> get('precio_venta');\n $articulo -> descripcion = $request -> get('descripcion');\n $articulo -> estado = 'Activo';\n\n //revisar si hay imagen y subirla al server\n if(Input::hasFile('imagen'))\n {\n $file = Input::file('imagen');\n $file -> move(public_path().'/imagenes/articulos', $file -> getClientOriginalName());\n $articulo -> imagen = $file -> getClientOriginalName();\n }\n \t\t$articulo -> update();\n Session::flash('actualizar','Se ha actualizado el articulo correctamente');\n \t\treturn Redirect::to('almacen/articulo');\n \t}", "public function update(Request $request, $id){\n $num_vuelo = $req->input('n_avion');\n $aerolinea = $req->input('aerolinea');\n $a_destino = $req->input('a_origen');\n $a_origen = $req->input('a_destino');\n $h_salida = $req->input('hora_salida');\n $h_llegada = $req->input('hora_llegada');\n $hora_salida = Carbon::createFromFormat('d/m/Y H:i', $h_salida);\n $hora_llegada = Carbon::createFromFormat('d/m/Y H:i', $h_llegada);\n $cap_equipaje = $req->input('c_equipaje');\n $maletas = $req->input('num_maletas');\n $cap_t = $req->input('c_turista');\n $cap_e = $req->input('c_ejecutivo');\n $cap_p = $req->input('c_primera_clase');\n $desc = $req->input('descuento');\n $precio_t = $req->input('p_turista');\n $precio_e = $req->input('p_ejecutivo');\n $precio_p = $req->input('p_primera_clase');\n }", "public function update(Request $request, $id)\n {\n\n // $partido = DB::table('resultado_admins')->where('id_partido', '=', $id)->select('goles_local','goles_visitante')->get();\n $partido = ResultadoAdmin::find_resultado($id);\n $partido->fill($request->all());\n $local = $request['goles_local'];\n $visitante = $request['goles_visitante'];\n\n\n DB::table('resultado_admins')->where('id_partido', $id)->update(\n ['goles_local'=> $local,\n 'goles_visitante'=> $visitante,\n 'fase'=> 0]);\n\n Session::flash('message','Resultado editado exitosamente');\n return Redirect::to('/resultado_A');\n }", "public function update(Request $request, $id)\n { \n \n \n $tivy = tivy::findOrFail($id);\n \n ///////////////////////\n if ($request->hasFile('img')) {\n // Eliminar imagen si se va a actualizar\n $filePath = storage_path('app/public/storage/' . $tivy->img);\n if (file_exists($filePath)) {\n unlink($filePath);\n } \n // Subir nueva imagen\n $file = $request->imagen_publication;\n $image_tivy = time() . $file->getClientOriginalName();\n $file->storeAs('app/public/storage/', $image_tivy); \n $tivy->img = $image_tivy;\n }\n /////////////////////\n $tivy->tittle = $request->tittle;\n $tivy->description = $request->description; \n $tivy->date = $request->date; \n $tivy->startTime = $request->startTime; \n $tivy->duration = $request->duration;\n $tivy->state = 1; \n $tivy->place = $request->place; \n $tivy->capacity = $request->capacity;\n // $user = User::where('id', $request->user);\n $tivy->user()->associate($request->user); \n $tivy->save(); \n return redirect()->route('home');\n \n }", "public function update(Request $request)\n {\n $data = json_decode($request->datos, true);\n \n //$producto->ID_MAR = $data['ID_MAR'];\n $recurso= Agencias::findOrFail($data['ID_AGE']);;\n $recurso->NOMBRE_AGE=$data['NOMBRE_AGE'];\n $recurso->RUC_AGE=$data['RUC_AGE'];\n $recurso->CIUDAD_AGE=$data['CIUDAD_AGE'];\n $recurso->TELEFONO_AGE=$data['TELEFONO_AGE'];\n $recurso->CORREO_AGE=$data['CORREO_AGE'];\n $recurso->DIRECCION_AGE=$data['DIRECCION_AGE']; \n // $recurso->lOGO_AGE=$data['lOGO_AGE'];\n //$recurso->NOMBRE_AGE=$request->get('ESTADO_AGE');\n if(Input::hasFile('LOGO_AGE'))\n {\n $file = Input::file('LOGO_AGE');\n\t\t$file->move(public_path().'/recursos_agencia/',$file->getClientOriginalName());\n $recurso->LOGO_AGE='recursos_agencia/'.$file->getClientOriginalName();\n //$recurso->ICO_APP=$file->getClientOriginalName();\n \n } \n $recurso->save(); \n }", "public function update(Request $request, $id)\n {\n Barrio::find($id)->update($request->all());\n \n return redirect()->route('superuser.barrio-index')\n ->with('info','Barrio actualizado Satisfactoriamente');\n }", "public function updated(Historia $historia)\n {\n //\n }", "public function update(Request $request, $id)\n {\n\n //Solo los miembros pueden editar\n $consulta=RsuParticipante::where('rsu_proyecto_id',$id)\n ->where('user_id',Auth::user()->id)->get();\n //return $consulta;\n if($consulta->isEmpty()){\n return redirect()->route('rsu.mp.index')->with('rojo','Ud. no tiene permiso para editar este proyecto');\n }\n //inicializamos las ruta de los archivos\n\n $myProyect= RsuProyecto::find($id);\n //si se cargaron archivos que guarden las imagenes en el servidor\n if($request->file('aprobacion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_aprobacion);\n $fileAprobacion= $request->file('aprobacion-file')->store('public/rsu/aprobacion');\n $myProyect->file_aprobacion=$fileAprobacion;\n }\n if($request->file('culminacion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_culminacion);\n $fileCulminacion= $request->file('culminacion-file')->store('public/rsu/culminacion');\n $myProyect->file_culminacion=$fileCulminacion;\n }\n if($request->file('satisfaccion-file')){\n //Eliminamos la imagen que existía\n Storage::delete($myProyect->file_satisfaccion);\n $fileSatisfaccion=$request->file('satisfaccion-file')->store('public/rsu/satisfaccion');\n $myProyect->file_satisfaccion=$fileSatisfaccion;\n }\n //guardar datos a la tabla rsu_proyectos\n \n $myProyect->titulo=$request->get('titulo');\n $myProyect->doc_aprobacion=$request->get('doc_aprobacion');\n $myProyect->lugar=$request->get('lugar');\n $myProyect->beneficiarios=$request->get('beneficiarios');\n $myProyect->aliados=$request->get('aliados');\n $myProyect->porcentaje=$request->get('porcentaje');\n $myProyect->doc_culminacion=$request->get('doc_culminacion');\n $myProyect->objetivos=$request->get('objetivos');\n $myProyect->justificacion=$request->get('justificacion');\n $myProyect->logros=$request->get('logros');\n $myProyect->dificultades=$request->get('dificultades');\n $myProyect->satisfaccion=$request->get('satisfaccion');\n $myProyect->mas_lineamientos=$request->get('mas_lineamientos');\n $myProyect->save();\n //Guardamos el ID del proyecto registrado\n// $ultimoID=$myProyect->id;\n\n// $array1 = array(1, 2,3,4);\n// $array2 = array(2,11,6);\n\n //return array_diff($array1, $array2);\n //Para eliminar\n //return $paraEliminar=RsuLineamientoProyecto::where('rsu_proy_id',$id)->whereNotBetween('rsu_lin_id',[100,12])->get(); \n //return $request->get('lineas');\n $lineas=$request->get('lineas');\n if($lineas){\n return $paraEliminar=RsuLineamientoProyecto::where('rsu_proy_id',$id)->whereNotIn('rsu_lin_id',$lineas)->pluck('rsu_lin_id');\n foreach($request->get('lineas') as $linea){\n $lineamientos=new RsuLineamientoProyecto;\n $lineamientos->rsu_lin_id=$linea;\n $lineamientos->rsu_proy_id=$ultimoID;\n $lineamientos->save();\n }\n }\n return redirect()->route('rsu.mp.index')->with('verde','Actualizó el proyecto \\''.$myProyect->titulo.'\\' correctamente');\n }", "public function update($tarConvenio);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'storage_code' => ['required', 'max:255', 'unique:silo_actuals,storage_code,' . $id],\n 'date' => ['required'],\n 'value_actual' => ['required'],\n ]);\n\n\n SiloActual::where('id', $id)->update($request->except('_token', '_method'));\n try {\n SiloActualCloud::where('id', $id)->update($request->except('_token', '_method'));\n } catch (\\Throwable $th) {\n return redirect('setting/silo-actual')->with(['update' => 'Data updated successfully! + ' . $th->getMessage()]);\n }\n return redirect('setting/silo-actual')->with(['update' => 'Data updated successfully!']);\n }", "public function update(Request $request, $id)\n {\n //\n // DB::table('users')\n // ->where('id', 1)\n // ->update(['votes' => 1]);\n // }\n $request->validate([\n 'name'=> \"required|unique:giay,name,$id,id_giay|max:50\",\n 'loaigiay'=>'required',\n 'cost'=> 'required|Numeric|max:50000000',\n 'mota_ngan'=>'required',\n 'mota_dai'=>'required',\n\n 'anh_1'=>'image|mimes:jpeg,jpg,png|max:2024',\n 'anh_2'=>'image|mimes:jpeg,jpg,png|max:2024',\n 'anh_3'=>'image|mimes:jpeg,jpg,png|max:2024',\n 'anh_4'=>'image|mimes:jpeg,jpg,png|max:2024'\n ]);\n $product = giay::findOrFail($id);\n\n $product->name = $request->name;\n $product->id_loaigiay = loaigiay::where('name', $request->loaigiay)->first()->id_loaigiay;\n $product->cost = $request->cost;\n $product->mota_ngan = $request->mota_ngan;\n $product->mota_dai = $request->mota_dai;\n $product->save();\n\n if($request->has('anh_1')){\n $path1 = $request->file('anh_1')->store('public/img');\n $anh = giay::findOrFail($id)->anh_giay[0];\n $old_anh = $anh->url; \n Storage::delete('public/img/'.$old_anh);\n $anh->url = preg_replace(\"/(public\\/img\\/)/\", '', $path1);\n $anh->save();\n }\n\n if($request->has('anh_2')){\n $path2 = $request->file('anh_2')->store('public/img');\n $anh = giay::findOrFail($id)->anh_giay[1];\n $old_anh2 = $anh->url; \n Storage::delete('public/img/'.$old_anh2);\n $anh->url = preg_replace(\"/(public\\/img\\/)/\", '', $path2);\n $anh->save();\n }\n\n if($request->has('anh_3')){\n $path3 = $request->file('anh_3')->store('public/img');\n $anh = giay::findOrFail($id)->anh_giay[2];\n $old_anh3 = $anh->url; \n Storage::delete('public/img/'.$old_anh3);\n $anh->url = preg_replace(\"/(public\\/img\\/)/\", '', $path3);\n $anh->save();\n }\n\n if($request->has('anh_4')){\n $path4 = $request->file('anh_4')->store('public/img');\n $anh = giay::findOrFail($id)->anh_giay[3];\n $old_anh4 = $anh->url; \n Storage::delete('public/img/'.$old_anh4);\n $anh->url = preg_replace(\"/(public\\/img\\/)/\", '', $path4);\n $anh->save();\n }\n \n return redirect()->route('admin.tables', 'product')->with(['message'=> 'Thay đổi thành công', 'class'=> 'alert alert-success']);\n }", "public function update($dato, $datoNuevo){\n }", "public function update(Request $request, Venta $venta)\n {\n //\n }", "public function update(Request $request, Venta $venta)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $estufa = Estufa::find($id);\n if($estufa){\n\n $estufa->encargado = $request->input('encargado');\n $estufa->descripcion = $request->input('descripcion');\n $estufa->estado = $request->input('estado');\n $estufa->material = $request->input('material');\n $estufa->fecha = $request->input('fecha');\n $estufa->ubicacion = $request->input('ubicacion');\n \n if ($request->hasFile('imgPortada')) {\n\n $archivoPortada = $request->file('imgPortada');\n $rutaArchivo = $archivoPortada->store('public/portadas');\n $rutaArchivo = substr($rutaArchivo, 16);\n $estufa->foto_resultado = $rutaArchivo;\n \n }\n\n \n $estufa->pieza = $request->input('pieza');\n $estufa->precio_pieza = $request->input('precio_pieza');\n\n\n if($estufa->save()){\n\n $respuesta = array();\n return $respuesta['estufa'] = $estufa;\n \n }\n \n $respuesta = array();\n return $respuesta['estufa'] = \"no se pudo guardar la tarea\";\n \n }\n $respuesta = array();\n return $respuesta['estufa'] = \"no se pudo guardar la tarea\";\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'nomPv' => 'required',\n 'telPv'=>'required|digits:8',\n 'faxPv'=>'required|digits:8',\n 'adrPv' => 'required',\n 'pvMapx' => 'required',\n 'pvMapy' => 'required',\n 'pvImg' =>'nullable|max:9000'\n ]);\n // Handle File Upload\n if($request->hasFile('pvImg')){\n // Get filename with the extension\n $filenameWithExt = $request->file('pvImg')->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $request->file('pvImg')->getClientOriginalExtension();\n // Filename to store\n $fileNameToStore= $filename.'_'.time().'.'.$extension;\n // Upload Image\n $path = $request->file('pvImg')->storeAs('public/pointvente', $fileNameToStore);\n } \n $pv = PointVente::find($id);\n if($request->hasFile('pvImg')){\n Storage::delete('public/pointvente/'.$pv->pvImg);\n }\n $pv->nomPv = $request->input('nomPv');\n $pv->adrPv = $request->input('adrPv');\n $pv->telPv = $request->input('telPv');\n $pv->faxPv = $request->input('faxPv');\n $pv->pvMapx = substr($request->input('pvMapx'),0,9);\n $pv->pvMapy = substr($request->input('pvMapy'),0,9);\n if($request->hasFile('pvImg')){\n $pv->pvImg = $fileNameToStore;\n }\n $pv->save();\n return redirect('/pointvente')->with('success', 'la point de Vente a été mis a jour');\n\n }", "public function update( Request $request){\n #debuger($request->all());\n $error = null;\n DB::beginTransaction();\n try {\n $data = [];\n $key_value = ['id'];\n foreach ($request->factura as $key => $value) {\n if( !in_array($key, $key_value)){\n $data[$key] = strtoupper($value);\n }\n } \n $data['subtotal'] = str_replace(\",\", \"\", $data['subtotal']); \n $data['iva'] = str_replace(\",\", \"\", $data['iva']);\n $data['total'] = str_replace(\",\", \"\", $data['total']);\n $this->_tabla_model::where(['id' => $request->factura['id']])->update($data);\n #$response = $this->_tabla_model::where(['id' => $request->pedidos['id']])->get()[0];\n DB::commit();\n $success = true;\n } catch (\\Exception $e) {\n $success = false;\n $error = $e->getMessage().\" \".$e->getLine().\" \".$e->getFile();\n DB::rollback();\n }\n\n if ($success) {\n return $this->show(new Request(['id' => $request->factura['id']]));\n #return $this->_message_success( 201, $response , self::$message_success );\n }\n return $this->show_error(6, $error, self::$message_error );\n\n }", "public function update(Request $request, $id)\n {\n $valores['usuario_id']=Auth::id();\n $registro = Producto::find($id);\n\n $valores = $request->except(['imagen','concesionado']);\n $imagen = $request->file('imagen');\n if(!is_null($imagen)){\n foreach ($imagen as $img) {\n $ruta_destino = public_path('fotos/');\n $nombre_de_archivo = $img->getClientOriginalName();\n $img->move($ruta_destino, $nombre_de_archivo);\n $valores['imagen']=$nombre_de_archivo;\n Foto::create([\n 'imagen'=>$nombre_de_archivo,\n 'producto_id'=>$registro->id\n ]);\n }\n }\n $registro->update($valores);\n\n if($registro->concesionado==0)\n {\n $registro->update(['concesionado'=>NULL]);\n }\n // $registro->fill($valores);\n // $registro->save();\n\n\n return redirect(\"/Productos\")->with('mensaje','Producto modificado correctamente');\n\n }", "public function update(Request $request, $id_ubic_patio)\n {\n try {\n $ubic_patio_id = Crypt::decrypt($id_ubic_patio);\n } catch (DecryptException $e) {\n abort(404);\n }\n\n $ubic_patio = UbicPatio::findOrFail($ubic_patio_id);\n\n if(isset($request->vin_codigo)){\n $vin = Vin::where('vin_codigo', $request->vin_codigo)->first();\n }\n\n try {\n \n $ubic_patio->ubic_patio_fila = $request->ubic_patio_fila;\n $ubic_patio->ubic_patio_columna = $request->ubic_patio_columna;\n $ubic_patio->ubic_patio_ocupada = $request->ubic_patio_ocupada;\n \n if(isset($vin)){\n $ubic_patio->vin_id = $vin->vin_id;\n } else {\n $ubic_patio->vin_id = null;\n }\n \n $ubic_patio->bloque_id = $request->bloque_id;\n\n $ubic_patio->save();\n\n flash('Ubicación modificada correctamente.')->success();\n return redirect()->route('ubic_patio.index', ['id_bloque' => Crypt::encrypt($request->bloque_id)]);\n\n }catch (\\Exception $e) {\n\n flash('Error modificando la ubicación.')->error();\n flash($e->getMessage())->error();\n return redirect()->route('ubic_patio.index', ['id_bloque' => Crypt::encrypt($request->bloque_id)]);\n }\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 updateAtivo(Patrocinio $Patrocinio) {\n $conn = $this->conex->connectDatabase();\n if($Patrocinio->getStatus()==\"0\"){\n $Patrocinio->setStatus(\"1\");\n }\n else {\n $Patrocinio->setStatus(\"0\");\n }\n //Query de update\n $sql = \"update tbl_patrocinio set ativo=? where id_patrocinio=?\";\n $stm = $conn->prepare($sql);\n //Setando os valores\n $stm->bindValue(1, $Patrocinio->getStatus());\n $stm->bindValue(2, $Patrocinio->getId());\n //Executando a query\n $stm->execute();\n $this->conex->closeDataBase();\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'type' => 'required',\n 'file' =>'required|mimes:jpg,pdf,jpeg',\n 'serial_number' => 'required',\n 'inventaris_code' => 'required',\n 'operating_system' => 'required',\n // 'pegawai_id' => 'required'\n ]);\n\n $type = $request->input('type');\n $file = $request->file('file');\n $serial_number = $request->input('serial_number');\n $inventaris_code = $request->input('inventaris_code');\n $operating_system = $request->input('operating_system');\n // $pegawai_id = $request->input('pegawai_id');\n\n\n // dd($pegawai_name,$divisi_name);\n\n\n $laptop = Laptop::findOrFail($id);\n $laptop->type = $type;\n $laptop->serial_number = $serial_number;\n $laptop->inventaris_code = $inventaris_code;\n $laptop->operating_system = $operating_system;\n\n $extension = $file->getClientOriginalExtension();\n $path = $file->getFilename().'.'.$extension;\n\n $files = AppFile::findOrFail($request->input('file_id'));\n $files->type = $file->getClientMimeType();\n $files->path = $path;\n\n Storage::disk('public')\n ->putFileAs('file/laptop', $file, 'laptop'.'.'.$extension);\n $files->update();\n\n // dd($laptop);\n\n if((!$laptop->update()) && (!$files->update())){\n return response()->json([\n 'message' => 'Data gagal di update',\n 'status_code' => '0005',\n 'data' => ''\n ],400);\n }\n\n return response()->json([\n 'message' => 'Data berhasil di update',\n 'status_code' => '0001',\n 'data' => [\n $laptop,\n $files\n ]\n ],200);\n }", "public function update(Request $request, $id)\n {\n //\n if($request->all()){\n $descripcion = $request->get('descripcion');\n $usuario=Auth::user()->id;\n\n if($request->file('img') == null){\n $opcion = 3;\n $sql = \"call spCSL_CRUD_galeria\n (\n '\".$opcion.\"',\n 'no importa',\n '\".$descripcion.\"',\n '\".$usuario.\"',\n '\".$id.\"'\n )\";\n $datos = DB::select($sql,array(1,10));\n if($datos==null){\n return Redirect::to('administrador/galeria')->withErrors(['erroregistro'=> 'Error']);\n }\n return Redirect::to('administrador/galeria');\n }\n else{\n $imagenAnterior = DB::table('tbl_galeria') \n ->select('imagen')\n ->where('id_galeria','=',$id)\n ->first();\n $getImageAnterior = $imagenAnterior->imagen;\n $cadena=substr($getImageAnterior, 22,strlen ($getImageAnterior)); \n if(Storage::disk('local')->exists($cadena)){\n $dele= Storage::disk('local')->delete($cadena);\n }\n $path= Storage::disk('local')->put('uploads/galeria', $request->file('img'));\n $imagen = asset($path);\n $opcion = 4;\n $sql = \"call spCSL_CRUD_galeria\n (\n '\".$opcion.\"',\n '\".$imagen.\"',\n '\".$descripcion.\"',\n '\".$usuario.\"',\n '\".$id.\"'\n )\";\n $datos = DB::select($sql,array(1,10));\n if($datos==null){\n return Redirect::to('administrador/galeria')->withErrors(['erroregistro'=> 'Error']);\n }\n return Redirect::to('administrador/galeria');\n }\n\n\n }\n }", "public function update(Request $request, $id)\n {\n $veiculo = Veiculo::find($id);\n $dados = $request->all();\n $veiculo->update($dados);\n if($veiculo) {\n return response()->json(['data' => $veiculo, 'status' => true]);\n }else {\n return response()->json(['data' => \"Erro ao alterar o veículo.\", 'status' => false]);\n }\n }", "public function update(Request $request, Archivo $archivo)\n {\n //\n }", "public function update(Request $request, Archivo $archivo)\n {\n //\n }", "public\n function update(Request $request, $id)\n {\n date_default_timezone_set('America/Lima');\n\n $kardex = Kardex::findOrFail($id);\n $kardex->idInsumo = $request->id;\n $kardex->fecha = date(\"Y-m-d H:i:s\");\n $kardex->factura = $request->factura;\n $kardex->cantidad = $request->cantidad;\n $kardex->preciounitario = $request->preciounitario;\n\n $insumos = DB::table('insumos')\n ->select('id', 'stock')\n ->get();\n\n $cantidadexistencia = 0;\n foreach ($insumos as $insumo) {\n if ($insumo->id == $request->id) {\n if ($request->concepto == \"Entrada\") {\n $kardex->cantidadexistencia = $insumo->stock + $request->cantidad - $request->cantidadold;\n $cantidadexistencia = $insumo->stock + $request->cantidad - $request->cantidadold;\n } else {\n $kardex->cantidadexistencia = $insumo->stock - $request->cantidad + $request->cantidadold;\n $cantidadexistencia = $insumo->stock - $request->cantidad + $request->cantidadold;\n }\n }\n }\n\n $updateInsumo = Insumo::findOrFail($request->id);\n $updateInsumo->stock = $cantidadexistencia;\n $updateInsumo->save();\n\n $kardex->save();\n\n alert()->success('Kardex modificado correctamente', 'Modificado');\n\n return redirect()->route('kardexindex');\n }", "public function update(Request $request, $id)\n {\n $lapangan = Lapangan::findOrFail($id);\n $data = $request->all();\n $data['slug'] = str_slug($request->nama_lapangan, \"-\");\n if ($request->hasFile('gambar')) {\n $file = $request->file('gambar')->store('gambar_lapangan', 'public');\n $data['gambar'] = $file;\n Storage::delete('public' . $lapangan->gambar);\n }\n $lapangan->update($data);\n $lapangan->waktus()->sync($request->get('waktus'));\n return redirect()->back()->with('status', 'Lapangan Updated');\n }", "public function vendido($id, Request $request){\n $cotizacion = Cotizacion::find($id);\n $cotizacion->status = 'Vendido';\n $cotizacion->posventa = $request->input('posventa');\n $cotizacion->update();\n return back()->with('success','Cotizacion Vendida');\n }", "public function update(SeccionTiendaProductoRequest $request, $id)\n {\n $precio_original= $request->get('precio_original');\n $descuento= $request->get('descuento');\n\n if ($descuento > 0) {\n $cantidad_a_descontar= ($precio_original * $descuento) / 100;\n $precio_con_descuento= $precio_original - $cantidad_a_descontar;\n }else{\n $precio_con_descuento= $request->get('precio_original');\n }\n //\n $objeto = SeccionTiendaProducto::find($id);\n $objeto->fk_categoria = $request->get('fk_categoria');\n $objeto->nombre = $request->get('nombre');\n $objeto->descripcion = $request->get('descripcion');\n $objeto->precio_original = $request->get('precio_original');\n $objeto->precio_con_descuento = $precio_con_descuento;\n $objeto->descuento = $request->get('descuento');\n $objeto->coleccion = $request->get('coleccion');\n $objeto->peso = $request->get('peso');\n $objeto->orden = $request->get('orden');\n\n //ruta de imagen\n $rutaDeCarpeta= 'images/seccion_tienda_productos/';\n $idArchivo= $id;\n\n // imagen de producto\n if ($request->hasFile('imagen')) {\n $nombreArchivo= \"producto_\".$idArchivo;\n $extension= $request->imagen->extension();\n\n $rutaConArchivo= $rutaDeCarpeta.$nombreArchivo.'.'.$extension;\n\n // Subir imagen:\n $archivo= $request->file('imagen');\n Storage::put($rutaConArchivo, File::get($archivo));\n\n if ($request->file('imagen')->isValid()) {\n $objeto->ruta = $rutaConArchivo;\n }\n }\n\n // guia de talles\n if ($request->hasFile('guia_de_talle')) {\n $nombreArchivoTalle= \"guia_talle_\".$idArchivo;\n $extensionTalle= $request->guia_de_talle->extension();\n\n $rutaConArchivoTalle= $rutaDeCarpeta.$nombreArchivoTalle.'.'.$extensionTalle;\n\n // Subir imagen:\n $archivoTalle= $request->file('guia_de_talle');\n Storage::put($rutaConArchivoTalle, File::get($archivoTalle));\n\n if ($request->file('guia_de_talle')->isValid()) {\n $objeto->guia_de_talle = $rutaConArchivoTalle;\n }\n }\n\n $objeto->save();\n\n $request->session()->flash('guardado', 'cambios guardados');\n return back();\n }", "public function update(Request $request,$idPromocion)\n {\n $promocion = Promocion::find($idPromocion);\n\n if(!$cliente){\n abort(404);\n }\n else{\n $promociones = Promocion::find($idPromocion);\n $promociones->nombre = $request->nombre;\n $promociones->precioReal = $request->precioReal;\n $promociones->precioOferta = $request->precioOferta;\n $promociones->ahorro = $request->ahorro;\n $promociones->cantVentas = $request->cantVentas;\n $promociones->validez = $request->validez;\n $promociones->imagenusers = $request->imagenusers;\n $promociones->url=$requuest->url;\n $promociones->save();\n return redirect('')->route('promociones.index')>with('message','data has been updated!');\n }\n }", "public function update(Request $request, $id)\n {\n $apero = Apero::find($id);\n\n $apero->update($request->all());\n\n\n if (!empty($request->tags)) {\n $apero->tags()->detach();\n $apero->tags()->attach($request->input('tags'));\n } else {\n $apero->tags()->detach();\n }\n\n // Supression de l'image\n\n if (!is_null($request->delete_picture) || !is_null($request->picture))\n {\n\n $this->deleteImage($apero);\n\n\n $this->createImage($request, $apero);\n\n }\n\n /*if (!is_null($request->picture)) {\n\n $img = $request->picture;\n\n $ext = $img->getClientOriginalExtension();\n\n $fileName = md5(uniqid(rand(), true)) . \".$ext\";\n\n $img->move(env('UPLOADS'), $fileName);\n\n $apero->uri = $fileName;\n\n $apero->save();\n\n\n }*/\n\n\n return redirect()\n ->route('admin.apero.index')\n ->with(['message' => 'success update']);\n }", "public function update(Request $request, $id)\n {\n $eventoTipoBilhete = EventoTipoBilhete::find($id);\n \n $this->validate($request, [\n 'quantidade' => 'required|integer|min:'.$eventoTipoBilhete->quantidade,\n ]);\n \n $eventoTipoBilhete->evento_id = $request->input('evento');\n $eventoTipoBilhete->tipo_bilhete_id = $request->input('tipoBilhetes');\n $eventoTipoBilhete->quantidade = $request->quantidade;\n $eventoTipoBilhete->orientacao = $request->input('orientacao');\n \n if($request->file('fundo')!=null)\n {\n Storage::delete($eventoTipoBilhete->fundo);\n $eventoTipoBilhete->fundo = $request->file('fundo')->store('fundos', 'public');\n }\n $eventoTipoBilhete->save();\n $this->generateBilhetes($eventoTipoBilhete);\n\n $request->session()->flash('mensagem', 'Bilhetes actualizados com sucesso!');\n return redirect('bilhetes');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,\n [\"txtnamedv\" => \"required\",\n \"txtmotadv\" => \"required\",\n \"txtgiatien\"=> \"required|numeric\"],\n [\"txtnamedv.required\" => \"Chưa nhập tên kìa quang liêu :v\",\n \"txtmotadv.required\" => \"Mô tả không được trống\",\n \"txtgiatien.required\" =>\"Giá tiền không được trống\",\n \"txtgiatien.numeric\" => \"Giá tiền phải là số\"]\n );\n $dichvu = DichVu::Find($id);\n $dichvu ->name = $request->txtnamedv;\n $dichvu ->mota = $request->txtmotadv;\n $dichvu ->id_loaidv = $request->optionloaidv;\n $dichvu ->id_kieudv = $request->optionkieudv;\n $dichvu ->giatien = $request->txtgiatien;\n $dichvu -> save();\n return redirect() -> route('loaidv.index')->with(['flash_level' => 'success' , 'flash_message' =>'Cập nhật dịch vụ thành công !!']);\n }", "public function update(Request $request, $id)\n {\n $user = Auth::user();\n $user_id = Auth::id();\n \n $dataForm = $request->all();\n $contas = $this->contas->find($id);\n $old_contas = $this->contas->find($id);\n $update = $contas->update($dataForm);\n\n #if($contas->conta != $old_contas->conta)\n #{\n #event(new LogSistema(\" A conta a $old_contas->conta foi alterada $contas->conta.\", \"contas\", $user_id));\n #}\n\n if ($update)\n return redirect()->route('contas.index')->with('success', \"A conta {$old_contas->conta} foi atualizada com sucesso!\");\n else\n return redirect()->route('contas.edit')->with('error', \"Houve um erro ao editar a conta {$contas->conta}.\");\n }", "public function update(FueraServicioRequest $request, $id) {\n if (Sentinel::hasAccess('fueraservicio.update')) {\n $fillable = $request->only('clave', 'sucursal', 'numSiniestro', 'numReporte', 'inciso', 'poliza', 'tipo_siniestro', 'fecha_del_siniestro', 'comentarios', 'description');\n\n $FlotillaSiniestros = $this->FlotillaSiniestros->find($id);\n //No. of days from the accident\n $fillable['num_dias'] = Carbon::createFromFormat('Y-m-d', $fillable['fecha_del_siniestro'])->diff(new Carbon())->days;\n // fill data\n $FlotillaSiniestros->fill($fillable);\n // save flotilla\n $FlotillaSiniestros->save();\n // message\n flash()->success('Actualización exitosa.');\n\n return redirect('fueraservicio');\n }\n alert()->error('No tiene permisos para acceder a esta area.', 'Oops!')->persistent('Cerrar');\n return back();\n }", "public function update(Request $request, $id)\n {\n //\n $datosProfesor=request()->except(['_token','_method']);\n if($request->hasFile('Foto')){\n $profesor=Profesor::findOrFail($id);\n Storage::delete('public/'.$profesor->foto);\n $datosProfesor['Foto']=$request->file('Foto')->store('uploads','public');\n }\n Profesor::where('id','=',$id)->update($datosProfesor);\n\n //$profesor=Profesor::findOrFail($id);\n //return view('profesor.edit',compact('profesor'));\n return redirect('profesor')->with('Mensaje','Profesor modificado con exito');\n }", "public function update(Request $request, Venta $venta)\n {\n //\n \n $vventa = Venta::find($venta->id);\n $data=$request->all();\n $vventa->update($data);\n return redirect('ventas');\n }", "public function update(Request $request, $id)\n {\n $venda = Venda::find($id);\n $produtoId = $request->produto_id;\n $vendaProduto = VendaProduto::where('venda_id', $venda->id)->get();\n foreach($vendaProduto as $produto){\n if($produto->produto_id == $produtoId){\n $produto->amount = $request->amount;\n $produto->value = $request->value;\n $produto->update();\n return response()->json(['data' => true], 200);\n }\n }\n \n }", "public function update(Request $request, $id)\n {\n $presencial = Presencial::findOrFail($id);\n $presencial->matricula = $request->input('matricula');\n $presencial->cpf = $request->input('cpf');\n $presencial->nome = $request->input('nome');\n $presencial->telefone = $request->input('telefone');\n $presencial->email = $request->input('email');\n $presencial->setor = $request->input('setor');\n $presencial->motivo = $request->input('motivo');\n $presencial->assunto = $request->input('assunto');\n $presencial->observacao = $request->input('observacao');\n $presencial->protocolo = $request->input('protocolo');\n $presencial->digitro = $request->input('digitro');\n if ($request->file('documento')){\n $file=$request->file('documento');\n $filename=time().'.'.$file->getClientOriginalExtension();\n $request->documento->move('storage/', $filename);\n $presencial->documento=$filename;\n }\n $presencial->save();\n return redirect()->route('presencials.index')->with('toast_success','Protocolo Alterado com Sucesso');\n }", "public function testUpdate()\n {\n $id = $this->tester->grabRecord('common\\models\\Comentario', ['id_receita' => 2]);\n $receita = Comentario::findOne($id);\n $receita->descricao = 'novo Comentario';\n $receita->update();\n $this->tester->seeRecord('common\\models\\Comentario', ['descricao' => 'novo Comentario']);\n }", "public function update(Request $request,$id)\n {\n //\n $datosManual=request()->except(['_token','_method']);\n\n if($request->hasFile('archivo_url')){\n $Manual= Manuales::findOrFail($id);\n Storage::delete('public/'.$Manual->archivo_url);\n $datosManual['archivo_url']=$request->file('archivo_url')->store('uploads', 'public');\n }\n\n Manuales::where('id','=',$id)->update($datosManual);\n \n $Manual= Manuales::findOrFail($id);\n return redirect('manuales');\n \n }", "public function update(Request $request, $id)\n {\n // return 'ok';\n $info = ['about'=>5,'ceo letter'=>6,'osv'=>7];\n $maininfo = MainInfo::get();\n $maininfo[$info['about']]->update(array('content'=>$request->about,'status'=>true));\n $maininfo[$info['ceo letter']]->update(array('content'=>$request->letter,'status'=>true));\n if ($request->hasFile('osv')) {\n $change_name = time().'.'.$request->osv->getClientOriginalExtension();\n $maininfo[$info['osv']]->update(array('content'=>$change_name,'status'=>true));\n $request->osv->move(public_path('upload/osv'),$change_name);\n }\n return redirect('admin/about');\n }", "public function update(Request $request, Kavomati $kavomati)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $model = huaweiModel::find($id);\n $model->kode = $request->kode;\n $model->nama = $request->nama;\n if($request->hasfile(\"foto\"))\n {\n $destination = 'images/foto_huawei/'. $model->foto;\n if (File::exists($destination))\n {\n File::delete($destination);\n }\n $file = $request->file('foto');\n $nama_file = time().str_replace(\" \", \"\", $file->getClientOriginalName());\n $file->move('images/foto_huawei', $nama_file);\n $model->foto = $nama_file;\n }\n $model->harga = $request->harga;\n $model->stok = $request->stok;\n\n $model->save();\n\n return redirect('huawei')->with('success', \"Data Berhasil Diubah\");\n }", "public function update(DicomFormRequest $request, $id)\n {\n $lista = DicomModel::findOrFail($id);\n $lista->rut=$request->get('rut');\n $lista->dv=$request->get('dv');\n //$lista->idcliente=$request->get('idcliente');\n $lista->monto_protesto=$request->get('monto_protesto');\n $lista->moneda=$request->get('moneda');\n $lista->fecha_vencimiento=$request->get('fecha_vencimiento');\n $lista->fecha_protesto=$request->get('fecha_protesto');\n $lista->numero_documento=$request->get('numero_documento');\n $lista->situacion=$request->get('situacion');\n $lista->fecha_envio_aclaracion=$request->get('fecha_envio_aclaracion');\n $lista->fecha_aclaracion=$request->get('fecha_aclaracion');\n $lista->observacion=$request->get('observacion');\n \n $lista->update();\n\n $cli = DicomBaseModel::findOrFail($request->get('id_cli'));\n $cli->apellido_mat=$request->get('apellido_mat');\n $cli->apellido_pat=$request->get('apellido_pat');\n $cli->nombres=$request->get('nombres');\n\n $cli->update();\n\n return Redirect::to('/dicom')->with('status','Datos Actualizados con éxito');\n\n }", "public function update(Request $request, $kasus_id, $id)\n {\n $this->validate($request, [\n 'nama_terlapor' => 'required',\n 'lembaga' => 'required',\n 'foto' => 'image|max:2048'\n ]);\n\n $subyek = Subyek::find($id);\n if ($subyek) {\n $subyek->update($request->all()); \n }\n\n if ($request->hasFile('foto')) {\n $filename = null;\n $uploaded_foto = $request->file('foto');\n $extension = $uploaded_foto->getClientOriginalExtension();\n $filename = md5(time()) . '.' . $extension;\n $destinationPath = public_path() . DIRECTORY_SEPARATOR . 'images';\n $uploaded_foto->move($destinationPath, $filename);\n\n if ($subyek->foto) {\n $old_foto = $subyek->foto;\n $filepath = public_path() . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . $subyek->foto;\n try {\n File::delete($filepath);\n } catch (FileNotFoundException $e) {}\n }\n\n $subyek->foto = $filename;\n $subyek->save();\n }\n\n return redirect('subyek');\n }", "public function updated(Saida $saida)\n {\n //\n }", "public function update(Request $request, $id){\n\n $equipo_data = $request->all();\n \\JWTAuth::parseToken();\n $user = \\JWTAuth::parseToken()->authenticate();\n $equipo = NULL;\n\n $equiposCapitan = $this->JugadoresEquiposRepository->scopeQuery(function($query) use($id, $user) {\n return $query->where('id_jugador',$user->id_jugador)\n ->whereIn('capitan', ['t', 's'])\n ->where('id_equipo',$id);\n })->all();\n \n if(count($equiposCapitan)==0){\n return ResponseMessage::invalidPermission();\n }\n \n try{\n\n $equipo = $this->equiposRepository->update($equipo_data,$id);\n\n $file = $request->file(\"foto\");\n if(!empty($file)){\n $file->move(\"images/jugadores/\",$equipo[\"data\"][\"id\"].\".jpg\");\n }\n \n\n return response()->json($equipo);\n\n }catch (\\Exception $e) {\n if ($e instanceof ValidatorException) {\n return response()->json($e->toArray(), 400);\n\n } else {\n \n return response()->json($e->getMessage(), 500);\n\n }\n }\n \n \n }", "public function update(Request $request)\n {\n DB::table('vinos')\n ->where('id', $request->vino_id)\n ->update(['nombre' => $request->nombre,\n 'descripcion' => $request->descripcion,\n 'anyo' => $request->anyo,\n 'alcohol' => $request->alcohol,\n 'tipo_de_vino' => $request->tipo_vino\n ]);\n return redirect()->route('bodegas.show', ['id' => $request->bodega_id]);\n }" ]
[ "0.6588939", "0.65573376", "0.64659107", "0.6450939", "0.6436887", "0.64128554", "0.63867676", "0.6374083", "0.63693124", "0.63629323", "0.6362914", "0.63430583", "0.6328835", "0.63190275", "0.6314574", "0.631033", "0.6308764", "0.63052374", "0.630153", "0.6284505", "0.62816125", "0.62783635", "0.6265342", "0.62556744", "0.6252035", "0.62477565", "0.62417805", "0.6227751", "0.6209761", "0.6202653", "0.6201871", "0.62004817", "0.6200402", "0.6189492", "0.618678", "0.61815083", "0.6178661", "0.6174832", "0.61712354", "0.61706436", "0.6169817", "0.61673224", "0.6164961", "0.6164454", "0.61641157", "0.61620843", "0.61601245", "0.6159538", "0.6155454", "0.61488736", "0.6144742", "0.61430013", "0.6141852", "0.61401457", "0.6137038", "0.6136304", "0.6132187", "0.6130755", "0.6130644", "0.61305434", "0.6130184", "0.61251867", "0.6124015", "0.612078", "0.612078", "0.6119874", "0.6118981", "0.6110881", "0.61066854", "0.6104031", "0.61023325", "0.6101201", "0.6099848", "0.6097809", "0.60951996", "0.6093942", "0.6093942", "0.6092403", "0.6089852", "0.6088496", "0.60824066", "0.60800886", "0.6075841", "0.60736626", "0.60676676", "0.6066608", "0.6065991", "0.60599494", "0.6059196", "0.6054257", "0.6053765", "0.6052834", "0.6051825", "0.6051727", "0.60470814", "0.60447127", "0.6042806", "0.60382813", "0.60377264", "0.60374486", "0.60322267" ]
0.0
-1
Remove the specified Vehiculo from storage.
public function destroy($id) { $vehiculo = $this->vehiculoRepository->findWithoutFail($id); if (empty($vehiculo)) { Flash::error('Vehículo No se encuentra registrado.'); return redirect(route('vehiculos.index')); } $this->vehiculoRepository->delete($id); Flash::success('Vehículo eliminado correctamente.'); return redirect(route('vehiculos.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eliminarImagenCarpeta($campo, $tabla, $idAsignacion, $carpeta)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$carpeta/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function eliminar($objeto){\r\n\t}", "function eliminarImagenSusQ($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/fotoSustanciasQuimicas/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "function eliminarImagenServidor($campo, $tabla, $idAsignacion)\n {\n $data=$this->analisisRiesgo->getNombreImagen($campo, $tabla, $idAsignacion);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagen($borrar, $tabla, $idAsignacion);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function destroy(Request $request, $idContenido)\n {\n //dd($request->all());\n\n $caracteristica = CaracteristicasTecnica::find($request->caracteristica_id);\n echo \"<script>console.log('Borrando el contenido: \".$caracteristica->contenidos->find($idContenido)->nombre_archivo.\"')</script>\";\n //dd($caracteristica->contenidos->find($idContenido)->nombre_archivo);\n if($caracteristica->contenidos->find($idContenido)->tipo_contenidos_id==1)\n Storage::disk('public')->delete(\"productos\\imagenes\\\\\".$caracteristica->contenidos->find($idContenido)->nombre_archivo);\n else if($caracteristica->contenidos->find($idContenido)->tipo_contenidos_id==2){\n Storage::disk('public')->delete(\"productos\\/videos\\\\\".$caracteristica->contenidos->find($idContenido)->nombre_archivo);\n }\n \n $caracteristica->contenidos->find($idContenido)->delete();\n\n //return back()->withInput();\n return redirect()->route('caracteristicasTecnicas', ['id' => $request->producto_id]);\n }", "public function destroy($id)\n {\n $opcion=2;\n $usuario=Auth::user()->id;\n $imagen=\"no importa\";\n $descripcion=\"no importa\";\n $idimagen=$id;\n $sql_sol = \"call spCSL_CRUD_galeria\n (\n '\".$opcion.\"',\n '\".$imagen.\"',\n '\".$descripcion.\"',\n '\".$usuario.\"',\n '\".$idimagen.\"'\n )\";\n $datos = DB::select($sql_sol,array(1,10));\n //recupero de la base de datos para eliminar en fisico!\n \n if($datos==null){\n return Redirect::to('administrador/galeria')->withErrors(['erroregistro'=> 'Error']);\n }\n $cadena=substr($datos[0]->imagen, 22 ,strlen ($datos[0]->imagen)); \n if(Storage::disk('local')->exists($cadena)){\n $dele= Storage::disk('local')->delete($cadena);\n }\n return Redirect::to('administrador/galeria');\n \n }", "function eliminarImagenArreglo($campo, $tabla, $llavePrimaria, $campoLlave)\n {\n $data=$this->analisisRiesgo->getNombreImagenTabla($campo, $tabla, $llavePrimaria, $campoLlave);\n //Delete el nombre de la imagen de la base de datos\n $borrar=Array($campo => null);\n $this->analisisRiesgo->deleteImagenTabla($borrar, $tabla, $llavePrimaria, $campoLlave);\n //Unlink el nombre de la imagen del servidor\n foreach($data as $row)\n {\n $nombreImagen=$row[$campo];\n unlink(\"assets/img/fotoAnalisisRiesgo/$campo/$nombreImagen\");\n echo \"OK\";\n }\n\n }", "public function deleteSeguimiento(Request $request){\n $this->validate($request,['id' => 'required']);\n $id = $request->input('id');\n $seguimiento = Seguimiento::find($id);\n if($seguimiento != null){\n $file = storage_path('recursos/seguimientos/'.$seguimiento->foto);\n unlink($file);\n $seguimiento->delete();\n }\n\n return response()->json([\n 'status' => 'ok',\n 'code' => 200,\n 'result' => 'Se elimino el seguimiento'\n ],200)\n ->header('Access-Control-Allow-Origin','*')\n ->header('Content-Type', 'application/json');\n }", "public function eliminar($id) {\n\n $datosLibro = new Libro;\n //Validar que exista un archivo\n if($datosLibro) {\n //ubicar el archivo y su ruta\n $rutaArchivo = base_path('public').$datosLibro->imagen;\n //validar que exista lo anterior y si es asi eliminarlo\n if($rutaArchivo) {\n unlink($rutaArchivo);\n }\n $datosLibro->delete();\n }\n return response()->json(\"Registro Borrado\");\n }", "public function destroy(Vuelo $vuelo)\n {\n //\n }", "public function delete(Vuelo $vuelo) {\n try {\n $this->vueloDao->delete($vuelo);\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function delete($fisicasuelo);", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "public static function eliminarServicio($id_servicio){\n \n $eliminar = Neo4Play::client()->getNode($id_servicio);\t\t\n $eliminar->delete();\t\n \n\t}", "public function deleted(Historia $historia)\n {\n //\n }", "public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}", "public function deleteByid(Request $req , Response $res , $args)\n{\n //$pizzaid = $this->em->find('App\\Model\\Categorias' , $args['id']);\n\n $categorias = $this->em->find('App\\Model\\Categorias' , $args['id']);\n \n\n foreach ($categorias->getPizza() as $key => $value) {\n echo $value->getValorM().\"<br>\";\n echo $value->getId().\"<br>\";\n\n if($value->getId() == 113){ // a varialvel get com id pizza\n \n $pizza = $this->em->find('App\\Model\\Pizza', 113);\n $this->em->remove($pizza);\n $this->em->flush();\n\n }\n }\n\n\n // $directory = $this->container->get('upload_directory');\n // unlink($directory . $pizza->getUrlimg());\n\n //echo \"<p class='red text-darken-1'>Item excluido com sucesso</p>\";\n\n\n}", "public function destroy($id)\n {\n\n $vehiculo=Vehiculos::findOrFail($id);\n if(Storage::delete('public/'.$vehiculo->foto)){\n Vehiculos::destroy($id);\n }\n return redirect('vehiculos');\n }", "public function destroy($id)\n {\n //\n $estudiante = Estudiante::findOrFail($id);\n if (Storage::delete('public/'.$estudiante->foto)) {\n # code...\n Estudiante::destroy($id);\n }\n return redirect('estudiante')->with('mensaje', 'Estudiante eliminado con éxito');\n }", "public function destroy(Veiculo $veiculo)\n {\n try {\n DB::beginTransaction();\n $veiculo->delete();\n DB::commit();\n return response()->json(['message' => 'true']);\n } catch (\\Exception $exception) {\n DB::rollBack();\n return response()->json(['message' => 'false', 'error' => $exception]);\n }\n }", "public function deleteSeguimientos(Request $request){\n $this->validate($request,['id' => 'required']);\n $id = $request->input('id');\n $seguimiento = Seguimiento::where('paciente_id',$id)->get()->toArray();\n foreach($seguimiento as $seg){\n $file = storage_path('recursos/seguimientos/'.$seg['foto']);\n unlink($file);\n }\n\n DB::table('seguimientos')->where('paciente_id',$id)->delete();\n\n return response()->json([\n 'status' => 'ok',\n 'code' => 200,\n 'result' => 'Se elimino el seguimiento'\n ],200)\n ->header('Access-Control-Allow-Origin','*')\n ->header('Content-Type', 'application/json');\n\n }", "public function destroy($folio)\n {\n //captop el valor de la imagen \n $datos = DB::select(\"SELECT imagen FROM empleados \");\n //verefico si esta vacio\n if($datos[0]->imagen==\"\"){\n //guardar la imagen\n Empleado::destroy($folio);\n }else{\n //y si exxiste eliminalo\n $imagen_antigua = DB::select(\"SELECT imagen FROM empleados\");\n storage::delete('public/'.$imagen_antigua[0]->imagen);\n }\n Empleado::destroy($folio);\n\n return redirect('empleados');\n \n }", "public function destroy($id)\n {\n $pelicula = Pelicula::find($id);//En vez de usar Destroy, buscaremos el usuario según el ID\n \\Storage::delete($pelicula->path);\n $pelicula->delete();//y ahora se hará referencia al método Delete\n Session::flash('message','Película Eliminada Correctamente');\n return Redirect::to('/pelicula');\n }", "public function destroy($id_empresa)\n {\n $empresa=empresa::find($request->id_empresa);\n $image=$empresa->url_image;\n if ($empresa->delete()) {\n unlink(public_path().'/'.$image);\n flash('¡Registro eliminado exitosamente!', 'success');\n return redirect()->back();\n } else {\n flash('¡No se pudo eliminar el registro, posiblemente esté siendo usada su información en otra área!', 'error');\n return redirect()->back();\n } \n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function delete($producto);", "public function Excluir(){\n $idMotorista = $_GET['id'];\n\n $motorista = new Motorista();\n\n $motorista->id = $idMotorista;\n\n $motorista::Delete($motorista);\n\n\n }", "public function eliminar(Request $request, $id)\n {\n Asignacion::destroy($id);\n\n $bitacora = new Bitacora;\n $bitacora->user_id = Auth::id();\n $consulta = User::where('id',Auth::id())->select(\"nombres\",\"apellidos\",\"rolprimario\",\"rolsecundario\")->get();\n foreach($consulta as $item){\n $nombres = $item->nombres;\n $apellidos = $item->apellidos;\n $rolprimario = $item->rolprimario;\n $rolsecundario = $item->rolsecundario;\n }\n \n $bitacora->usuario = $nombres.\" \".$apellidos;\n $bitacora->rol = $rolprimario.\", \".$rolsecundario;\n $bitacora->fecha = Carbon::now()->setTimezone('America/Caracas')->toDateString();\n $bitacora->hora = Carbon::now()->setTimezone('America/Caracas')->toTimeString();\n $bitacora->accion = \"Eliminada asignacion de materia-grupo-horario\";\n $bitacora->direccion_ip = $request->getClientIp();\n $bitacora->save();\n\n return redirect('asignacion');\n }", "public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}", "public function vymaz(){\r\n $db = napoj_db();\r\n $sql =<<<EOF\r\n DELETE FROM Diskusie WHERE id = \"$this->ID\";\r\nEOF;\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n }\r\n $db->close();\r\n }", "public function destroy( $value)\n {\n\n\n try {\n\n DB::beginTransaction();\n $classe = Classe::find($value);\n\n\n foreach ($classe->eleves as $eleve) {\n $eleve->delete();\n }\n\n\n $classe->delete();\n\n DB::commit();\n\n\n\n } catch (\\Exception $e) {\n\n DB::rollback();\n Session::flash('error' , 'Erreur la suppression echoué');\n\n }\n\n\n return $this->index();\n}", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n //\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function eliminar($id)\n {\n }", "public function deleteVoto($voto)\n {\n try\n {\n self::execQuery(\"DELETE FROM voto WEHRE id=\".$voto->getId());\n\n return true; \n }\n catch(PDOException $e)\n {\n echo $e->getMessage(); \n return false;\n }\n }", "public function destroy($nombre, $url_regreso = null){\n $cubiculo = Cubiculo::where('nombre', $nombre)->first();\n Storage::deleteDirectory('infraestructura/cubiculosMini/'. $cubiculo->id . '/');\n Storage::deleteDirectory('infraestructura/cubiculos/'. $cubiculo->id . '/');\n if(!$cubiculo){\n $mensaje = \"No existe cubiculo con nombre: \".$nombre;\n return view('general.error')\n ->with(['mensaje' => $mensaje]);\n }\n $cubiculo->delete();\n\n if($url_regreso != null){\n return redirect(url($url_regreso))\n ->with('status', 'Elemento borrado exitosamente');\n }else{\n return redirect(url('/'))\n ->with('status', 'Elemento borrado exitosamente');\n }\n }", "public function eliminarComuna($id){\n\n $comuna = Commune::find($id);\n $ruta = public_path().'/imagenes/comunas';\n $rutaImagen = $ruta.'/'.$comuna->image;\n $exito = $comuna->delete();\n if($exito){\n File::delete($rutaImagen);\n alert()->success('El comuna fue eliminada correctamente','Comuna Eliminada')->autoclose(3000);\n } \n return redirect('administrador/comunas');\n }", "public function eliminar()\n {\n // Comprobar si esta logeado como admin\n if( isset($_SESSION['admin']) ){\n\n // Capturar el id enviado por GET\n $id = $_GET['id'];\n\n // Comprobar si no esta siendo utilizado en un reporte\n $comprobarForanea = Reporte::donde('tipo_reporte_id', $id)\n ->resultado();\n\n // Encontra el tipo de reporte por el id y capturarlo\n $tipoReporte = TipoReporte::encontrarPorID($id);\n\n\n if ( empty($comprobarForanea) ) {\n\n // Eliminar el tipo de reporte\n $tipoReporte->eliminar();\n\n\n // Guardar un mensaje de que se elimino correctamente en una cookie\n setcookie('mensaje', \"Se elimino correctamente el tipo de reporte ($tipoReporte->reporte)\", time() + 10, '/' );\n\n } else {\n\n // Guardar un mensaje de que se no se pudo eliminar\n setcookie('mensaje_error', \"El tipo de reporte ($tipoReporte->reporte) esta siendo utilizado en un reporte\", time() + 10, '/' );\n }\n\n\n // Redirigir a la tabla con todos los tipos de reporte\n header('Location: ../reportes/tipos_reporte');\n\n } else {\n\n // Redirigir al perfil\n header('Location: ../perfil');\n }\n }", "public function destroy($id,$tipo)\n {\n $ip = request()->server();\n $user =auth()->user();\n\n $venta = Venta::find($id);\n\n $mensaje = Venta::find($id);\n $darBaja =\"200\"; \n $darAlta =\"400\";\n $eliminado =\"600\";\n if($tipo === $darBaja){\n //si es 200 de da de baja\n $venta->estado = false;\n Log::info( 'IP DEL CLIENTE:'. $ip['REMOTE_ADDR'] . ' CLIENTE: '. $user->name . ' DESDE NAVEGADOR:'.$ip['HTTP_USER_AGENT'] . ' DESCRIPCIÓN: Venta dado de baja, id: ' .$mensaje->id . ', Nombre: ' . $mensaje->nombre . ' ' );\n \n $venta->save();\n\n return back()->with('info', 'Dado de baja correctamente');\n }\n if($tipo === $darAlta){\n //si es 400 dar Alta\n $venta->estado = true;\n Log::info( 'IP DEL CLIENTE:'. $ip['REMOTE_ADDR'] . ' CLIENTE: '. $user->name . ' DESDE NAVEGADOR:'.$ip['HTTP_USER_AGENT'] . ' DESCRIPCIÓN: Venta dado de alta, id: ' .$mensaje->id . ', Nombre: ' . $mensaje->nombre . ' ' );\n $venta->save();\n\n return back()->with('info', 'Dado de alta correctamente');\n }\n if($tipo === $eliminado){\n //si es 400 de cambia el eliminado\n $venta->eliminado = true;\n\n //Cambia el estado eliminado de las areas dependientes de este venta\n //DB::table('areas')->where('departamento_id',$venta->id)->update(['eliminado'=>true]);\n\n Log::info( 'IP DEL CLIENTE:'. $ip['REMOTE_ADDR'] . ' CLIENTE: '. $user->name . ' DESDE NAVEGADOR:'.$ip['HTTP_USER_AGENT'] . ' DESCRIPCIÓN: Venta eliminado, id: ' .$mensaje->id . ', Nombre: ' . $mensaje->nombre . ' ' );\n $venta->save();\n\n return back()->with('info', 'Eliminado correctamente');\n }\n \n }", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "function Eliminar()\n{\n /**\n * Se crea una instanica a Concesion\n */\n $Concesion = new Titulo();\n /**\n * Se coloca el Id del acuifero a eliminar por medio del metodo SET\n */\n $Concesion->setId_titulo(filter_input(INPUT_GET, \"ID\"));\n /**\n * Se manda a llamar a la funcion de eliminar.\n */\n echo $Concesion->delete();\n}", "public function eliminar(){\n $dimensiones = $this->descripciones()->distinct()->get()->pluck('id')->all();\n $this->descripciones()->detach($dimensiones);\n DescripcionProducto::destroy($dimensiones);\n $this->categorias()->detach();\n $this->imagenes()->delete();\n $this->delete();\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function destroy(Conta $conta)\n {\n //\n }", "public function destroy(Foto $foto)\n {\n // dd($foto->inmueble->tipoinmueble->nombre);\n // $foto=Foto::find($foto->id);\n // dd($foto);\n $id=$foto->inmueble->id;\n $oldImage=public_path().'/storage/images/galeria_imagen_foto/'.$foto->img;\n\n if (file_exists($oldImage)) {\n # delete the image\n unlink($oldImage);\n }\n // $foto->servicios()->detach();\n\n // $ruta='/'. trim(strtolower($foto->inmueble->tipoinmueble->nombre)) . 's' ;\n // if ($foto->inmueble->tipoinmueble->nombre=='Particular') {\n // $ruta='/inmuebles'.'/'.$foto->inmueble->id;\n // }else{\n\n // $ruta=str_replace(' ', '', $ruta);\n // }\n // dd($ruta);\n\n //guardo\n $foto->delete();\n\n //redirecciono\n return redirect('/inmuebles/'. $id);\n }", "public function destroy($id)\n {\n //CREAR ARREGLO PARA MANDAR A VALIDAR SI TIENE CARACTERESE ESPECIALES\n $DesencriptarID=array(\n 'id'=>decrypt($id)\n );\n //Validar si tiene caracteres especiales\n if(tieneCaracterEspecialRequest($DesencriptarID)){\n return back()->with(['mensajePInfoServicio'=>'No puede ingresar caracteres especiales','estadoP'=>'danger']);\n };\n //BUSCAMOS EL REGISTRO\n $idservicioGet=decrypt($id);\n \n\n $emision=EmisionModel::where('estado','Activo')->where('idservicio',$idservicioGet)->first();\n if(!is_null($emision))\n {\n return back()->with(['mensajePInfoServicio'=>'No se pudo eliminar el registro ya que se encuentra relacionado','estadoP'=>'danger']);\n }\n\n $detalleServicio=DetalleServicioModel::where('estado','Activo')->where('idservicio',$idservicioGet)->first();\n if(!is_null($detalleServicio))\n {\n return back()->with(['mensajePInfoServicio'=>'No se pudo eliminar el registro ya que se encuentra relacionado','estadoP'=>'danger']);\n }\n\n $servicio= ServicioModel::find(decrypt($id));\n $servicio->estado=\"Eliminado\";\n if($servicio->save())\n {\n return back()->with(['mensajePInfoServicio'=>'El registro fué eliminado','estadoP'=>'success']);\n }\n\n // //ELIMINAMOS EL REGISTRO\n // try {\n // $provincia->delete();\n // return back()->with(['mensajePInfoProvincia'=>'El registro fué eliminado','estadoP'=>'success']);\n // } catch (\\Throwable $th) {\n // return back()->with(['mensajePInfoProvincia'=>'No se pudo eliminar el registro ya que se encuentra relacionado','estadoP'=>'danger']);\n // }\n }", "public function remover() {\n \n if (!db_utils::inTransaction()) {\n throw new DBException(_M(self::ARQUIVO_MENSAGEM . \"sem_transacao_ativa\"));\n }\n \n $this->removerItens();\n \n $oDaoProcessoLote = new cl_processocompralote;\n $oDaoProcessoLote->excluir($this->getCodigo());\n if ($oDaoProcessoLote->erro_status == 0) {\n throw new BusinessException(_M(self::ARQUIVO_MENSAGEM.\"erro_remover_lote\"));\n }\n }", "public function destroy(Archivo $archivo)\n {\n //\n }", "public function destroy(Archivo $archivo)\n {\n //\n }", "public function destroy(Archivo $archivo)\n {\n //\n }", "public function destroy($codice)\n {\n DB::delete(\"delete from anagrafe WHERE Codice='$codice'\");\n\n return redirect()->action(\"ClientiController@index\");\n }", "public function eliminar($id)\n {\n Permiso::destroy($id);\n cache()->tags('Permiso')->flush();\n return redirect()->route('permiso')->with('mensaje','Permiso eliminado con exito');\n }", "public function deleting(Seguimiento $Seguimiento){\n \n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "function eliminaDaDB($ID_cliente, $ID_ordine, $ID_foto) {\n $servername = \"localhost\";\n $username = \"onlinesales\";\n $password = \"Sale0nl1nE\";\n $dbname = \"fmc-db-onlinesales\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $query1 = \"DELETE FROM `Ordine` WHERE `ID_cliente` = '$ID_cliente' AND `ID_ordine` = '$ID_ordine'\";\n $query2 = \"DELETE FROM `Cliente` WHERE `ID_cliente` = '$ID_cliente'\";\n $query3 = \"DELETE FROM `Foto` WHERE `ID_cliente` = '$ID_cliente'\";\n \n unlink(\"../Pagina_iniziale/images/\".$ID_foto);\n eseguiQuery($conn, $query1);\n eseguiQuery($conn, $query2);\n eseguiQuery($conn, $query3);\n // chiusura della connessione\n \n $conn->close();\n }", "public function deleteVesti($id){\n\t\t\t$this->db->where('skolaId', $id);\n\t\t\t$this->db->delete('vesti');\n\t\t}", "protected\n function eliminar($id)\n {\n }", "function elimina_vetrina()\n {\n $peer = new VetrinaPeer();\n $do = $peer->find_by_id(Params::get(\"id_vetrina\"));\n $peer->delete($do);\n\n $peer2 = new ProdottoServizioVetrinaPeer();\n $peer2->id_vetrina__EQUAL(Params::get(\"id_vetrina\"));\n $elenco_prodotti_servizi = $peer2->find();\n foreach ($elenco_prodotti_servizi as $ps)\n $peer2->delete($ps);\n\n if (is_html())\n return Redirect::success();\n else\n return Result::ok();\n }", "public function eliminarProducto($codigo){\r\n //Preparamos la conexion a la bdd:\r\n $pdo=Database::connect();\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $sql=\"delete from producto where codigo=?\";\r\n $consulta=$pdo->prepare($sql);\r\n //Ejecutamos la sentencia incluyendo a los parametros:\r\n $consulta->execute(array($codigo));\r\n Database::disconnect();\r\n }", "public function destroy($id)\n {\n if(Auth::user()->tipoUsuario == 3){\n try{\n $estimulos = Estimulos::find($id);\n $estimulos->delete();\n return redirect()->route('estimulos.index')->with('status', 'Estimulo eliminado');\n }\n catch(\\Illuminate\\Database\\QueryException $e){\n return redirect()->route('estimulos.index')->with('status', 'No se pueden eliminar elementos con Integridad Referencial');\n }\n }\n else{\n return redirect()->route('estimulos.index');\n }\n }", "public function destroy(Vinicola $vinicola)\n {\n //\n foreach ($vinicola->uvasVin as $uvaVin) {\n $uvaVin->delete();\n }\n $vinicola->delete();\n return redirect()->route('vinicolas.index');\n }", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function destroy($id)\n {\n $data = oficina::find($id);\n $data->vigencia = 0;\n $data->save();\n return oficina::destroy($id) ? redirect(\"inmobiliario/oficina\"): view(\"inmobiliario.oficina.edit\", print 'Hubo un error al eliminar');\n\n }", "function removeAval($codUsr,$cod,$tipo){\r\n\t\t$fAval = new fachada_avaliacao();\r\n\t\t$fAval->removeAval($codUsr,$cod,$tipo);\r\n\t}", "public function destroy( $idMenu)\n {\n //\n $Menus = Menu::Find($idMenu);\n \n$image_path = parse_url($Menus->imagen);\n$imagen1 = (public_path($image_path['path']));\n//dd($prueba);\n File::delete($imagen1);\n $Menus::destroy($idMenu); \n \n return redirect()->route('Menu.index')->with('success','Registro eliminado satisfactoriamente');\n }", "public function eliminarServicio(Servicio $servicio){\n $servicio->delete();\n return redirect()->route('servicios');\n }", "public function destroy($id)\n {\n $guichet = Guichet::find($id);\n $guichet->delete();\n return redirect('guichets')->with(\"success\", \"Le guichet est supprimé !\");\n}", "public function eliminar()\n\t{\n\t\t$idestado = $_POST['idestado'];\n\t\t//en viamos por parametro el id del estado a eliminar\n\t\tEstado::delete($idestado);\n\t}", "public function destroy(Request $request, Articulo $articulo)\n {\n if($articulo)\n {\n //$articulo->movimientos_stock()->delete();\n $articulo->delete();\n return $articulo;\n }\n }", "function eliminarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_ime';\r\n\t\t$this->transaccion='tgv_SERVIC_ELI';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\t\t\t\t\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('id_servicio','id_servicio','int4');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "public function eliminar()\n {\n if (isset ($_REQUEST['id'])){\n $id=$_REQUEST['id'];\n $miConexion=HelperDatos::obtenerConexion();\n $resultado=$miConexion->query(\"call eliminar_rubro($id)\");\n }\n }", "public function destroy(Venta $venta)\n {\n //\n }", "public function destroy(Venta $venta)\n {\n //\n }", "public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}", "public function eliminarfoto($idf, $idc) {\n $imagen = CaptacionFoto::find($idf);\n File::delete($imagen->ruta . '/' . $imagen->nombre);\n $foto = CaptacionFoto::find($idf)->delete();\n\n return redirect()->route('captacion.edit', [$idc, 3])->with('status', 'Foto eliminada con éxito');\n }", "public function destroy(ubicacion $ubicacion)\n {\n //\n }", "public function destroy(Equipo $equipo)\n {\n //\n }", "public function eliminar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToDelete' => trim($_POST['especialidadToDelete'])\n ];\n \n // Validar carga de especialidadToDelete\n if(empty($data['especialidadToDelete'])){\n $data['especialidadToDelete_error'] = 'No se ha seleccionado la especialidad a eliminar';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToDelete_error'])){\n // Crear especialidad\n if($this->especialidadModel->eliminarEspecialidad($data['especialidadToDelete'])){\n flash('especialidad_success', 'Especialidad eliminada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToDelete_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }", "function deleteVenta($folio)\n{\n\t$con = getDBConnection();\n\t$sql = \"DELETE FROM ventas WHERE folio = :folio\";\n\t$stmt = $con->prepare($sql);\n\t$stmt->bindParam(':folio', $folio);\n\t$stmt->execute();\n}", "public function destroy(Vehicle $vechile)\n {\n //\n }", "public function destroy( $id) //aqui reemplazamos los objetos para recibir solo el id\n {\n $empleado = Empleados::findOrFail($id); // busco los registros correspondientes al id que estoy buscando\n if(Storage::delete('public/'.$empleado->Foto)){// y si el borrado se lleva a cabo ->\n Empleados::destroy($id); //eliminamos de la base de datos\n } \n return redirect('empleados')->with('Mensaje','Empleado Eliminado'); //usamos un return para desplegar la informacion con el registro borrado\n //aqui enviamos un parametro id luego lo destruimos y finalmente actualizamos con el return los registros\n }", "public function eliminar($servicio, $recinto)\n\t{\n\t\t$vinculos = $users = Recinto_servicio::\n\t\twhere('active_flag', 1)\n\t\t->where('servicio_id', $servicio)\n\t\t->where('recinto_id', $recinto)->update(['active_flag'=>0]);\n\n\t\tSession::flash('message_type', 'negative');\n\t\tSession::flash('message_icon', 'hide');\n\t\tSession::flash('message_header', 'Failure');\n\t\tSession::flash('error', 'Vínculo eliminado exitosamente');//shows confirmation about deletion\n\t\t\n\t\treturn redirect()->route('recinto_servicios.index');\n\t}", "public function destroy($nom)\n {\n \t//si se quiere organizar mejor creando una carpeta dentro de public/\n \t//indicar esa carpeta en un path\n \t// $path = \"foldername\".$nom;\n \t//\\Storage::disk('public')->delete($path);\n \\Storage::disk('public')->delete($nom);\n echo \"Archivo $nom eliminado\";\n }", "public function destroy($id)\n {\n DB::table('producto')->where('codigo',$id)->delete();\n return redirect()->route('productos.index')\n ->with('success','Producto Borrado Exitosamente');\n \n }", "public function destroy(Request $request)\n {\n\n \n $usuario=User::where('tipo_usuario','Admin')->first();\n\n if(\\Hash::check($request->clave, $usuario->password)){\n\n $producto=Productos::find($request->id_producto);\n $nombre=$producto->nombre;\n if ($producto->delete()) {\n //---------------registrando en bitacora------------\n $bitacora=new Bitacora();\n $bitacora->id_usuario=\\Auth::getUser()->id;\n $bitacora->operacion=\"Producto \".$nombre.\" eliminado\";\n $bitacora->save();\n //---------fin de registro en bitacora---------------\n flash('<i class=\"icon-circle-check\"></i> Registro Eliminado exitosamente')->success()->important();\n return redirect()->back();\n } else {\n flash('<i class=\"icon-circle-check\"></i> No se pudo eliminar el registro, posiblemente esté siendo usada su información en otra área!')->warning()->important();\n \n return redirect()->back();\n }\n } else {\n flash('<i class=\"icon-circle-check\"></i> Clave de usuario admin incorrecta!')->error()->important();\n return redirect()->back();\n }\n \n }", "public function destroy($id)\n {\n $producto = tb_producto::FindOrFail($id);\n if (Storage::delete('public/' . $producto->imagen)) {\n tb_producto::destroy($id);\n }\n return redirect('admin_productos');\n }", "public function eliminarPorDominio($dominio)\n {\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function removeProducto(Request $request){\n \n $id_producto = $request['id_producto'];\n return ProductoModel::eliminarProducto($id_producto);\n }", "public function destroy($incidencia)\n {\n //\n Incidencies::find($incidencia)->delete();\n }", "function deleteProyecto($proyecto){\n //no implementado por no requerimiento del proyecto\n }", "public function eliminarPorId($id)\n {\n }", "public function destroy(Venta $venta)\n {\n foreach ($venta->productos as $key => $a) {\n \n //sumar del stock\n $producto = Product::findOrfail($a->producto_id);\n $producto->stock = $producto->stock + $a->cantidad;\n $producto->save();\n \n }\n\n if ($venta->delete()) {\n return redirect()->route('ventas.index')->with(['type' => 'warning', 'title' => 'Se Elimino Correctamente', 'msg' => 'La venta se ha eliminado Correctamente.']);\n }\n }", "public function destroy($id) {\n //eliminamos el producto y los mandamos a la verga! :v\n try {\n $producto = Producto::find($id);\n if ($producto->delete()) {\n $pathToSave = env(\"PATH_SAVE_IMAGES\");\n //eliminamos archivo anterior\n $directorySubStringLastFile = explode(\"/\",$producto->img); \n //dd($directorySubStringLastFile);\n //dd($pathToSave.$directorySubStringLastFile[1]);\n unlink($pathToSave.$directorySubStringLastFile[1]);\n\n return redirect(\"admin/producto?mensaje=Se elimino con exito el producto&tipo=success\");\n } else {\n return redirect(\"admin/producto?mensaje=No elimino con exito el producto&tipo=warining\");\n }\n } catch (\\Exception $ex) {\n return redirect(\"admin/producto?mensaje=\".$ex->getMessage().\"&tipo=error\");\n }\n }", "protected function eliminar($id)\n {\n }", "public function destroy($id)\n {\n $veichle=Veichle::FindOrFail($id);\n $veichle->delete();\n if($veichle->image){\n Storage::disk('uploads')->delete($veichle->image);\n }\n\n return redirect()->route('veichles.index')\n ->with('success',\"Veichle deleted!\");\n }" ]
[ "0.647394", "0.6430235", "0.6410976", "0.63926893", "0.63897043", "0.63566506", "0.6272069", "0.62652475", "0.6260194", "0.6242225", "0.622742", "0.6221773", "0.6188794", "0.61867654", "0.61486614", "0.6141093", "0.6132746", "0.6132355", "0.61164874", "0.61120534", "0.60930496", "0.60868996", "0.6075859", "0.6067289", "0.60531557", "0.6050688", "0.60462976", "0.60291266", "0.6010635", "0.60054195", "0.5994556", "0.5976779", "0.5976779", "0.59751046", "0.59751046", "0.59751046", "0.5952121", "0.5948126", "0.5945561", "0.594333", "0.59328353", "0.59228903", "0.589203", "0.5883349", "0.58818984", "0.58818984", "0.58818984", "0.58818984", "0.5873478", "0.58690816", "0.5866246", "0.5862532", "0.5861071", "0.5861071", "0.5861071", "0.58565515", "0.5854915", "0.585081", "0.58504236", "0.58465356", "0.58462834", "0.5840613", "0.5840418", "0.5839686", "0.58335805", "0.5819312", "0.5817913", "0.5816358", "0.5812386", "0.580765", "0.58050114", "0.58046865", "0.57970405", "0.57896346", "0.5783777", "0.57757777", "0.5774432", "0.5774432", "0.57735276", "0.577161", "0.5766095", "0.5766062", "0.5765892", "0.57597655", "0.5759476", "0.5757597", "0.5753687", "0.575324", "0.5751044", "0.5749821", "0.5747001", "0.57442313", "0.5741434", "0.5734731", "0.57330334", "0.5732514", "0.57302266", "0.5725633", "0.57252496", "0.57250804", "0.5724032" ]
0.0
-1
Gets price for a single pair
function getPrice ($api, $exchange, $pairSymbol) { if ($exchange=='binance') { $price = $api->price($pairSymbol); } elseif ($exchange=='kraken') { $price = $api->QueryPublic('Ticker', array('pair'=>$pairSymbol)); $price = $price['result'][$pairSymbol]['c'][0]; } return $price; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function price($pair) {\n\t\t\treturn (self::valid($prices = self::prices(array($pair)))) ? $prices->prices[0] : $prices;\n\t\t}", "abstract function getPriceFromAPI($pair);", "public function getPrice()\n {\n $price = Cache::tags([$this->exchange])->get($this->pair, function () {\n return $this->getPriceFromAPI($this->pair);\n });\n return $price;\n }", "public function getPrice()\n {\n return $this->get(self::_PRICE);\n }", "public function getPairPriceHandle($response, $first_currency, $second_currency)\n {\n $response = json_decode($response, true);\n\n if (isset($response['error_code'])) {\n return null;\n }\n\n return (float) $response['ticker']['last'];\n }", "function getPairValue($pair,$type='ask') { \r\n\t$curl = new Curl;\r\n\t$ticker = (array)$curl->get(\"https://api.bitfinex.com/v1/pubticker/$pair\");\r\n\treturn $ticker[$type];\r\n}", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getPairPriceHandle($response, $first_currency, $second_currency)\n {\n $response = json_decode($response, true);\n\n if (!$response || !is_array($response)) {\n return null;\n }\n\n return (float) $response['ticker']['last'];\n }", "abstract public function getPrice();", "public function getPrice()\n {\n return $this->object->Price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice() {\n\t\treturn($this->price);\n\t}", "public function getPrice()\n {\n if (array_key_exists(\"price\", $this->_propDict)) {\n return $this->_propDict[\"price\"];\n } else {\n return null;\n }\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n\t{\n\t\treturn $this->price;\n\t}", "public function getPrice()\r\n {\r\n return $this->price;\r\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice()\n {\n return $this->Price;\n }", "function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n\n return $this->price;\n }", "function get_price($find){\n\t$books=array(\n\t\t\"paris-seoul\"=>599,\n\t\t\"paris-madrid\"=>400,\n\t\t\"paris-marseille\"=>387\n\t)\n\t;\n\n\tforeach ($books as $book => $price) {\n\t\tif($book==$find){\n\t\t\treturn $price;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "public function getTickerPrice($symbol = NULL);", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice()\n {\n if ($this->_calculatePrice || !$this->getData('price')) {\n return $this->getPriceModel()->getPrice($this);\n } else {\n return $this->getData('price');\n }\n }", "public function getPrice() {\n }", "public function getPrice()\n {\n $price_is_tax_inc = \\App\\Configuration::get('PRICES_ENTERED_WITH_TAX');\n\n $price = $price_is_tax_inc ? \n $this->price_tax_inc :\n $this->price ;\n\n $priceObject = new \\App\\Price( $price, $price_is_tax_inc, \\App\\Context::getContext()->currency, \\App\\Context::getContext()->currency->conversion_rate);\n\n return $priceObject;\n }", "public function getPrice() {\n return $this->item->getPrice();\n }", "public function getPrice(): string;", "public function getPricePoint() {\n return $this->pricePoint;\n }", "public function getPrice(): float;", "public function getPrice(): float;", "public function getListPrice()\n\t{\n\t\treturn $this->getKeyValue('list_price'); \n\n\t}", "public function getPrice()\n {\n $price = [ $this->price, $this->price_tax_inc ]; // These prices are in Company Currency\n\n $priceObject = Price::create( $price, Context::getContext()->company->currency );\n\n return $priceObject;\n }", "public function getPriceInfo()\n {\n return $this->price_info;\n }", "public function getPrice()\n {\n return 0.2;\n }", "public function getPriceFromDatabase()\n {\n }", "public static function price_time($pair, $date) {\n\t\t\treturn (self::valid($candles = self::candles_time($pair, 'S5', ($time=strtotime($date)), $time+10))) ?\n $candles->candles[0] : $candles;\n\t\t}", "static function getPrice($procent , $price){\n return $price - ( $price / 100 * $procent);\n }", "public function getPrice()\n {\n return $this->amount;\n }", "public function getPrice() {\n return $this->_price;\n }", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "function get_price($pid){\n\t$products = \"scart_products\"; // products table\n\t$serial = \"bookid\"; // products key\n\t$result=mysql_query(\"select price from $products where $serial=$pid\")\n or die (\"Query '$products' and '$pid' failed with error message: \\\"\" . mysql_error () . '\"');\n\t$row=mysql_fetch_array($result);\n\treturn $row['price']; // products price\n}", "public function getPrice()\n {\n $db = new db_connector();\n $conn = $db->getConnection();\n\n $stmt = \"SELECT `Order List`.orderID, `Order List`.PQuantity, `Product`.PPrice, `Product`.PID\n FROM `Order List`\n LEFT JOIN `Product`\n ON `Order List`.productID = `Product`.PID\";\n\n $result5 = $conn->query($stmt);\n\n if($result5)\n {\n $price_array = array();\n\n while($price = $result5->fetch_assoc())\n {\n array_push($price_array, $price);\n }\n $total = 0;\n $curr = 0;\n for($x = 0; $x < count($price_array); $x ++)\n {\n // echo \"price array \" . $price_array[$x]['orderID'] . \"<br>\";\n // echo \"session order id \" . $_SESSION['orderID'] . \"<br>\";\n\n if($price_array[$x]['orderID'] == $_SESSION['orderID'])\n {\n\n // echo $price_array[$x]['orderID'];\n // echo $price_array[$x]['PQuantity'];\n\n $curr = ((float) $price_array[$x]['PPrice'] * (float) $price_array[$x]['PQuantity']);\n $total = $total + $curr;\n $curr = 0;\n }\n }\n echo \"$\" . $total;\n return $total;\n }\n }", "public function get_price() {\n $query = $this->db->query(\"SELECT * FROM price \");\n\n if ($query) {\n return $query->result_array();\n }\n }", "function GetPrice($symbol)\n{\n\t//google finance can only handle up to 100 quotes at a time so split up query then merge results\n\tif(count($symbol) > 100)\n\t{\n\t\t$retArr = array();\n\t\tfor($j=0; $j< count($symbol); $j +=100)\n\t\t{\n\t\t\t$arr = LookUpWithFormattedString(FormatString(array_slice($symbol, $j, 100)));\n\t\t\t$retArr = array_merge($retArr, $arr);\n\t\t}\n\t\treturn $retArr;\n\t}\n\telse\n\t\treturn LookUpWithFormattedString(FormatString($symbol));\n}", "public function getPrice() {\n $price = 420;\n return $price;\n }", "public function resolvePrice();", "public function getPrice() : float\n {\n return $this->get('price', 'products');\n }", "public function getPriceProduct()\n {\n return $this->priceProduct;\n }", "public function getSearsPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.precio')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.precio_secundario')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public static function trade_pair($pair, $number=50) {\n\t\t\treturn self::get(self::trade_index(), array('instrument' => $pair, 'count' => $number));\n\t\t}", "public function getTicketPrice() {\n return $this->get(self::TICKETPRICE);\n }", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "public function getPrices()\n {\n }", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "public static function calc_pip_price($pair, $size, $side=1) {\n\t\t\treturn (self::valid($price = self::price(self::nav_instrument_name($pair, 1)))) ?\n (self::instrument_pip($pair)/($side ? $price->bid : $price->ask))*$size : $price;\n\t\t}", "public function getProductPrice()\n {\n }", "public function getPrice($coin,$time) {\n $this ->initStorage();\n $start = date('Y-m-d H:',$time) . '00:00';\n $end = date('Y-m-d H:',$time) . '59:59';\n $query = \"SELECT price FROM prices WHERE symbol='\" . $coin . \"' AND ts BETWEEN '\" . $start . \"' AND '\" . $end . \"'\";\n \n $result = $this -> _db -> query($query);\n $row = $result -> fetchArray(SQLITE3_ASSOC);\n \n if(empty($row)) {\n $compare = new CryptoCompare;\n $price = $compare ->getHistoricalPrice($coin, $time);\n if($price === false) {\n $price = 0;\n }\n $result = $this -> _db -> exec('INSERT INTO prices (symbol,price,ts) VALUES (' . \"'\" . $coin . \"',\" . $price . \",'\" . date('Y-m-d H:i:s',$time) . \"')\");\n return $price;\n } else {\n \n return $row['price'];\n }\n \n \n }", "function get_price($of, $to)\n {\n $price = $this->call_api('/v1/public/' . $of . $to . '/marketsummary');\n return $price->lastTradedPrice;\n }", "public function getProductPrice(){\n return $this->product_price;\n }", "public function getPrice(){ return $this->price_rur; }", "public function getPrice()\n {\n return parent::getPrice();\n }", "function get_price( $force_refresh=false ){\r\n\t\tif( $force_refresh || $this->price == 0 ){\r\n\t\t\t//get the ticket, clculate price on spaces\r\n\t\t\t$this->price = $this->get_ticket()->get_price() * $this->spaces;\r\n\t\t}\r\n\t\treturn apply_filters('em_booking_get_prices',$this->price,$this);\r\n\t}", "public function getGoodsPrice()\n {\n return $this->goods_price;\n }", "public function getProductPrice() {\n\t\t\t$data = request()->all();\n\t\t\t$dataArr = explode('-', $data['idSize']);\n\t\t\t$proAttr = ProductsAttribute::where(['product_id'=>$dataArr[0], 'size'=>$dataArr[1]])->first();\n\t\t\t$productData = [\n\t\t\t\t'sku' \t=> $proAttr->sku, \n\t\t\t\t'price' => $proAttr->price,\n\t\t\t\t'stock' => $proAttr->stock\n\t\t\t]; \n\t\t\treturn $productData;\n\t\t}", "public function get_price() {\n\n\t\t$price = null;\n\t\tif ( $this->is_on_sale() ) {\n\t\t\tif ( strstr($this->sale_price,'%') ) {\n\t\t\t\t$price = round($this->regular_price * ( (100 - str_replace('%','',$this->sale_price) ) / 100 ), 4);\n\t\t\t} else if ( $this->sale_price ) {\n\t\t\t\t$price = $this->sale_price;\n\t\t\t}\n\t\t} else {\n\t\t\t$price = apply_filters('jigoshop_product_get_regular_price', $this->regular_price, $this->variation_id);\n\t\t}\n\t\treturn apply_filters( 'jigoshop_product_get_price', $price, $this->variation_id );\n\n\t}", "public function getPrice(){\n }", "public function getPrice(){\n }", "function sale_price() {\n\t\treturn $this->_apptivo_sale_price;\n\t}", "private function currencyPairOfProductId($productId)\n {\n foreach($this->productIds as $pair=>$pid) {\n if ($productId === $pid)\n return $pair;\n }\n throw new \\Exception(\"Product id not found: $productId\");\n }", "function getCapPrice($capID)\n {\n $caps = $this->data->getCapByID($capID);\n while ($cap = $caps->fetch_assoc())\n {\n $price = $cap['Price'];\n }\n return $price;\n }", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "protected function _getVoucherPrice()\n {\n $voucherId = $this->payment['VoucherId'];\n $voucherObj = Voucher::find($voucherId);\n $orderId = $voucherObj['order_id'];\n $itemObj = Item::getVoucher($orderId,$voucherId);\n return $itemObj['price'];\n }", "public function getDepositPrice()\n {\n $this->checkIfKeyExistsAndIsInteger('price');\n\n return $this->data['price'];\n }", "public function getSonyPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.skuBestPrice')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.skuListPrice')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getOptionPrice()\n {\n return $this->optionPrice;\n }" ]
[ "0.8449567", "0.7935346", "0.7338197", "0.6902439", "0.6815187", "0.6724694", "0.6718239", "0.6718239", "0.6718239", "0.6718239", "0.6708396", "0.66819745", "0.66590893", "0.66117144", "0.6608096", "0.6608096", "0.6575397", "0.65591764", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6557551", "0.6543672", "0.651759", "0.6492323", "0.6492323", "0.64795995", "0.6469907", "0.64574957", "0.6424451", "0.64196634", "0.6374862", "0.6359178", "0.63496965", "0.6340243", "0.63138276", "0.6307103", "0.62976605", "0.629324", "0.6271305", "0.6271305", "0.6255422", "0.62513024", "0.62465906", "0.62448215", "0.62367684", "0.62193406", "0.6208614", "0.6181748", "0.6152525", "0.6151968", "0.6151968", "0.6141252", "0.61382276", "0.61352473", "0.6118106", "0.6115195", "0.61132205", "0.61096436", "0.60883003", "0.6068819", "0.606481", "0.6061496", "0.605865", "0.60541356", "0.6046066", "0.6043877", "0.60393775", "0.6033307", "0.6027458", "0.6005664", "0.6005302", "0.60028374", "0.599051", "0.59880066", "0.5965503", "0.5960538", "0.59600526", "0.59600526", "0.59492075", "0.59455156", "0.5937848", "0.5926884", "0.59064764", "0.5902611", "0.5888975", "0.5886653" ]
0.7234025
3
Gets price for multiple pairs
function getTicker ($api, $exchange, $folioArray) { $pairSymbols = array_column ($folioArray, 'pairSymbol'); if ($exchange=='binance') { // Binance gives all pairs, and this code gets the desired pairs from the result $ticker = $api->prices(); for($i=0; $i<count($pairSymbols)-1; $i++) { $price[$i]=$ticker[$pairSymbols[$i]]; } $ticker = $price; } elseif ($exchange=='kraken') { // Kraken uses a comma separated string for the symbols array_pop ($pairSymbols); $pairsString = implode(", ",$pairSymbols); $ticker = $api->QueryPublic('Ticker', array('pair'=>$pairsString)); $ticker = $ticker['result']; $i=0; foreach ($ticker as $key => $value) { $price[$i] = $value['c'][0]; settype ($price[$i], 'float'); $i++; } $ticker = $price; } return $ticker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function price($pair) {\n\t\t\treturn (self::valid($prices = self::prices(array($pair)))) ? $prices->prices[0] : $prices;\n\t\t}", "abstract function getPriceFromAPI($pair);", "public function getPrices()\n {\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 getItemsPrice()\n {\n return [10,20,54];\n }", "public function getAllList_Price()\n {\n try\n {\n // Создаем новый запрс\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query->select('a.*');\n $query->from('`#__gm_ceiling_components_option` AS a');\n $query->select('CONCAT( component.title , \\' \\', a.title ) AS full_name');\n $query->select('component.id AS component_id');\n $query->select('component.title AS component_title');\n $query->select('component.unit AS component_unit');\n $query->join('RIGHT', '`#__gm_ceiling_components` AS component ON a.component_id = component.id');\n\n $db->setQuery($query);\n $return = $db->loadObjectList();\n return $return;\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 getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "function GetPrice($symbol)\n{\n\t//google finance can only handle up to 100 quotes at a time so split up query then merge results\n\tif(count($symbol) > 100)\n\t{\n\t\t$retArr = array();\n\t\tfor($j=0; $j< count($symbol); $j +=100)\n\t\t{\n\t\t\t$arr = LookUpWithFormattedString(FormatString(array_slice($symbol, $j, 100)));\n\t\t\t$retArr = array_merge($retArr, $arr);\n\t\t}\n\t\treturn $retArr;\n\t}\n\telse\n\t\treturn LookUpWithFormattedString(FormatString($symbol));\n}", "abstract public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice()\n {\n $db = new db_connector();\n $conn = $db->getConnection();\n\n $stmt = \"SELECT `Order List`.orderID, `Order List`.PQuantity, `Product`.PPrice, `Product`.PID\n FROM `Order List`\n LEFT JOIN `Product`\n ON `Order List`.productID = `Product`.PID\";\n\n $result5 = $conn->query($stmt);\n\n if($result5)\n {\n $price_array = array();\n\n while($price = $result5->fetch_assoc())\n {\n array_push($price_array, $price);\n }\n $total = 0;\n $curr = 0;\n for($x = 0; $x < count($price_array); $x ++)\n {\n // echo \"price array \" . $price_array[$x]['orderID'] . \"<br>\";\n // echo \"session order id \" . $_SESSION['orderID'] . \"<br>\";\n\n if($price_array[$x]['orderID'] == $_SESSION['orderID'])\n {\n\n // echo $price_array[$x]['orderID'];\n // echo $price_array[$x]['PQuantity'];\n\n $curr = ((float) $price_array[$x]['PPrice'] * (float) $price_array[$x]['PQuantity']);\n $total = $total + $curr;\n $curr = 0;\n }\n }\n echo \"$\" . $total;\n return $total;\n }\n }", "function getPrice ($api, $exchange, $pairSymbol) {\n if ($exchange=='binance') {\n $price = $api->price($pairSymbol);\n } elseif ($exchange=='kraken') {\n $price = $api->QueryPublic('Ticker', array('pair'=>$pairSymbol));\n \t$price = $price['result'][$pairSymbol]['c'][0];\n }\n return $price;\n}", "protected function calculatePrices()\n {\n }", "public function getPrice()\n {\n $price = Cache::tags([$this->exchange])->get($this->pair, function () {\n return $this->getPriceFromAPI($this->pair);\n });\n return $price;\n }", "public function testProductGetPrices()\n {\n $product = $this->find('product', 1);\n $prices = $product->getPrices();\n $price = $prices[0];\n \n $currencies = $this->findAll('currency');\n $dollarCurrency = $currencies[0];\n \n $money = Money::create(10, $dollarCurrency); \n \n $this->assertEquals(\n $money,\n $price\n );\n }", "public function getListPrice()\n\t{\n\t\treturn $this->getKeyValue('list_price'); \n\n\t}", "public function listProductprices(){\n try{\n $sql = \"Select * from productforsale pr inner join product p on pr.id_product = p.id_product inner join categoryp c on p.id_categoryp = c.id_categoryp inner join medida m on p.product_unid_type = m.medida_id\";\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), 'Inventory|listProductprices');\n $result = 2;\n }\n\n return $result;\n }", "function get_price($find){\n\t$books=array(\n\t\t\"paris-seoul\"=>599,\n\t\t\"paris-madrid\"=>400,\n\t\t\"paris-marseille\"=>387\n\t)\n\t;\n\n\tforeach ($books as $book => $price) {\n\t\tif($book==$find){\n\t\t\treturn $price;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "public function get_price() {\n $query = $this->db->query(\"SELECT * FROM price \");\n\n if ($query) {\n return $query->result_array();\n }\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 }", "function price(){\n\n\t\t$total = 0; //initialize to 0 lest error\n\n\t\tglobal $con;\n\n\t\t$ip=getIP();\n\n\t\t$sel_price = \"select * from cart where ip_add='$ip'\"; //get price from what is in the cart for whoevers ip address\n\n\t\t$run_price = mysqli_query($con, $sel_price);\n\n\t\twhile ($p_price = mysqli_fetch_array($run_price)){\n\n\t\t\t$pro_id = $p_price['p_id'];\n\n\t\t\t$pro_price = \"select * from products where product_id='$pro_id'\";\n\n\t\t\t$run_pro_price = mysqli_query($con, $pro_price);\n\n\t\t\t//link to the products table to get prices\n\t\t\twhile($pp_price = mysqli_fetch_array($run_pro_price)){\n\n\t\t\t\t$product_price = array($pp_price['product_price']);\n\t\t\t\t//array to get all the prices in one\n\n\t\t\t\t$values = array_sum($product_price);\n\n\t\t\t\t$total +=$values; //sum\n\n\t\t\t}\n\t\t}\n\n\t\techo \"Ksh\" . $total;\n\n\t}", "public function getPairPriceHandle($response, $first_currency, $second_currency)\n {\n $response = json_decode($response, true);\n\n if (isset($response['error_code'])) {\n return null;\n }\n\n return (float) $response['ticker']['last'];\n }", "public function getProductNameAndPriceInPartnerOrdersByProductId() {\n\n $query = $this->db->prepare(\"SELECT o.order_id, p.product_name, p.product_price FROM orders o JOIN products p ON o.order_product_id = p.ext_product_id AND o.order_partner_id = p.vendor_id ORDER BY o.order_id\");\n\n try {\n\n $query->execute();\n\n $result = $query->fetchAll();\n return $result;\n\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }", "function calculatePrice( &$item ) {\r\n\t\r\n\tglobal $db, $site;\r\n\t\r\n\t$resultPrice = $basePrice = $item['price'];\r\n\t\r\n\t$pricing = $db->getAll( 'select * from '. ATTRPRICING_TABLE.\" where product_id='$item[id]' and site_key='$site'\" );\r\n\t\r\n\tforeach ( $pricing as $pidx=>$price ) {\r\n\t\t\r\n\t\t$match = true;\r\n\t\t\r\n\t\tif ( $item['attributes'] )\r\n\t\tforeach( $item['attributes'] as $attr_id=>$attr ) {\r\n\t\t\t\r\n\t\t\t$values = $db->getRow( 'select value1, value2 from '. ATTRPRICEVALUES_TABLE.\" where price_id='$price[id]' and attr_id='$attr_id'\" );\r\n\t\t\t\r\n\t\t\tif ( !$values )\r\n\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t$value1 = $values['value1'];\r\n\t\t\t$value2 = $values['value2'];\r\n\t\t\t$value = $attr['value'];\r\n\t\t\r\n\t\t\tswitch( $attr['type'] ) {\r\n\t\t\t\tcase 'number':\r\n/*\t\t\t\t\tif ( strlen( $value1 ) )\r\n\t\t\t\t\t\t$match &= $value >= $value1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ( strlen( $value2 ) )\r\n\t\t\t\t\t\t$match &= $value <= $value2;\r\n\t\t\t\t\tbreak;\r\n*/\t\t\t\t\t\r\n\t\t\t\tcase 'single-text':\r\n\t\t\t\tcase 'multi-text':\r\n\t\t\t\tcase 'date':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$match &= $value == $value1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( $match ) {\r\n\t\t\t$resultPrice = getPriceValue( $price, $basePrice );\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $resultPrice;\r\n\t\r\n}", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "public function getPriceList()\n {\n try {\n $apiClient = $this->getApiClientPricing();\n $priceList = $apiClient->get(\n array(\"parcel\" => array('dimensions' => $this->getParcelDimensions()))\n );\n\n return json_decode($priceList);\n } catch (\\Exception $e) {\n Logger::debug($e->getMessage());\n return array();\n }\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 getPrices($ean) {\n \t// 1. check digits length of EAN number and fill it with zero if necessary\n $ean = $this->checkDigitLen($ean);\n\n // 2. request search page by url\n // Create DOM from URL\n $html = file_get_html($this->host . '/search?hl=nl&output=search&tbm=shop&q=' . $ean);\n\n // 3. find the first product link on this page\n $prodLink = $this->findProdLink($html);\n\n // 4. add /online?hl=nl string to the end of the product link and compose url for product link\n $prodLink .= '/online?hl=nl';\n $prodLink = $this->host . $prodLink; // https://www.google.nl/shopping/product/12115883691353094589/online?hl=nl\n\n // 5. download the product link\n $downloadedProd = file_get_html($prodLink);\n\n // 6. Create an array with the prices\n return $this->createPricesArray($downloadedProd);\n\n }", "public function cal_sell_price_by_price_break(){\n\t\t$price_break = $this->price_break_from_to;\n\t\tif(!isset($price_break['sell_price_plus']))\n\t\t\t$price_break['sell_price_plus'] = 0;\n\t\t//Dò trong bảng company_price_break trước\n\t\tif(isset($price_break['company_price_break']) && is_array($price_break['company_price_break']) && count($price_break['company_price_break'])>0){\n\n\t\t\t$price_break['company_price_break'] = $this->aasort($price_break['company_price_break'],'range_from');\n\n\t\t\tforeach($price_break['company_price_break'] as $keys=>$value){\n\t\t\t\tif($this->arr_product_items['adj_qty']<=(float)$value['range_to'] && $this->arr_product_items['adj_qty']>=(float)$value['range_from']){\n\t\t\t\t\t//neu thoa dieu kien\n\t\t\t\t\tif(!isset($value['unit_price']))\n\t\t\t\t\t\t$value['unit_price'] = 0;\n\t\t\t\t\t$this->arr_product_items['sell_price'] = (float)$value['unit_price'] + (float)$price_break['sell_price_plus'];\n\t\t\t\t\t$this->price_break_from_to = $price_break; //luu lai bang price_break da sort\n\t\t\t\t\treturn 'company_price_break';\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\n\t\t//Nếu không có trong company_price_break thì tìm trong product_price_break\n\t\tif(isset($price_break['product_price_break']) && is_array($price_break['product_price_break']) && count($price_break['product_price_break'])>0){\n\t\t\t$price_break['product_price_break'] = $this->aasort($price_break['product_price_break'],'range_from');\n\t\t\tforeach($price_break['product_price_break'] as $keys=>$value){\n\t\t\t\tif($this->arr_product_items['adj_qty']<=(float)$value['range_to'] && $this->arr_product_items['adj_qty']>=(float)$value['range_from']){\n\t\t\t\t\t//neu thoa dieu kien\n\t\t\t\t\tif(!isset($value['unit_price']))\n\t\t\t\t\t\t$value['unit_price'] = 0;\n\t\t\t\t\t$this->arr_product_items['sell_price'] = (float)$value['unit_price'] + (float)$price_break['sell_price_plus'];\n\t\t\t\t\t$this->discount(); //và tính discount\n\t\t\t\t\t$this->price_break_from_to = $price_break; //luu lai bang price_break da sort\n\t\t\t\t\treturn 'product_price_break';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t//Ngược lại thì lấy sell_price trong price_break_from_to\n\t\tif(isset($price_break['sell_price'])){\n\t\t\t$this->arr_product_items['sell_price'] = (float)$price_break['sell_price'];\n\t\t\t$this->discount();//và tính discount\n\t\t\treturn 'sell_price';\n\t\t}\n\n\n\n\t}", "public function getMyParcelOrderPrices($order_id)\r\n {\r\n $order_query = $this->db->query(\"SELECT prices FROM `\" . DB_PREFIX . self::$table_name . \"` WHERE order_id = \" . (int)$order_id . \" LIMIT 1\");\r\n return $this->getValueFromQuery('prices', $order_query);\r\n }", "public function getMyParcelOrderPrices($order_id)\r\n {\r\n $order_query = $this->db->query(\"SELECT prices FROM `\" . DB_PREFIX . self::$table_name . \"` WHERE order_id = \" . (int)$order_id . \" LIMIT 1\");\r\n return $this->getValueFromQuery('prices', $order_query);\r\n }", "public function get_prices($ids)\n\t{\n\t\t$data = '';\n\n\t\t// create comma sepearted lists\n\t\t$items = '';\n\t\tforeach ($ids as $id) {\n\t\t\tif ($items != '') {\n\t\t\t\t$items .= ',';\n\t\t\t}\n\t\t\t$items .= $id;\n\t\t}\n\n\t\t// get multiple product info based on list of ids\n\t\tif($result = $this->Database->query(\"SELECT id, price FROM $this->db_table WHERE id IN ($items) ORDER BY name\" ))\n\t\t{\n\t\t\tif($result->num_rows > 0)\n\t\t\t{\n\t\t\t\twhile($row = $result->fetch_array())\n\t\t\t\t{\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t\t'price' => $row['price']\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\n\t}", "public function computePriceProvider(){\n\n /*Price once a child is < 4 years full day 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01' , false, 0];\n /*Price once a child is < 4 years full day \"reduce\" 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01', true, 0];\n /*Price once a child is < 4 years half day 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', false, 0];\n /*Price once a child is < 4 years half day \"reduce\" 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', true, 0];\n\n\n /*Price once a child is 4 - 12 years full day 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', false, 8];\n /*Price once a child is 4 - 12 years full day \"reduce\" 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', true, 8];\n /*Price once a child is 4 - 12 years half day 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', false, 4];\n /*Price once a child is 4 - 12 years half day \"reduce\" 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', true, 4];\n\n\n /*Price normal full day 16€*/\n yield [Booking::TYPE_DAY, '1980-01-01', false, 16];\n /*Price normal full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1980-01-01', true, 10];\n /*Price normal half day 8€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', false, 8];\n /*Price normal half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', true, 5];\n\n\n /*Price senior >60 years full day 12€*/\n yield [Booking::TYPE_DAY, '1955-01-01', false, 12];\n /*Price senior >60 years full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1955-01-01', true, 10];\n /*Price senior >60 years half day 6€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', false, 6];\n /*Price senior >60 years half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', true, 5];\n\n }", "function get_vehicles_by_price() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY price DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $vehicles;\n }", "public function resolvePrice();", "function getListFee($price) {\n $fee = round($price * 0.1);\n return $fee;\n }", "public function getPairPriceHandle($response, $first_currency, $second_currency)\n {\n $response = json_decode($response, true);\n\n if (!$response || !is_array($response)) {\n return null;\n }\n\n return (float) $response['ticker']['last'];\n }", "public function getPrice() {\n }", "public function getTickerPrice($symbol = NULL);", "public function price()\n {\n return $this->morphToMany('Sanatorium\\Pricing\\Models\\Money', 'priceable', 'priced');\n }", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getProductPriceDetails($params){\n\t\ttry {\n\t\t\t$query = \"SELECT * FROM store_products_price spp WHERE spp.statusid=1 AND spp.product_id = \".$params['id'];\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}", "function getPricesAll($game_id, $round_number,$company_id){\r\n\t\t\t$prices=new Model_DbTable_Decisions_Mk_Prices();\r\n\t\t\t$result=$prices->getDecision($game_id, $company_id, $round_number);\r\n\t\t\treturn $result;\r\n\t\t}", "public function pricesProvider()\n {\n return [\n 'sufficient data' => [\n 'period' => 14,\n 'precision' => 2,\n 'prices' => [\n 4834.91,// current\n 4724.89,// previous\n 4555.14,\n 4587.48,\n 4386.69,\n 4310.01,\n 4337.44,\n 4280.68,\n 4316.01,\n 4114.01,\n 4040.0,\n 4016.0,\n 4086.29,\n 4139.98,\n 4108.37,\n 4285.08,\n ],\n 'expected RSI' => [\n 81.19,// current\n 67.86,// previous\n 62.72,\n ],\n ],\n 'insufficient data' => [\n 'period' => 14,\n 'precision' => 2,\n 'prices' => [\n 4834.91,// current\n 4724.89,// previous\n ],\n 'expected RSI' => [],\n ],\n ];\n }", "public function getPrices(Collection $currencies)\n {\n $currencies = $currencies\n ->pluck('id', 'currency_code')\n ->map(function($id){\n return [\n 'id' => $id,\n 'currency_id' => null\n ];\n })->toArray();\n\n // add currencyIds\n foreach($this->currencyIds() as $currencyCode => $currencyID){\n if($currencies[$currencyCode]) {\n $currencies[$currencyCode]['currency_id'] = $currencyID;\n }\n }\n\n\n // exchangeRate\n $exchangeRate = $this->getExchangeRate();\n\n\n // make api call\n $version = '';\n $url = $this->apiBase . $version . '/public/ticker/ALL';\n $res = null;\n\n try{\n $res = Http::request(Http::GET, $url);\n }\n catch (\\Exception $e){\n // Error handling\n echo($e->getMessage());\n exit();\n }\n\n\n // data from API\n $data = [];\n $dataOriginal = json_decode($res->content, true);\n $data = $dataOriginal['data'];\n\n\n // Finalize data. [id, currency_id, price]\n $currencies = array_map(function($currency) use($data, $exchangeRate){\n $dataAvailable = true;\n if(is_array($currency['currency_id'])){\n foreach($currency['currency_id'] as $i){\n if(!isset($data[$i])){\n $dataAvailable = false;\n }\n }\n } else {\n $dataAvailable = isset($data[$currency['currency_id']]);\n }\n\n\n if($dataAvailable){\n if(is_array($currency['currency_id'])){ // 2 step\n $level1 = doubleval($data[$currency['currency_id'][0]]['closing_price']) / $exchangeRate;\n $level2 = doubleval($data[$currency['currency_id'][1]]['closing_price']) / $exchangeRate;\n $currency['price'] = $level1 * $level2;\n }\n else { // 1 step: string\n $currency['price'] = doubleval($data[$currency['currency_id']]['closing_price']) / $exchangeRate;\n }\n\n }\n else {\n $currency['price'] = null;\n }\n\n return $currency;\n\n }, $currencies);\n\n\n return $currencies;\n\n\n }", "public function getProductPrice()\n {\n }", "protected function parseResult()\n\t{\n\t\t$result = [];\n\t\tif(!empty($this->result)) {\n\t\t\tforeach($this->crypto as $pair => $coin) {\n\t\t\t\tif(!empty($this->result[$pair])) {\n\t\t\t\t\t$result[$coin] = $this->result[$pair]['last'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->price = $result;\n\t\t\treturn;\n\t\t}\n\n\t\tthrow new Exception(\"Price error \" . __CLASS__);\n\t}", "public function getPrice()\n {\n return $this->get(self::_PRICE);\n }", "public function getEmoneyPricelist($operator_id)\n {\n $user = Auth::user();\n $quickbuy = false;\n if ($user->is_store) {\n $quickbuy = true;\n }\n // switch operators\n $operator = 'GO PAY';\n switch ($operator_id) {\n case 22:\n $operator = 'MANDIRI E-TOLL';\n break;\n case 23:\n $operator = 'OVO';\n break;\n case 24:\n $operator = 'DANA';\n break;\n case 25:\n $operator = 'LinkAja';\n break;\n case 26:\n $operator = 'SHOPEE PAY';\n break;\n case 27:\n $operator = 'BRI BRIZZI';\n break;\n case 28:\n $operator = 'TAPCASH BNI';\n break;\n }\n\n // empty array to be filled with selected operator pricelist data\n $priceArr = [];\n // get all Prepaid Pricelist data from Cache if available or fresh fetch from API\n $prepaidPricelist = $this->getAllPrepaidPricelist();\n foreach ($prepaidPricelist['data'] as $row) {\n if ($row['category'] == 'E-Money') {\n $addedPrice = $row['price'] + 1000;\n $last3DigitsCheck = substr($addedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $addedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $addedPrice + $check;\n }\n if ($check == 500) {\n $price = $addedPrice;\n }\n if ($check < 0) {\n $price = $addedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n }\n $pricelist = collect($priceArr)->sortBy('price')->toArray();\n $pricelistCall = null;\n\n return view('member.app.shopping.prepaid_pricelist')\n ->with('title', 'Isi Emoney')\n ->with(compact('pricelist'))\n ->with(compact('pricelistCall'))\n ->with(compact('quickbuy'))\n ->with('type', $operator_id);\n }", "public function getPriceNet();", "function getPairValue($pair,$type='ask') { \r\n\t$curl = new Curl;\r\n\t$ticker = (array)$curl->get(\"https://api.bitfinex.com/v1/pubticker/$pair\");\r\n\treturn $ticker[$type];\r\n}", "function allOptionCombos($input) {\n $result = array();\n $prices = array();\n $final = array();\n\n while (list($key, $values) = each($input)) {\n\n if (empty($values)) {\n continue;\n }\n if (empty($result)) {\n foreach($values as $value) {\n $result[] = array($key => $value);\n }\n }\n else {\n\n $append = array();\n\n foreach($result as &$product) {\n\n $product[$key] = array_shift($values);\n $copy = $product;\n foreach($values as $item) {\n $copy[$key] = $item;\n $append[] = $copy;\n }\n array_unshift($values, $product[$key]);\n }\n $result = array_merge($result, $append);\n }\n }\n\n foreach($result as $key => $res) {\n\n \t\t foreach($res as $opt) {\n\t \tif(strpos($opt, ';') !== false) {\n\t \t\t$price = explode(\";\", $opt);\n\t \t\t$prices[$key][0] = $prices[$key][0]+$price[1];\n\t \t}\n\t \telse {\n\t \t\t$prices[$key][0] = $prices[$key][0]+0;\n\t \t}\n\t }\n\n }\n\n $final['results'] = $result;\n $final['prices'] = $prices;\n\n return $final;\n}", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "public function getOptions_values_price() {\n\t\treturn $this->options_values_price;\n\t}", "public function getPairsTicker($pairs) {\n\t\treturn $this->makePublicMethod( self::PUBLIC_METHOD_TICKER, $pairs);\n\t}", "public function getProductPrice() {\n\t\t\t$data = request()->all();\n\t\t\t$dataArr = explode('-', $data['idSize']);\n\t\t\t$proAttr = ProductsAttribute::where(['product_id'=>$dataArr[0], 'size'=>$dataArr[1]])->first();\n\t\t\t$productData = [\n\t\t\t\t'sku' \t=> $proAttr->sku, \n\t\t\t\t'price' => $proAttr->price,\n\t\t\t\t'stock' => $proAttr->stock\n\t\t\t]; \n\t\t\treturn $productData;\n\t\t}", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "function fetch_prices()\n {\n $data = $this->db->query('SELECT * FROM `users_prices` WHERE users_price_order != 999 ORDER BY users_price_order ASC');\n if (!isset($data[0])) {\n return false;\n }\n return $data;\n }", "function getPrice()\n {\n return $this->price;\n }", "public function getPairsFee($pairs) {\n\t\treturn $this->makePublicMethod( self::PUBLIC_METHOD_FEE, $pairs);\n\t}", "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 }", "private function two() {\n $position1 = $this->inputarray[$this->position+1];\n $position2 = $this->inputarray[$this->position+2];\n $content1 = $this->inputarray[$position1];\n $content2 = $this->inputarray[$position2];\n $product = $content1 * $content2;\n return $product;\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPriceHistory() { return array($this->getPrice()); }", "public function getPriceInformation() {\n $fields = array('priceInformation' => array(\n 'priceHeader' => 'header',\n 'price',\n 'acquisitionTerms',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "public function getPriceFromDatabase()\n {\n }", "public function getPair() : array;", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "public function pairs() { return $this->_m_pairs; }", "function get_price( $force_refresh=false ){\r\n\t\tif( $force_refresh || $this->price == 0 ){\r\n\t\t\t//get the ticket, clculate price on spaces\r\n\t\t\t$this->price = $this->get_ticket()->get_price() * $this->spaces;\r\n\t\t}\r\n\t\treturn apply_filters('em_booking_get_prices',$this->price,$this);\r\n\t}", "public function getProductRegularPrices($pid)\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $productListObj = $objectManager->create('Stalwart\\Sweda\\Block\\ProductPricesRegular');\n return $productListObj->setBlockProductId($pid)->getProductRegularPrices();\n \n }", "public function modelReadSearchProductPrice($fromPrice,$toPrice,$recordPerPage){\n\t\t\t//lay bien p truyen tu url\n\t\t\t$p = isset($_GET[\"p\"]) && is_numeric($_GET[\"p\"]) && $_GET[\"p\"] > 0 ? ($_GET[\"p\"]-1) : 0;\t\t\t\n\t\t\t//lay tu ban ghi nao\n\t\t\t$from = $p * $recordPerPage;\n\t\t\t//---\n\t\t\t//lay bien ket noi csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van\n\t\t\t$query = $conn->query(\"select * from products where price >= $fromPrice and price <= $toPrice order by id desc limit $from,$recordPerPage\");\n\t\t\t//lay toan bo ket qua tra ve\n\t\t\t$result = $query->fetchAll();\t\t\t\n\t\t\t//---\n\t\t\treturn $result;\n\t\t}", "public function getPriceInfo()\n {\n return $this->price_info;\n }", "public static function getPrice(&$products_table = NULL, $uid = NULL) {\n Yii::import('application.controllers.ProfileController');\n\n if (!$products_table) { //if it's cart products table\n $table = 'store_cart';\n } else {\n $table = 'temp_order_product_' . (Yii::app()->user->id ? Yii::app()->user->id : 'exchange');\n $query = \"DROP TABLE IF EXISTS {$table};\";\n $query .= \"CREATE TEMPORARY TABLE {$table} (product_id int(11) unsigned, quantity smallint(5) unsigned);\";\n foreach ($products_table as $item) {\n\n if ($item instanceof OrderProduct || $item instanceof stdClass || $item instanceof Cart) {\n $product = Product::model()->findByAttributes(array('id' => (string) $item->product_id));\n } else {\n $product = Product::model()->findByAttributes(array('code' => (string) $item->code));\n }\n\n if ($product) {\n $query .= \"INSERT INTO {$table} VALUES ({$product->id}, {$item->quantity});\";\n } else {\n throw new Exception('Product not found. Product code: ' . $item->code);\n }\n }\n Yii::app()->db->createCommand($query)->execute();\n }\n $query = Yii::app()->db->createCommand()\n ->select('SUM(c.quantity*round(prices.price*(1-greatest(ifnull(disc.percent,0),ifnull(disc1.percent,0),ifnull(disc2.percent,0))/100))) as c_summ, prices.price_id')\n ->from($table . ' c')\n ->join('store_product product', 'c.product_id=product.id')\n ->join('store_product_price prices', 'product.id=prices.product_id')\n ->join('store_price price', 'price.id=prices.price_id')\n ->leftJoin('store_discount disc', \"disc.product_id=0 and disc.actual=1 and (disc.begin_date='0000-00-00' or disc.begin_date<=CURDATE()) and (disc.end_date='0000-00-00' or disc.end_date>=CURDATE())\")\n ->leftJoin('store_product_category cat', 'cat.product_id=product.id')\n ->leftJoin('store_discount_category discat', 'discat.category_id=cat.category_id')\n ->leftJoin('store_discount disc1', \"disc1.product_id=1 and disc1.id=discat.discount_id and disc1.actual=1 and (disc1.begin_date='0000-00-00' or disc1.begin_date<=CURDATE()) and (disc1.end_date='0000-00-00' or disc1.end_date>=CURDATE())\")\n ->leftJoin('store_discount_product dispro', 'dispro.product_id=product.id')\n ->leftJoin('store_discount disc2', \"disc2.product_id=2 and disc2.id=dispro.discount_id and disc2.actual=1 and (disc2.begin_date='0000-00-00' or disc2.begin_date<=CURDATE()) and (disc2.end_date='0000-00-00' or disc2.end_date>=CURDATE())\")\n ->order('price.summ DESC')\n ->group('prices.price_id, price.summ')\n ->having('c_summ>price.summ');\n\n if (!$products_table){\n $sid = ProfileController::getSession();\n $query->where(\"(session_id=:sid AND :sid<>'') OR (user_id=:uid AND :sid<>'')\", array(\n ':sid' => $sid,\n ':uid' => Yii::app()->user->isGuest ? '' : Yii::app()->user->id,\n ));\n }\n\n// $text = $query->getText();\n $row = $query->queryRow();\n if ($row)\n $price = self::model()->findByPk($row['price_id']);\n else\n $price = self::model()->find(array('order' => 'summ'));\n\n if ($products_table)\n Yii::app()->db->createCommand(\"DROP TABLE IF EXISTS {$table};\")->execute();\n\n if ($uid)\n $profile = CustomerProfile::model()->with('price')->findByAttributes(array('user_id' => $uid));\n else\n $profile = ProfileController::getProfile();\n\n if ($profile && $profile->price_id && $profile->price->summ > $price->summ)\n return $profile->price;\n else\n return $price;\n }", "public function displayBothPrices()\n {\n return $this->itemPriceRenderer->displayBothPrices();\n }", "public function getSalePrices()\n {\n return $this->postRequest('GetSalePrices');\n }", "public function getPrice()\n {\n $price = [ $this->price, $this->price_tax_inc ]; // These prices are in Company Currency\n\n $priceObject = Price::create( $price, Context::getContext()->company->currency );\n\n return $priceObject;\n }", "function getPrice($link)\r\n {\r\n $argosTitle = $this->getTitleArgos($link);\r\n\r\n $products = $this->getDeals(urlencode($argosTitle));\r\n\r\n if(!empty($products)) {\r\n\r\n // Update product's percentage based on greatest\r\n foreach ($products as &$product) {\r\n similar_text($product['title'], $argosTitle, $percent);\r\n $product['percent'] = round($percent);\r\n }\r\n\r\n // Sort array based on percentage\r\n usort($products, array($this, \"sortByOrder\"));\r\n\r\n $walmart_information = array(\r\n 'price' => $products[0]['price'],\r\n 'percent' => $products[0]['percent'],\r\n );\r\n\r\n return $walmart_information;\r\n }\r\n }", "public function getPrice() {\n $sum = parent::getPrice();\n foreach ($this->extraItems as $extraItem) {\n $sum += $extraItem->getPrice();\n }\n return $sum;\n }", "public function bestPriceProvider()\n {\n return [\n [0, 100.0, 50.0, 50.0],\n [0, 100.0, 150.0, 100.0],\n [1, 100.0, 50.0, 50.0],\n [1, 100.0, 150.0, 100.0],\n [2, 100.0, 50.0, 100.0],\n [2, 100.0, 150.0, 150.0],\n [3, 100.0, 50.0, 100.0],\n [3, 100.0, 150.0, 150.0],\n [4, 100.0, 50.0, 50.0],\n [4, 100.0, 150.0, 100.0],\n [5, 100.0, 50.0, 50.0],\n [5, 100.0, 150.0, 100.0],\n ];\n }", "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 getPrice(): float;", "public function getPrice(): float;", "public function getPairs()\n {\n $pairsTemp = Cache::tags([$this->exchange])->get(\"pairs\", function () {\n return $this->getPairsFromAPI();\n });\n $pairs = [];\n foreach($pairsTemp as $title => $pairsArray) {\n $pairs[] = [\n 'title' => $title,\n 'pairs' => $pairsArray\n ];\n }\n return $pairs;\n }", "public function getPrice()\r\n {\r\n return $this->price;\r\n }", "public function getPrice() {\n\t\treturn($this->price);\n\t}", "public function Prices()\n\t{\n\t\treturn $this->hasMany('App\\Models\\Price');\n\t}", "public function prices()\n {\n return $this->hasMany(Price::class);\n }", "public static function calc_pip_price($pair, $size, $side=1) {\n\t\t\treturn (self::valid($price = self::price(self::nav_instrument_name($pair, 1)))) ?\n (self::instrument_pip($pair)/($side ? $price->bid : $price->ask))*$size : $price;\n\t\t}", "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 getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }" ]
[ "0.74964476", "0.71815735", "0.64932656", "0.63813025", "0.63105106", "0.6225467", "0.6199801", "0.6199788", "0.6105884", "0.6054909", "0.6054909", "0.6054909", "0.6054909", "0.6034928", "0.60301596", "0.6029374", "0.602507", "0.5968318", "0.5967422", "0.59259915", "0.58754426", "0.58694357", "0.58600354", "0.58305174", "0.5820859", "0.5801009", "0.57916635", "0.578018", "0.5776848", "0.57668406", "0.57342416", "0.5718081", "0.57041377", "0.57041377", "0.5702411", "0.5686727", "0.5674107", "0.56736505", "0.5669746", "0.5668985", "0.56387323", "0.56369", "0.56183696", "0.5610938", "0.55963534", "0.5589434", "0.5588258", "0.5565841", "0.5562266", "0.55553854", "0.5552067", "0.5543826", "0.5543758", "0.5539962", "0.5527979", "0.55216473", "0.55216473", "0.5520453", "0.5516294", "0.5512912", "0.5504577", "0.5504577", "0.55006456", "0.54999846", "0.5498511", "0.54883116", "0.548783", "0.5485136", "0.5480716", "0.5480716", "0.54745036", "0.54727876", "0.54665667", "0.5465208", "0.5461457", "0.5459789", "0.5439557", "0.54328483", "0.5423684", "0.5420116", "0.541497", "0.5414915", "0.54055655", "0.54051024", "0.5401089", "0.5400685", "0.53975064", "0.5394907", "0.5392417", "0.5392417", "0.5390262", "0.53865427", "0.5383608", "0.5382392", "0.5379916", "0.5378066", "0.5366981", "0.5366332", "0.5366332", "0.5366332", "0.5366332" ]
0.0
-1
/gets OHLC and runs it through the rekey function to get both exchanges giving compatible results
function getOHLC ($api, $exchange, $pairSymbol, $interval, $since) { if ($exchange=='binance') { $interval = $interval.'m'; $ohlc = $api->candlesticks($pairSymbol, $interval, $since, null, null, 1000); $ohlc = ohlcRekey ($ohlc); } elseif ($exchange=='kraken') { $ohlc = $api->QueryPublic('OHLC', array('pair' => $pairSymbol,'interval' => $interval, 'since' => $since)); $ohlc = ohlcRekey($ohlc, $pairSymbol); } return $ohlc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(StockPrice $stockPrice)\n {\n\n\n\n //\n $belowYForOneMinute = false;\n $this->stockPrice = $stockPrice;\n $this->current_general = StockHelper::getCurrentGeneralPrice($this->stockPrice->tlong);\n if($this->current_general){\n $this->previous_general =StockHelper::getPreviousGeneralPrice($this->current_general['tlong']);\n }\n\n $this->unclosed_orders = StockOrder::where(\"code\", $this->stockPrice->code)\n ->where(\"closed\", \"=\", false)\n ->where(\"order_type\", \"=\", StockOrder::DL0)\n ->where(\"deal_type\", \"=\", StockOrder::SHORT_SELL)\n ->where(\"date\", $this->stockPrice->date)\n ->orderBy(\"tlong\", \"asc\")\n ->get();\n\n $this->previous_order = StockOrder::where(\"code\", $this->stockPrice->code)\n ->where(\"closed\", \"=\", true)\n ->where(\"order_type\", \"=\", StockOrder::DL0)\n ->where(\"deal_type\", \"=\", StockOrder::SHORT_SELL)\n ->where(\"date\", $this->stockPrice->date)\n ->orderByDesc(\"tlong2\")\n ->first();\n\n $range = range($this->stockPrice->tlong - 600, $this->stockPrice->tlong);\n\n if($this->stockPrice->best_bid_price <= $this->stockPrice->yesterday_final)\n $belowYForOneMinute = true;\n\n foreach ($range as $tmp){\n $price = Redis::hgetall(\"Stock:prices#{$this->stockPrice->code}#{$tmp}\");\n\n if($price){\n\n if($price['best_bid_price'] > $price['yesterday_final']){\n $belowYForOneMinute = false;\n }\n\n }\n }\n\n\n\n $this->lowest_updated = Redis::get(\"Stock:lowest_updated#{$this->stockPrice->code}#{$this->stockPrice->date}\") == 1;\n $this->highest_updated = Redis::get(\"Stock:highest_updated#{$this->stockPrice->code}#{$this->stockPrice->date}\") == 1;\n\n $this->previous_price = Redis::hgetall(\"Stock:previousPrice#{$this->stockPrice->code}#{$this->stockPrice->date}\");\n $this->general_start = StockHelper::getGeneralStart($this->stockPrice->date);\n $this->yesterday_final = StockHelper::getYesterdayFinal($this->stockPrice->date);\n\n //$this->lowest_updated = $this->previous_price && $this->previous_price['low'] - $this->stockPrice->low;\n //$this->highest_updated = $this->previous_price && $this->previous_price['high'] < $this->stockPrice->high;\n $this->stock_trend = $this->previous_5_mins_price ? $this->previous_5_mins_price['best_ask_price'] > $this->stockPrice->best_ask_price ? \"DOWN\" : \"UP\" : false;\n\n $this->high_range = $this->stockPrice->yesterday_final > 0 ? (($this->stockPrice->high - $this->stockPrice->yesterday_final)/$this->stockPrice->yesterday_final)*100 : 0;\n $this->low_range = $this->stockPrice->yesterday_final > 0 ? (($this->stockPrice->low - $this->stockPrice->yesterday_final)/$this->stockPrice->yesterday_final)*100 : 0;\n\n $this->high_was_great = $this->high_range > 2;\n $this->low_was_great = $this->low_range < -2;\n\n /**\n * Analyze stock price\n */\n $time_since_previous_order = 0;\n if($this->previous_order){\n $time_since_previous_order = ($this->stockPrice->tlong - $this->previous_order->tlong2) / 1000 / 60;\n }\n\n $date = new DateTime();\n $date->setDate($this->stockPrice->stock_time[\"year\"], $this->stockPrice->stock_time[\"mon\"], $this->stockPrice->stock_time[\"mday\"]);\n $date->setTime(9, 0, 0);\n $this->time_since_begin = ($this->stockPrice->tlong / 1000 - $date->getTimestamp()) / 60;\n\n\n if(1\n && ($this->stockPrice->stock_time['hours'] < 13 || ($this->stockPrice->stock_time['hours'] == 13 && $this->stockPrice->stock_time['minutes'] < 10))\n && $this->lowest_updated\n //&& $this->stockPrice->open > $this->stockPrice->yesterday_final\n /*&& count($this->unclosed_orders) < 2\n && $belowYForOneMinute\n && $this->time_since_begin > 1*/\n && !$this->previous_order\n #&& ($time_since_previous_order == 0 || $time_since_previous_order > 5 )\n ){\n $this->should_sell = true;\n\n }\n $this->should_sell_another = false;\n }", "function getTicker ($api, $exchange, $folioArray) {\n $pairSymbols = array_column ($folioArray, 'pairSymbol');\n\n if ($exchange=='binance') {\n // Binance gives all pairs, and this code gets the desired pairs from the result\n $ticker = $api->prices();\n for($i=0; $i<count($pairSymbols)-1; $i++) {\n $price[$i]=$ticker[$pairSymbols[$i]];\n }\n $ticker = $price;\n } elseif ($exchange=='kraken') {\n // Kraken uses a comma separated string for the symbols\n \tarray_pop ($pairSymbols);\n\n \t$pairsString = implode(\", \",$pairSymbols);\n \t$ticker = $api->QueryPublic('Ticker', array('pair'=>$pairsString));\n \t$ticker = $ticker['result'];\n\n $i=0;\n foreach ($ticker as $key => $value) {\n\n $price[$i] = $value['c'][0];\n\t\t\tsettype ($price[$i], 'float');\n $i++;\n }\n $ticker = $price;\n }\n\n return $ticker;\n}", "public function getOpenOrders($symbol = NULL, $recvWindow = NULL);", "function calculateEURX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURX '.$shortDate);\n\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDSEK = $data['USDSEK']['bars'];\n $index = [];\n\n foreach ($EURUSD as $i => $bar) {\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdsek = $USDSEK[$i]['open'];\n $open = 34.38805726\n * pow($eurusd/100000 * $usdchf/100000, 0.1113)\n * pow($eurusd / $gbpusd , 0.3056)\n * pow($eurusd/100000 * $usdjpy/1000 , 0.1891)\n * pow($eurusd/100000 * $usdsek/100000, 0.0785)\n * pow($eurusd/100000 , 0.3155);\n $iOpen = (int) round($open * 1000);\n\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdsek = $USDSEK[$i]['close'];\n $close = 34.38805726\n * pow($eurusd/100000 * $usdchf/100000, 0.1113)\n * pow($eurusd / $gbpusd , 0.3056)\n * pow($eurusd/100000 * $usdjpy/1000 , 0.1891)\n * pow($eurusd/100000 * $usdsek/100000, 0.0785)\n * pow($eurusd/100000 , 0.3155);\n $iClose = (int) round($close * 1000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getTickerBookTicker($symbol = NULL);", "function retrieveDataFromAlphavantage() {\n // Variables needed to created a url to use the alphavantage api\n $requestTypeURL = \"function=TIME_SERIES_INTRADAY\";\n $apiKey = 'F65M552NK586I4QJ';\n\n if (isset($_POST['submit']) && !empty($_POST['symbols'])) {\n $symbol = $_POST['symbols'];\n $url = 'https://www.alphavantage.co/query?'. $requestTypeURL . '&symbol='\n . $symbol . '&interval=1min&outputsize=compact&apikey=' . $apiKey;\n\n // Retrieving data from the url in JSON format\n // Returns false if it fails\n $content = @file_get_contents($url);\n\n if(!$content){\n throw new Exception('Unable to retrieve ticker stock info (invalid ticker symbol)');\n }\n\n $jsonData = json_decode($content, true);\n\n // Saves only the first element of the retrieved data\n $metadata = current($jsonData);\n\n // Append data\n echo '<div id=\"lasttrade\">';\n echo '<h2>' . $metadata['2. Symbol'] . '</h2>';\n echo '<p>Time Zone: ' . $metadata['6. Time Zone'] . '</p>';\n echo '<p>Last Refreshed: ' . $metadata['3. Last Refreshed'] . '</p>';\n\n // Validation to make sure 'Time Series (1min)' exists\n if(isset($jsonData['Time Series (1min)'])){\n $lastTrade = current($jsonData['Time Series (1min)']);\n echo '<p>Last trade closing value: ' . $lastTrade['4. close'] . '</p>';\n }\n\n echo '</div>';\n } else {\n // if submit and smbols aren't set\n throw new Exception('Ticker symbol not specified.');\n }\n }", "function updateFunctions ($api, $folioArray, $targetPair, $interval, $date, $since, $unixTime, $intervalSec, $moduleName) {\n\t$ohlc = null;\n\t$rowTime = null;\n\n\t$pairName = $folioArray[$targetPair]['pairSymbol'];\n\n\t$currentFile =$moduleName.'-'.$pairName.'-';\n\n\t$filepath = 'indic/' . $currentFile . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\tend($emaSet);\n\t$lastKey = key($emaSet);\n\n\t// update\n\n\n\t$compareTime = $unixTime-$intervalSec*3;\n\n\tif ($emaSet[$lastKey]['time']<=$compareTime){ //reinstall if too many missing\n\t\t\t$days = 30;\n\t\t\t$since = $unixTime-(60*60*24*$days);\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\t\tif (is_array($ohlc)){\n\t\t\t\t$current = installIndicR($currentFile, $ohlc);\n\t\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\t\t\t\tif ($current!=null) {\n\t\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' '.$current.' ok <br>');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\texit ('Error API JSON empty');\n\t\t\t}\n\n\t}else {\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\tif (is_array($ohlc)) {\n\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\n\t\t\tif ($rowTime > $emaSet[$lastKey]['time']){\n\t\t\t\tindicUPR($currentFile, $emaSet, $ohlc);\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t\tif ($rowTime == $emaSet[$lastKey]['time']){\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t} else {\n\t\t\t$rowTime = null;\n\t\t}\n\t}\n\n\treturn $rowTime;\n}", "private function _request()\n {\n if (!$this->history) {\n $file = 'http://download.finance.yahoo.com/d/quotes.csv?s=' . $this->symbol . '&f=' . $this->_convertStat($this->stat) . '=.csv';\n } elseif (is_array($this->history)) {\n \n //Make sure they aren't trying to use multiple stocks. Unsupported as of 11-5-14.\t\n if (strstr($this->symbol, \"+\")) {\n trigger_error(\"This method is not supported by the Yahoo! Finance API. You cannot select a date range AND multiple stocks.\");\n return;\n }\n \n $this->history['start'] = isset($this->history['start']) ? $this->history['start'] : '1-1-' . (date('Y') - 1);\n $start = explode('-', $this->history['start']); // dd-mm-yyyy\n $a = $start[0] - 1; // Month\n $b = $start[1]; // Day\n $c = $start[2]; // Year\n \n $this->history['end'] = isset($this->history['end']) ? $this->history['end'] : '12-31-' . date('Y');\n $end = explode('-', $this->history['end']); // dd-mm-yyyy\n $d = $end[0] - 1; // Month\n $e = $end[1]; // Day\n $f = $end[2]; // Year\n \n $g = isset($this->history['interval']) ? $this->history['interval'] : 'd'; // d = Daily, w = Weekly, m = Monthly\n \n $file = 'http://ichart.yahoo.com/table.csv?s=' . $this->symbol . '&a=' . $a . '&b=' . $b . '&c=' . $c . '&d=' . $d . '&e=' . $e . '&f=' . $f . '&g=' . $g . '&ignore=.csv';\n }\n \n $handle = fopen($file, \"r\");\n if (!$this->history) {\n while (($data = fgetcsv($handle, false, \",\")) !== FALSE) {\n $return[] = $data;\n } //Loop through and store each item in an indice\n \n } elseif (is_array($this->history)) {\n $return = array();\n $row = 0;\n while (($data = fgetcsv($handle, false, ',')) !== FALSE) {\n $num = count($data);\n $return[$this->symbol][$row] = array();\n for ($c = 0; $c < $num; $c++) {\n switch ($c) {\n case 0:\n $key = 'date';\n break;\n case 1:\n $key = 'open';\n break;\n case 2:\n $key = 'high';\n break;\n case 3:\n $key = 'low';\n break;\n case 4:\n $key = 'close';\n break;\n case 5:\n $key = 'volume';\n break;\n case 6:\n $key = 'adj_close';\n break;\n }\n $return[$this->symbol][$row][$key] = $data[$c];\n }\n $row++;\n } //end while\n \n }\n \n fclose($handle);\n return $return;\n }", "function getprices()\n{\n global $replay;\n global $pricefh;\n\n if($replay == 0)\n {\n $api = new Binance\\API(\"<api key>\",\"<secret>\");\n $mp = $api->prices();\n $pricefh = fopen(\"BTC-prices.txt\",\"a\") or die(\"Cannot open file\");\n fwrite($pricefh, serialize($mp) . \"\\n\");\n fclose($pricefh);\n }\n else\n {\n if (!$pricefh)\n {\n $pricefh = fopen(\"BTC-prices.txt\",\"r\") or die(\"Cannot open replay file\");\n }\n $mp = unserialize(fgets($pricefh));\n if ($mp == NULL) die(\"end of price data reached.\\n\");\n }\n return $mp;\n}", "function returnOpenPositions($date, $verbose = false, $debug = false){\n $dbc = connect();\n $stmt = $dbc->prepare(\"SELECT * FROM `data_transactions`\n WHERE `transaction_date` <= :date\n AND `symbol` IS NOT NULL\n AND `symbol` <> ''\n ORDER BY `transaction_date` ASC\");\n $stmt->bindParam(':date', $date);\n $stmt->execute();\n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n\n $openPositions = array();\n\n foreach($result as $transaction){\n switch($transaction['type']){\n case 'B':\n if (array_key_exists ( $transaction['symbol'] , $openPositions )){\n // symbol in array\n $openPositions[$transaction['symbol']]['shares'] += $transaction['shares'];\n $openPositions[$transaction['symbol']]['purchase'] += $transaction['amount'];\n array_push($openPositions[$transaction['symbol']]['purchases'], $transaction['transaction_date'] );\n } else {\n // new symbol\n $openPositions[$transaction['symbol']] = array(\n 'shares' => $transaction['shares'],\n 'purchase' => $transaction['amount'],\n 'purchases' => array($transaction['transaction_date']),\n 'dividend' => 0\n );\n }\n break;\n case 'S':\n $openPositions[$transaction['symbol']]['shares'] += $transaction['shares'];\n $openPositions[$transaction['symbol']]['purchase'] += $transaction['amount'];\n if (round($openPositions[$transaction['symbol']]['shares'],5) == 0) unset($openPositions[$transaction['symbol']]);\n break;\n case 'D':\n if (array_key_exists ( $transaction['symbol'] , $openPositions )){\n $openPositions[$transaction['symbol']]['dividend'] += $transaction['amount'];\n }\n break;\n default:\n break;\n }\n }\n\n //add basis data\n foreach($openPositions as &$position){\n $position['basis'] = round(-1*($position['purchase']+$position['dividend'])/$position['shares'],3);\n }\n\n if ($verbose) show($openPositions);\n return $openPositions;\n}", "function sellPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price, $unixTime, $threshold) {\n\t$filename = $moduleName. '-';\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\t$history = file_get_contents($filepath);\n\t$history = json_decode($history, true);\n\n\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\tif (!isset($history)) {\n\t\tprint ('zero history');\n\t}\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n\t// Sell if higher than threshold\n\t// || $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow']\n\n\tif ($folioEntry['dumpable']==0 || $ohlcOld[$lastKey]['close']>=$emaSet[$lastKey]['priceEMASlow']) {\n\t\t$devPercent = $currentPercent - $folioEntry['targetPercent'];\n\t\t$dev = round($devPercent*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t$toSell = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\n\t\t$soldValue = $toSell*$price;\n\t\t$fee = 0.004*$soldValue;\n\t\t$soldValue = $soldValue- $fee; // fee and drift\n\n\t\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t// History Stuff\n\t\t$originalValue = $toSell*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$toSell,\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t// Main Stuff\n\n\t\t$newAveragePrice = round(($main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toSell * $price)/($main[$mainEntry]['quantity'] + $toSell),5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] -=$toSell;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold');\n\t}\n\n\t// Sell all aka dump. Only dumpable ones apply.\n\n\tif ($folioEntry['dumpable']==1 && $ohlcOld[$lastKey]['close']<$emaSet[$lastKey]['priceEMASlow'] && $devPercent>$threshold) {\n\n\t\t$soldValue = $main[$mainEntry]['quantity']*$price;\n\t\t$soldValue -= 0.004*$soldValue; // fee and drift\n\n\t\t$fee = 0.004*$soldValue;\n\n\t\t// History Stuff\n\t\t$originalValue = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$main[$mainEntry]['quantity'],\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t$main[$mainEntry]['quantity'] = 0;\n\t\t$main[$mainEntry]['averageBuyPrice'] = 0;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold (dump)');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\tfile_put_contents($filepath, json_encode($history));\n}", "public function getTicker24hr($symbol = NULL);", "function returnMarketValue($date, $historicalData){\n $openPositions = returnOpenPositions($date);\n\n // list of data providers\n $dataProviders = array_keys($historicalData);\n\n // $historicalData = $historicalData['alphaVantage'];\n\n foreach($dataProviders as $provider){\n\n $marketValue[$provider] = array(\n 'open' => 0,\n 'high' => 0,\n 'low' => 0,\n 'close' => 0,\n );\n foreach($openPositions as $symbol => $data){\n if (array_key_exists($symbol, $historicalData[$provider])){\n $marketValue[$provider]['open'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['open'] ,3);\n $marketValue[$provider]['high'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['high'] ,3);\n $marketValue[$provider]['low'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['low'] ,3);\n $marketValue[$provider]['close'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['close'] ,3);\n }\n }\n }\n\n return $marketValue;\n}", "public function get_open_orders( $market = 'BTC-USD' ) {\r\n\t\t\t\t//return $this->open_orders;\r\n\t\t\t$open_orders = $this->exch->ActiveOrders( $arr = array() );\r\n\t\t\t$this->open_orders = [];\r\n\t\t\tif( isset( $open_orders['return'] ) ) {\r\n\t\t\t\tforeach( $open_orders['return'] as $order_id => $open_order ) {\r\n\t\t\t\t\t$open_order['id'] = $order_id;\r\n\t\t\t\t\tarray_push( $this->open_orders, $open_order );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $this->open_orders;\r\n\t\t}", "function SchedullerPO(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Cek --> Update PO List, Update Quantity PO Open\n\t\t// echo \"hahah\";\t\t\n\t\trequire_once APPPATH.'third_party/sapclasses/sap.php';\n\t\t$sap = new SAPConnection();\n\t\t$sap->Connect(APPPATH.\"third_party/sapclasses/logon_dataDev.conf\");\n\t\tif ($sap->GetStatus() == SAPRFC_OK ) $sap->Open ();\n\t\tif ($sap->GetStatus() != SAPRFC_OK ) {\n\t\t\techo $sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\n\t\t$fce = &$sap->NewFunction (\"Z_ZCMM_VMI_PO_DETAILC\");\n\t\t\n\t\tif ($fce == false) {\n\t\t\t$sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$start \t= date(\"20170101\");\t\t\t\t\t// Date start VMI apps\n\t\t$end \t= date(\"Ymd\");\t\t\t\t\t\t// Date Now\n\t\t$opco\t\t\t\t\t= '7000';\n\t\t$fce->COMPANY \t\t\t= \"$opco\";\t\t// BUKRS\n\t\t// $fce->PO_TYPE \t\t= 'ZK17';\n\t\t// $fce->VENDOR \t\t= ;\n\t\t$fce->DATE['SIGN'] \t= 'I';\n\t\t$fce->DATE['OPTION']\t= 'BT';\n\t\t$fce->DATE['LOW'] \t= $start;\n\t\t$fce->DATE['HIGH'] \t= $end;\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK10';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK17';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\t\n $fce->call();\n\n if ($fce->GetStatus() == SAPRFC_OK) {\n $fce->T_ITEM->Reset();\n $data=array();\n $empty=0;\n $tampildata=array();\n while ($fce->T_ITEM->Next()) {\n\t\t\t\t$matnr \t\t= $fce->T_ITEM->row[\"MATNR\"];\t// Kode Material\n\t\t\t\t$lifnr \t\t= $fce->T_ITEM->row[\"LIFNR\"];\t// Kode Vendor\n\t\t\t\t$ebeln \t\t= $fce->T_ITEM->row[\"EBELN\"];\t// No PO\n\t\t\t\t$menge \t\t= intval($fce->T_ITEM->row[\"MENGE\"]);\t// Quantity PO\n\t\t\t\t$sisaqty\t= intval($fce->T_ITEM->row[\"DELIV_QTY\"]);\t// Quantity PO Open\n\t\t\t\t$werks \t\t= $fce->T_ITEM->row[\"WERKS\"];\t// Plant\n\t\t\t\t$vendor\t\t= $fce->T_ITEM->row[\"VENDNAME\"];\t// Nama Vendor\n\t\t\t\t$material \t= $fce->T_ITEM->row[\"MAKTX\"];\t// Nama Material\n\t\t\t\t$potype \t= $fce->T_ITEM->row[\"BSART\"];\t// Type PO\n\t\t\t\t// $mins \t\t= $fce->T_ITEM->row[\"EISBE\"];\t// Safety Stock\n\t\t\t\t$mins \t\t= $fce->T_ITEM->row[\"MINBE\"];\t// Re Order Point\n\t\t\t\t$maxs \t\t= $fce->T_ITEM->row[\"MABST\"];\t// Max\n\t\t\t\t$statuspo\t= $fce->T_ITEM->row[\"ELIKZ\"];\t// Max\n\t\t\t\t$start \t\t= date_format(date_create($fce->T_ITEM->row[\"BEDAT\"]),'d M Y');\n\t\t\t\t$end \t\t= date_format(date_create($fce->T_ITEM->row[\"EINDT\"]),'d M Y');\n\t\t\t\t\n\t\t\t\tif($statuspo == 'X' || $statuspo == 'x')\n\t\t\t\t{\n\t\t\t\t\t$sts = 0;\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$sts = 1;\n\t\t\t\t}\n\t\t\t\t$sqlread= \"SELECT count(id_list) ADA\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t$jum \t= $this->db->query($sqlread)->row();\n\t\t\t\t$nilai \t= $jum->ADA;\n\t\t\t\t// echo $nilai.\"->\".$matnr.\" | \".$lifnr.\" | \".$ebeln.\" | \".$menge.\" | \".$werks.\" | \".$vendor.\" | \".$material.\" | \".$start.\" | \".$end.\" ==> \".$potype.\"<br/>\";\n\t\t\t\t// $ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\")\n\t\t\t\t\n\t\t\t\tif($nilai < 1){\n\t\t\t\t\tif($ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\"\n\t\t\t\t\t\t|| $lifnr == \"0000113004\" || $lifnr == \"0000110091\" || $lifnr == \"0000110253\" || $lifnr == \"0000110015\" || $lifnr == \"0000112369\" || $lifnr == \"0000110016\"){\t\t\t\t\t\t\n\t\t\t\t\t\t$sqlcount \t= \"SELECT max(ID_LIST) MAXX FROM VMI_MASTER\";\n\t\t\t\t\t\t$maxid \t\t= $this->db->query($sqlcount)->row();\t\t\n\t\t\t\t\t\t$max_list \t= $maxid->MAXX+1;\n\t\t\t\t\t\t$insert\t\t= \"insert into VMI_MASTER(ID_LIST,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPLANT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUNIT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNO_PO,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPO_ITEM,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_ACTIVE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_END,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDOC_DATE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSLOC,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMIN_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMAX_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_AWAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_VMI,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQUANTITY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tID_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS)\n\t\t\t\t\t\t\t\t\t\t\t\tvalues('$max_list',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$werks',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$matnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$material',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MEINS\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$lifnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$vendor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$ebeln',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EBELP\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($end),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"LGORT\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EISBE\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MABST\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$opco',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\";\n\t\t\t\t\t\t$save \t= $this->db->query($insert);\n\t\t\t\t\t\techo \"Baru ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($nilai >= 1){\n\t\t\t\t\t$sqlread1 = \"SELECT ID_LIST\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t\t$getlist= $this->db->query($sqlread1)->row();\n\t\t\t\t\t$idlist = $getlist->ID_LIST;\n\t\t\t\t\t$update\t\t= \"update VMI_MASTER set quantity = '$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin_stock = '$mins',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmax_stock = '$maxs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS = '$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere ID_LIST = '$idlist'\n\t\t\t\t\t\t\t\t\";\n\t\t\t\t\t$update_data\t= $this->db->query($update);\n\t\t\t\t\t\techo \"$update <br/>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco| $werks | $potype<br/>\";\n\t\t\t\t}\n\t\t\t\t// echo \"<hr/>\"; \n\t\t\t}\n\t\t// echo \"<pre>\";\n\t\t// print_r($fce);\n\t\t// echo \"hahaha\";\n $fce->Close();\n\t\t}\n }", "function returnDamwidiOHLC($verbose, $debug){\n $dbc = connect();\n $stmt = $dbc->prepare(\"SELECT `date`, `open`, `high`, `low`, `close` FROM `data_value` ORDER BY `date` DESC\");\n $stmt->execute();\n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n\n $damwidiOHLC = array();\n foreach($result as $candle){\n $damwidiOHLC['Time Series (Daily)'][$candle['date']] = array(\n \"1. open\" => round($candle['open'],2),\n \"2. high\" => round($candle['high'],2),\n \"3. low\" => round($candle['low'],2),\n \"4. close\" => round($candle['close'],2),\n );\n }\n\n if ($verbose) show($damwidiOHLC);\n if (!$verbose) echo json_encode($damwidiOHLC);\n}", "function installHistory ($api, $moduleName, $folioArray, $installTime) {\n\n\t$pairSymbols = array_column ($folioArray, 'pairSymbol');\n\tarray_pop ($pairSymbols);\n\n\t$pairsString = implode(\", \",$pairSymbols);\n\n global $exchange;\n $ticker = getTicker ($api, $exchange, $folioArray);\n\n\t$pairCount = count($folioArray)-1;\n\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\t$pairSymbol = $folioArray[$i]['pairSymbol'];\n\t\t$coinSymbol = $folioArray[$i]['coinSymbol'];\n\n\t\t/*\n\t\tif (isset($balance['result'][$coinSymbol])) {\n\t\t\t$quantity = $balance['result'][$coinSymbol];\n\t\t\tsettype($quantity,'float');\n\t\t} else {\n\t\t\t$quantity = 0;\n\t\t}\n\t\t*/\n\n\t\tif ($i<$pairCount) {\n\t\t\t$price = $ticker[$i];\n\t\t\tsettype ($price, 'float');\n\t\t} else {\n\t\t\t$price = 1;\n\t\t}\n\n\t\t$quantity = round($folioArray[$i]['targetPercent']/$price*10, 5, PHP_ROUND_HALF_UP);\n\n\n\t\t$main[$i] = array ('pairSymbol'=>$pairSymbol, 'coinSymbol'=> $coinSymbol, 'targetPercent'=>$folioArray[$i]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>$price, 'startQuantity'=>$quantity);\n\n\t\t$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\n\t\t$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t$filename = $moduleName. '-'. $folioArray[$i]['pairSymbol'].'-';\n\t\t$filepath = '' . $filename . 'history.json';\n\t\tfile_put_contents($filepath, json_encode($history));\n\t}\n\n\n\t$quantity = $folioArray[$pairCount]['targetPercent']*10;\n\t$main[] = array ('pairSymbol'=>'ZUSD', 'coinSymbol'=>'ZUSD','targetPercent'=>$folioArray[$pairCount]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>1, 'startQuantity'=>$quantity);\n\t$filename = $moduleName. '-';\n\t$filepath = '' . $filename . 'main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\n\t$quickExt = array ('lastPosInt'=>$installTime, 'pairIndex'=>0, 'updateTime'=>$installTime, 'indicCurrent'=>'current');\n\t$filepath = '' . $filename . 'QuickExt.json';\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\n\t$ledgerTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\n\t$ledger = array ('ledger'=>null, 'totals'=>$ledgerTotals);\n\n\t$filepath = '' . $moduleName . '-ledger.json';\n\tfile_put_contents($filepath, json_encode($ledger));\n}", "function getSMA_sub_real ($company, $from=\"1900-01-01 00:00:00\", $to=null, \n\t\t\t\t\t$dataorg=\"json\", $samplePeriod=15, $enSignals=false,\n\t\t\t\t\t$host, $db, $user, $pass) {\n\t\t$intervalPeriod = $samplePeriod * 1.5;\n\t\t//from date has to be adjusted for the bollinger bands\n\t\t$date = date_create($from);\n\t\tdate_add($date,date_interval_create_from_date_string(\"-$intervalPeriod days\"));\n\t\t$fromAdjusted = date_format($date,\"Y-m-d\");\n\n\t\t$dataOhlc = [];\n\n\t\t//OHLC data format [timestamp,open,high,low,close,volume]\n\t\tif ($dataorg == \"highchart\") {\n\t\t\t$dataOhlc = getOHLC ($company, $fromAdjusted, $to, \"array2\", $host, $db, $user, $pass);\n\t\t} else {\n\t\t\t$dataOhlc = getOHLC ($company, $fromAdjusted, $to, \"array\", $host, $db, $user, $pass);\n\t\t}\n\n\t\t//Return if $dataOhlc is null\n\t\tif ( ($dataOhlc == []) || ($dataOhlc == 0) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t//Input for SMA functions should be [timestamp,close]\n\t\t$ctr = 0;\n\t\tforeach ((array)$dataOhlc as $ohlc) {\n\t\t\t$dbreturn[$ctr][0] = $ohlc[0];\t//timestamp\n\t\t\t$dbreturn[$ctr++][1] = $ohlc[4];\t//close\n\t\t}\n\n\t\treturn $dbreturn;\n\t}", "function get_market_default($pair,$print=false){\n\t$url_coin_price = \"https://graviex.net/api/v2/tickers/\".$pair.\".json\";\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch,CURLOPT_TIMEOUT,20);\n\tcurl_setopt($ch, CURLOPT_URL, $url_coin_price);\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\t$obj = json_decode($result);\n\t//print_r($obj);\n\t$coin_buy_price = $obj->ticker->buy;\n\t$coin_sell_price = $obj->ticker->sell;\n\t$coin_volume = $obj->ticker->vol;\n\t$coin_btc_volume = $obj->ticker->volbtc;\n\tif($print){\n\t\techo \"<br /><b>Pair</b>: \".$pair;\n\t\techo \"<br /><br /><b>Ofertas</b>\";\n\t\techo \"<br />Compra: \".$coin_buy_price;\n\t\techo \"<br />Venda: \".$coin_sell_price;\n\t\techo \"<br /><br /><b>Volume last 24h</b>\";\n\t\techo \"<br />Coins: \".$coin_volume;\n\t\techo \"<br />BTC: \".$coin_btc_volume; \n\t}\n\treturn array('buy' => $coin_buy_price,'sell' => $coin_sell_price,'vol' => $coin_volume,'volbtc' => $coin_btc_volume);\n}", "function getCalcs($masterIndex, $indexNumber, $marketnum1, $marketnum2, $TempPoll) {\r\n\t//get database info\r\nglobal $db;\r\n$db = new mysqli(\"localhost\", \"root\", \"\", \"trading\");\r\n\r\n//check connection to database\r\nif($db->connect_errno > 0){\r\n die('Unable to connect to database [' . $db->connect_error . ']');\r\n\t$errors = 1;\r\n}\r\n\t\r\n\t//if statement used to tell which market we should focus on. \r\n\t//our only option $marketnum1 and marketnum2 are ===== 1, 2, 3, 4,\r\n\t$master1code;\r\n\t$market1code ;\r\n\t$master2code;\r\n\t$market2code ;\r\n\tif (($marketnum1 == 1)) \r\n\t{\r\n\t\t$master1code = \"Master1code\";\r\n\t\t$market1code = \"Market1code\";\r\n\t} \r\n\telse if ($marketnum1 == 2) \r\n\t{\r\n\t\t$master1code = \"Master2code\";\r\n\t\t$market1code = \"Market2code\";\r\n\t} \r\n\telse if ($marketnum1 == 3) \r\n\t{\r\n\t\t$master1code = \"Master3code\";\r\n\t\t$market1code = \"Market3code\";\r\n\t} \r\n\telse if ($marketnum1 == 4) \r\n\t{\r\n\t\t$master1code = \"Master4code\";\r\n\t\t$market1code = \"Market4code\";\r\n\t\t\r\n\t} \r\n\t\r\n\r\n\t$firstCalc; \r\n//\t\t M1toM2 DOUBLE, M1toM3 DOUBLE, M1toM4 DOUBLE,\r\n//\t\t M2toM1 DOUBLE, M2toM3 DOUBLE, M2toM4 DOUBLE,\r\n//\t\t M3toM1 DOUBLE, M3toM2 DOUBLE, M3toM4 DOUBLE,\r\n//\t\t M4toM1 DOUBLE, M4toM2 DOUBLE, M4toM3 DOUBLE,\r\n\t//get the markets we will be saving to. \r\n\t//\t\t M1toM2 DOUBLE, M2toM1 DOUBLE,\r\n\t\tif ($marketnum1 == 1 && $marketnum2 == 2) \r\n\t{\r\n\t\t$firstCalc = 'M1toM2';\r\n\t\t\r\n\t} \r\n\t\r\n\telse if ($marketnum1 == 1 && $marketnum2 == 3) \r\n\t{\r\n\t\t$firstCalc = 'M1toM3';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 1 && $marketnum2 == 4) \r\n\t{\r\n\t\t$firstCalc = 'M1toM4';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 2 && $marketnum2 == 1) \r\n\t{\r\n\t\t$firstCalc = 'M2toM1';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 2 && $marketnum2 == 3) \r\n\t{\r\n\t\t$firstCalc = 'M2toM3';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 2 && $marketnum2 == 4) \r\n\t{\r\n\t\t$firstCalc = 'M2toM4';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 3 && $marketnum2 == 1) \r\n\t{\r\n\t\t$firstCalc = 'M3toM1';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 3 && $marketnum2 == 2) \r\n\t{\r\n\t\t$firstCalc = 'M3toM2';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 3 && $marketnum2 == 4) \r\n\t{\r\n\t\t$firstCalc = 'M3toM4';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 4 && $marketnum2 == 1) \r\n\t{\r\n\t\t$firstCalc = 'M4toM1';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 4 && $marketnum2 == 2) \r\n\t{\r\n\t\t$firstCalc = 'M4toM2';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 4 && $marketnum2 == 3) \r\n\t{\r\n\t\t$firstCalc = 'M4toM3';\t\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t//put all variables into tempvars\r\n\t//check to see if a first market exist\r\n\t//if not were done. \r\n\tif ($masterIndex[$indexNumber][$master1code] != \"NULL\")\r\n\t{\r\n\t\t//Create a master1currcode for easy access.\r\n\t\t$Master1CurrCode = $masterIndex[$indexNumber][$master1code];\r\n\t\t//Create Martet1code for this variable\r\n\t\t$tSlaveMarketcode1 = $masterIndex[$indexNumber][$market1code];\r\n\t\t//if we pass this marker\r\n\t\t//we have atleast two markets for this currency.\r\n\t\tif ($masterIndex[$indexNumber][$master2code] != \"NULL\")\r\n\t\t\t{\t\r\n\t\t\t//get the master2currcode\r\n\t\t\t$Master2CurrCode = $masterIndex[$indexNumber][$master2code];\r\n\t\t\t//get masketCurrency2\r\n\t\t\t$tSlaveMarketcode2 = $masterIndex[$indexNumber][$market2code];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//find master1currcode last trade value\r\n\t\t\t$SlaveValueInMarket1 = GetLastTrade($tSlaveMarketcode1, $TempPoll);\r\n\t\t\t$SlaveValueInMarket2 = GetLastTrade($tSlaveMarketcode2, $TempPoll);\r\n\r\n\r\n\r\n\t\t\t//Mission: Get second market currency code\r\n\t\t\t$masterSlaveMASTERIndex = getMasterIndex($Master2CurrCode);\r\n\t\t\t$masterSlaveValue;\r\n\t\t\t//create var for secondary market code \r\n\t\t\t$MSMarketCode; \r\n\t\t\t$didwegetamatch = 0; //if set to one we recieved a match in our search for a second market\r\n\t\t\t\r\n\t\t\t//check to see whether it is traded in the same market as our slave currency \r\n\t\t\tfor ($p = 1; $p < 5; $p++) \r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t//if a master currency of our master-slave currnecy matches our slave currency's master currency\r\n\t\t\t\t//insert it into $MSMarketCode so we can look up its last trade value.\r\n\t\t\t\tif ($masterSlaveMASTERIndex['Master' . $p . 'code'] == $masterIndex[$indexNumber][$master1code]) \r\n\t\t\t\t\t{ \r\n\t\t\t\t\t$MSMarketCode = $masterIndex[$indexNumber][$market1code];\r\n\t\t\t\t\t$p = 5;\r\n\t\t\t\t\t$didwegetamatch = 1;\r\n\t\t\t\t\t}\r\n\t\t\t}//end for loop\r\n\t\t\t//if it does exist, get its last trade value within that market.\r\n\t\t\tif ($didwegetamatch == 1) { \r\n\t //get the value of the masterslave currency within the first market\r\n\t\t\t$masterSlaveValue = GetLastTrade($MSMarketCode, $TempPoll);\r\n\t\t\t}\r\n\r\n\t\t\t//how many slave currencies can we buy with one master slave currency. \r\n\t\t\t//lets find out. \r\n\t\t\t//Divide M1-MasterSlaveValue by M1-CurrValue \r\n\t\t\t//Get SlavePerSlave Value\r\n\t\t\t$amountperCurr1M = $masterSlaveValue / $SlaveValueInMarket1;\r\n\t\t\t \t//Divide 1 by lasttradevalue\r\n\t\t\t$amountperCurr2M = 1 / $SlaveValueInMarket2;\r\n\t\t\t\r\n\t\t\t$firstMarketAdvantageValue = $amountperCurr1M - $amountperCurr2M;\r\n\t\t\t$firstMarketAdvantagePercentage = $firstMarketAdvantageValue / $amountperCurr2M;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tUpdateM2MAtPoll($masterIndex[$indexNumber]['LongName'],$TempPoll, $firstCalc,\t$firstMarketAdvantagePercentage);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\r\n\t}\r\n\t}\r\n}", "public function get_historical_prices($start_date,$end_date,$period) {\n\t\tlist($month_from, $day_from, $year_from) = explode('-',$start_date);\n\t\tlist($month_to, $day_to, $year_to) = explode('-',$end_date);\n\t\t\n\t\t$month_from -= 1;\n\t\t$month_to -= 1;\n\t\t\n\t\t$url = \"http://ichart.yahoo.com/table.csv?s={$this->ticker}&a={$month_from}&b={$day_from}&c={$year_from}&d={$month_to}&e={$day_to}&f={$year_to}&g={$period}&ignore=.csv\";\n\n\t\tif ($file = fopen($url,\"r\")){\n\t\t\t$row = 0;\n\t\t\t$hist_data = array();\n\t\t\twhile ($data = fgetcsv($file,200,\",\")) {\n\t\t\t\tif ($row != 0) {\n\t\t\t\t\t$daily = array();\n\t\t\t\t\t$daily[\"Date\"] = $data[0];\n\t\t\t\t\t$daily[\"Open\"] = $data[1];\n\t\t\t\t\t$daily[\"High\"] = $data[2];\n\t\t\t\t\t$daily[\"Low\"] = $data[3];\n\t\t\t\t\t$daily[\"Close\"] = $data[4];\n\t\t\t\t\t$daily[\"Volume\"] = $data[5];\n\t\t\t\t\t$daily[\"Adj Close\"] = $data[6];\n\t\t\t\t\t\n\t\t\t\t\tarray_push($hist_data, $daily);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$row++;\n\t\t\t\t}\n\t\t\tfclose($file);\n\t\t\t}\n\t\telse {\n\t\t\t//echo \"Error opening the file for $this->ticker.<br />\";\n\t\t\t$hist_data = '';\n\t\t\t}\n\n\t\treturn $hist_data;\t\n\t\t}", "public function getOpenedOrders() {\n\t\t$client = $this->getWssClient();\n\t\t$client->send( \"{\\\"H\\\":\\\"corehub\\\",\\\"M\\\":\\\"QueryExchangeState\\\",\\\"A\\\":[\\\"{$this->pair}\\\"],\\\"I\\\":1}\" );\n\t\ttime_nanosleep( 0, 500000 );\n\t\t$orders = json_decode( $client->receive(), true )['R'];\n\t\tif ( ! $orders ) {\n\t\t\ttime_nanosleep( 0, 500000 );\n\t\t\t$orders = json_decode( $client->receive(), true )['R'];\n\t\t}\n\n\t\treturn $orders;\n\t}", "public function updateTicker()\n {\n \n $val = $this->mtgox->getTicker();\n \n $arr = [\"value\"=>\"\", \"value_int\"=>\"\", \"display\"=>\"\", \"currency\"=>\"\"];\n \n $defs = [\n \"high\" => $arr,\n \"low\" => $arr,\n \"avg\" => $arr,\n \"vwap\" => $arr,\n \"vol\" => $arr,\n \"last_all\" => $arr,\n \"last_local\" => $arr,\n \"last_orig\" => $arr,\n \"last\" => $arr,\n \"buy\" => $arr,\n \"sell\" => $arr,\n ];\n \n $val = array_merge($defs, $val);\n \n $this->insert($val);\n \n $this->setPercentChange();\n \n $this->tickerPear();\n }", "public function handle()\n {\n $this->info('Start save ohlcv for top 100 ' . date('H:i:s d-m-Y'));\n // get ids from 100\n // save historical data for 100 with convert value USD\n $interval = !empty($this->option('interval')) ? $this->option('interval') : 'hourly';\n $timePeriod = !empty($this->option('time_period')) ? $this->option('time_period') : 'hourly';\n\n if ($interval == 'hourly') {\n $allCrypts = TopCryptocurrency::select('cryptocurrency_coin_id as id', 'cryptocurrency_id')->limit(100)->get();\n } else {\n $allCrypts = Cryptocurrency::select('id', 'cryptocurrency_id')->get();\n }\n $query['interval'] = $interval;\n $query['time_period'] = $timePeriod;\n $convert = self::DEFAULT_COINS_QUOTES_SYMBOL;\n $timeEnd = !empty($this->option('time_end')) ? date('Y-m-d 23:59:59',\n strtotime($this->option('time_end'))) : date('Y-m-d 23:59:59', strtotime(\"-1 day\"));\n $timeStart = !empty($this->option('time_start')) ? date('Y-m-d 23:59:59',\n strtotime($this->option('time_start'))) : date('Y-m-d H:i:s', strtotime($timeEnd . \"-1 day\"));\n $query['time_end'] = $timeEnd;\n $query['time_start'] = $timeStart;\n $service = new CurrencyOhlcvService();\n $quote = Cryptocurrency::where('symbol', $convert)->first();\n\n foreach ($allCrypts as $currency) {\n if (!$quote) {\n return false;\n }\n\n $quoteId = $quote->cryptocurrency_id;\n $result = $service->getCryptoCurrencyOhlcvApiData($currency->id, '', $timePeriod, $interval, $timeEnd,\n $timeStart, $convert);\n if (!empty($result['status']) && $result['status']['error_code'] == 0) {\n $service->saveCryptoCurrencyOhlcvData($result['data']['quotes'], self::INTERVAL_MODELS[$interval],\n $currency->cryptocurrency_id, $quoteId, $convert);\n $this->info('Done for ' . $result['data']['symbol'] . ' / ' . $convert);\n\n } else {\n if (!empty($result['status'])) {\n $this->info('cryptocurrency_id ' . $currency->cryptocurrency_id . ' ' . $result['status']['error_message']);\n Log::info($this->description . ' fails for pair ' . $currency->cryptocurrency_id . ' / ' . $convert . ' ' . $result['status']['error_message']);\n }\n }\n $microSec = 1000000;\n if (((int)date('i') == 0) || ((int)date('i') == 2)) {\n $timeSleep = 2.8;\n }else{\n $timeSleep = 1.2;\n }\n usleep($timeSleep * $microSec);\n\n }\n $sleep = new SleepService;\n\n $this->info('finish ' . $interval . ' save ohlcv for top 100 ' . date('H:i:s d-m-Y'));\n\n if ($interval === 'hourly' && $timePeriod === 'hourly') {\n sleep($sleep->intervalSleep('everyHour'));\n } elseif ($interval === 'daily' && $timePeriod === 'daily') {\n sleep($sleep->intervalSleepEveryDayByTime(Config::get('commands_sleep.cryptocurrency_historical_daily')));\n }\n }", "public function getOpenOrders($pair='all')\n {\n return $this->trading([\n 'command' => 'returnOpenOrders',\n 'currencyPair' => strtoupper($pair)\n ]);\n }", "function downloadExchangeRates() {\r\n $currency_domain = substr($this->xml_file,0,strpos($this->xml_file,\"/\"));\r\n $currency_file = substr($this->xml_file,strpos($this->xml_file,\"/\"));\r\n $fp = @fsockopen($currency_domain, 80, $errno, $errstr, 10);\r\n if($fp) {\r\n \r\n $out = \"GET \".$currency_file.\" HTTP/1.1\\r\\n\";\r\n $out .= \"Host: \".$currency_domain.\"\\r\\n\";\r\n $out .= \"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5\\r\\n\";\r\n $out .= \"Connection: Close\\r\\n\\r\\n\";\r\n fwrite($fp, $out);\r\n while (!feof($fp)) {\r\n \r\n $buffer .= fgets($fp, 128);\r\n }\r\n fclose($fp);\r\n \r\n $pattern = \"{<Cube\\s*currency='(\\w*)'\\s*rate='([\\d\\.]*)'/>}is\";\r\n preg_match_all($pattern,$buffer,$xml_rates);\r\n array_shift($xml_rates);\r\n \r\n for($i=0;$i<count($xml_rates[0]);$i++) {\r\n \r\n $exchange_rate[$xml_rates[0][$i]] = $xml_rates[1][$i];\r\n }\r\n \r\n $conn = mysql_connect($this->mysql_host,$this->mysql_user,$this->mysql_pass);\r\n \r\n $rs = mysql_select_db($this->mysql_db,$conn);\r\n \r\n foreach($exchange_rate as $currency=>$rate) {\r\n \r\n if((is_numeric($rate)) && ($rate != 0)) {\r\n \r\n $sql = \"SELECT * FROM \".$this->mysql_table.\" WHERE currency='\".$currency.\"'\";\r\n $rs = mysql_query($sql,$conn) or die(mysql_error());\r\n if(mysql_num_rows($rs) > 0) {\r\n \r\n $sql = \"UPDATE \".$this->mysql_table.\" SET rate=\".$rate.\" WHERE currency='\".$currency.\"'\";\r\n } else {\r\n \r\n $sql = \"INSERT INTO \".$this->mysql_table.\" VALUES('\".$currency.\"',\".$rate.\")\";\r\n }\r\n \r\n $rs = mysql_query($sql,$conn) or die(mysql_error());\r\n }\r\n \r\n }\r\n }\r\n }", "function balanceCheck ($api, $moduleName, $folioArray, $threshold, $unixTime) {\n\n\n // get trade balance would go here\n\n\n\t// get current % of each coin and ema or other indicators\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$pairSymbols = array_column($folioArray, 'pairSymbol');\n\tarray_pop($pairSymbols);\n\n\t$pairCount = count($folioArray)-1; //last is USD\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('USD');\n\t\t}\n\t\t$currentPair = $folioArray[$i]['pairSymbol'];\n\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\n\t\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t $ohlcOld = file_get_contents($filepath);\n\t $ohlcOld = json_decode($ohlcOld, true);\n\n\t\tend($ohlcOld);\n\t\t$lastKey = key($ohlcOld);\n\n\t\t$price[$i] = $ohlcOld[$lastKey]['close'];\n\t\t$priceT[$i] = $ticker[$currentPair]['c'][0];\n\n\t\t$currentValue[$i] = $main[$i]['quantity']*$price[$i];\n\t\t$holdValue[$i] = $main[$i]['startQuantity']*$price[$i];\n\n\t}\n\t$totalValue = array_sum($currentValue);\n\t$totalValue += $main[$pairCount]['quantity']; // add USD\n\n // Hold value is the value if one only holds from the beginning\n\t$holdValue = array_sum($holdValue);\n\t$holdValue += $main[$pairCount]['startQuantity']; // add USD\n\n\t$operation = null;\n\n\t// based on deviation from planned % of folio, do stuff for each thing\n\tfor ($i=0; $i<$pairCount; $i++) { // count($folioArray)-1 since last is USD\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('squeak');\n\t\t}\n\n\t\tif ($folioArray[$i]['coinSymbol']!='ZUSD') {\n\t\t\t$currentPercent[$i] = round ($currentValue[$i]/$totalValue*100, 3, PHP_ROUND_HALF_UP);\n\t\t\t$deviation = $currentPercent[$i]-$main[$i]['targetPercent'];\n\n //Potential checks if it is worth buying or selling, depending on status of indicators\n\t\t\tif ($deviation>$threshold) {\n\t\t\t\tsellPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i], $unixTime, $threshold);\n\t\t\t}\n\t\t\tif ($deviation<-$threshold) {\n\t\t\t\tbuyPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i]);\n\t\t\t}\n\t\t\t$operation[] = $folioArray[$i]['pairSymbol'].' balance checked';\n\t\t}\n\t}\n\n\n\n\t$filepath = ''.$moduleName.'-'.'QuickExt.json';\n\t$quickExt = file_get_contents($filepath);\n\t$quickExt = json_decode($quickExt, true);\n\n\t$quickExt['tempTotalValue'] = $totalValue;\n\t$quickExt['holdValue'] = $holdValue;\n\n\tfor ($i=0; $i<=$pairCount; $i++) { // includes USD\n\t\t$quickExt['volChange'][$folioArray[$i]['coinSymbol']] = round($main[$i]['quantity']/$main[$i]['startQuantity']*100, 2, PHP_ROUND_HALF_UP);\n\t}\n\n\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\tprint_r ($operation);\n}", "function createCalculationsArray($symbol,$recorddate,$open,$high,$low,$close,$prevclose,$volume,$candleBody,$candleHeight,$candleType,$change,$changePercent,$avgVol,$ma20,$ma50,$avgCandleBody,$avgCandleHeight){\n return array('symbol' => $symbol,\n 'recorddate' => $recorddate,\n 'open' => $open,\n 'high' => $high,\n 'low' => $low,\n 'close' => $close,\n 'prevclose' => $prevclose,\n 'volume' => $volume,\n 'candleBody' => $candleBody,\n 'candleHeight' => $candleHeight,\n 'candleType' => $candleType,\n 'change'=>$change,\n 'changePercent'=>$changePercent,\n 'avgVol'=>$avgVol,\n 'ma20'=>$ma20,\n 'ma50'=>$ma50,\n 'avgCandleBody'=>$avgCandleBody,\n 'avgCandleHeight'=>$avgCandleHeight\n );\n}", "function island_reversal($candles) {\n echo \"Testing Island Reversal\\n\";\n return $candles[0]->get_open() < 0.97*$candles[1]->get_low();\n }", "private function getOrders()\n {\n $OD = $this->dbclient->coins->OwnOrderBook;\n\n $ownOrders = $OD->find(\n array('$or'=>\n array(array('Status'=>'buying'), array('Status'=>'selling'))\n ));\n\n $output = ' {\n \"success\" : true,\n \"message\" : \"\",\n \"result\" : [';\n foreach ($ownOrders as $ownOrder) {\n\n if ($ownOrder) {\n if ($ownOrder->Status == 'buying' or $ownOrder->Status == 'selling') {\n $uri = $this->baseUrl . 'public/getorderbook';\n $params['market'] = $ownOrder->MarketName;\n if ($ownOrder->Status == 'buying') {\n $params['type'] = 'sell';\n $params['uuid'] = $ownOrder->BuyOrder->uuid;\n $limit = 'buy';\n } elseif ($ownOrder->Status == 'selling') {\n $params['type'] = 'buy';\n $params['uuid'] = $ownOrder->SellOrder->uuid;\n $limit = 'sell';\n }\n\n if (!empty($params)) {\n $uri .= '?' . http_build_query($params);\n }\n\n $sign = hash_hmac('sha512', $uri, $this->apiSecret);\n $ch = curl_init($uri);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign: ' . $sign));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n $answer = json_decode($result);\n $success = false;\n $quantity = 0;\n $rate = 0;\n\n if ($answer->success == true) {\n $closest_rate = $answer->result[0]->Rate;\n\n if ($ownOrder->Status == 'buying' && $ownOrder->BuyOrder->Rate >= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if ($ownOrder->Status == 'selling' && $ownOrder->SellOrder->Rate <= $closest_rate) {\n $success = true;\n $quantity = $answer->result[0]->Quantity;\n $rate = $answer->result[0]->Rate;\n }\n\n if (!$success) {\n $output = $output.'{\n \"AccountId\" : null,\n \"OrderUuid\" : \"' . $params['uuid'] . '\",\n \"Exchange\" : \"' . $params['market'] . '\",\n \"Type\" : \"LIMIT_' . strtoupper($limit) . '\",\n \"Quantity\" : ' . $quantity . ',\n \"QuantityRemaining\" : 0.00000000,\n \"Limit\" : 0.00000001,\n \"Reserved\" : 0.00001000,\n \"ReserveRemaining\" : 0.00001000,\n \"CommissionReserved\" : 0.00000002,\n \"CommissionReserveRemaining\" : 0.00000002,\n \"CommissionPaid\" : 0.00000000,\n \"Price\" : ' . $rate . ',\n \"PricePerUnit\" : ' . $closest_rate . ',\n \"Opened\" : \"2014-07-13T07:45:46.27\",\n \"Closed\" : null,\n \"IsOpen\" : true,\n \"Sentinel\" : \"6c454604-22e2-4fb4-892e-179eede20972\",\n \"CancelInitiated\" : false,\n \"ImmediateOrCancel\" : false,\n \"IsConditional\" : false,\n \"Condition\" : \"NONE\",\n \"ConditionTarget\" : null\n },';\n\n }\n }\n }\n }\n }\n $output = rtrim($output, ',').']\n}';\n return $output;\n }", "public function testClosingRateRecycling()\n {\n $closingRate = ClosingRate::create([\n 'exchange_rate_id' => factory(ExchangeRate::class)->create()->id,\n 'reporting_period_id' => factory(ReportingPeriod::class)->create()->id,\n ]);\n\n $recycled = RecycledObject::all()->first();\n $this->assertEquals($closingRate->recycled->first(), $recycled);\n }", "function getSellBidStockTickers()\n{\n$mysql_server ='192.168.1.101';\n\n$mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n\n//make empty array to hold the Stock Tickers attached to Username\n$stackTickers = array();\n\n//find the items that are attached to username and requested Ticker\n$TickerQry = \"Select * from SellBestBidOffer\";\n$TickerResult = $mysqli->query($TickerQry);\n\nif($TickerResult->num_rows > 0){\n while ($row = $TickerResult->fetch_assoc()){\n\n if(!in_array($row['stockSymbol'], $stackTickers)){\n array_push($stackTickers, $row['stockSymbol']);\n }\n\n }\n}\n\n$SQLresultObj = array('Stocks' => $stackTickers);\n\n//var_dump($SQLresultObj);\nreturn($SQLresultObj);\n\n}", "public function update()\n {\n $uniqueId = uniqid();\n echo sprintf(\"Start updating gopax ticker[%s]! Time: %s\\n\", $uniqueId, time());\n\n $gopaxTokenList = GOPAX_API::getAssets();\n if (isset($gopaxTokenList['code']) && isset($gopaxTokenList['message'])) {\n echo sprintf(\"get gopaxTokenList failed. Code: %s, Message: %s, File: %s, Line: %s\\n\",\n $gopaxTokenList['code'], $gopaxTokenList['message'], __FILE__, __LINE__);\n return ;\n }\n\n $gopaxTradingList = GOPAX_API::getTradingPairs();\n if (isset($gopaxTradingList['code']) && isset($gopaxTradingList['message'])) {\n echo sprintf(\"get gopaxTradingList failed. Code: %s, Message: %s, File: %s, Line: %s\\n\",\n $gopaxTradingList['code'], $gopaxTradingList['message'], __FILE__, __LINE__);\n return ;\n }\n\n $tokenHash = array_combine(array_column($gopaxTokenList, 'id'), $gopaxTokenList);\n\n // exchange name[the section key] from conf/app.ini\n $tickerModel = new TickerModel('gopax');\n foreach ($gopaxTradingList as $tickerInfo) {\n sleep(1);\n $tradingPairInfo = GOPAX_API::getTickerPairs($tickerInfo['name']);\n $data = [\n 'symbol_key' => $tickerInfo['baseAsset'],\n 'symbol_name' => $tokenHash[$tickerInfo['baseAsset']]['name'],\n 'anchor_key' => $tickerInfo['quoteAsset'],\n 'anchor_name' => $tokenHash[$tickerInfo['quoteAsset']]['name'],\n 'price' => $tradingPairInfo['price'],\n 'price_updated_at' => $tradingPairInfo['time'],\n 'volume_24h' => $tradingPairInfo['volume'],\n 'volume_anchor_24h' => $tradingPairInfo['volume'] * $tradingPairInfo['price'],\n ];\n $res = $tickerModel->create($data);\n if (isset($res['code']) && isset($res['message'])) {\n echo sprintf(\"update ticker failed. Data: %s, Code: %s, Message: %s\\n\", json_encode($data), $res['code'], $res['message']);\n }\n }\n\n echo sprintf(\"Finish updating gopax ticker[%s]! Time: %s\\n\", $uniqueId, time());\n }", "public function ticker(string $symbol) : array;", "public function get_rates(){\n\n \n $endpoint = 'live';\n $access_key = '6b976c41ce198b8b5d28f7890bd447f9';\n // Initialize CURL:\n $ch = curl_init('http://apilayer.net/api/'.$endpoint.'?access_key='.$access_key.'');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Store the data:\n $json = curl_exec($ch);\n curl_close($ch);\n\n // Decode JSON response:\n $exchangeRates = json_decode($json, true);\n \n #calculate the inverse rates \n\n #calculate ZAR -> USD Rate \n $zar_usd = 1 / $exchangeRates['quotes']['USDZAR'];\n # ZAR -> GBP\n $gbp_usd = (1 / $exchangeRates['quotes']['USDGBP']);\n $zar_gdp = $zar_usd / $gbp_usd;\n #ZAR->EUR\n $eur_usd = (1 / $exchangeRates['quotes']['USDEUR']);\n $zar_eur = $zar_usd / $eur_usd;\n #ZAR->KES\n $kes_usd = (1 / $exchangeRates['quotes']['USDKES']);\n $zar_kes = $zar_usd / $kes_usd;\n\n \n $updated_rates = array(\n array(\n 'er_id' => 1 , // ZAR -> GBP\n 'er_rate' => $zar_gdp \n ),\n array(\n 'er_id' => 2 , // ZAR -> EUR\n 'er_rate' => $zar_eur\n ),\n array(\n 'er_id' => 3 , // ZAR -> EUR\n 'er_rate' => $zar_kes\n ),\n array(\n 'er_id' => 4 , // ZAR -> EUR\n 'er_rate' => $zar_usd\n )\n );\n \n #batch update db\n $this->ExchangeRate->update_rates($updated_rates);\n\n echo \"Your exchange rates have been successfully updated\";\n\n // else do some exception handling here\n }", "function getPrice ($api, $exchange, $pairSymbol) {\n if ($exchange=='binance') {\n $price = $api->price($pairSymbol);\n } elseif ($exchange=='kraken') {\n $price = $api->QueryPublic('Ticker', array('pair'=>$pairSymbol));\n \t$price = $price['result'][$pairSymbol]['c'][0];\n }\n return $price;\n}", "function getBuyBidStockTickers()\n{\n$mysql_server ='192.168.1.101';\n\n$mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n\n//make empty array to hold the Stock Tickers attached to Username\n$stackTickers = array();\n\n//find the items that are attached to username and requested Ticker\n$TickerQry = \"Select * from BuyBestBidOffer\";\n$TickerResult = $mysqli->query($TickerQry);\n\nif($TickerResult->num_rows > 0){\n while ($row = $TickerResult->fetch_assoc()){\n\n if(!in_array($row['stockSymbol'], $stackTickers)){\n array_push($stackTickers, $row['stockSymbol']);\n }\n\n }\n}\n\n$SQLresultObj = array('Stocks' => $stackTickers);\n\nvar_dump($SQLresultObj);\nreturn($SQLresultObj);\n\n}", "function getCoinTrackingBuysForUser($accountID, $dataImportEventRecordID, $cryptoCurrencyTypesImported, $userEncryptionKey, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t$responseObject \t\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t\n\t\t$transactionTypeID\t\t\t\t\t\t\t\t\t\t\t\t\t= 1; // These are all buy records for now\n\t\t$transactionTypeLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Buy\";\n\t\t$displayTransactionTypeLabel\t\t\t\t\t\t\t\t\t\t= \"Bought\";\n\t\t$transactionSourceID\t\t\t\t\t\t\t\t\t\t\t\t= 20;\n\t\t$transactionSourceLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"CoinTracking\";\n\t\t$importTypeID\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 16;\n\t\t$authorID\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$isDebit\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$isDisabled\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$feeAmountInUSD\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$feeAmountInBaseCurrency\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$realizedReturnInUSD\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$sentCostBasisInUSD\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$receivedCostBasisInUSD\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$transactionStatusID\t\t\t\t\t\t\t\t\t\t\t\t= 1;\n\t\t$transactionStatusLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Completed\";\n\t\t\n\t\t$providerNotes\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"\";\n\t\t\n\t\t$creationDate\t\t\t\t\t\t\t\t\t\t\t\t\t \t= $globalCurrentDate;\n\t\t\n\t\t$quoteCurrencyID\t\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$quoteCurrency\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"USD\";\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getCoinTrackingRecords\t\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT\n\ttransactions_FIFO_Universal.transactionRecordID,\n\ttransactions_FIFO_Universal.FK_ProviderAccountWalletID,\n\ttransactions_FIFO_Universal.transactionDate AS transactionTime,\n\tUNIX_TIMESTAMP(transactions_FIFO_Universal.transactionDate) AS transactionTimestamp,\n\ttransactions_FIFO_Universal.FK_LedgerEntryTypeID,\n\ttransactions_FIFO_Universal.FK_TransactionTypeID AS FK_EffectiveTypeID,\n\ttransactions_FIFO_Universal.FK_TransactionTypeID,\n\ttransactions_FIFO_Universal.FK_ReceivedCurrencyID AS FK_AssetTypeID,\n\ttransactions_FIFO_Universal.sentQuantity AS amount,\n\ttransactions_FIFO_Universal.isDebit,\n\t(transactions_FIFO_Universal.sentQuantity / transactions_FIFO_Universal.receivedQuantity) AS baseToQuoteCurrencySpotPrice,\n\t(transactions_FIFO_Universal.sentQuantity / transactions_FIFO_Universal.receivedQuantity) AS baseToUSDCurrencySpotPrice,\n\ttransactions_FIFO_Universal.FK_ReceivedWalletID AS FK_BaseCurrencyWalletID,\n\ttransactions_FIFO_Universal.FK_SentWalletID AS FK_QuoteCurrencyWalletID,\n\ttransactions_FIFO_Universal.receivedQuantity,\n\ttransactions_FIFO_Universal.sentQuantity,\n\ttransactions_FIFO_Universal.isDisabled,\n\ttransactions_FIFO_Universal.FK_TransactionSourceID,\n\t20 AS FK_ExchangeID,\n\ttransactions_FIFO_Universal.FK_ReceivedCurrencyID,\n\ttransactions_FIFO_Universal.receivedCurrency,\n\ttransactions_FIFO_Universal.FK_SentCurrencyID,\n\ttransactions_FIFO_Universal.sentCurrency,\n\ttransactions_FIFO_Universal.FK_ReceivedWalletID,\n\ttransactions_FIFO_Universal.FK_SentWalletID,\n\ttransactions_FIFO_Universal.realizedReturnInUSD,\n\ttransactions_FIFO_Universal.sentCostBasisInUSD,\n\ttransactions_FIFO_Universal.receivedCostBasisInUSD,\n\ttransactions_FIFO_Universal.receivedWalletType,\n\ttransactions_FIFO_Universal.receivedWallet,\n\ttransactions_FIFO_Universal.sentWalletType,\n\ttransactions_FIFO_Universal.sentWallet,\n\ttransactions_FIFO_Universal.FK_ReceivedTransactionSourceID,\t\n\ttransactions_FIFO_Universal.FK_SentTransactionSourceID\nFROM\n\ttransactions_FIFO_Universal\nWHERE\n\ttransactions_FIFO_Universal.FK_TransactionTypeID = 1\nORDER BY\n\tUNIX_TIMESTAMP(transactions_FIFO_Universal.transactionDate)\");\n\t\n\t\t\t$insertCoinTrackingRecords\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"INSERT INTO CoinTrackingLedgerTransaction\n(\n\ttransactionRecordID,\n\tFK_GlobalTransactionRecordID,\n\tFK_AccountID,\n\tFK_ProviderAccountWalletID,\n\ttransactionTime,\n\ttransactionTimestamp,\n\tFK_EffectiveTypeID,\n\tFK_TransactionTypeID,\n\tFK_AssetTypeID,\n\tamount,\n\tisDebit,\n\tbaseToQuoteCurrencySpotPrice,\n\tbaseToUSDCurrencySpotPrice,\n\tbtcSpotPriceAtTimeOfTransaction,\n\tFK_BaseCurrencyWalletID,\n\tFK_QuoteCurrencyWalletID,\n\treceivedQuantity,\n\tsentQuantity,\n\tFK_TransactionSourceID,\n\tFK_ExchangeID,\n\tFK_ReceivedCurrencyID,\n\treceivedCurrencyAbbreviation,\n\tFK_SentCurrencyID,\n\tsentCurrencyAbbreviation,\n\tFK_ReceivedWalletID,\n\tFK_SentWalletID,\n\treceivedWalletType,\n\treceivedWallet,\n\tsentWalletType,\n\tsentWallet\n)\nVALUES\n(\n\t:transactionRecordID,\n\t:FK_GlobalTransactionRecordID,\n\t:FK_AccountID,\n\t:FK_ProviderAccountWalletID,\n\t:transactionTime,\n\t:transactionTimestamp,\n\t:FK_EffectiveTypeID,\n\t:FK_TransactionTypeID,\n\t:FK_AssetTypeID,\n\t:amount,\n\t:isDebit,\n\t:baseToQuoteCurrencySpotPrice,\n\t:baseToUSDCurrencySpotPrice,\n\t:btcSpotPriceAtTimeOfTransaction,\n\t:FK_BaseCurrencyWalletID,\n\t:FK_QuoteCurrencyWalletID,\n\t:receivedQuantity,\n\t:sentQuantity,\n\t:FK_TransactionSourceID,\n\t:FK_ExchangeID,\n\t:FK_ReceivedCurrencyID,\n\t:receivedCurrencyAbbreviation,\n\t:FK_SentCurrencyID,\n\t:sentCurrencyAbbreviation,\n\t:FK_ReceivedWalletID,\n\t:FK_SentWalletID,\n\t:receivedWalletType,\n\t:receivedWallet,\n\t:sentWalletType,\n\t:sentWallet\n)\");\n\t\n\t\t\tif ($getCoinTrackingRecords -> execute() && $getCoinTrackingRecords -> rowCount() > 0)\n\t\t\t{\n\t\t\t\terrorLog(\"began get cointracking buy transaction records \".$getCoinTrackingRecords -> rowCount() > 0);\n\t\t\t\t\n\t\t\t\twhile ($row = $getCoinTrackingRecords -> fetchObject())\n\t\t\t\t{\n\t\t\t\t\t$transactionRecordID\t\t\t\t\t\t\t\t\t= $row -> transactionRecordID;\n\t\t\t\t\t$FK_ProviderAccountWalletID\t\t\t\t\t\t\t\t= $row -> FK_ProviderAccountWalletID;\n\t\t\t\t\t$transactionTime\t\t\t\t\t\t\t\t\t\t= $row -> transactionTime;\n\t\t\t\t\t$transactionTimestamp\t\t\t\t\t\t\t\t\t= $row -> transactionTimestamp;\n\t\t\t\t\t$FK_LedgerEntryTypeID\t\t\t\t\t\t\t\t\t= $row -> FK_LedgerEntryTypeID;\n\t\t\t\t\t$FK_EffectiveTypeID\t\t\t\t\t\t\t\t\t\t= $row -> FK_EffectiveTypeID;\n\t\t\t\t\t$FK_TransactionTypeID\t\t\t\t\t\t\t\t\t= $row -> FK_TransactionTypeID;\n\t\t\t\t\t$FK_AssetTypeID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_AssetTypeID;\n\t\t\t\t\t$amount\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> amount;\n\t\t\t\t\t$baseToQuoteCurrencySpotPrice\t\t\t\t\t\t\t= $row -> baseToQuoteCurrencySpotPrice;\t\t\t\t\t\t\t\n\t\t\t\t\t$baseToUSDCurrencySpotPrice\t\t\t\t\t\t\t\t= $row -> baseToUSDCurrencySpotPrice;\n\t\t\t\t\t\n\t\t\t\t\t$FK_BaseCurrencyWalletID\t\t\t\t\t\t\t\t= $row -> FK_BaseCurrencyWalletID;\n\t\t\t\t\t$FK_QuoteCurrencyWalletID\t\t\t\t\t\t\t\t= $row -> FK_QuoteCurrencyWalletID;\n\t\t\t\t\t$receivedQuantity\t\t\t\t\t\t\t\t\t\t= $row -> receivedQuantity;\n\t\t\t\t\t$sentQuantity\t\t\t\t\t\t\t\t\t\t\t= $row -> sentQuantity;\n\t\t\t\t\t$FK_TransactionSourceID\t\t\t\t\t\t\t\t\t= $row -> FK_TransactionSourceID;\n\t\t\t\t\t$FK_ExchangeID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_ExchangeID;\n\t\t\t\t\t$FK_ReceivedCurrencyID\t\t\t\t\t\t\t\t\t= $row -> FK_ReceivedCurrencyID;\n\t\t\t\t\t$receivedCurrency\t\t\t\t\t\t\t\t\t\t= $row -> receivedCurrency;\n\t\t\t\t\t$FK_SentCurrencyID\t\t\t\t\t\t\t\t\t\t= $row -> FK_SentCurrencyID;\n\t\t\t\t\t$sentCurrency\t\t\t\t\t\t\t\t\t\t\t= $row -> sentCurrency;\n\t\t\t\t\t$FK_ReceivedWalletID\t\t\t\t\t\t\t\t\t= $row -> FK_ReceivedWalletID;\n\t\t\t\t\t$FK_SentWalletID\t\t\t\t\t\t\t\t\t\t= $row -> FK_SentWalletID;\n\t\t\t\t\t$receivedWalletType\t\t\t\t\t\t\t\t\t\t= $row -> receivedWalletType;\n\t\t\t\t\t$receivedWallet\t\t\t\t\t\t\t\t\t\t\t= $row -> receivedWallet;\n\t\t\t\t\t$sentWalletType\t\t\t\t\t\t\t\t\t\t\t= $row -> sentWalletType;\n\t\t\t\t\t$sentWallet \t\t\t\t\t\t\t\t\t\t\t= $row -> sentWallet;\n\t\t\t\t\t$FK_ReceivedTransactionSourceID\t\t\t\t\t\t\t= $row -> FK_ReceivedTransactionSourceID;\n\t\t\t\t\t$FK_SentTransactionSourceID\t\t\t\t\t\t\t\t= $row -> FK_SentTransactionSourceID;\n\n\t\t\t\t\tif (isset($cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$currentCount\t\t\t\t\t\t\t\t\t\t= $cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID];\n\t\t\t\t\t\t$currentCount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]\t= $currentCount;\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$cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]\t= 1;\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// create asset type status record for this data import event record ID\n\t\t\t\t\tcreateDataImportAssetStatusRecord($accountID, $userEncryptionKey, $dataImportEventRecordID, $FK_AssetTypeID, $quoteCurrencyID, $globalCurrentDate, $sid, $dbh);\n\n\t\t\t\t\t$transactionAmountInUSD\t\t\t\t\t\t\t\t\t= $amount;\n\t\t\t\t\t$transactionAmountMinusFeeInUSD\t\t\t\t\t\t\t= $amount;\n\n\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t\t= 0;\n\n\t\t\t\t\t$nativeTransactionIDValue\t\t\t\t\t\t\t\t= md5(\"$transactionSourceID $transactionTimestamp $FK_TransactionTypeID $FK_ReceivedCurrencyID $FK_SentCurrencyID $receivedWalletType $sentWalletType $amount $sentQuantity $receivedCurrency\".md5(\"$sentQuantity.$transactionTime.$accountID\"));\n\n\t\t\t\t\t$profitStanceTransactionIDValue\t\t\t\t\t\t\t= createProfitStanceTransactionIDValue($accountID, $FK_AssetTypeID, $transactionSourceID, $nativeTransactionIDValue, $globalCurrentDate, $sid);\n\n\t\t\t\t\t$globalTransactionCreationResults\t\t\t\t\t\t= createGlobalTransactionIdentificationRecordWithProfitStanceTransactionIDValue($accountID, $FK_AssetTypeID, $dataImportEventRecordID, $nativeTransactionIDValue, $profitStanceTransactionIDValue, $transactionSourceID, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\t\n\t\t\t\t\tif ($globalTransactionCreationResults['createdGlobalTransactionIdentificationRecord'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t= $globalTransactionCreationResults['globalTransactionIdentificationRecordID'];\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t\t= 0;\n\t\t\t\t\t\n\t\t\t\t\tif ($FK_ReceivedCurrencyID == 1 && $FK_SentCurrencyID == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t= $baseToUSDCurrencySpotPrice;\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$cascadeRetrieveSpotPriceResponseObject\t\t\t\t= getSpotPriceForAssetPairUsingSourceCascade(1, 2, $transactionTime, 14, \"CoinGecko price by date\", $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($cascadeRetrieveSpotPriceResponseObject['foundSpotPrice'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t= $cascadeRetrieveSpotPriceResponseObject['spotPrice'];\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$unspentTransactionTotal\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t\n\t\t\t\t\tif ($isDebit == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$unspentTransactionTotal \t\t\t\t\t\t\t= $amount;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($isDebit == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t= $amount;\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$sourceWallet\t\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t$destinationWallet\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t\n\t\t\t\t\t$sourceWalletResponseObject\t\t\t\t\t\t\t\t= $sourceWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $FK_SentWalletID, $userEncryptionKey, $dbh);\n\t\t\t\n\t\t\t\t\tif ($sourceWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"could not instantiate crypto wallet $accountID, $FK_SentWalletID, $userEncryptionKey\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$destinationWalletResponseObject\t\t\t\t\t\t= $destinationWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $FK_ReceivedWalletID, $userEncryptionKey, $dbh);\n\t\t\t\n\t\t\t\t\tif ($destinationWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"could not instantiate crypto wallet $accountID, $FK_ReceivedWalletID, $userEncryptionKey\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\terrorLog(\"INSERT INTO CoinTrackingLedgerTransaction\n(\n\ttransactionRecordID,\n\tFK_GlobalTransactionRecordID,\n\tFK_AccountID,\n\tFK_ProviderAccountWalletID,\n\ttransactionTime,\n\ttransactionTimestamp,\n\tFK_EffectiveTypeID,\n\tFK_TransactionTypeID,\n\tFK_AssetTypeID,\n\tamount,\n\tisDebit,\n\tbaseToQuoteCurrencySpotPrice,\n\tbaseToUSDCurrencySpotPrice,\n\tbtcSpotPriceAtTimeOfTransaction,\n\tFK_BaseCurrencyWalletID,\n\tFK_QuoteCurrencyWalletID,\n\treceivedQuantity,\n\tsentQuantity,\n\tFK_TransactionSourceID,\n\tFK_ExchangeID,\n\tFK_ReceivedCurrencyID,\n\treceivedCurrencyAbbreviation,\n\tFK_SentCurrencyID,\n\tsentCurrencyAbbreviation,\n\tFK_ReceivedWalletID,\n\tFK_SentWalletID,\n\treceivedWalletType,\n\treceivedWallet,\n\tsentWalletType,\n\tsentWallet\n)\nVALUES\n(\n\t$transactionRecordID,\n\t$globalTransactionIdentificationRecordID,\n\t$accountID,\n\t$FK_ProviderAccountWalletID,\n\t'$transactionTime',\n\t$transactionTimestamp,\n\t$FK_EffectiveTypeID,\n\t$FK_TransactionTypeID,\n\t$FK_AssetTypeID,\n\t$amount,\n\t$isDebit,\n\t$baseToQuoteCurrencySpotPrice,\n\t$baseToUSDCurrencySpotPrice,\n\t$btcSpotPriceAtTimeOfTransaction,\n\t$FK_BaseCurrencyWalletID,\n\t$FK_QuoteCurrencyWalletID,\n\t$receivedQuantity,\n\t$sentQuantity,\n\t$transactionSourceID,\n\t$FK_ExchangeID,\n\t$FK_ReceivedCurrencyID,\n\t'$receivedCurrency',\n\t$FK_SentCurrencyID,\n\t'$sentCurrency',\n\t$FK_ReceivedWalletID,\n\t$FK_SentWalletID,\n\t'$receivedWalletType',\n\t'$receivedWallet',\n\t'$sentWalletType',\n\t'$sentWallet'\n)\");\n\t\t\t\t\t\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionRecordID', $transactionRecordID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_GlobalTransactionRecordID', $globalTransactionIdentificationRecordID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_AccountID', $accountID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ProviderAccountWalletID', $FK_ProviderAccountWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionTime', $transactionTime);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionTimestamp', $transactionTimestamp);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_EffectiveTypeID', $FK_EffectiveTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_TransactionTypeID', $FK_TransactionTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_AssetTypeID', $FK_AssetTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':amount', $amount);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':isDebit', $isDebit);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':baseToQuoteCurrencySpotPrice', $baseToQuoteCurrencySpotPrice);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':baseToUSDCurrencySpotPrice', $baseToUSDCurrencySpotPrice);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':btcSpotPriceAtTimeOfTransaction', $btcSpotPriceAtTimeOfTransaction);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_BaseCurrencyWalletID', $FK_BaseCurrencyWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_QuoteCurrencyWalletID', $FK_QuoteCurrencyWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedQuantity', $receivedQuantity);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentQuantity', $sentQuantity);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_TransactionSourceID', $transactionSourceID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ExchangeID', $FK_ExchangeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ReceivedCurrencyID', $FK_ReceivedCurrencyID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedCurrencyAbbreviation', $receivedCurrency);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_SentCurrencyID', $FK_SentCurrencyID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentCurrencyAbbreviation', $sentCurrency);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ReceivedWalletID', $FK_ReceivedWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_SentWalletID', $FK_SentWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedWalletType', $receivedWalletType);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedWallet', $receivedWallet);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentWalletType', $sentWalletType);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentWallet', $sentWallet);\n\n\t\t\t\t\t\n\n\t\t\t\t\t$nativeRecordID\t\t\t\t\t\t\t\t\t\t\t= 0;\n\n\t\t\t\t\tif ($insertCoinTrackingRecords -> execute())\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"insert coin tracking record worked\", $GLOBALS['debugCoreFunctionality']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nativeRecordID \t\t\t\t\t\t\t\t\t= $dbh -> lastInsertId();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$cryptoTransaction\t\t\t\t\t\t\t\t\t\t= new CryptoTransaction();\n\t\t\t\t\t\n\t\t\t\t\t$cryptoTransaction -> setData(0, $accountID, $authorID, $globalTransactionIdentificationRecordID, $FK_TransactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $FK_AssetTypeID, $receivedCurrency, $quoteCurrencyID, $quoteCurrency, $FK_SentWalletID, $FK_ReceivedWalletID, $transactionTime, $transactionTime, $transactionTimestamp, $nativeRecordID, $nativeRecordID, $receivedQuantity, $amount, $baseToQuoteCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountInUSD, $feeAmountInBaseCurrency, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid);\n\t\t\t\t\t\n\t\t\t\t\t$writeToDatabaseResponse\t\t\t\t\t\t\t\t= $cryptoTransaction -> writeToDatabase($userEncryptionKey, $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\tif ($writeToDatabaseResponse['wroteToDatabase'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$transactionID\t\t\t\t\t\t\t\t\t\t= $cryptoTransaction -> getTransactionID();\n\t\t\t\t\t\n\t\t\t\t\t\terrorLog(\"transaction $transactionID created\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$profitStanceLedgerEntry\t\t\t\t\t\t\t= new ProfitStanceLedgerEntry();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$profitStanceLedgerEntry -> setData($accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $exchangeTileID, $globalTransactionIdentificationRecordID, $transactionTime, $receivedQuantity, $dbh);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$writeProfitStanceLedgerEntryRecordResponseObject\t= $profitStanceLedgerEntry -> writeToDatabase($dbh);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($writeProfitStanceLedgerEntryRecordResponseObject['wroteToDatabase'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"wrote profitStance ledger entry $accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $globalTransactionIdentificationRecordID, $receivedQuantity to the database.\", $GLOBALS['debugCoreFunctionality']);\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\terrorLog(\"could not write profitStance ledger entry $accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $globalTransactionIdentificationRecordID, $receivedQuantity to the database.\", $GLOBALS['criticalErrors']);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= true;\n\t\t}\n\t\tcatch (PDOException $e) \n\t\t{\n\t\t\t$cryptoTransaction \t\t\t\t\t\t\t\t\t\t\t\t= null;\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= false;\n\t\t\t\n\t\t\terrorLog($e -> getMessage());\n\t\t\n\t\t\tdie();\n\t\t}\n\n return $cryptoCurrencyTypesImported;\n }", "function calculateEURLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $eurusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $eurusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function getPortfolioStockTickers($username)\n{\n$mysql_server = '192.168.1.101';\n\n$mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n\n//make empty array to hold the Stock Tickers attached to Username\n$stackTickers = array();\n\n//find the items that are attached to username and requested Ticker\n$TickerQry = \"Select * from portfolio where username='$username'\";\n$TickerResult = $mysqli->query($TickerQry);\n\nif($TickerResult->num_rows > 0){\n while ($row = $TickerResult->fetch_assoc()){\n\n if(!array_search($row['stockSymbol'], $stackTickers)){\n array_push($stackTickers, $row['stockSymbol']);\n }\n\n }\n}\n\n$SQLresultObj = array('Stocks' => $stackTickers);\n\n//var_dump($SQLresultObj);\nreturn($SQLresultObj);\n\n}", "function updateMain ($api, $unixTime, $folioArray, $moduleName, $interval, $quickExt) {\n\t$pairCount = count($folioArray)-2; // last entry is USD\n\n\t$intervalSec = $interval*60;\n\t$intervalSec2 = $intervalSec*2;\n\n\t$date = date('Y-m-d', $unixTime);\n\n\t$since = $unixTime-5400;\n\n\t$compareTime = $unixTime-$intervalSec;\n\n\tif ($quickExt['updateTime']<$compareTime) { //check total update status\n\t\t$pairsUpdated = $quickExt['pairIndex'];\n\t\t$updateTime = 0;\n\n\t\tif ($pairsUpdated+2>=$pairCount) {\n\t\t\t$updateTarget = $pairCount;\n\t\t} else {\n\t\t\t$updateTarget = $pairsUpdated+2;\n\t\t}\n\n\t\tfor ($i=$pairsUpdated; $i<=$updateTarget; $i++) { //for every pair, check time of latest indic row\n\t\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\t\tprint ('mew');\n\t\t\t}\n\t\t\t$currentUpdate = 0;\n\n\t\t\t$pairName = $folioArray[$i]['pairSymbol'];\n\t\t\t$currentFile = $moduleName.'-'.$pairName.'-';\n\n\t\t\t$filepath = 'indic/' . $currentFile . 'emaSet.json';\n\t\t\t$emaSet = file_get_contents($filepath);\n\t\t\t$emaSet = json_decode($emaSet, true);\n\n\t\t\t$compareTime = $unixTime-$intervalSec2;\n\t\t\tif ($emaSet[count($emaSet)-1]['time']>=$compareTime){\n\t\t\t\t$pairsUpdated +=1;\n\t\t\t\t$currentUpdate = 1;\n\t\t\t\t$quickExt['pairIndex'] = $pairsUpdated;\n\t\t\t\t$updateTime = $emaSet[count($emaSet)-1]['time'];\n\t\t\t\tprint_r ($pairName.'-update not needed<br>');\n\t\t\t}\n\t\t\tif ($currentUpdate==0){ // If current pair isn't update, run update functions\n\t\t\t\t$updateTime = updateFunctions ($api, $folioArray, $i, $interval, $date, $since, $unixTime, $intervalSec, $moduleName);\n\t\t\t\tif ($updateTime!=null) {\n\t\t\t\t\t$pairsUpdated +=1;\n\t\t\t\t\t$quickExt['pairIndex'] = $pairsUpdated;\n\n\t\t\t\t\t$filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index\n\t\t\t\t\tfile_put_contents($filepath, json_encode($quickExt));\n\t\t\t\t\tprint ('updateRan ');\n\t\t\t\t} else {\n\t\t\t\t\texit ('error');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset ($emaSet);\n\t\t\tif (is_int($i/3)){\n\t\t\t\tusleep(330000); // sleep for 1/3 of a second\n\t\t\t}\n\t\t}\n\t}\n\tif ($quickExt['pairIndex']==$pairCount+1){\n\t\t$quickExt['updateTime'] = $updateTime;\n\t\t$quickExt['pairIndex'] = 0;\n\t\tprint ('<br>'.$quickExt['updateTime'].'..'.$pairsUpdated.'..</br>');\n\n\t\t$filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index\n\t\tfile_put_contents($filepath, json_encode($quickExt));\n\t}\n\n}", "function stock_array() {\n\t\t$row = 0;\n\t\t$stock_array = array();\n\t\t\t\t\n\t\tif ($handle = fopen(STOCK_CSV, \"r\")) {\n\t\t\t while ($data = fgetcsv($handle, 1000, \",\")) {\n\t\t\t\t$new_tick = array();\n\t\t\t\tif ($row != 0) {\n\t\t\t\t\t$new_tick['ticker'] = $data[0];\n\t\t\t\t\t$new_tick['name'] = $data[1];\n\t\t\t\t\t$new_tick['exchange'] = $data[2];\n\t\t\t\t\t\n\t\t\t\t\tarray_push($stock_array, $new_tick);\n\t\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t }\n\t\t\t fclose($handle);\n\t\t\t}\n\t\telse {\n\t\t\techo \"Could not open file\";\n\t\t\t}\n\t\treturn $stock_array;\n\t}", "function calculateEverything($symbolSpecificData,$noOfDays){\n $calculationResults = array();\n $closingPrices = array();\n $volumes = array();\n $candleHeight = array();\n $candleBody = array();\n $change=array();\n $percentageChange=array();\n $closingPrices20 = array();\n $count=0;\n for($i=1;$i<sizeof($symbolSpecificData);$i++){\n $prevclose=$symbolSpecificData[$i-1]['close'];\n $closingPrices[] = $symbolSpecificData[$i]['close'];\n $volumes[] = $symbolSpecificData[$i]['volume'];\n $candleBodies[] = abs($symbolSpecificData[$i]['close']-$symbolSpecificData[$i]['open']);\n $candleHeights[] =abs($symbolSpecificData[$i]['high']-$symbolSpecificData[$i]['low']);\n $candleType = getCandleType($symbolSpecificData[$i]['open'],$symbolSpecificData[$i]['high'],$symbolSpecificData[$i]['low'],$symbolSpecificData[$i]['close']);\n $change = round($symbolSpecificData[$i]['close']-$prevclose,2);\n $changePercent=calculateChangePercent($symbolSpecificData[$i]['close'],$prevclose);\n if($i>=50){\n $ma20= calculateAverage(array_slice($closingPrices, -20));\n $ma50= calculateAverage(array_slice($closingPrices, -50));\n $avgVol= calculateAverage(array_slice($volumes, -50));\n $avgCandleBody=calculateAverage(array_slice($candleBodies, -50));\n $avgCandleHeight=calculateAverage(array_slice($candleHeights, -50));\n $calculationResults[] = createCalculationsArray($symbolSpecificData[$i]['symbol'],$symbolSpecificData[$i]['recorddate'],$symbolSpecificData[$i]['open'],$symbolSpecificData[$i]['high'],$symbolSpecificData[$i]['low'],$symbolSpecificData[$i]['close'],$prevclose,$symbolSpecificData[$i]['volume'],$candleBodies[$i-1],$candleHeights[$i-1],$candleType,$change,$changePercent,$avgVol,$ma20,$ma50,$avgCandleBody,$avgCandleHeight);\n }\n }\n return $calculationResults;\n}", "function getCryptoDailyPricesForCryptoAndFiatWithDateRangeWithAutoAmountForIdenticalPairMembers($cryptoCurrency, $cryptoCurrencyAssetTypeID, $fiatCurrency, $fiatCurrencyAssetTypeID, $testDate, $endingDate, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\terrorLog(\"getCryptoDailyPricesForCryptoAndFiatWithDateRangeWithAutoAmountForIdenticalPairMembers($cryptoCurrency, $cryptoCurrencyAssetTypeID, $fiatCurrency, $fiatCurrencyAssetTypeID, $testDate, $endingDate, $globalCurrentDate, $sid\", $GLOBALS['debugCoreFunctionality']);\n\t\t\n\t\t$responseObject\t\t\t\t\t\t\t\t\t= array();\n\t\t$responseObject['pulledData']\t\t\t\t\t= false;\n\t\t\n/*\n\t\tif ($cryptoCurrencyAssetTypeID == 0 || $fiatCurrencyAssetTypeID == 0)\n\t\t{\n\t\t\terrorLog(\"ERROR: one or more assets is type 0: $cryptoCurrency, $cryptoCurrencyAssetTypeID, $fiatCurrency, $fiatCurrencyAssetTypeID\");\n\t\t\treturn $responseObject;\t\n\t\t}\n*/\n\t\t\n\t\ttry\n \t{\n\t\t\t$createDailyCryptoPriceRecord\t\t\t\t= $dbh->prepare(\"REPLACE DailyCryptoSpotPrices\n(\n\tFK_CryptoAssetID,\n\tFK_FiatCurrencyAssetID,\n\tpriceDate,\n\tfiatCurrencySpotPrice\n)\nVALUES\n(\n\t:FK_CryptoAssetID,\n\t:FK_FiatCurrencyAssetID,\n\t:priceDate,\n\t:fiatCurrencySpotPrice\n)\");\n\n\t\t\twhile ($testDate < $endingDate)\n\t\t\t{\n\t\t\t\t$formattedTestDate\t\t\t\t\t\t= date_format($testDate, \"Y-m-d\");\n\t\t\t\t\n\t\t\t\terrorLog($formattedTestDate);\n\t\t\t\t\n\t\t\t\terrorLog(\"https://api.coinbase.com/v2/prices/$cryptoCurrency-$fiatCurrency/spot?date=$formattedTestDate\");\n\t\t\t\t\n\t\t\t\tif ($cryptoCurrencyAssetTypeID == $fiatCurrencyAssetTypeID)\n\t\t\t\t{\n\t\t\t\t\t$responseObject['pulledData']\t\t= true;\n\t\t\t\t\t\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':FK_CryptoAssetID', $cryptoCurrencyAssetTypeID);\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':FK_FiatCurrencyAssetID', $fiatCurrencyAssetTypeID);\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':priceDate', $formattedTestDate);\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':fiatCurrencySpotPrice', 1);\n\t\t\t\t\t\t\n\t\t\t\t\tif ($createDailyCryptoPriceRecord -> execute())\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"REPLACE DailyCryptoSpotPrices\n\t(\n\t\tFK_CryptoAssetID,\n\t\tFK_FiatCurrencyAssetID,\n\t\tpriceDate,\n\t\tfiatCurrencySpotPrice\n\t)\n\tVALUES\n\t(\n\t\t$cryptoCurrencyAssetTypeID,\n\t\t$fiatCurrencyAssetTypeID,\n\t\t'$priceDate',\n\t\t$amount\n\t)\");\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ch \t\t\t\t\t\t\t\t\t= curl_init();\n\t\t\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://api.coinbase.com/v2/prices/$cryptoCurrency-$fiatCurrency/spot?date=$formattedTestDate\");\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\t\n\t\t\t\t\t$headers \t\t\t\t\t\t\t= array();\n\t\t\t\t\t$headers[] \t\t\t\t\t\t\t= \"Content-Type: application/x-www-form-urlencoded\";\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t\t\t\n\t\t\t\t\t$result \t\t\t\t\t\t\t\t= curl_exec($ch);\n\t\t\t\t\t\n\t\t\t\t\tif (curl_errno($ch)) \n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog('Error:' . curl_error($ch));\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$responseObject['pulledData']\t= true;\n\t\t\t\t\t\terrorLog($result);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcurl_close ($ch);\n\t\t\t\t\t\n\t\t\t\t\t# Get JSON as a string, return empty JSON if nothing returned\n\t\t\t\t\t$jsonObject\t\t\t\t\t\t\t= json_decode($result);\t\n\t\t\t\t\t\n\t\t\t\t\tcleanJSONDailyPriceData($jsonObject, \"data\", $formattedTestDate, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$testDate -> modify('+1 day');\n\t\t\t}\n\t\n\t \t}\n\t \tcatch (Exception $e)\n\t \t{\n\t\t errorLog(\"ERROR: $name not found in JSON object\");\t\n\t \t}\n\t\t\n\t\treturn $responseObject;\t\n\t}", "function installIndicCaller ($api, $unixTime, $pairSymbol, $moduleName, $interval) {\n\t$days = 30;\n\t$since = $unixTime-(60*60*24*$days);\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairSymbol, $interval, $since);\n\n\tif (is_array($ohlc)) {\n\n\t\t$currentFile=$moduleName.'-'.$pairSymbol.'-';\n\t\t$output = installIndicR($currentFile, $ohlc);\n\n\t\tif ($output!=null) {\n\t\t\tprint_r ($pairSymbol.' '.$output. ' installed<br>');\n\t\t}\n\t} else {\n\t\texit ('not array');\n\t}\n\treturn $output;\n}", "public function getTickerPrice($symbol = NULL);", "public function getHistoricalHourlyExchangeVolume($options = [])\n {\n return $this->send(\n $this->endpoint.\"/exchange/histohour\",\n 'GET',\n ['query' => array_merge($this->getEndpointConfiguration(), $options)]\n );\n }", "function getCryptoLivePrice(){\n \n //$url = \"https://api.coinmarketcap.com/v1/ticker/ethereum/\";\n $url = \"https://api.coinmarketcap.com/v2/ticker/?limit=10&structure=array\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 60);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n $data = curl_exec($ch);\n $transaction = json_decode($data, TRUE);\n curl_close($ch);\n \n //BTC\n $btcUsdPrice = 0;\n $cryptoSymbol_1 = isset($transaction['data'][0]['symbol'])?$transaction['data'][0]['symbol']:'';\n \n if($cryptoSymbol_1==\"BTC\"){\n $btcUsdPrice = isset($transaction['data'][0]['quotes']['USD']['price'])?$transaction['data'][0]['quotes']['USD']['price']:0;\n }\n //ETH\n $ethUsdPrice = 0;\n $cryptoSymbol_2 = isset($transaction['data'][1]['symbol'])?$transaction['data'][1]['symbol']:'';\n if($cryptoSymbol_2==\"ETH\"){\n $ethUsdPrice = isset($transaction['data'][1]['quotes']['USD']['price'])?$transaction['data'][1]['quotes']['USD']['price']:0;\n }\n //LTC\n $ltcUsdPrice = 0;\n $cryptoSymbol_3 = isset($transaction['data'][5]['symbol'])?$transaction['data'][5]['symbol']:'';\n if($cryptoSymbol_3==\"LTC\"){\n $ltcUsdPrice = isset($transaction['data'][5]['quotes']['USD']['price'])?$transaction['data'][5]['quotes']['USD']['price']:0;\n } \n \n return ['eth_price_usd'=>$ethUsdPrice,'btc_price_usd'=>$btcUsdPrice,'ltc_price_usd'=>$ltcUsdPrice];\n}", "function getOldOpenOrders($minutes)\n\t{\n\t\t$threshold_timestamp = time()-($minutes*60);\n\t\t$threshold_dt_tm = date(\"Y-m-d H:i:s\",$threshold_timestamp);\n\t\t$old_order_data['status'] = 'O';\n\t\t$old_order_data['created'] = array(\"<\"=>$threshold_dt_tm);\n\t\t$options[TONIC_FIND_BY_METADATA] = \t$old_order_data;\n\t\t$options[TONIC_JOIN_STATEMENT] = \" JOIN Merchant ON Orders.merchant_id = Merchant.merchant_id \";\n\t\t$options[TONIC_FIND_STATIC_FIELD] = \" Merchant.time_zone, Merchant.state \";\n\n\t\t$default_timezone_string = date_default_timezone_get();\n\n\t\t$old_order_resources = Resource::findAll($this,'',$options);\n\t\t$old_open_orders = array();\n\t\tforeach ($old_order_resources as $order_resource)\n\t\t{\n\t\t\tsetTheDefaultTimeZone($order_resource->time_zone,$order_resource->state);\n\t\t\t$pickup_timestamp = strtotime($order_resource->pickup_dt_tm);\n\t\t\tif ($pickup_timestamp < $threshold_timestamp)\n\t\t\t{\n\t\t\t\tmyerror_log(\"we have an open order that was scheduled to be picke up over $minutes minutes ago\");\n\t\t\t\t$old_open_orders[] = $order_resource;\n\t\t\t}\n\t\t}\n\t\tdate_default_timezone_set($default_timezone_string);\n\t\treturn $old_open_orders;\n\n\t}", "function calculateEURFX6($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURFX6 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $eurusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $eurusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "abstract public function getExchangeRate($fromCurrency, $toCurrency);", "function calculateNOKFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] NOKFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDNOK = $data['USDNOK']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdnok = $USDNOK[$i]['open'];\n $open = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdnok * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdnok = $USDNOK[$i]['close'];\n $close = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdnok * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function getLitecoinPrice()\r\n{\r\n\t // Fetch the current rate from MtGox\r\n\t$ch = curl_init('https://mtgox.com/api/0/data/ticker.php');\r\n\tcurl_setopt($ch, CURLOPT_REFERER, 'Mozilla/5.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');\r\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"CakeScript/0.1\");\r\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t$mtgoxjson = curl_exec($ch);\r\n\tcurl_close($ch);\r\n\r\n\t// Decode from an object to array\r\n\t$output_mtgox = json_decode($mtgoxjson);\r\n\t$output_mtgox_1 = get_object_vars($output_mtgox);\r\n\t$mtgox_array = get_object_vars($output_mtgox_1['ticker']);\r\n\r\n\techo '\r\n\t\t\t<ul>\r\n\t\t\t<li><strong>Last:</strong>&nbsp;&nbsp;', $mtgox_array['last'], '</li>\r\n\t\t\t<li><strong>High:</strong>&nbsp;', $mtgox_array['high'], '</li>\r\n\t\t\t<li><strong>Low:</strong>&nbsp;&nbsp;', $mtgox_array['low'], '</li>\r\n\t\t\t<li><strong>Avg:</strong>&nbsp;&nbsp;&nbsp;', $mtgox_array['avg'], '</li>\r\n\t\t\t<li><strong>Vol:</strong>&nbsp;&nbsp;&nbsp;&nbsp;', $mtgox_array['vol'], '</li>\r\n\t\t\t</ul>';\r\n}", "public function returnAllOpenOrders(): array\n {\n $openOrders = [];\n foreach ($this->request('returnOpenOrders', ['currencyPair' => 'all']) as $pair => $orders) {\n if (is_array($orders)) {\n foreach ($orders as $openOrder) {\n $openOrders[$pair][] = $this->factory(OpenOrder::class, $openOrder);\n }\n }\n }\n\n return $openOrders;\n }", "function updateRawcoins()\n{\n // debuglog(__FUNCTION__);\n\n exchange_set_default('alcurex', 'disabled', true);\n exchange_set_default('binance', 'disabled', true);\n exchange_set_default('empoex', 'disabled', true);\n exchange_set_default('coinbene', 'disabled', true);\n exchange_set_default('coinexchange', 'disabled', true);\n exchange_set_default('coinsmarkets', 'disabled', true);\n exchange_set_default('escodex', 'disabled', true);\n exchange_set_default('gateio', 'disabled', true);\n exchange_set_default('jubi', 'disabled', true);\n exchange_set_default('nova', 'disabled', true);\n exchange_set_default('stocksexchange', 'disabled', true);\n exchange_set_default('tradesatoshi', 'disabled', true);\n\n settings_prefetch_all();\n\n if (!exchange_get('bittrex', 'disabled')) {\n $list = bittrex_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bittrex'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bittrex', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bittrex', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('bitz', 'disabled')) {\n $list = bitz_api_query('tickerall');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bitz'\");\n foreach ($list as $c => $ticker) {\n $e = explode('_', $c);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('bitz', $symbol);\n }\n }\n }\n\n if (!exchange_get('bleutrade', 'disabled')) {\n $list = bleutrade_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bleutrade'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bleutrade', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bleutrade', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('coinbene', 'disabled')) {\n $data = coinbene_api_query('market/symbol');\n $list = objSafeVal($data, 'symbol');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinbene'\");\n foreach ($list as $ticker) {\n if ($ticker->quoteAsset != 'BTC')\n continue;\n $symbol = $ticker->baseAsset;\n updateRawCoin('coinbene', $symbol);\n }\n }\n }\n\n if (!exchange_get('crex24', 'disabled')) {\n $list = crex24_api_query('currencies');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='crex24'\");\n foreach ($list as $currency) {\n $symbol = objSafeVal($currency, 'symbol');\n $name = objSafeVal($currency, 'name');\n if ($currency->isFiat || $currency->isDelisted)\n continue;\n updateRawCoin('crex24', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('poloniex', 'disabled')) {\n $poloniex = new poloniex;\n $tickers = $poloniex->get_currencies();\n if (!$tickers)\n $tickers = array();\n else\n dborun(\"UPDATE markets SET deleted=true WHERE name='poloniex'\");\n foreach ($tickers as $symbol => $ticker) {\n if (arraySafeVal($ticker, 'disabled'))\n continue;\n if (arraySafeVal($ticker, 'delisted'))\n continue;\n updateRawCoin('poloniex', $symbol);\n }\n }\n\n if (!exchange_get('c-cex', 'disabled')) {\n $ccex = new CcexAPI;\n $list = $ccex->getPairs();\n if ($list) {\n sleep(1);\n $names = $ccex->getCoinNames();\n\n dborun(\"UPDATE markets SET deleted=true WHERE name='c-cex'\");\n foreach ($list as $item) {\n $e = explode('-', $item);\n $symbol = strtoupper($e[0]);\n\n updateRawCoin('c-cex', $symbol, arraySafeVal($names, $e[0], 'unknown'));\n }\n }\n }\n\n if (!exchange_get('yobit', 'disabled')) {\n $res = yobit_api_query('info');\n if ($res) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='yobit'\");\n foreach ($res->pairs as $i => $item) {\n $e = explode('_', $i);\n $symbol = strtoupper($e[0]);\n updateRawCoin('yobit', $symbol);\n }\n }\n }\n\n if (!exchange_get('coinexchange', 'disabled')) {\n $list = coinexchange_api_query('getmarkets');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinexchange'\");\n foreach ($list->result as $item) {\n if ($item->BaseCurrencyCode != 'BTC')\n continue;\n $symbol = $item->MarketAssetCode;\n $label = objSafeVal($item, 'MarketAssetName');\n updateRawCoin('coinexchange', $symbol, $label);\n }\n }\n }\n\n if (!exchange_get('coinsmarkets', 'disabled')) {\n $list = coinsmarkets_api_query('apicoin');\n if (!empty($list) && is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinsmarkets'\");\n foreach ($list as $pair => $data) {\n $e = explode('_', $pair);\n if ($e[0] != 'BTC')\n continue;\n $symbol = strtoupper($e[1]);\n updateRawCoin('coinsmarkets', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptopia', 'disabled')) {\n $list = cryptopia_api_query('GetMarkets');\n if (isset($list->Data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptopia'\");\n foreach ($list->Data as $item) {\n $e = explode('/', $item->Label);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptopia', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptobridge', 'disabled')) {\n $list = cryptobridge_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptobridge'\");\n foreach ($list as $ticker) {\n $e = explode('_', $ticker->id);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptobridge', $symbol);\n }\n }\n }\n\n if (!exchange_get('escodex', 'disabled')) {\n $list = escodex_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='escodex'\");\n foreach ($list as $ticker) {\n #debuglog (json_encode($ticker));\n if (strtoupper($ticker->base) !== 'BTC')\n continue;\n $symbol = strtoupper($ticker->quote);\n updateRawCoin('escodex', $symbol);\n }\n }\n }\n\n if (!exchange_get('hitbtc', 'disabled')) {\n $list = hitbtc_api_query('symbols');\n if (is_object($list) && isset($list->symbols) && is_array($list->symbols)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='hitbtc'\");\n foreach ($list->symbols as $data) {\n $base = strtoupper($data->currency);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($data->commodity);\n updateRawCoin('hitbtc', $symbol);\n }\n }\n }\n\n if (!exchange_get('kraken', 'disabled')) {\n $list = kraken_api_query('AssetPairs');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kraken'\");\n foreach ($list as $pair => $item) {\n $pairs = explode('-', $pair);\n $base = reset($pairs);\n $symbol = end($pairs);\n if ($symbol == 'BTC' || $base != 'BTC')\n continue;\n if (in_array($symbol, array(\n 'GBP',\n 'CAD',\n 'EUR',\n 'USD',\n 'JPY'\n )))\n continue;\n if (strpos($symbol, '.d') !== false)\n continue;\n $symbol = strtoupper($symbol);\n updateRawCoin('kraken', $symbol);\n }\n }\n }\n\n if (!exchange_get('alcurex', 'disabled')) {\n $list = alcurex_api_query('market', '?info=on');\n if (is_object($list) && isset($list->MARKETS)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='alcurex'\");\n foreach ($list->MARKETS as $item) {\n $e = explode('_', $item->Pair);\n $symbol = strtoupper($e[0]);\n updateRawCoin('alcurex', $symbol);\n }\n }\n }\n\n if (!exchange_get('binance', 'disabled')) {\n $list = binance_api_query('ticker/allBookTickers');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='binance'\");\n foreach ($list as $ticker) {\n $base = substr($ticker->symbol, -3, 3);\n // XXXBTC XXXETH BTCUSDT (no separator!)\n if ($base != 'BTC')\n continue;\n $symbol = substr($ticker->symbol, 0, strlen($ticker->symbol) - 3);\n updateRawCoin('binance', $symbol);\n }\n }\n }\n\n if (!exchange_get('gateio', 'disabled')) {\n $json = gateio_api_query('marketlist');\n $list = arraySafeVal($json, 'data');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='gateio'\");\n foreach ($list as $item) {\n if ($item['curr_b'] != 'BTC')\n continue;\n $symbol = trim(strtoupper($item['symbol']));\n $name = trim($item['name']);\n updateRawCoin('gateio', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('nova', 'disabled')) {\n $list = nova_api_query('markets');\n if (is_object($list) && !empty($list->markets)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='nova'\");\n foreach ($list->markets as $item) {\n if ($item->basecurrency != 'BTC')\n continue;\n $symbol = strtoupper($item->currency);\n updateRawCoin('nova', $symbol);\n //debuglog(\"nova: $symbol\");\n }\n }\n }\n\n if (!exchange_get('stocksexchange', 'disabled')) {\n $list = stocksexchange_api_query('markets');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='stocksexchange'\");\n foreach ($list as $item) {\n if ($item->partner != 'BTC')\n continue;\n if ($item->active == false)\n continue;\n $symbol = strtoupper($item->currency);\n $name = trim($item->currency_long);\n updateRawCoin('stocksexchange', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('empoex', 'disabled')) {\n $list = empoex_api_query('marketinfo');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='empoex'\");\n foreach ($list as $item) {\n $e = explode('-', $item->pairname);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('empoex', $symbol);\n }\n }\n }\n\n if (!exchange_get('kucoin', 'disabled')) {\n $list = kucoin_api_query('currencies');\n if (kucoin_result_valid($list) && !empty($list->data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kucoin'\");\n foreach ($list->data as $item) {\n $symbol = $item->name;\n $name = $item->fullName;\n updateRawCoin('kucoin', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('livecoin', 'disabled')) {\n $list = livecoin_api_query('exchange/ticker');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='livecoin'\");\n foreach ($list as $item) {\n $e = explode('/', $item->symbol);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('livecoin', $symbol);\n }\n }\n }\n\n if (!exchange_get('shapeshift', 'disabled')) {\n $list = shapeshift_api_query('getcoins');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='shapeshift'\");\n foreach ($list as $item) {\n $status = $item['status'];\n if ($status != 'available')\n continue;\n $symbol = strtoupper($item['symbol']);\n $name = trim($item['name']);\n updateRawCoin('shapeshift', $symbol, $name);\n //debuglog(\"shapeshift: $symbol $name\");\n }\n }\n }\n\n if (!exchange_get('tradesatoshi', 'disabled')) {\n $data = tradesatoshi_api_query('getcurrencies');\n if (is_object($data) && !empty($data->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='tradesatoshi'\");\n foreach ($data->result as $item) {\n $symbol = $item->currency;\n $name = trim($item->currencyLong);\n updateRawCoin('tradesatoshi', $symbol, $name);\n }\n }\n }\n\n //////////////////////////////////////////////////////////\n\n $markets = dbocolumn(\"SELECT DISTINCT name FROM markets\");\n foreach ($markets as $exchange) {\n if (exchange_get($exchange, 'disabled')) {\n $res = dborun(\"UPDATE markets SET disabled=8 WHERE name='$exchange'\");\n if (!$res)\n continue;\n $coins = getdbolist('db_coins', \"id IN (SELECT coinid FROM markets WHERE name='$exchange')\");\n foreach ($coins as $coin) {\n // allow to track a single market on a disabled exchange (dev test)\n if (market_get($exchange, $coin->getOfficialSymbol(), 'disabled', 1) == 0) {\n $res -= dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND coinid={$coin->id}\");\n }\n }\n debuglog(\"$exchange: $res markets disabled from db settings\");\n } else {\n $res = dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND disabled=8\");\n if ($res)\n debuglog(\"$exchange: $res markets re-enabled from db settings\");\n }\n }\n\n dborun(\"DELETE FROM markets WHERE deleted\");\n\n $list = getdbolist('db_coins', \"not enable and not installed and id not in (select distinct coinid from markets)\");\n foreach ($list as $coin) {\n if ($coin->visible)\n debuglog(\"{$coin->symbol} is no longer active\");\n // todo: proper cleanup in all tables (like \"yiimp coin SYM delete\")\n // if ($coin->symbol != 'BTC')\n // $coin->delete();\n }\n}", "public function getAllOrders($symbol = NULL, $orderId = NULL, $limit = NULL, $recvWindow = NULL);", "function calculateCADLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CADLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdcad * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdcad * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function returnOpenOrders(string $currencyPair): array\n {\n $this->throwExceptionIf($currencyPair === 'all', 'Please use TradingApi::returnAllOpenOrders() method');\n\n $openOrders = [];\n foreach ($this->request('returnOpenOrders', compact('currencyPair')) as $openOrder) {\n $openOrders[] = $this->factory(OpenOrder::class, $openOrder);\n }\n\n return $openOrders ?? [];\n }", "public function getOpen( $store, $dayInput ) {\n\t\t$result = false;\n\t\tforeach ( $this->getStoreOpenings( $store ) as $day => $openings ) {\n\t\t\tif( $day === $dayInput ) {\n\t\t\t\t$amount = count( $openings );\n\t\t\t\t$now = time();\n//\t\t\t\t$now = strtotime( '12:31' ); // debug\n\t\t\t\t// Has open today?\n\t\t\t\tif( $amount === 0 ) return $result;\n\t\t\t\tif ( $amount > 2 ) {\n\t\t\t\t\t// we have more than one open and close time\n\t\t\t\t\tif( $now >= strtotime( $openings[0] ) && $now <= strtotime( $openings[1] ) ) {\n\t\t\t\t\t\t$result = $openings[0] . ' - ' . $openings[1] . '<br />' . $openings[2] . ' - ' . $openings[3];\n\t\t\t\t\t} else if( $now >= strtotime( $openings[2] ) && $now <= strtotime( $openings[3] ) ) {\n\t\t\t\t\t\t$result = $openings[2] . ' - ' . $openings[3];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunset( $this->dataOut[ $store ] );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// only one open and close times\n\t\t\t\t\t// is now between open and close \n\t\t\t\t\tif( $now >= strtotime( $openings[0] ) && $now <= strtotime( $openings[1] ) ) {\n\t\t\t\t\t\t$result = $openings[0] . ' - ' . $openings[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunset( $this->dataOut[ $store ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // wrong day\n\t\t}\n\t\t// set new object data\n\t\tif( $result ) {\n\t\t\t$this->dataOut[ $store ] = $this->data[ $store ];\n\t\t\t$this->dataOut[ $store ]->geöffnet = $result;\n\t\t}\n\t\t$this->setTotal( count($this->dataOut) );\n\t\treturn $result;\n\t}", "function calculateEURFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $eurusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $eurusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getData($symbol = '', $stat = '')\n {\n \n if (is_array($this->symbol)) {\n $symbol = implode(\"+\", $this->symbol); //The Yahoo! API will take multiple symbols\n }\n \n if ($symbol)\n $this->_setParam('symbol', $symbol);\n if ($stat)\n $this->_setParam('stat', $stat);\n \n $data = $this->_request();\n \n if (!$this->history) {\n if ($this->stat === 'all') {\n foreach ($data as $item) {\n \n //Add to $return[$symbol] array. Indice 23 is the symbol.\n $return[$item[23]] = array(\n 'price' => strip_tags($item[0]),\n 'change' => strip_tags($item[1]),\n 'volume' => strip_tags($item[2]),\n 'avg_daily_volume' => strip_tags($item[3]),\n 'stock_exchange' => strip_tags($item[4]),\n 'market_cap' => strip_tags($item[5]),\n 'book_value' => strip_tags($item[6]),\n 'ebitda' => strip_tags($item[7]),\n 'dividend_per_share' => strip_tags($item[8]),\n 'dividend_yield' => strip_tags($item[9]),\n 'earnings_per_share' => strip_tags($item[10]),\n 'fiftytwo_week_high' => strip_tags($item[11]),\n 'fiftytwo_week_low' => strip_tags($item[12]),\n 'fiftyday_moving_avg' => strip_tags($item[13]),\n 'twohundredday_moving_avg' => strip_tags($item[14]),\n 'price_earnings_ratio' => strip_tags($item[15]),\n 'price_earnings_growth_ratio' => strip_tags($item[16]),\n 'price_sales_ratio' => strip_tags($item[17]),\n 'price_book_ratio' => strip_tags($item[18]),\n 'short_ratio' => strip_tags($item[19]),\n 'name' => strip_tags($item[20])\n );\n }\n } else {\n foreach ($data as $item)\n $return[] = array(\n $this->stat => $item\n );\n }\n } elseif (is_array($this->history)) {\n $return = $data;\n }\n \n return $return;\n }", "function calculateCHFLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CHFLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdchf * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdchf * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getHistoricalDailyExchangeVolume($options = [])\n {\n return $this->send(\n $this->endpoint.\"/exchange/histoday\",\n 'GET',\n ['query' => array_merge($this->getEndpointConfiguration(), $options)]\n );\n }", "public function getOpenOrders ($market = null)\n\t{\n\t\t$params = array ('market' => $market);\n\t\treturn $this->call ('market/getopenorders', $params, true);\n\t}", "function is_kicker($candles) {\n $decreases = $candles[0]->is_decrease();\n $consecutive = 0;\n for($i = 1; $i < 3; $i++) {\n if($candles[$i-1]->get_open() <= $candles[$i]->get_close())\n $consecutive++;\n $decreases += $candles[$i]->is_decrease();\n }\n echo \"Kicker pattern: $decreases decreases and $consecutive consecutive decreases\\n\";\n return $decreases == 3 && $consecutive == 2;\n }", "public function exchangeRate() {\n try{\n $client = new GuzzleHttp\\Client(['base_uri' => 'https://api.exchangeratesapi.io/']);\n // Latest endpoint \n $response = $client->request('GET', 'latest');\n $statusCode = $response->getStatusCode();\n if($statusCode == 200) {\n // Get body of the response and stringify\n $body = (string)$response->getBody();\n // Parse json to ApiResponse Object\n $apiResponse = new ApiResponse($body);\n // Print associative response to console\n print_r($apiResponse);\n }\n }catch(Exception $e){\n echo $e;\n }\n\n }", "function calculateJPYLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] JPYLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = 100 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdjpy * 1000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = 100 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdjpy * 1000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function lookup($symbol)\n {\n // reject symbols that start with ^\n if (preg_match(\"/^\\^/\", $symbol))\n {\n return false;\n }\n\n // reject symbols that contain commas\n if (preg_match(\"/,/\", $symbol))\n {\n return false;\n }\n\n // open connection to Yahoo nsl1op snl1&\n //http://download.finance.yahoo.com/d/quotes.csv?f=nsl1op&s=%40%5EDJI,\n $handle = @fopen(\"http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgn&s=$symbol\", \"r\");\n if ($handle === false)\n {\n // trigger (big, orange) error\n /*trigger_error(\"Could not connect to Yahoo!\", E_USER_ERROR);\n exit;*/\n apologize(\"Could not connect to Yahoo! Check your Internet Connection\");\n }\n\n // download first line of CSV file\n $data = fgetcsv($handle);\n if ($data === false || count($data) == 1)\n {\n return false;\n }\n\n // close connection to Yahoo\n fclose($handle);\n\n // ensure symbol was found\n if ($data[2] === \"0.00\")\n {\n return false;\n }\n\n // return stock as an associative array\n return [\n \"symbol\" => $data[0],\n \"name\" => trim($data[8]),\n \"price\" => $data[1],\n \"open\" => $data[5],\n \"high\" => $data[6],\n \"low\" => $data[7],\n \"change\" => $data[4]\n ];\n }", "function updateCalculations($updateType,$startDate,$endDate,$tz = \"Asia/Kolkata\",$noOfDays=550){\n /*$errorDates=checkDataInTable($noOfDays);\n if(!empty($errorDates)){\n echo(\"</br><h3>Please check the following dates in the <b>Daily Candlesticks</b> table:</h3></br>\");\n for($errorDates as $errorDate){\n echo(\"<br>\"+$errorDate);\n }\n return;\n }*/\n $startTime = time();\n $conn = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n if($updateType==='full'){\n $stmt = $conn->prepare(DATE_LIST_FULL_QUERY);\n $stmt->bind_param(\"s\", $noOfDays);\n $stmt->execute();\n }else if($updateType==='partial'){\n $stmt = $conn->prepare(DATE_LIST_PARTIAL_QUERY);\n $stmt->bind_param(\"ss\", $startDate,$endDate);\n $stmt->execute();\n }\n \n \n /* bind result variables */\n $stmt->bind_result($symbol,$recorddate,$open,$high,$low,$close,$volume);\n $previousSymbol = null;\n while ($stmt->fetch()) {\n if($previousSymbol!==null && $symbol!==$previousSymbol){\n $symbolSpecificResults[] = array('symbol' => $previousSymbol,\n 'values' => $queryResults);\n $queryResults = [];\n }\n $previousSymbol=$symbol;\n $queryResults[] = array('symbol' => $symbol,\n 'recorddate' => $recorddate,\n 'open' => $open,\n 'high' => $high,\n 'low' => $low,\n 'close' => $close,\n 'volume' => $volume);\n }\n $stmt->close();\n $conn->close();\n \n foreach($symbolSpecificResults as $symbolSpecificResult) {\n $calculationResults[] =calculateEverything($symbolSpecificResult['values'],$noOfDays);\n }\n \n if(!empty($calculationResults)){\n deleteTableDataFromDatabase('calculations_daily_liquid_options',$updateType,$startDate,$endDate);\n storeCalculationsInDatabase($calculationResults);\n }\n \n echo(\"<span class='font-weight-600'>Total time(mins) = </span>\".((time()-$startTime)/60));\n}", "function buyPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price) {\n\t$filename = $moduleName. '-'. $folioEntry['pairSymbol'].'-';\n\n\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n global $exchange;\n $price = getPrice ($api, $exchange, $pairSymbol);\n\n\tif (!isset($price)) {\n\t\tprint ('no price');\n\t}\n\n\n\t// Buy if lower than threshold\n\tif ($currentPercent>1 && $ohlcOld[$lastKey]['close']>$emaSet[$lastKey]['priceEMAMed'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent']-$currentPercent;\n\t\t$dev = round($dev*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy-$toBuy*0.004; // fee and drift\n\t\t$newAveragePrice = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toBuy * $price;\n\t\t$newAveragePrice = $newAveragePrice/($main[$mainEntry]['quantity'] + $toBuy);\n\t\t$newAveragePrice = round($newAveragePrice,5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] +=$toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought');\n\t}\n\n\t// Re-buy if preveiously sold all. Only dumpable ones apply.\n\n\tif ($currentPercent<=1 && $ohlcOld[$lastKey]['close']<$ohlcOld[$lastKey-1]['close'] && $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent'];\n\t\t$dev = $dev*$totalValue/100;\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy- $toBuy*0.004; // fee and drift\n\n\t\t$main[$mainEntry]['quantity'] = $toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $price;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought from zero');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n}", "function fetchFromStock($id_stockdluo)\r\n\t{\r\n\t\t$sql = \"SELECT\";\r\n\t\t$sql.= \" pb.batch,\";\r\n\t\t$sql.= \" pl.sellby,\";\r\n\t\t$sql.= \" pl.eatby,\";\r\n\t\t$sql.= \" ps.fk_entrepot\";\r\n\r\n\t\t$sql.= \" FROM \".MAIN_DB_PREFIX.\"product_batch as pb\";\r\n\t\t$sql.= \" JOIN \".MAIN_DB_PREFIX.\"product_stock as ps on pb.fk_product_stock=ps.rowid\";\r\n\t\t$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.\"product_lot as pl on pl.batch = pb.batch AND pl.fk_product = ps.fk_product\";\r\n\t\t$sql.= \" WHERE pb.rowid = \".(int) $id_stockdluo;\r\n\r\n\t\tdol_syslog(get_class($this).\"::fetch\", LOG_DEBUG);\r\n\t\t$resql=$this->db->query($sql);\r\n\t\tif ($resql)\r\n\t\t{\r\n\t\t\tif ($this->db->num_rows($resql))\r\n\t\t\t{\r\n\t\t\t\t$obj = $this->db->fetch_object($resql);\r\n\r\n\t\t\t\t$this->sellby = $this->db->jdate($obj->sellby);\r\n\t\t\t\t$this->eatby = $this->db->jdate($obj->eatby);\r\n\t\t\t\t$this->batch = $obj->batch;\r\n\t\t\t\t$this->entrepot_id= $obj->fk_entrepot;\r\n\t\t\t\t$this->fk_origin_stock=(int) $id_stockdluo;\r\n\t\t\t}\r\n\t\t\t$this->db->free($resql);\r\n\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->error=\"Error \".$this->db->lasterror();\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "function calculateAUDFX6($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] AUDFX6 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $audusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $audusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "Function UpdateRates()\n{\n\t$query = \"SELECT *,NOW()-(last_update) as dif from HB_lastupdate\";\n \t$res = mysql_query($query);\n\t\n\tif(!$res)\n\t{\n\t\treturn;\n\t}\n\t$ar = mysql_fetch_array($res);\n\t$mydif = (int)($ar[dif]/60) - 1440;\n\tprint \"+++++++++++++++++++++\";$mydif;\n\tif($mydif>0)\n\t{\n\t $fp = fopen(\"http://www.bankofcanada.ca/fmd/exchange.htm\",\"r\");\n\t $x=0;$g=0;\n\t while(!feof($fp))\n\t {\n\t $buf = fgets($fp, 4096);\n\t if(eregi(\"U.S. Dollar\",$buf)) $x=4;\n\t if(eregi(\"</PRE>\",$buf)) $x=0;\n\t if($x==4)\n\t {\n if(!eregi(\"US/CA\",$buf))\n {\n \t$ime = explode(\"/\",$buf);\n\t\tprint_r($ime);\n\t\tprint \"<BR>\";\n \t$s = explode(\" \",$ime[1]);\n \t$r = array_reverse ($s);\n\n \tif(eregi(\"Euro de\",$buf))\n \t{\n \t $ime[0]=\"European Monetary Union EURO\";\n \t $s = explode(\" \",$buf);\n \t $r = array_reverse ($s);\n \t}\n\n \tif($ime[0]<>\"\" and $r[0]<>\"\")\n \t{\n \t $g++;\n \t if(eregi(\"U.S. Dollar\",$buf)) {$koef = (float)$r[0];}\n \t $k = ((float)$r[0]/(float)$koef);\n \t $usd = 1/$k;\n \t $res = mysql_query(\"SELECT * FROM HB_rates WHERE sifra=\\\"$ime[0]\\\"\");\n \t $num = mysql_num_rows($res);\n \t if($num > 0)\n\t\t {\n \tmysql_query(\"UPDATE HB_rates SET rate='$usd' WHERE sifra=\\\"$ime[0]\\\"\");\n\t\t }\n\t\t else\n\t\t {\n \t//mysql_query(\"INSERT INTO HB_rates VAUES( \t\t\t\t\t\t NULL,\t\t\t\t\t\t '$usd', sifra=\\\"$ime[0]\\\"\");\n\t\t }\n \t}\n if(eregi(\"Venezuelan Bolivar\",$buf)) $x=0;\n }\n\t }\n\t }\n\t fclose($fp);\n\t mysql_query(\"UPDATE HB_lastupdate SET last_update=NOW();\");\n\t}\n}", "public function reOpen_Orders_get() {\n extract($_GET);\n $result = $this->feeds_model->reOpen_Orders($order_id);\n return $this->response($result);\n }", "private function _update_currency_conversion_rate(){\n\t\t\t$query = \"SELECT `serial_num`, `\".$this->table_fields['currency_iso_code'].\"` as 'currency_iso_code' FROM `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` where `record_status`='1' AND `modification_date` < \".(date(\"U\") - (3600*24));\n\t\t\t$query_settings = array(\n\t\t\t\t'database' => $this->class_settings['database_name'] ,\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'SELECT',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n \n //get exchange rate\n $all_country_list = execute_sql_query($query_settings);\n\t\t\t$return = array();\n \n\t\t\tif( is_array( $all_country_list ) && ! empty( $all_country_list ) ){\n\t\t\t\t$query_settings['query_type'] = 'UPDATE';\n \n $first = true;\n foreach( $all_country_list as $val ){\n\t\t\t\t\tif( $val['currency_iso_code'] ){\n $json = file_get_contents('http://rate-exchange.appspot.com/currency?from=USD&to='.strtoupper($val['currency_iso_code']) );\n if($json)$cur = json_decode($json, true);\n if( isset( $cur['rate'] ) && $cur['rate'] ){\n $return[] = $cur;\n \n $query_settings['query'] = \"UPDATE `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` SET `\".$this->table_fields['conversion_rate'].\"`= '\".$cur['rate'].\"' WHERE `serial_num`='\".$val['serial_num'].\"' \";\n \n execute_sql_query($query_settings);\n \n if( $first ){\n $query_settings['tables'] = array();\n $query_settings['set_memcache'] = 0;\n $first = false;\n }\n }\n }\n\t\t\t\t}\n \n $this->class_settings[ 'do_not_check_cache' ] = 1;\n $this->_get_country_list();\n }\n \n return $return;\n }", "function __construct($tkr, $entry_date, $open, $high, $low, $close, $vol, $adj_close) {\n\t\t\t$this->tkr = $tkr;\n\t\t\t$this->entry_date = $entry_date;\n\t\t\t$this->open = $open;\n\t\t\t$this->high = $high;\n\t\t\t$this->low = $low;\n\t\t\t$this->close = $close;\n\t\t\t$this->vol = $vol;\n\t\t\t$this->adj_close = $adj_close;\n\t\t\t\n\t\t\t$tkr_qry = sprintf(\"SELECT * FROM %s WHERE ticker='%s'\", TKR_TBL, $this->tkr);\n\t\t\tif (!mysql_ping()) {\n\t\t\t\t$con = connect();\n\t\t\t\t}\n\t\t\t$result = mysql_query($tkr_qry);\n\t\t\tif (!$result) {\n\t\t\t\tdie(\"ERROR: Could not get ticker ID: \" . mysql_error());\n\t\t\t\t}\n\t\t\telse {\n\t\t\t\t$data = mysql_fetch_row($result);\n\t\t\t\t$this->tkr_id = $data[0];\n\t\t\t\t}\n\t\t\t}", "public static function trade_close_all($pair) {\n\t\t\tif (! self::valid($trades = self::trade_pair($pair)))\n\t\t\t\treturn $trades;\n\n\t\t\t$result = (object) array('trades' => array());\n\t\t\tforeach ($trades->trades as $trade)\n\t\t\t\tif (isset($trade->id))\n\t\t\t\t\t$result->trades[] = self::trade_close($trade->id);\n\t\t\treturn $result;\n\t\t}", "public function orderBookLtc()\n\t{\n\n\t\t$url = \"https://api.crex24.com/v2/public/orderBook?instrument=LTC-BTC\";\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n\t\tif (curl_errno($ch)) {\n\t\t\t$result = 'Error:' . curl_error($ch);\n\t\t} else {\n\t\t\t$result = curl_exec($ch);\n\t\t}\n\t\t\n\t\treturn json_decode($result);\n\t\t\n\t}", "private function close_orders($quote, $limit_order, $stop_order)\n\t{\n \t// When we opened the order we placed a stop / limit order.\n \t// Here we are checking on the status of that order and seeing\n \t// if we need to update our trade log.\n \t\n // But..... for now we are paper trading.\n \n // Make sure we have an open trade.\n $this->daytrades_model->set_col('DayTradesStatus', 'Open');\n if($t = $this->daytrades_model->get())\n {\n $trade = $t[0];\n } else\n {\n return false;\n } \t\n \n // See if we hit our limit order target - Long\n if(($trade['DayTradesType'] == 'Long Stock') && ($quote['bid'] >= ($trade['DayTradesOpenPrice'] + $limit_order)))\n {\n $profit = (($quote['bid'] - $trade['DayTradesOpenPrice']) * $trade['DayTradesQty']) - $trade['DayTradesOpenCommission'] - 1.00;\n \n $this->daytrades_model->update([\n 'DayTradesStatus' => 'Closed',\n 'DayTradesCloseTime' => date('G:i:s'),\n 'DayTradesClosePrice' => $quote['bid'],\n 'DayTradesCloseCommission' => 1.00,\n 'DayTradesProfit' => $profit\n ], $trade['DayTradesId']);\n \n $this->log(\"Closed long stock position at \\$$quote[bid] for a profit of \\$$profit\");\n \n return true; \n }\n\n // See if we hit our stop order target - Long\n if(($trade['DayTradesType'] == 'Long Stock') && ($quote['bid'] <= ($trade['DayTradesOpenPrice'] - $stop_order)))\n {\n $profit = (($quote['bid'] - $trade['DayTradesOpenPrice']) * $trade['DayTradesQty']) - $trade['DayTradesOpenCommission'] - 1.00; \n \n $this->daytrades_model->update([\n 'DayTradesStatus' => 'Closed',\n 'DayTradesCloseTime' => date('G:i:s'),\n 'DayTradesClosePrice' => $quote['bid'],\n 'DayTradesCloseCommission' => 1.00,\n 'DayTradesProfit' => $profit\n ], $trade['DayTradesId']); \n \n $this->log(\"Closed long stock position at \\$$quote[bid] for a profit of \\$$profit\"); \n \n return true; \n }\n \n // See if we hit our limit order target - Short\n if(($trade['DayTradesType'] == 'Short Stock') && ($quote['ask'] <= ($trade['DayTradesOpenPrice'] - $limit_order)))\n {\n $profit = (($trade['DayTradesOpenPrice'] - $quote['ask']) * $trade['DayTradesQty']) - $trade['DayTradesOpenCommission'] - 1.00;\n \n $this->daytrades_model->update([\n 'DayTradesStatus' => 'Closed',\n 'DayTradesCloseTime' => date('G:i:s'),\n 'DayTradesClosePrice' => $quote['bid'],\n 'DayTradesCloseCommission' => 1.00,\n 'DayTradesProfit' => $profit\n ], $trade['DayTradesId']); \n \n $this->log(\"Closed short stock position at \\$$quote[ask] for a profit of \\$$profit\"); \n \n return true; \n }\n\n // See if we hit our stop order target - Long\n if(($trade['DayTradesType'] == 'Short Stock') && ($quote['ask'] >= ($trade['DayTradesOpenPrice'] + $stop_order)))\n {\n $profit = (($trade['DayTradesOpenPrice'] - $quote['ask']) * $trade['DayTradesQty']) - $trade['DayTradesOpenCommission'] - 1.00;\n \n $this->daytrades_model->update([\n 'DayTradesStatus' => 'Closed',\n 'DayTradesCloseTime' => date('G:i:s'),\n 'DayTradesClosePrice' => $quote['bid'],\n 'DayTradesCloseCommission' => 1.00,\n 'DayTradesProfit' => $profit\n ], $trade['DayTradesId']);\n \n $this->log(\"Closed short stock position at \\$$quote[ask] for a profit of \\$$profit\"); \n \n return true; \n }\n \n // Nothing closed.\n return false;\n\t}", "function calculateSEKFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] SEKFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDSEK = $data['USDSEK']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdsek = $USDSEK[$i]['open'];\n $open = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdsek * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdsek = $USDSEK[$i]['close'];\n $close = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdsek * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function getComexData($symbol,$type = null) {\n\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"[email protected]\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"F8F0E4AB52D34B6E85E21D48FD3B0E25\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"FDFDBEAF9B004b2eBB2D7A9D1D39F24F\"));\n\t\t\t\t$client = new soapclient('http://www.xignite.com/xFutures.asmx?WSDL', array('trace' => 1));\n\t\t\t\t$client->__setSoapHeaders(array($xignite_header));\n\n\t\t\t\tswitch ($type) {\n\t\t\t\t\tcase 'strip':\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'StripType' => \"EighteenMonth\"\n\t\t\t\t\t\t );\n\t\t\t\t\t\t // call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t $result = $client->GetDelayedFutureStrip($param);\n\t\t\t\t\t\t // assess the results\n\t\t\t\t\t\t if (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t \techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \techo '</pre>';\n\t\t\t\t\t\t } elseif (isset($_GET['xml'])) {\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t \tprint_r($comex);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t \t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'Day' => \"0\",\n\t\t\t\t\t\t 'Month' => \"0\",\n\t\t\t\t\t\t 'Year' => date('Y')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t$result = $client->GetDelayedFuture($param);\n\t\t\t\t\t\t// assess the results\n\t\t\t\t\t\tif (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t\techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t\tprint_r($result);\n\t\t\t\t\t\t\techo '</pre>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t\treturn $comex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "function getComexData($symbol,$type = null) {\n\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"[email protected]\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"F8F0E4AB52D34B6E85E21D48FD3B0E25\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"FDFDBEAF9B004b2eBB2D7A9D1D39F24F\"));\n\t\t\t\t$client = new soapclient('http://www.xignite.com/xFutures.asmx?WSDL', array('trace' => 1));\n\t\t\t\t$client->__setSoapHeaders(array($xignite_header));\n\n\t\t\t\tswitch ($type) {\n\t\t\t\t\tcase 'strip':\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'StripType' => \"EighteenMonth\"\n\t\t\t\t\t\t );\n\t\t\t\t\t\t // call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t $result = $client->GetDelayedFutureStrip($param);\n\t\t\t\t\t\t // assess the results\n\t\t\t\t\t\t if (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t \techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \techo '</pre>';\n\t\t\t\t\t\t } elseif (isset($_GET['xml'])) {\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t \tprint_r($comex);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t \t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'Day' => \"0\",\n\t\t\t\t\t\t 'Month' => \"0\",\n\t\t\t\t\t\t 'Year' => date('Y')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t$result = $client->GetDelayedFuture($param);\n\t\t\t\t\t\t// assess the results\n\t\t\t\t\t\tif (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t\techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t\tprint_r($result);\n\t\t\t\t\t\t\techo '</pre>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t\treturn $comex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "function buy($amount,$symbol)\n {\n //balance should be greater than stock value to buy\n if($amount<=$this->totalamount)\n {\n //buy book stock\n if($symbol==\"Book\"){\n echo $this->new_account.\" owned Book Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->bookstock_buy++;\n $this->object_linkedlist->insertfirst(\"Book: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n //buy newspaper stock\n elseif($symbol==\"Newspaper\")\n {\n echo $this->new_account.\" owned Newspaper Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->newspaperstock_buy++;\n $this->object_linkedlist->insertfirst(\"Newspaper: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n }\n //if balance is less than stock value\n else{\n echo \"Your Balance is low than Stock price\\n\";\n }\n }", "function calculateGBPLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] GBPLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $gbpusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $gbpusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function testExchange()\n {\n //test exchange method\n $conversorManager = new ConversorManager($this->entityManager);\n $response = $conversorManager->getExchange('EUR', 'USD');\n\n //asserst\n $this->assertTrue(isset($response['rates']));\n $this->assertTrue(isset($response['base']));\n $this->assertTrue(isset($response['date']));\n $this->assertEquals('EUR', $response['base']);\n }", "function fundSellStock($seller, $selling, $date, $dbh)\n{\n\t\t\n\t$sql = \"SELECT shares, percentage FROM fund_stock WHERE name = :fund AND symbol = :symbol\";\n\t$query = $dbh->prepare($sql);\n\t$query->bindValue(':fund', $seller);\n\t$query->bindValue(':symbol', $selling);\n\t$query->execute();\n\t\n\ttry{\n\t\tif ($query->rowCount() > 0)\n\t\t{\n\t\t\t$rs = $query->fetch(PDO::FETCH_OBJ);\n\t\t\t$percentage = $rs->percentage;\n\t\t\t$shares = $rs->shares;\n\n\t\t\t$currStockPrice = getStockPrice($selling,$date,$dbh);\n\t\t\t$returnToCash = $currStockPrice * $shares;\n\n\t\t\t//Update the funds cash and percentage with returns from the stock sold.\t\n\t\t\t$sql = \"UPDATE fund_cash SET cash=cash+:cash, percentage = percentage+:perc WHERE name = :name\";\n\t\t\t$query = $dbh->prepare($sql);\n\t\t\t$query->bindValue(':name', $seller);\n\t\t\t$query->bindValue(':cash', $returnToCash);\n\t\t\t$query->bindValue(':perc', $percentage);\n\t\t\t$query->execute();\n\n\t\t\t// remove from fund_stock\n\t\t\t$sql = \"DELETE FROM fund_stock WHERE name = :name AND symbol=:selling\";\n\t\t\t$query = $dbh->prepare($sql);\n\t\t\t$query->bindValue(':name', $seller);\n\t\t\t$query->bindValue(':selling', $selling);\n\t\t\t$query->execute();\n\t\t\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\"Error fundSellStock(): Fund \".$seller.\" doesn't own \".$selling.\"<br>\";\n\t\t}\n\t}\n\tcatch (PDOException $e)\n\t{\n\t\techo \"Error fund selling stock<br>\";\n\t}\n\t\n}", "public function bookTicker($symbol = null)\n {\n return $this->client->publicRequest('GET', '/api/v3/ticker/bookTicker', [\n 'symbol' => $symbol,\n ]);\n }", "private function open_orders($quote, $upper, $lower, $comission, $shares_to_trade, $limit_order, $stop_order)\n\t{\n \t$price = 0.00;\n $trade = null;\n \n // Make sure we don't already have an open trade.\n $this->daytrades_model->set_col('DayTradesStatus', 'Open');\n if($this->daytrades_model->get())\n {\n return false;\n }\n \t\n/*\n // Did we cross the upper bound?\n if($quote['bid'] > $upper)\n {\n $price = $quote['bid'];\n $trade = 'Short Stock';\n }\n*/\n \n // Did we cross the lower bound\n if($quote['ask'] < $lower)\n {\n $price = $quote['ask']; \n $trade = 'Long Stock';\n }\n \n // Did we hit a bound\n if(is_null($trade))\n {\n return false;\n }\n \n // Place order.\n $this->daytrades_model->insert([\n 'DayTradesSymbolsId' => 1,\n 'DayTradesStatus' => 'Open',\n 'DayTradesType' => $trade,\n 'DayTradesQty' => $shares_to_trade,\n 'DayTradesDate' => date('Y-m-d'),\n 'DayTradesOpenTime' => date('G:i:s'),\n 'DayTradesOpenPrice' => $price,\n 'DayTradesOpenCommission' => 1.00\n ]); \n \n $this->log(\"Placed a $trade order at $price.\");\n\t}", "function calculateAUDFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] AUDFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd), 1/7) * $audusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd), 1/7) * $audusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "protected static function requestUpdatedRate( $from_iso_code, $to_iso_code ){\n \n $from_iso_code = \\Altumo\\Validation\\Strings::assertNonEmptyString(\n $from_iso_code,\n '$from_iso_code expects non-empty string'\n ); \n \n $to_iso_code = \\Altumo\\Validation\\Strings::assertNonEmptyString(\n $to_iso_code,\n '$to_iso_code expects non-empty string'\n );\n \n // Get exchange rate from yahoo finance.\n $query = \"{$from_iso_code}{$to_iso_code}=X\";\n\n $url = 'http://download.finance.yahoo.com/d/quotes.csv?s=' . $query . '&f=l1&e=.cs';\n\n $http_request = new \\Altumo\\Http\\OutgoingHttpRequest( $url );\n $http_request->setHeaders(\n array( \n 'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.60 Safari/537.11', \n 'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',\n 'X-Requested-With' => 'XMLHttpRequest'\n )\n );\n\n $response = \\Altumo\\Validation\\Numerics::assertPositiveDouble(\n trim($http_request->sendAndGetResponseMessage()->getRawMessageBody()),\n 'Unable to update currency exchange rate. Invalid response received.'\n ); \n \n \n return (float)$response;\n \n // Google implementation (unsupported by google, likely unreliable).\n /* $query = \"1{$from_iso_code}=?{$to_iso_code}\";\n\n $url = 'http://www.google.com/ig/calculator?hl=en&q=' . urlencode($query);\n\n $http_request = new \\Altumo\\Http\\OutgoingHttpRequest( $url );\n $http_request->setHeaders(\n array( \n 'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.60 Safari/537.11', \n 'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',\n 'X-Requested-With' => 'XMLHttpRequest'\n )\n );\n $response = $http_request->sendAndGetResponseMessage()->getRawMessageBody();\n\n if( preg_match('/^.*?rhs\\\\:.*?([-+]?\\\\b[0-9]+(\\\\.[0-9]+)?\\\\b)/m', $response, $matches) ){\n $rate = $matches[1];\n } else {\n throw new \\Exception( 'Error retrieving an updated currency conversion rate. (unexpected format)' );\n }*/\n\n }", "public function getStock();", "private function loadExchangeRatesFromAPI($baseCurrency, $url) {\n $res = file_get_contents($url);\n if ($res) {\n $data = json_decode($res, true);\n if (is_array($data) and @$data['rates']) {\n import('xf/db/Database.php');\n $db = new xf\\db\\Database(df_db());\n foreach ($data['rates'] as $target => $conversion) {\n $db->query(\"replace into stripe_exchange_rates (base_currency, target_currency, conversion, last_updated) VALUES (:from, :to, :conversion, NOW())\", (object)[\n 'from' => $baseCurrency,\n 'to' => $target,\n 'conversion' => $conversion\n ]);\n \n $this->exchangeRates[$baseCurrency.':'.$target] = floatval($conversion);\n }\n }\n }\n return $this->exchangeRates;\n }", "function buy_sell($pairing_id,$amount,$rate,$type){\n\tif($ch = curl_init ()){\n\t\t$data['pairing'] = $pairing_id;//btc/thb\n\t\t$data['amount'] = $amount;\n\t\t$data['rate'] = $rate;\n\t\t$data['type'] = $type;\n\t\t$data['key'] = 'xxx';\n\t\t$mt = explode(' ', microtime());\n\t\t$nonce = $mt[1].substr($mt[0], 2, 6);\n\t\t$data['nonce'] = $nonce;\n\t\t$data['signature'] = hash('sha256', 'xxx'.$nonce.'xxx');\n\t\t// if($this->twofa != ''){\n\t\t\t// $data['twofa'] = $this->twofa;\n\t\t// }\n\t\t\n\t\tcurl_setopt ( $ch, CURLOPT_URL, 'https://bx.in.th/api/order/');\n\t\tcurl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, false );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, false ); \n\t\tcurl_setopt ( $ch, CURLOPT_POST, count($data));\n\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS,$data);\n\t\t\n\t\t$str = curl_exec ( $ch );\n\t\n\t\tcurl_close ( $ch );\n\t\t\n\t\t$str = json_decode($str);\n\t\n\t\treturn $str;\n\n\t}\n\n}", "public function fetchRates($currency1, $currency2, Logger $logger);", "function calculateAUDLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] AUDLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $audusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $audusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function checkSellBids()\n{\n echo \"IM AT SELL BIDS\";\n $mysql_server = '192.168.1.101'; //reference global mysql_server\n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n //Retrieve all Values from SellBidOffer\n $indexQry = \"SELECT * FROM SellBestBidOffer\";\n $indexResult = $mysqli->query($indexQry);\n \n //Create Info Stacks to store Information\n $stackUsername = array();\n $stackSymbol = array();\n $stackQty = array();\n $stackAsk = array();\n $stackIndexNo = array();\n $stackBidType = array();\n \n //Copy the info into arrays in exact same order\n if($indexResult->num_rows > 0)\n { //if there is something in the DB then...\n while ($row = $indexResult->fetch_assoc())\n {\n array_push($stackUsername, $row['username']);\n array_push($stackSymbol, $row['stockSymbol']);\n array_push($stackQty, $row['qty']);\n array_push($stackIndexNo, $row['indexNo']);\n array_push($stackAsk, $row['askPrice']);\n }\n }\n //Get the size of Arrays\n $arraySize = count($stackUsername);\n \n //Get the List of Unique tickers in SellBids DB\n $SellBidsTickers = getSellBidStockTickers();\n \n //Array that contains Current Price for Stocks\n $currentPriceStack = array();\n \n //get information about DISTINCT tickers only\n foreach($SellBidsTickers[\"Stocks\"] as $symbol)\n {\n \n $tempVar = getInfo($symbol);\n $tempObj = json_decode($tempVar);\n array_push($currentPriceStack, $tempObj->Close[0]); //get the current prices for Tickers\n }\n \n //var_dump($currentPriceStack);\n \n //Loop and compare each Ticker asking price with Current Prices. Ignore Username at this Level.\n foreach($stackSymbol as $key => $symbol)\n {\n //for each Ticker excluding duplicates in your sell bids DB\n foreach($SellBidsTickers[\"Stocks\"] as $compareKey => $compareSymbol)\n {\n //if ticker in records matches a ticker in currentPrice data list\n if ($symbol == $compareSymbol)\n {\n if($stackAsk[$key] >= $currentPriceStack[$compareKey])\n {\n //Find the user linked to this current items.\n //var_dump($stackUsername[$key]);\n //Create Data Object and Run Sell function\n $tempArray = array(\"Username\" => $stackUsername[$key],\n \"Symbol\" => $stackSymbol[$key],\n \"Quantity\" => $stackQty[$key]);\n sellStock($tempArray);\n //delete the IndexNo of this record in SellBestBidOffer Table\n deleteFromSellBids($stackIndexNo[$key]);\n }\n }\n }\n }\n \n}", "public function getExchangeRate();", "function refresh()\n {\n $p_maximumValue = 0;\n \n $sql = '\n SELECT \n IsoneDayAheadBidID,\n i.AssetIdentifier,\n ObjectName,\n StartDay,\n StopDay,\n MW,\n OfferPrice,\n CurtailmentInitiationPrice,\n MinimumInterruptionDuration,\n IsSent,\n i.CreatedBy,\n i.CreatedDate,\n i.UpdatedBy,\n i.UpdatedDate\n FROM \n t_isonedayaheadbids i,\n t_pointchannels pc,\n t_objects o \n WHERE\n pc.AssetIdentifier = i.AssetIdentifier and \n o.ObjectID = pc.ObjectID \n order by \n StartDay,\n StopDay\n ';\n \n $result = $this->processQuery($sql,$this->sqlConnection(),'select');\n //$this->preDebugger($result);\n\n if($result['error'] != null)\n {\n $this->p_bidList['error'] = true;\n }\n else\n {\n if($result['records'] > 0)\n {\n $this->p_size = 0;\n \n foreach($result['items'] as $inx=>$bidItem)\n {\n if($this->p_oUser->HasPrivilege(\"Read.\".$bidItem->ObjectName))\n {\n $updatedBy = $bidItem->UpdatedBy == null ? 0 : $bidItem->UpdatedBy;\n $updateDate = $bidItem->UpdatedDate == null ? 0 : $bidItem->UpdatedDate;\n \n $oBid = new IsoneDayAheadBid();\n $oBid->load(\n $bidItem->IsoneDayAheadBidID,\n $bidItem->AssetIdentifier,\n $bidItem->StartDay,\n $bidItem->StopDay,\n $bidItem->MW,\n $bidItem->OfferPrice,\n $bidItem->CurtailmentInitiationPrice,\n $bidItem->MinimumInterruptionDuration,\n $bidItem->IsSent,\n $bidItem->CreatedBy,\n $bidItem->CreatedDate,\n $updatedBy,\n $updatedDate\n );\n \n $this->p_bidList[$this->p_size] = $oBid;\n $this->p_size++;\n }\n }\n }\n }\n }", "function checkBuyBids()\n{\n $mysql_server = '192.168.1.101'; //reference global mysql_server\n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n //Retrieve all Values from BestBidOffer\n $indexQry = \"SELECT * FROM BuyBestBidOffer\";\n $indexResult = $mysqli->query($indexQry);\n \n //Create Info Stacks to store Information\n $stackUsername = array();\n $stackSymbol = array();\n $stackQty = array();\n $stackAsk = array();\n $stackIndexNo = array();\n $stackBidType = array();\n \n //Copy the info into arrays in exact same order\n if($indexResult->num_rows > 0)\n { //if there is something in the DB then...\n while ($row = $indexResult->fetch_assoc())\n {\n array_push($stackUsername, $row['username']);\n array_push($stackSymbol, $row['stockSymbol']);\n array_push($stackQty, $row['qty']);\n array_push($stackIndexNo, $row['indexNo']);\n array_push($stackAsk, $row['askPrice']);\n }\n }\n //Get the size of Arrays\n $arraySize = count($stackUsername);\n \n //Get the List of Unique tickers in BuyBids DB\n $BuyBidsTickers = getBuyBidStockTickers();\n \n //Array that contains Current Price for Stocks\n $currentPriceStack = array();\n \n //get information about DISTINCT tickers only\n foreach($BuyBidsTickers[\"Stocks\"] as $symbol)\n {\n \n $tempVar = getInfo($symbol);\n $tempObj = json_decode($tempVar);\n array_push($currentPriceStack, $tempObj->Close[0]); //get the current prices for Tickers\n }\n \n //var_dump($currentPriceStack);\n \n //Loop and compare each Ticker asking price with Current Prices. Ignore Username at this Level.\n foreach($stackSymbol as $key => $symbol)\n {\n //for each Ticker excluding duplicates in your buy bids DB\n foreach($BuyBidsTickers[\"Stocks\"] as $compareKey => $compareSymbol)\n {\n //if ticker in records matches a ticker in currentPrice data list\n if ($symbol == $compareSymbol)\n {\n if($stackAsk[$key] <= $currentPriceStack[$compareKey])\n {\n //Find the user linked to this current items.\n //var_dump($stackUsername[$key]);\n //Create Data Object and Run Buy function\n $tempArray = array(\"Username\" => $stackUsername[$key],\n \"Symbol\" => $stackSymbol[$key],\n \"Quantity\" => $stackQty[$key]);\n buyStock($tempArray);\n //delete the IndexNo of this record in BuyBestBidOffer Table\n deleteFromBuyBids($stackIndexNo[$key]);\n }\n }\n }\n }\n \n}", "function sellStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qtyRequested = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n\n //check how many of the stock you own\n $qtyYouOwn = getStockQuantity($username,$sym);\n \n //Make sure you have more or equal qty in portfolio compared to what you wanna sell\n if($qtyYouOwn >= $qtyRequested)\n {\n //Calculate the total value of your sell.\n $totalValue = $currentCost * $qtyRequested;\n }\n else //Placeholder for now, should probably not do this.\n {\n //Sell only the amount that you have in portfolio\n $totalValue = $currentCost * $qtyYouOwn;\n }\n \n \n //Call addtoAccountBalance and add $totalValue to the account balance\n $currentBalance = addtoAccountBalance($username,$totalValue,$sym);\n \n //Call deleteFromPortfolioDB and delete the previous entry\n deleteFromPortfolioDB($username, $qtyRequested, $sym);\n\n $returnString = \"Sell Order Confirmed!\";\n \n return($returnString);\n}" ]
[ "0.5427624", "0.5237283", "0.52298105", "0.5043422", "0.50361115", "0.50041693", "0.4922948", "0.4891757", "0.48872188", "0.4846009", "0.48241416", "0.48167008", "0.47821417", "0.4779623", "0.47733432", "0.4761777", "0.47476357", "0.4739246", "0.46760303", "0.46565756", "0.4655136", "0.46550497", "0.4632625", "0.46298948", "0.46196538", "0.4616589", "0.46011627", "0.4599065", "0.45903853", "0.4588625", "0.45809954", "0.4568548", "0.45678127", "0.4564052", "0.4562055", "0.45584607", "0.45484802", "0.45475966", "0.4538411", "0.45377", "0.45324853", "0.45201853", "0.45121723", "0.45085138", "0.45013574", "0.44967932", "0.4476957", "0.44716114", "0.4445992", "0.44421715", "0.44356585", "0.44041634", "0.4397367", "0.43896967", "0.438755", "0.4380405", "0.43786776", "0.4368605", "0.43598852", "0.43579176", "0.43449038", "0.4338107", "0.43357024", "0.43249342", "0.432389", "0.43188632", "0.42990476", "0.42946446", "0.4288063", "0.42867085", "0.42847532", "0.42780432", "0.4275275", "0.42728224", "0.4266388", "0.42647657", "0.4264258", "0.42642483", "0.42568922", "0.42480782", "0.4236099", "0.4236099", "0.42329064", "0.42193154", "0.4217902", "0.42163435", "0.4210428", "0.42055848", "0.42015824", "0.41867056", "0.41823208", "0.41778433", "0.41694483", "0.4167899", "0.4165977", "0.41643915", "0.4163612", "0.41533938", "0.4153164", "0.4149218" ]
0.6582336
0
/ Install Hstory Per pair installs a rebalancePAIRhistory.json which stores list of all sell operations and the averageBuyPrice of the asset. rebalancemain.json includes a list of all assets, essentially the balance
function installHistory ($api, $moduleName, $folioArray, $installTime) { $pairSymbols = array_column ($folioArray, 'pairSymbol'); array_pop ($pairSymbols); $pairsString = implode(", ",$pairSymbols); global $exchange; $ticker = getTicker ($api, $exchange, $folioArray); $pairCount = count($folioArray)-1; for ($i=0; $i<$pairCount; $i++) { $pairSymbol = $folioArray[$i]['pairSymbol']; $coinSymbol = $folioArray[$i]['coinSymbol']; /* if (isset($balance['result'][$coinSymbol])) { $quantity = $balance['result'][$coinSymbol]; settype($quantity,'float'); } else { $quantity = 0; } */ if ($i<$pairCount) { $price = $ticker[$i]; settype ($price, 'float'); } else { $price = 1; } $quantity = round($folioArray[$i]['targetPercent']/$price*10, 5, PHP_ROUND_HALF_UP); $main[$i] = array ('pairSymbol'=>$pairSymbol, 'coinSymbol'=> $coinSymbol, 'targetPercent'=>$folioArray[$i]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>$price, 'startQuantity'=>$quantity); $historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0); $history = array ('ledger'=>null, 'totals'=>$historyTotals); $filename = $moduleName. '-'. $folioArray[$i]['pairSymbol'].'-'; $filepath = '' . $filename . 'history.json'; file_put_contents($filepath, json_encode($history)); } $quantity = $folioArray[$pairCount]['targetPercent']*10; $main[] = array ('pairSymbol'=>'ZUSD', 'coinSymbol'=>'ZUSD','targetPercent'=>$folioArray[$pairCount]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>1, 'startQuantity'=>$quantity); $filename = $moduleName. '-'; $filepath = '' . $filename . 'main.json'; file_put_contents($filepath, json_encode($main)); $quickExt = array ('lastPosInt'=>$installTime, 'pairIndex'=>0, 'updateTime'=>$installTime, 'indicCurrent'=>'current'); $filepath = '' . $filename . 'QuickExt.json'; file_put_contents($filepath, json_encode($quickExt)); $ledgerTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0); $ledger = array ('ledger'=>null, 'totals'=>$ledgerTotals); $filepath = '' . $moduleName . '-ledger.json'; file_put_contents($filepath, json_encode($ledger)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sellPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price, $unixTime, $threshold) {\n\t$filename = $moduleName. '-';\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\t$history = file_get_contents($filepath);\n\t$history = json_decode($history, true);\n\n\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\tif (!isset($history)) {\n\t\tprint ('zero history');\n\t}\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n\t// Sell if higher than threshold\n\t// || $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow']\n\n\tif ($folioEntry['dumpable']==0 || $ohlcOld[$lastKey]['close']>=$emaSet[$lastKey]['priceEMASlow']) {\n\t\t$devPercent = $currentPercent - $folioEntry['targetPercent'];\n\t\t$dev = round($devPercent*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t$toSell = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\n\t\t$soldValue = $toSell*$price;\n\t\t$fee = 0.004*$soldValue;\n\t\t$soldValue = $soldValue- $fee; // fee and drift\n\n\t\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t// History Stuff\n\t\t$originalValue = $toSell*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$toSell,\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t// Main Stuff\n\n\t\t$newAveragePrice = round(($main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toSell * $price)/($main[$mainEntry]['quantity'] + $toSell),5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] -=$toSell;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold');\n\t}\n\n\t// Sell all aka dump. Only dumpable ones apply.\n\n\tif ($folioEntry['dumpable']==1 && $ohlcOld[$lastKey]['close']<$emaSet[$lastKey]['priceEMASlow'] && $devPercent>$threshold) {\n\n\t\t$soldValue = $main[$mainEntry]['quantity']*$price;\n\t\t$soldValue -= 0.004*$soldValue; // fee and drift\n\n\t\t$fee = 0.004*$soldValue;\n\n\t\t// History Stuff\n\t\t$originalValue = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$main[$mainEntry]['quantity'],\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t$main[$mainEntry]['quantity'] = 0;\n\t\t$main[$mainEntry]['averageBuyPrice'] = 0;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold (dump)');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\tfile_put_contents($filepath, json_encode($history));\n}", "function buyPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price) {\n\t$filename = $moduleName. '-'. $folioEntry['pairSymbol'].'-';\n\n\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n global $exchange;\n $price = getPrice ($api, $exchange, $pairSymbol);\n\n\tif (!isset($price)) {\n\t\tprint ('no price');\n\t}\n\n\n\t// Buy if lower than threshold\n\tif ($currentPercent>1 && $ohlcOld[$lastKey]['close']>$emaSet[$lastKey]['priceEMAMed'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent']-$currentPercent;\n\t\t$dev = round($dev*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy-$toBuy*0.004; // fee and drift\n\t\t$newAveragePrice = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toBuy * $price;\n\t\t$newAveragePrice = $newAveragePrice/($main[$mainEntry]['quantity'] + $toBuy);\n\t\t$newAveragePrice = round($newAveragePrice,5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] +=$toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought');\n\t}\n\n\t// Re-buy if preveiously sold all. Only dumpable ones apply.\n\n\tif ($currentPercent<=1 && $ohlcOld[$lastKey]['close']<$ohlcOld[$lastKey-1]['close'] && $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent'];\n\t\t$dev = $dev*$totalValue/100;\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy- $toBuy*0.004; // fee and drift\n\n\t\t$main[$mainEntry]['quantity'] = $toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $price;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought from zero');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n}", "function balanceCheck ($api, $moduleName, $folioArray, $threshold, $unixTime) {\n\n\n // get trade balance would go here\n\n\n\t// get current % of each coin and ema or other indicators\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$pairSymbols = array_column($folioArray, 'pairSymbol');\n\tarray_pop($pairSymbols);\n\n\t$pairCount = count($folioArray)-1; //last is USD\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('USD');\n\t\t}\n\t\t$currentPair = $folioArray[$i]['pairSymbol'];\n\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\n\t\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t $ohlcOld = file_get_contents($filepath);\n\t $ohlcOld = json_decode($ohlcOld, true);\n\n\t\tend($ohlcOld);\n\t\t$lastKey = key($ohlcOld);\n\n\t\t$price[$i] = $ohlcOld[$lastKey]['close'];\n\t\t$priceT[$i] = $ticker[$currentPair]['c'][0];\n\n\t\t$currentValue[$i] = $main[$i]['quantity']*$price[$i];\n\t\t$holdValue[$i] = $main[$i]['startQuantity']*$price[$i];\n\n\t}\n\t$totalValue = array_sum($currentValue);\n\t$totalValue += $main[$pairCount]['quantity']; // add USD\n\n // Hold value is the value if one only holds from the beginning\n\t$holdValue = array_sum($holdValue);\n\t$holdValue += $main[$pairCount]['startQuantity']; // add USD\n\n\t$operation = null;\n\n\t// based on deviation from planned % of folio, do stuff for each thing\n\tfor ($i=0; $i<$pairCount; $i++) { // count($folioArray)-1 since last is USD\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('squeak');\n\t\t}\n\n\t\tif ($folioArray[$i]['coinSymbol']!='ZUSD') {\n\t\t\t$currentPercent[$i] = round ($currentValue[$i]/$totalValue*100, 3, PHP_ROUND_HALF_UP);\n\t\t\t$deviation = $currentPercent[$i]-$main[$i]['targetPercent'];\n\n //Potential checks if it is worth buying or selling, depending on status of indicators\n\t\t\tif ($deviation>$threshold) {\n\t\t\t\tsellPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i], $unixTime, $threshold);\n\t\t\t}\n\t\t\tif ($deviation<-$threshold) {\n\t\t\t\tbuyPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i]);\n\t\t\t}\n\t\t\t$operation[] = $folioArray[$i]['pairSymbol'].' balance checked';\n\t\t}\n\t}\n\n\n\n\t$filepath = ''.$moduleName.'-'.'QuickExt.json';\n\t$quickExt = file_get_contents($filepath);\n\t$quickExt = json_decode($quickExt, true);\n\n\t$quickExt['tempTotalValue'] = $totalValue;\n\t$quickExt['holdValue'] = $holdValue;\n\n\tfor ($i=0; $i<=$pairCount; $i++) { // includes USD\n\t\t$quickExt['volChange'][$folioArray[$i]['coinSymbol']] = round($main[$i]['quantity']/$main[$i]['startQuantity']*100, 2, PHP_ROUND_HALF_UP);\n\t}\n\n\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\tprint_r ($operation);\n}", "public function UpdateAccountBalances () \r\n {\r\n $table = \"BALANCE\";\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove old ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"CREATE TEMPORARY TABLE ${table} SELECT ReceiptID AS AccountID, SUM(Total) As Receipts, (0) AS Payments FROM Transaction GROUP BY ReceiptID ORDER BY ReceiptID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"INSERT INTO ${table} SELECT PaymentID AS AccountID, (0) AS Receipts, SUM(Total) AS Payments FROM Transaction GROUP BY PaymentID ORDER BY PaymentID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account SET Receipts=(0.00), Payments=(0.00), Balance=(0.00)\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't clear Account table balances\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Receipts=${table}.Receipts\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Payments=${table}.Payments\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove new ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n return (true);\r\n }", "function updateAssetPrice( $asset=null ){\n global $mysqli;\n // Lookup asset id \n $asset = $mysqli->real_escape_string($asset);\n $results = $mysqli->query(\"SELECT id, divisible FROM assets WHERE asset='{$asset}'\");\n if($results && $results->num_rows){\n $row = $results->fetch_assoc();\n $asset_id = $row['id'];\n $divisible = ($row['divisible']==1) ? true : false;\n } else {\n byeLog('Error looking up asset id');\n }\n // Bail out on BTC or XCP\n if($asset_id<=2)\n return;\n // Lookup last order match for XCP\n $sql = \"SELECT\n m.forward_asset_id,\n m.forward_quantity,\n m.backward_asset_id,\n m.backward_quantity\n FROM\n order_matches m\n WHERE\n ((m.forward_asset_id=2 AND m.backward_asset_id='{$asset_id}') OR\n ( m.forward_asset_id='{$asset_id}' AND m.backward_asset_id=2)) AND\n m.status='completed'\n ORDER BY \n m.tx1_index DESC \n LIMIT 1\";\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n $data = $results->fetch_assoc();\n $xcp_amt = ($data['forward_asset_id']==2) ? $data['forward_quantity'] : $data['backward_quantity'];\n $xxx_amt = ($data['forward_asset_id']==2) ? $data['backward_quantity'] : $data['forward_quantity'];\n $xcp_qty = number_format($xcp_amt * 0.00000001,8,'.','');\n $xxx_qty = ($divisible) ? number_format($xxx_amt * 0.00000001,8,'.','') : number_format($xxx_amt,0,'.','');\n $price = number_format($xcp_qty / $xxx_qty,8,'.','');\n $price_int = number_format($price * 100000000,0,'.','');\n $results = $mysqli->query(\"UPDATE assets SET xcp_price='{$price_int}' WHERE id='{$asset_id}'\");\n if(!$results)\n byeLog('Error updating XCP price for asset ' . $asset);\n }\n } else {\n byeLog('Error while trying to lookup asset price');\n }\n}", "function updateAddressBalance( $address=null, $asset_list=null ){\n global $mysqli, $counterparty, $addresses, $assets;\n // Lookup any balance for this address and asset\n $balances = getAddressBalances($address, $asset_list);\n if(count($balances)){\n foreach($balances as $balance){\n $address_id = $addresses[$balance['address']]; // Translate address to address_id\n $asset = $balance['asset'];\n $asset_id = $assets[$asset]; // Translate asset to asset_id\n $quantity = $balance['quantity'];\n $results = $mysqli->query(\"SELECT id FROM balances WHERE address_id='{$address_id}' AND asset_id='{$asset_id}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n // Update asset balance\n $results = $mysqli->query(\"UPDATE balances SET quantity='{$quantity}' WHERE address_id='{$address_id}' AND asset_id='{$asset_id}'\");\n if(!$results)\n byeLog('Error while trying to update balance record for ' . $address . ' - ' . $asset);\n } else {\n // Create asset balance only if the quantity is greater than 0\n if($quantity){\n $results = $mysqli->query(\"INSERT INTO balances (asset_id, address_id, quantity) values ('{$asset_id}','{$address_id}','{$quantity}')\");\n if(!$results)\n byeLog('Error while trying to create balance record for ' . $address . ' - ' . $asset);\n }\n }\n } else {\n byeLog('Error while trying to lookup balance record for ' . $address . ' - ' . $asset);\n }\n }\n }\n}", "function buyStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qty = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n \n //Check Account Balance to see if the buy is possible\n $accountValue = getCurrentAccountBalance($username);\n \n //$purCost is to store a value in DB, ex: $purCost = API->currentCost;\n $purCost = $currentCost;\n \n //Calculate the total value of your purchase. Cost * Shares\n $totalValue = $purCost * $qty;\n \n if($accountValue >= $totalValue)\n {\n //add this entry into the DB.\n addToPortfolioDB($username,$purCost,$qty,$sym);\n //subtract cost of purchase from Bank Account Balance\n deleteFromAccountBalance($username,$totalValue,$accountValue);\n }\n else\n {\n echo \"NOT ENOUGH FUCKING MONEY\";\n }\n \n \n \n //make a new object to store data to return?\n $returnObj = array(\"TotalValue\"=>$totalValue);\n //example of how to single out a value is Below\n //var_dump($returnObj[\"TotalValue\"]);\n \n //returns an array\n return (json_encode($returnObj));\n //returns an json object\n //return (json_encode($returnObj));\n}", "public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}", "public function salesOrderCreditmemoSaveAfter_backup($observer) {\n if (Mage::helper('core')->isModuleEnabled('Magestore_Inventorywarehouse'))\n return;\n if (Mage::registry('INVENTORY_CORE_ORDER_CREDITMEMO'))\n return;\n Mage::register('INVENTORY_CORE_ORDER_CREDITMEMO', true);\n try {\n $warehouse = Mage::getModel('inventoryplus/warehouse')->getCollection()->getFirstItem();\n $warehouseId = $warehouse->getId();\n $creditmemo = $observer->getCreditmemo();\n $order = $creditmemo->getOrder();\n $supplierReturn = array();\n $transactionData = array();\n\n $parents = array();\n\n \n foreach ($creditmemo->getAllItems() as $item) {\n $orderItemId = $item->getOrderItemId();\n $orderItem = Mage::getModel('sales/order_item')->load($orderItemId);\n if (in_array($orderItem->getProductType(), array('configurable', 'bundle', 'grouped'))) {\n $parents[$orderItemId]['qtyRefund'] = $item->getQty();\n $parents[$orderItemId]['qtyRefunded'] = $orderItem->getQtyRefunded();\n $parents[$orderItemId]['qtyShipped'] = $orderItem->getQtyShipped();\n continue;\n }\n if ($orderItem->getParentItemId()) {\n $qtyRefund = $item->getQty();\n $qtyShipped = $orderItem->getQtyShipped();\n $creditmemoParentItem = Mage::getModel('sales/order_creditmemo_item')->getCollection()\n ->addFieldToFilter('parent_id', $item->getParentId())\n ->addFieldToFilter('order_item_id', $orderItem->getParentItemId())\n ->getFirstItem();\n if ($parents && $parents[$orderItem->getParentItemId()]['qtyRefund']) {\n $qtyRefund = max($qtyRefund, $parents[$orderItem->getParentItemId()]['qtyRefund']);\n }\n if ($qtyShipped == 0 && $parents && $parents[$orderItem->getParentItemId()]['qtyShipped']) {\n $qtyShipped = $parents[$orderItem->getParentItemId()]['qtyShipped'];\n }\n $qtyOrdered = $orderItem->getQtyOrdered();\n $qtyRefunded = $orderItem->getQtyRefunded();\n $qtyRefunded = max($qtyRefunded, $parents[$orderItem->getParentItemId()]['qtyRefunded']);\n } else {\n $qtyRefund = $item->getQty();\n $qtyShipped = $orderItem->getQtyShipped();\n $qtyOrdered = $orderItem->getQtyOrdered();\n $qtyRefunded = $orderItem->getQtyRefunded();\n }\n //if return to stock\n /*\n * total qty will be updated if (qtyShipped + qtyRefunded + qtyRefund) > qtyOrdered and will be returned = (qtyShipped + qtyRefunded + qtyRefund) > qtyOrdered\n * available qty will be returned = qtyRefund\n */\n $qtyReturnAvailableQty = 0;\n $qtyReturnTotalQty = 0;\n if ($item->getBackToStock()) {\n $qtyReturnAvailableQty = $qtyRefund;\n $qtyChecked = $qtyShipped + $qtyRefunded + $qtyRefund - $qtyOrdered;\n if ($qtyChecked > 0)\n $qtyReturnTotalQty = $qtyChecked;\n }else {\n //if not return to stock\n /*\n * total qty will be updated = qtyShipped - min[(qtyShipped + qtyRefunded + qtyRefund),qtyOrdered]\n * available qty not change\n */\n $totalShipAndRefund = $qtyShipped + $qtyRefunded + $qtyRefund;\n $qtyReturnTotalQty = min($totalShipAndRefund, $qtyOrdered);\n }\n $warehouseProduct = Mage::getModel('inventoryplus/warehouse_product')\n ->getCollection()\n ->addFieldToFilter('product_id', $item->getProductId())\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->getFirstItem();\n if ($warehouseProduct->getId()) {\n $warehouseProduct->setData('total_qty', $warehouseProduct->getTotalQty() + $qtyReturnTotalQty)\n ->setData('available_qty', $warehouseProduct->getAvailableQty() + $qtyReturnAvailableQty)\n ->save();\n }\n\n $warehouseShipment = Mage::getModel('inventoryplus/warehouse_shipment')\n ->getCollection()\n ->addFieldToFilter('item_id', $orderItemId)\n ->addFieldToFilter('product_id', $item->getProductId())\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->getFirstItem();\n if ($warehouseShipment->getId()) {\n $warehouseShipment->setData('qty_refunded', $warehouseShipment->getQtyRefunded() + $qtyRefund)\n ->save();\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(), null, 'inventory_management.log');\n }\n }", "public function run()\n {\n /** @var \\App\\Domains\\Repositories\\ExchangesHistoricsRepository $excHistRepository */\n $excHistRepository = app()->make('\\App\\Domains\\Repositories\\ExchangesHistoricsRepository');\n\n $excHistRepository->create([\n 'pair' => [\n ['id' => 'USD', 'default' => true, 'format' => 'U$', 'fraction_size' => 2],\n ['id' => 'BRL', 'default' => false, 'format' => 'R$', 'fraction_size' => 2]\n ],\n 'buy_value' => 2.90,\n 'sale_value' => 3.05\n ]);\n\n // BRL - USD\n $excHistRepository->create([\n 'pair' => [\n ['id' => 'BRL', 'default' => false, 'format' => 'U$', 'fraction_size' => 2],\n ['id' => 'PYG', 'default' => false, 'format' => 'G$', 'fraction_size' => 0]\n ],\n 'buy_value' => 1600,\n 'sale_value' => 1660\n ]);\n $excHistRepository->create([\n 'pair' => [\n ['id' => 'USD', 'default' => true, 'format' => 'U$', 'fraction_size' => 2],\n ['id' => 'PYG', 'default' => false, 'format' => 'G$', 'fraction_size' => 0]\n ],\n 'buy_value' => 5520,\n 'sale_value' => 5555\n ]);\n\n // BRL - USD - PYG\n $excHistRepository->create([\n 'pair' => [\n ['id' => 'USD', 'default' => true, 'format' => 'U$', 'fraction_size' => 2],\n ['id' => 'ARS', 'default' => false, 'format' => 'P$', 'fraction_size' => 0]\n ],\n 'buy_value' => 16.20,\n 'sale_value' => 17.20\n ]);\n $excHistRepository->create([\n 'pair' => [\n ['id' => 'BRL', 'default' => false, 'format' => 'U$', 'fraction_size' => 2],\n ['id' => 'ARS', 'default' => false, 'format' => 'P$', 'fraction_size' => 0]\n ],\n 'buy_value' => 4.74,\n 'sale_value' => 5.13\n ]);\n $excHistRepository->create([\n 'pair' => [\n ['id' => 'ARS', 'default' => false, 'format' => 'P$', 'fraction_size' => 0],\n ['id' => 'PYG', 'default' => false, 'format' => 'G$', 'fraction_size' => 0]\n ],\n 'buy_value' => 320,\n 'sale_value' => 345\n ]);\n }", "function addToAccountBalance($username,$soldValue,$stockTicker)\n{\n \n $mysql_server = '192.168.1.101';\n \n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n $findBalQry = \"SELECT * FROM bank WHERE username='$username'\";\n $findBalResult = $mysqli->query($findBalQry);\n \n $oldBalance = 0;\n \n if($findBalResult->num_rows > 0){\n while ($row = $findBalResult->fetch_assoc()){\n \n $oldBalance = $row['balance'];\n }\n }\n $newBalance = $oldBalance + $soldValue;\n \n $UpdateQry = \"UPDATE bank SET balance='$newBalance' where username='$username'\";\n $result = $mysqli->query($UpdateQry);\n \n //Print Values for Tests\n //var_dump($oldBalance);\n //var_dump($newBalance);\n \n}", "function buy_sell($pairing_id,$amount,$rate,$type){\n\tif($ch = curl_init ()){\n\t\t$data['pairing'] = $pairing_id;//btc/thb\n\t\t$data['amount'] = $amount;\n\t\t$data['rate'] = $rate;\n\t\t$data['type'] = $type;\n\t\t$data['key'] = 'xxx';\n\t\t$mt = explode(' ', microtime());\n\t\t$nonce = $mt[1].substr($mt[0], 2, 6);\n\t\t$data['nonce'] = $nonce;\n\t\t$data['signature'] = hash('sha256', 'xxx'.$nonce.'xxx');\n\t\t// if($this->twofa != ''){\n\t\t\t// $data['twofa'] = $this->twofa;\n\t\t// }\n\t\t\n\t\tcurl_setopt ( $ch, CURLOPT_URL, 'https://bx.in.th/api/order/');\n\t\tcurl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, false );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, false ); \n\t\tcurl_setopt ( $ch, CURLOPT_POST, count($data));\n\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS,$data);\n\t\t\n\t\t$str = curl_exec ( $ch );\n\t\n\t\tcurl_close ( $ch );\n\t\t\n\t\t$str = json_decode($str);\n\t\n\t\treturn $str;\n\n\t}\n\n}", "public function auto_import_cash_bond()\n {\n $this->load->model('EmployeeModel', 'employee');\n $this->load->model('CashBondModel', 'cashBond');\n $this->load->model('CashBondDetailModel', 'cashBondDetail');\n $this->load->model('StatusHistoryModel', 'statusHistory');\n $this->load->model('modules/WarehouseAPI', 'apiClient');\n\n $fromDate = date('Y-m-d', strtotime('-30 days'));\n\n try {\n $payments = $this->apiClient->get('cash-bond/payment', [\n 'type' => 'OB TPS',\n 'is_realized' => 1,\n 'from_date' => format_date($fromDate),\n ]);\n $cashBonds = $this->cashBond->getBy([\n 'cash_bond_type' => CashBondModel::TYPE_OTHER,\n 'no_cash_bond' => array_column(if_empty($payments, []), 'no_payment')\n ]);\n\n foreach ($payments as &$payment) {\n $payment = (array)$payment;\n $isEdit = false;\n foreach ($cashBonds as $index => $cashBond) {\n if ($payment['no_payment'] == $cashBond['no_cash_bond']) {\n $isEdit = true;\n $employeePayment = $this->employee->getBy(['ref_employees.id_user' => $payment['created_by']], true);\n $this->cashBond->update([\n 'id_employee' => if_empty((!empty($employeePayment) ? $employeePayment['id'] : ''), null),\n 'id_bank_account' => get_if_exist($payment, 'id_bank_account', null),\n 'no_cash_bond' => $payment['no_payment'],\n 'cash_bond_type' => CashBondModel::TYPE_OTHER,\n 'cash_bond_date' => $payment['created_at'],\n 'settlement_date' => $payment['realized_at'],\n 'requisite_description' => if_empty($payment['description'], 'OB TPS ' . $payment['no_reference']),\n 'amount_request' => $payment['amount_request'],\n 'description' => $payment['customer_name'] . ' - ' . $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n ], $cashBond['id']);\n\n $this->cashBondDetail->delete(['id_cash_bond' => $cashBond['id']]);\n $this->cashBondDetail->create([\n 'id_cash_bond' => $cashBond['id'],\n 'invoice_date' => if_empty(format_date($payment['payment_date']), null),\n 'payment_date' => if_empty(format_date($payment['payment_date']), null),\n 'no_invoice' => $payment['no_invoice'],\n 'amount' => $payment['amount'],\n 'description' => $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n ]);\n\n $cashBond = $this->cashBond->getById($cashBond['id']);\n $this->statusHistory->create([\n 'type' => StatusHistoryModel::TYPE_CASH_BOND,\n 'id_reference' => $cashBond['id'],\n 'status' => CashBondModel::STATUS_VALIDATED,\n 'description' => 'Auto merge data ' . $cashBond['no_cash_bond'],\n 'data' => json_encode([\n 'cash_bond' => $cashBond,\n 'cash_bond_detail' => $this->cashBondDetail->getBy(['id_cash_bond' => $cashBond['id']]),\n 'payment' => $payment,\n 'creator' => UserModel::loginData('name')\n ])\n ]);\n\n unset($cashBonds[$index]);\n break;\n }\n }\n\n if (!$isEdit) {\n $employeePayment = $this->employee->getBy(['ref_employees.id_user' => $payment['created_by']], true);\n $this->cashBond->create([\n 'id_employee' => if_empty((!empty($employeePayment) ? $employeePayment['id'] : ''), null),\n 'id_bank_account' => get_if_exist($payment, 'id_bank_account', null),\n 'no_cash_bond' => $payment['no_payment'],\n 'cash_bond_type' => CashBondModel::TYPE_OTHER,\n 'cash_bond_date' => $payment['created_at'],\n 'settlement_date' => $payment['realized_at'],\n 'source' => CashBondModel::SOURCE_IMPORT,\n 'requisite_description' => if_empty($payment['description'], 'OB TPS ' . $payment['no_reference']),\n 'amount_request' => $payment['amount_request'],\n 'description' => $payment['customer_name'] . ' - ' . $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n 'status' => CashBondModel::STATUS_VALIDATED\n ]);\n $cashBondId = $this->db->insert_id();\n\n $this->cashBondDetail->create([\n 'id_cash_bond' => $cashBondId,\n 'invoice_date' => if_empty(format_date($payment['payment_date']), null),\n 'payment_date' => if_empty(format_date($payment['payment_date']), null),\n 'no_invoice' => $payment['no_invoice'],\n 'amount' => $payment['amount'],\n 'description' => $payment['no_reference'],\n 'created_by' => $payment['created_by'],\n ]);\n\n $cashBond = $this->cashBond->getById($cashBondId);\n $this->statusHistory->create([\n 'type' => StatusHistoryModel::TYPE_CASH_BOND,\n 'id_reference' => $cashBondId,\n 'status' => CashBondModel::STATUS_VALIDATED,\n 'description' => 'Auto import data ' . $payment['no_payment'],\n 'data' => json_encode([\n 'cash_bond' => $cashBond,\n 'payment' => $payment,\n 'creator' => UserModel::loginData('name')\n ])\n ]);\n }\n }\n } catch (GuzzleException $e) {\n log_message('error', $e->getMessage());\n }\n }", "public function handle()\n {\n $startTime = microtime(true);\n $total = 0;\n $bar = $this->output->createProgressBar(10);\n \n AssetRate::truncate();\n \n $assets_table = Asset::all();\n $assets_ref = [];\n $all_asset_count = Asset::count(); \n foreach ($assets_table as $asset) {\n $assets_ref[$asset->coingecko_id] = [\"id\" => $asset->id, \"ticker\"=> $asset->ticker, \"updated\" => 0];\n }\n \n for ($j = 1; $j <= 10; $j++) {\n $url = 'https://api.coingecko.com/api/v3/coins?order=gecko_desc&per_page=500&page=' . $j;\n\n $data = file_get_contents($url);\n $json = json_decode($data);\n\n // save to assets\n foreach ($json as $coin) {\n \n $asset = null;\n \n if (isset($assets_ref[$coin->id]))\n $asset = $assets_ref[$coin->id];\n //Asset::where('coingecko_id', '=', $coin->id)->first();\n\n if ($asset && !$asset[\"updated\"]) {\n $asset[\"updated\"] = 1;\n // create new asset price row\n $rate = new AssetRate();\n\n $rate->asset_id = $asset[\"id\"];\n if ($asset[\"ticker\"] == 'BTC') {\n $rate->btc = 1;\n } else {\n $rate->btc = @$coin->market_data->current_price->btc;\n }\n\n $rate->usd = @$coin->market_data->current_price->usd;\n $rate->rub = @$coin->market_data->current_price->rub;\n $rate->source = \"coingecko\";\n $rate->save();\n\n $total++;\n }\n }\n\n $bar->advance();\n }\n\n $bar->finish();\n echo 'Done ' . $total . ' / ' . $all_asset_count . ' assets updated in ' . round(microtime(true) - $startTime, 2) . ' sec.' . PHP_EOL;\n }", "public function perform()\n {\n $typeIDs = $this->args[\"typeIDs\"];\n\n // Get all the data from EVE Central\n $pricingData = $this->app->EveCentral->getPrices($typeIDs);\n\n // Loop through all the typeID\n foreach ($pricingData as $typeID => $data) {\n $avgSell = 0;\n $lowSell = 0;\n $highSell = 0;\n $avgBuy = 0;\n $lowBuy = 0;\n $highBuy = 0;\n\n switch ($typeID) {\n // Customs Office\n case 2233:\n // Fetch the price for gantry, nodes, modules, mainframes, cores and sum it up, that's the price for a customs office\n $gantry = $this->app->EveCentral->getPrice(3962)[\"sell\"][\"min\"];\n $nodes = $this->app->EveCentral->getPrice(2867)[\"sell\"][\"min\"];\n $modules = $this->app->EveCentral->getPrice(2871)[\"sell\"][\"min\"];\n $mainframes = $this->app->EveCentral->getPrice(2876)[\"sell\"][\"min\"];\n $cores = $this->app->EveCentral->getPrice(2872)[\"sell\"][\"min\"];\n $avgSell = $gantry + (($nodes + $modules + $mainframes + $cores) * 8);\n break;\n\n // Motherships\n case 3628:\n case 22852:\n case 23913:\n case 23917:\n case 23919:\n $avgSell = 20000000000; // 20b\n break;\n\n // Revenant\n case 3514:\n $avgSell = 100000000000; // 100b\n break;\n\n // Titans\n case 671:\n case 3764:\n case 11567:\n case 23773:\n $avgSell = 100000000000; // 100b\n break;\n\n // Turney frigs\n case 2834:\n case 3516:\n case 11375:\n $avgSell = 80000000000; // 80b\n break;\n\n // Chremoas\n case 33397:\n $avgSell = 120000000000; // 120b\n break;\n // Cambion\n case 32788:\n $avgSell = 100000000000; // 100b\n break;\n\n // Adrestia\n case 2836:\n $avgSell = 150000000000; // 150b\n break;\n // Vangel\n case 3518:\n $avgSell = 90000000000; // 90b\n break;\n // Etana\n case 32790:\n $avgSell = 100000000000; // 100b\n break;\n // Moracha\n case 33395:\n $avgSell = 125000000000; // 125b\n break;\n // Mimir\n case 32209:\n $avgSell = 100000000000; // 100b\n break;\n\n // Chameleon\n case 33675:\n $avgSell = 120000000000; // 120b\n break;\n // Whiptail\n case 33673:\n $avgSell = 100000000000; // 100b\n break;\n\n // Polaris\n case 9860:\n $avgSell = 1000000000000; // 1t\n break;\n // Cockroach\n case 11019:\n $avgSell = 1000000000000; // 1t\n break;\n\n // Gold Magnate\n case 11940:\n // Silver Magnate\n case 11942:\n // Opux Luxury Yacht\n case 635:\n // Guardian-Vexor\n case 11011:\n // Opux Dragoon Yacht\n $avgSell = 500000000000; // 500b\n break;\n\n // Megathron Federate Issue\n case 13202:\n // Raven State Issue\n case 26840:\n // Apocalypse Imperial Issue\n case 11936:\n // Armageddon Imperial Issue\n case 11938:\n // Tempest Imperial Issue\n case 26842:\n $avgSell = 750000000000; // 750b\n break;\n\n // Fallthrough\n default:\n $avgSell = $data[\"sell\"][\"avg\"];\n $lowSell = $data[\"sell\"][\"min\"];\n $highSell = $data[\"sell\"][\"max\"];\n $avgBuy = $data[\"buy\"][\"avg\"];\n $lowBuy = $data[\"buy\"][\"min\"];\n $highBuy = $data[\"buy\"][\"max\"];\n\n // If the selling price is under 0.05% different from the buying price then we swap them..\n if ($highBuy > 0 && $lowSell > 0) {\n if ((($highBuy / $lowSell) * 100) < 0.05) {\n // Make sure it has no chance of being duplicated\n $duplicationChance = $this->app->Db->queryField(\"SELECT chanceOfDuplicating FROM invTypes WHERE typeID = :typeID\", \"chanceOfDuplicating\", array(\":typeID\" => $typeID));\n if ($duplicationChance == 0) {\n $avgSell = $data[\"buy\"][\"avg\"];\n $lowSell = $data[\"buy\"][\"min\"];\n $highSell = $data[\"buy\"][\"max\"];\n $avgBuy = $data[\"buy\"][\"avg\"];\n $lowBuy = $data[\"buy\"][\"min\"];\n $highBuy = $data[\"buy\"][\"max\"];\n }\n }\n }\n break;\n }\n\n $date = $data[\"date\"];\n\n // a fallthrough for pre-defined prices\n if ($lowSell == 0) $lowSell = $avgSell;\n\n if ($highSell == 0) $highSell = $avgSell;\n\n // Now we just insert it all and call it a day\n $this->app->Db->execute(\"INSERT INTO invPrices (typeID, avgSell, lowSell, highSell, avgBuy, lowBuy, highBuy) VALUES (:typeID, :avgSell, :lowSell, :highSell, :avgBuy, :lowBuy, :highBuy) ON DUPLICATE KEY UPDATE avgSell = :avgSell, lowSell = :lowSell, highSell = :highSell, avgBuy = :avgBuy, lowBuy = :lowBuy, highBuy = :highBuy\", array(\n \":typeID\" => $typeID,\n \":avgSell\" => $avgSell,\n \":lowSell\" => $lowSell,\n \":highSell\" => $highSell,\n \":avgBuy\" => $avgBuy,\n \":lowBuy\" => $lowBuy,\n \":highBuy\" => $highBuy,\n ));\n\n $this->app->StatsD->increment(\"ecPriceUpdates\");\n }\n }", "public function testRerunC51JsonDoesntIncreaseTotalOffers(): void\n {\n $path = __DIR__ . '/../../../data/c51.json';\n $statusCodeBefore = $this->executeCommand(['path' => $path]);\n $this->assertEquals(0, $statusCodeBefore);\n\n $offersBefore = self::$container->get(OfferRepository::class)->findAll();\n $statusCodeAfter = $this->executeCommand(['path' => $path]);\n $this->assertEquals(0, $statusCodeAfter);\n\n $offersAfter = self::$container->get(OfferRepository::class)->findAll();\n $this->assertEquals(count($offersBefore), count($offersAfter));\n }", "private function updateWallet ($vendor, $transaction) {\n $commission = $this->calculateCommission($transaction->type, $vendor->user_id, $transaction->amount);\n $distCommission = $this->calculateCommission($transaction->type, $vendor->parent_id, $transaction->amount);\n $superDistId = Vendor::where('user_id', $vendor->parent_id)->first()->parent_id;\n $superDistCommission = $this->calculateCommission($transaction->type, $superDistId, $transaction->amount);\n\n\n // Perform Wallet Updations for Amount Transacted\n if ($transaction->type == 1 || $transaction->type == 2) {\n $vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $vendor->balance\n ]);\n\n $key = $transaction->type == 1 ? 'debit_id' : ($transaction->type == 2 ? 'credit_id' : '');\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n $dipl_vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $dipl_vendor->save();\n $dipl_amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $dipl_vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $dipl_vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $dipl_vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $dipl_amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n }\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n\n // Perform Wallet Updations for Commission\n if ($commission && $dipl_vendor->commission && $vendor->commission) {\n if ($commission['rate_type'] == 1)\n $vendor->balance += $commission['rate'];\n if ($commission['rate_type'] == 2)\n $vendor->balance += $transaction->amount * $commission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => 1,\n 'amount' => $commission['rate'],\n 'balance' => $vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $commission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n\n if ($distCommission && $dipl_vendor->commission) {\n $distributor = Vendor::where('user_id', $vendor->parent_id)->lockForUpdate()->first();\n if ($distributor && $distributor->commission == 1) {\n if ($distCommission['rate_type'] == 1)\n $distributor->balance += $distCommission['rate'];\n if ($distCommission['rate_type'] == 2)\n $distributor->balance += $transaction->amount * $distCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $distributor->id,\n 'transaction_type' => 1,\n 'amount' => $distCommission['rate'],\n 'balance' => $distributor->balance\n ]);\n\n $distributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $distributor->id,\n 'amount' => $distCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n } \n }\n\n if ($superDistCommission && $dipl_vendor->commission) {\n $superDistributor = Vendor::where('user_id', $superDistId)->lockForUpdate()->first();\n if ($superDistributor && $superDistributor->commission == 1) {\n if ($superDistCommission['rate_type'] == 1)\n $superDistributor->balance += $superDistCommission['rate'];\n if ($superDistCommission['rate_type'] == 2)\n $superDistributor->balance += $transaction->amount * $superDistCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $superDistributor->id,\n 'transaction_type' => 1,\n 'amount' => $superDistCommission['rate'],\n 'balance' => $superDistributor->balance\n ]);\n\n $superDistributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $superDistributor->id,\n 'amount' => $superDistCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n \n }\n\n return $vendor->balance;\n }", "public function handle()\n {\n $this->info('Starting to process deposits');\n $this->info('Initiating Wallet...');\n $host = config('app.wallet.ip');\n $wallet = new Wallet($host);\n $this->info('Wallet initiated');\n \n $this->info('Get all banks');\n $banks = Bank::all();\n if (count($banks) > 0) {\n $deposits = 0;\n $success = 0;\n $bar = $this->output->createProgressBar(count($banks));\n $start = Carbon::now();\n foreach ($banks as $bank) {\n $user = User::find($bank->user_id);\n if ($user !== null) {\n $splitIntegrated = $wallet->splitIntegratedAddress($bank->address);\n $splitIntegrated = json_decode($splitIntegrated);\n \n if ($splitIntegrated !== '') {\n $payments = $wallet->getPayments($splitIntegrated->payment_id);\n $payments = json_decode($payments);\n \n if ($payments !== []) {\n if (isset($payments->payments)) {\n $payments = $payments->payments;\n foreach ($payments as $payment) {\n $entry_found = RecTxid::where('txid', $payment->tx_hash)->first();\n if ($entry_found === null) {\n sleep(1);\n $stats = file_get_contents('http://superior-coin.info:8081/api/transaction/'.$payment->tx_hash);\n $stats = json_decode($stats);\n $stats = $stats->data;\n\n $txid = $stats->tx_hash;\n $timestamps = $stats->timestamp_utc;\n $height = $stats->block_height;\n\n // FOR DOUBLE CHECKING\n $entry_found_again = RecTxid::where('txid', $txid)->first();\n if ($entry_found_again === null) {\n $rec_txids = new RecTxid;\n if ($height >= 10) {\n $rec_txids->status = 1;\n }else{\n $rec_txids->status = 0;\n }\n $rec_txids->user_id = $user->id;\n $rec_txids->recadd = $bank->address;\n $rec_txids->txid = $txid;\n $rec_txids->date = $timestamps;\n $rec_txids->height = $height;\n $rec_txids->coins = $payment->amount / 100000000;\n $rec_txids->save();\n \n $success++;\n }\n }\n $deposits++;\n }\n }\n }\n }\n }\n $bar->advance();\n }\n $end = Carbon::now();\n $total_run = $start->diffInSeconds($end);\n $run_time = gmdate('H:i:s', $total_run);\n $bar->finish();\n $this->info('Total run: ' . $run_time);\n $this->info('Processed ' . $success . ' out of ' . $deposits . ' deposits from ' . count($banks) . ' banks');\n } else {\n $this->info('No Banks found');\n }\n $this->info('Process end!');\n }", "function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Authorize.net (eCheck) Module', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STATUS', 'True', 'Do you want to accept eCheck payments via Authorize.net?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Login ID', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN', 'testing', 'The API Login ID used for the Authorize.net service', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('Transaction Key', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY', 'Test', 'Transaction Key used for encrypting TP data<br />(See your Authorizenet Account->Security Settings->API Login ID and Transaction Key for details.)', '6', '0', now(), 'zen_cfg_password_display')\"); \r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function) values ('MD5 Hash', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH', '*Set A Hash Value at AuthNet Admin*', 'Encryption key used for validating received transaction data (MAX 20 CHARACTERS)', '6', '0', now(), 'zen_cfg_password_display')\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE', 'Test', 'Transaction mode used for processing orders', '6', '0', 'zen_cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE', 'Authorize', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'zen_cfg_select_option(array(\\'Authorize\\', \\'Authorize+Capture\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Database Storage', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA', 'True', 'Do you want to save the gateway communications data to the database?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Customer Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER', 'False', 'Should Authorize.Net email a receipt to the customer?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Merchant Notifications', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT', 'False', 'Should Authorize.Net email a receipt to the merchant?', '6', '0', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID', '1', 'Set the status of orders made with this payment module to this value', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING', 'Off', 'Would you like to enable debug mode? A complete detailed log of failed transactions may be emailed to the store owner.', '6', '0', 'zen_cfg_select_option(array(\\'Off\\', \\'Log File\\', \\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Wells Fargo SecureSource Merchant', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED', 'False', 'Are you a Wells Fargo SecureSource merchant? eCheck transactions will collect additional information from customers. Set to True only if your account has been configured to use Wells Fargo SecureSource.', '6', '0', 'zen_cfg_select_option(array(\\'False\\', \\'True\\'), ', now())\");\r\n }", "function update_wallet($cust_id,$amount,$sale_id,$user_id,$sale_type){\n\tglobal $connection; \n\t$trans=\"CUSTOMER PAID UPFRONT\"; \n\t$update_wallet=mysqli_query($connection,\"INSERT INTO kp_sc (cust_id,amount) VALUES ('$cust_id', '$amount') ON DUPLICATE KEY UPDATE amount=amount+'$amount'\") or die(mysqli_error($connection));\n\n\tif ($update_wallet) {\n\t\t$create_history = mysqli_query($connection,\"INSERT INTO kp_sc_hist(cust_id,amount,trans,user_id,trans_id,trans_type,day) \n\t\tVALUES('$cust_id','$amount','$trans','$user_id','$sale_id','$sale_type',CURRENT_DATE)\") or die(mysqli_error($connection));\n\t}else{\n\t\t error_logs(\"PAY CREDIT ORDER\",\"COULDN'T UPDATE WALLET FOR SALE ID $sale_id\");\n\t}\n\t\n}", "public function importmagento()\n {\n $base_url=\"http://myshoes.fastcomet.host/Magentos/\";\n //API user\n $user=\"apiuser\";\n //API key\n $password=\"81eRvINu9r\";\n\n\n $api_url=$base_url.'index.php/api/soap/?wsdl';\n $client = new SoapClient($api_url);\n $session = $client->login($user,$password);\n\n $params = array(array(\n 'status'=>array('eq'=>'enabled')\n ));\n\n $result1 = $client->call($session, 'catalog_product.list');\n\n $i=0;\n foreach($result1 as $key => $value)\n {\n $result2 = $client->call($session, 'catalog_product.info',$result1[$key]['product_id']);\n $result3 = $client->call($session, 'cataloginventory_stock_item.list',$result1[$key]['product_id']);\n $arr[$i]['Product']['product_id']=$result1[$key]['product_id'];\n $arr[$i]['Product']['name']=$result1[$key]['name'];\n $arr[$i]['Product']['description']=$result2['description'];\n $arr[$i]['Product']['uom']='';\n $arr[$i]['Product']['category']= '';\n $arr[$i]['Product']['group']='';\n $arr[$i]['Product']['sku']=$result1[$key]['sku'];\n $arr[$i]['Product']['value']= number_format((float)$result2['price'], 2, '.', '');\n $arr[$i]['Product']['reorderpoint']='';\n $arr[$i]['Product']['safetystock']='';\n $arr[$i]['Product']['bin']='';\n $arr[$i]['Product']['imageurl']='';\n $arr[$i]['Product']['pageurl']=$base_url.$result2['url_path'];\n $arr[$i]['Product']['weight']= number_format((float)$result2['weight'], 2, '.', '');\n $arr[$i]['Product']['height']='';\n $arr[$i]['Product']['width']='';\n $arr[$i]['Product']['depth']='';\n $arr[$i]['Product']['barcodesystem']='';\n $arr[$i]['Product']['barcode_number']='';\n $arr[$i]['Product']['packaginginstructions']='';\n $arr[$i]['Product']['color']='';\n $arr[$i]['Product']['size']='';\n $arr[$i]['Inventory']['inventoryquantity']=$result3[0]['qty'];\n $arr[$i]['Product']['createdinsource']=$result2['created_at'];\n $arr[$i]['Product']['modifiedinsource']=$result2['updated_at'];\n $i++;\n }\n $this->importcsv(null, $arr);\n return $this->redirect(array('controller' => 'products', 'action' => 'index'));\n }", "function applyWallet($Adv,$amount,$lastrate,$transferAmount){ \r\n\t$wallet = Wallet::get(array(\"id_user\" => $_SESSION[\"gak_id\"]));\r\n\t$totalToman = $amount*$lastrate + $lastrate*$transferAmount;\r\n\tif ($wallet->amount < $totalToman){\r\n\t\t$_SESSION['result']=\" موجودی کیف پول شما از مبلغ درخواست کمتر است. \";\r\n\t\t$_SESSION['alert']=\"warning\";\r\n\t\theader(\"location: /dinero/deal?amount=\".$_GET['amount'].\"&id=\".$_GET['id'].\"&balance=low\");\r\n\t}else{\r\n\t\t//update wallet and add transaction\r\n\t\t//insert\r\n\t\t$insert_wallettransaction=array(\r\n\t\t\t\t\"id_wallet\" => $wallet->id,\r\n\t\t\t\t\"type\" => \"withdraw\",\r\n\t\t\t\t\"amount\" => $totalToman,\r\n\t\t\t\t\"status\" => \"confirm\",\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\")\r\n\t\t);\r\n\t\t$walletTransaction = Wallettransactions::insert($insert_wallettransaction);\r\n\t\t//update\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $wallet->id,\r\n\t\t\t\t\"amount\" => $wallet->amount - $totalToman\r\n\t\t);\r\n\t\tWallet::update($arr_update);\r\n\t\t//log\r\n\t\tAccountkitlog::insert(array(\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"), \"title\" => \"walletWithdraw\"));\r\n\t\t//trade\r\n\t\t\r\n\t\t$arr_insert=array(\r\n\t\t\t\t\"id_buyer\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"id_seller\" => $Adv->id_user,\r\n\t\t\t\t\"id_adv\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $amount,\r\n\t\t\t\t\"exchange_rate\" => $lastrate,\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"trade_status\" => \"buyerpaid\",\r\n\t\t\t\t\"buyerpay_status\" => \"confirm\",\r\n\t\t\t\t\"sellerpay_status\" => \"pending\",\r\n\t\t\t\t\"buyerpay_details\" => \"id:\".$walletTransaction.\"|Payment:Wallet|refID:\".date(\"YmdHis\"),\r\n\t\t\t\t\"sellerpay_details\" => \"\"\r\n\t\t);\r\n\t\t$Trade = Dinerotrade::insert($arr_insert);\r\n\t\t\r\n\t\t//update text transaction wallet\r\n\t\tWallettransactions::update(array(\"id\"=>$walletTransaction, \"text\"=>\"Withdraw from wallet, Trade #\".$Trade*951753 ));\r\n\t\t\r\n\t\t//update adv\r\n\t\t$updateAmount = $Adv->amount - $amount;\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $updateAmount\r\n\t\t);\r\n\t\tDineroadv::update($arr_update);\r\n\t\t\r\n\t\t//user logs\r\n\t\tAccountkitlog::insert(array(\r\n\t\t\t\t\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"title\" => \"tradePaid\"));\r\n\t\t\t\r\n\t\t//send emails and sms\r\n\t\t$checkTrade=Dinerotrade::get(array(\"id\" => $Trade,\"id_buyer\" => $_SESSION[\"gak_id\"]));\r\n\t\t$seller = AccountKit::get(array(\"id\" => $checkTrade->id_seller));\r\n\t\t$buyer = AccountKit::get(array(\"id\" => $checkTrade->id_buyer));\r\n\t\t$sellerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_seller, \"type\" => \"fullname\"));\r\n\t\t$buyerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"fullname\"));\r\n\t\t$buyerBankname= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"bankname\"));\r\n\t\t$buyerIban= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"iban\"));\r\n\t\t$transferAmount = findTransferAmount($checkTrade->amount);\r\n\t\t$token = $GLOBALS['GCMS_SETTING']['dinero']['smstoken'];\r\n\t\t$params = array(\r\n\t\t\t\t'to' => $seller->number,\r\n\t\t\t\t'from' => 'Info',\r\n\t\t\t\t'message' => \"Trade for \".$checkTrade->amount .\"€ \"\r\n\t\t\t\t.\"https://24dinero.com/\"\r\n\t\t\t\t,\r\n\t\t);\r\n\t\t//sms_send($params,$token);\r\n\t\t\r\n\t\t//start send email\r\n\t\t$bodyStatusDineroSeller= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#D84A38;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو، لطفا سریعا اقدام کنید\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoSeller= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your advertisements on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can confirm or cancel the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionSeller= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format(floor($checkTrade->amount*2.5/100)).' <br>\r\n ٪2.5 Commission\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format((floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ (floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t$bodyStatusDineroBuyer= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#016910;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoBuyer= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your trade on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can follow the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionBuyer= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format($transferAmount).' <br>\r\n Transfer Amount\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($transferAmount* $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ $transferAmount* $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t//sendingblue email\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/libs/Mailin.php\");\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/controller/emailTemplate.php\");\r\n\t\t$mailin = new Mailin('https://api.sendinblue.com/v2.0',$GLOBALS['GCMS_SETTING']['dinero']['sendinblueAPIKey']);\r\n\t\t//seller\r\n\t\t$maildata = array( \"to\" => array($seller->email=> $sellerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroSeller,$bodyInfoSeller,$bodyTransactionSeller),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//buyer\r\n\t\t$maildata = array( \"to\" => array($buyer->email=> $buyerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroBuyer,$bodyInfoBuyer,$bodyTransactionBuyer),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//\\\\\\\\\\end send email\r\n\t\t\r\n\t\t$_SESSION['result']=\"پرداخت شما با موفقیت انجام شد\";\r\n\t\t$_SESSION['alert']=\"success\";\r\n\t\theader(\"location: /dinero/trade/\".$Trade);\r\n\t\t\r\n\t}\r\n\t\r\n}", "public function userBuyCoinHistory()\n {\n $response = ['success' => false, 'message'=> __('Something went wrong.')];\n $items = Sell::where(['user_id'=> Auth::user()->id])->get();\n $datas = [];\n if (isset($items[0])) {\n $datas = [];\n foreach ($items as $item) {\n $datas[] = [\n 'user_name' => $item->user->name,\n 'coin_name' => $item->coin->name,\n 'payment_method' => $item->payment->name,\n 'amount' => $item->amount,\n 'price_rate' => $item->price,\n 'date' => date('d M y', strtotime($item->created_at)),\n ];\n }\n $response = [\n 'success' => true,\n 'buy_history' => $datas,\n 'message'=> __('Data get successfully.')];\n } else {\n $response = ['success' => false,'buy_history' => [], 'message'=> __('No data found.')];\n }\n\n return $response;\n }", "public function canBuyStatusAdditionalBundle($args)\n {\n // error_reporting(0);\n // exit;\n $repo = $this->entityManager->getRepository('ZSELEX_Entity_Bundle');\n $bundleId = $args ['bundle_id'];\n $shop_id = $args ['shop_id'];\n $downgradeBundleId = $args ['d_bundle_id'];\n $shoptype = ModUtil::apiFunc('ZSELEX', 'admin', 'shopType',\n $typeargs = array(\n 'shop_id' => $shop_id\n ));\n $shoptype = $shoptype ['shoptype'];\n\n $result = $repo->getAll(array(\n 'entity' => 'ZSELEX_Entity_BundleItem',\n 'fields' => array(\n 'b.plugin_id',\n 'a.servicetype',\n 'a.service_name',\n 'b.service_depended',\n 'b.depended_services',\n 'b.shop_depended'\n ),\n 'joins' => array(\n 'LEFT JOIN a.plugin b'\n ),\n 'where' => array(\n 'a.bundle' => $bundleId,\n ' b.status' => 1\n )\n ));\n // echo \"<pre>\"; print_r($result); echo \"</pre>\";\n\n $cantbuy = 0;\n $shopdepended = 0;\n $finalservices = array();\n $depend_services = array();\n $typeonly = array();\n $b = 0;\n\n foreach ($result as $key => $val) { // loop through bundle item services\n // $typeonly= array();\n $servicetype1 = $val ['servicetype'];\n // echo $servicetype1 . '<br>';\n $typeonly [] = $servicetype1;\n // echo \"<pre>\"; print_r($typeonly); echo \"</pre>\";\n // echo $servicetype . \"-\". $val['shop_depended'] .'<br>';\n if ($val ['service_depended'] == 1) { // check for depended services\n // echo $val['depended_services'] . '<br><br><br>';\n // echo $servicetype . \"-\". $val['shop_depended'] .'<br>';\n $depend_services = unserialize($val ['depended_services']); // convert to array\n $depend_services = (array) $depend_services;\n // echo \"<pre>\"; print_r($depend_services); echo \"</pre>\";\n // echo \"<pre>\"; print_r($newArr); echo \"</pre>\";\n\n foreach ($depend_services as $key1 => $val1) { // loop through depended services of each bundle item services\n // echo $val1['type'] . '<br>';\n // echo $key1 . '<br>';\n $serviceType = $val1 ['type'];\n\n $countItemInBundle = $repo->getCount(null,\n 'ZSELEX_Entity_BundleItem', 'id',\n array(\n 'a.bundle' => $bundleId,\n 'a.servicetype' => $serviceType\n ));\n // echo $countItemInBundle . \"<br>\";\n if ($countItemInBundle == 0) {\n\n $itemExist = $repo->getCount(null,\n 'ZSELEX_Entity_BundleItem', 'id',\n array(\n 'a.bundle' => $downgradeBundleId,\n 'a.servicetype' => $serviceType\n ));\n\n\n if ($itemExist < 1) {\n $cantbuy ++;\n }\n }\n if ($val ['shop_depended'] == 1) { // check for shop depended for depended services\n $shop_depend_count = $repo->getCount2(array(\n 'entity' => 'ZSELEX_Entity_Plugin',\n 'field' => 'plugin_id',\n 'where' => \"a.type=:servicetype AND (a.depended_shoptypes LIKE :shoptype OR a.depended_shoptypes LIKE '')\",\n 'setParams' => array(\n 'servicetype' => $serviceType,\n 'shoptype' => \"%\".DataUtil::formatForStore($shoptype).\"%\"\n )\n ));\n\n // echo $shop_depend_count . \"<br>\";\n // echo $serviceType .\"-\". $ishopcount . '<br>';\n if ($shop_depend_count < 1) {\n $cantbuy ++; // shop based\n $shopdepended ++;\n }\n }\n\n\n\n // echo $depend_services[$key]['canbuystatus'] . '<br>';\n $b ++;\n }\n\n // echo \"<br>\";\n }\n }\n\n\n\n return $cantbuy;\n }", "function buy(Time $processingTime, Trade $updateExistingTrade = null, $cancelOffer = false, $price)\n\t{\n\t\t$sellingAsset = $this->settings->getBaseAsset();\n\t\t$buyingAsset = $this->settings->getCounterAsset();\n\t\t\n\t\t$budget = $this->getCurrentBaseAssetBudget(true);\n\t\t$sellAmount = \\GalacticHorizon\\Amount::createFromFloat($budget);\n\n\t\tif (!$cancelOffer && $sellAmount->toFloat() <= 0) {\n\t\t\t$this->data->logError(\"Manage buy offer failed, buying amount is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$cancelOffer && (float)$price <= 0)\n\t\t{\n\t\t\t$this->data->logError(\"Manage buy offer failed, price is zero.\");\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/*\n\t\tvar_dump(\"budget = \" . $budget);\n\t\tvar_dump(\"price = \" . $price);\n\t\tvar_dump(\"sellingAsset = \" . $sellingAsset->getCode());\n\t\tvar_dump(\"sellAmount = \" . $sellAmount->toFloat());\n\t\tvar_dump(\"buyingAsset = \" . $buyingAsset->getCode());\n\t\texit();\n\t\t*/\n\n\t\t$manageOffer = new \\GalacticHorizon\\ManageSellOfferOperation();\n\t\t$manageOffer->setSellingAsset($sellingAsset);\n\t\t$manageOffer->setBuyingAsset($buyingAsset);\n\t\t$manageOffer->setSellAmount($cancelOffer ? \\GalacticHorizon\\Amount::createFromFloat(0) : $sellAmount);\n\t\t$manageOffer->setPrice(\\GalacticHorizon\\Price::createFromFloat($price));\n\t\t$manageOffer->setOfferID($updateExistingTrade ? $updateExistingTrade->getOfferID() : null);\n\n\t\ttry {\n\t\t\t$transaction = new \\GalacticHorizon\\Transaction($this->settings->getAccountKeypair());\n\t\t\t$transaction->addOperation($manageOffer);\n\t\t\t$transaction->sign([$this->settings->getAccountKeypair()]);\n\t\t\t\n\t\t\t$buffer = new \\GalacticHorizon\\XDRBuffer();\n\t\t\t$transaction->toXDRBuffer($buffer);\n\n\t\t\t$automaticlyFixTrustLineWithAmount = \\GalacticHorizon\\Amount::createFromFloat(2000000);\n\n\t\t\t$transactionResult = $transaction->submit($automaticlyFixTrustLineWithAmount);\n\n\t\t\tif ($transactionResult->getErrorCode() == \\GalacticHorizon\\TransactionResult::TX_SUCCESS) {\n\t\t\t\t// Return when an offer is cancelled\n\t\t\t\tif ($cancelOffer)\n\t\t\t\t\treturn true;\n\n\t\t\t\t$trade = Trade::fromGalacticHorizonOperationResponseAndResultForBot(\n\t\t\t\t\t$manageOffer,\n\t\t\t\t\tTrade::TYPE_BUY,\n\t\t\t\t\t$transactionResult,\n\t\t\t\t\t$transactionResult->getResult(0),\n\t\t\t\t\t$buffer->toBase64String(),\n\t\t\t\t\t$transactionResult->getFeeCharged()->toString(),\n\t\t\t\t\t$this\n\t\t\t\t);\n\n\t\t\t\t$lastTrade = $this->data->getLastTrade();\n\n\t\t\t\tif ($lastTrade)\n\t\t\t\t\t$trade->setPreviousBotTradeID($lastTrade->getID());\n\n\t\t\t\t$trade->setProcessedAt($processingTime->getDateTime());\n\n\t\t\t\t$this->data->addTrade($trade);\n\n\t\t\t\treturn $trade;\n\t\t\t} else {\n\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, error code = \" . $transactionResult->getErrorCode());\n\n\t\t\t\tif ($transactionResult->getResultCount() > 0) {\n\t\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer result, error code = \" . $transactionResult->getResult(0)->getErrorCode());\n\t\t\t\t}\n\n\t\t\t\t$this->getDataInterface()->logError(\"Transaction envelope = \" . $buffer->toBase64String());\n\t\t\t}\n\t\t} catch (\\GalacticHorizon\\Exception $e) {\n\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, exception = \" . (string)$e);\n\t\t\t$this->getDataInterface()->logError(\"Response = \" . $e->getHttpResponseBody());\n\t\t}\t\n\n\t\treturn false;\n\t}", "public function user_accept_history_flow($booking_id) {\n if (!empty($booking_id)) {\n $booking = $this->get_book_info_b($booking_id);\n\n if (!empty($booking)) {\n $provider = $this->get_user_info($booking['provider_id'], 1);\n\n $wallet = $this->api->get_wallet($provider['token']);\n\n $curren_wallet = $wallet['wallet_amt'];\n\n $query = $this->db->query('select * from admin_commission where admin_id=1');\n $amount = $query->row();\n $pertage = $amount->commission;\n\n $commission = ($booking['amount']) * $pertage / 100;\n $ComAmount = $booking['amount'] - $commission;\n\n /* wallet infos */\n\n $history_pay['token'] = $provider['token'];\n $history_pay['user_provider_id'] = $provider['id'];\n $history_pay['type'] = $provider['type'];\n $history_pay['tokenid'] = $booking_id;\n $history_pay['payment_detail'] = json_encode($booking); //response\n $history_pay['charge_id'] = $booking['provider_id'];\n $history_pay['transaction_id'] = $booking_id;\n $history_pay['exchange_rate'] = 0;\n $history_pay['paid_status'] = 'pass';\n $history_pay['cust_id'] = 'Self';\n $history_pay['card_id'] = 'Self';\n $history_pay['total_amt'] = $booking['amount'] * 100;\n $history_pay['fee_amt'] = 0;\n $history_pay['net_amt'] = $booking['amount'] * 100;\n $history_pay['amount_refund'] = 0;\n $history_pay['current_wallet'] = $curren_wallet;\n $history_pay['credit_wallet'] = $ComAmount;\n $history_pay['debit_wallet'] = 0;\n $history_pay['avail_wallet'] = ($ComAmount) + $curren_wallet;\n $history_pay['reason'] = COMPLETE_PROVIDER;\n $history_pay['created_at'] = date('Y-m-d H:i:s');\n\n $walletHistory = $this->db->insert('wallet_transaction_history', $history_pay);\n\n if ($walletHistory) {\n /* update wallet table */\n $wallet_data['wallet_amt'] = $history_pay['avail_wallet'];\n $wallet_data['updated_on'] = date('Y-m-d H:i:s');\n $WHERE = array('token' => $provider['token']);\n $result = $this->api->update_wallet($wallet_data, $WHERE);\n\n\n /* payment on stripe */\n\n $commissionInsert = [\n \t'date' => date('Y:m:d'),\n 'provider' => $booking['provider_id'],\n 'user' => $booking['user_id'],\n 'amount' => $booking['amount'],\n 'commission' => $pertage,\n ];\n $commInsert = $this->db->insert('revenue', $commissionInsert);\n\n\n return $result;\n }\n }\n }\n }", "function jsonfileRead(){\n $json_filecontent=file_get_contents(\"StockAccount.json\");\n $array=json_decode($json_filecontent,true);\n $sum=0;\n $totalvalue=0;\n $array_totalvalue=array();\n //create object of class Linkedlist\n //array to store stock names \n $array_stockname=array(\"Book\",\"Newspaper\");\n echo \"Details of stock\\n\";\n for($j=0;$j<count($array_stockname);$j++){\n echo \"\\n\";\n for($i=0;$i<count($array_stockname);$i++){\n echo \"value of \".$array[$array_stockname[$j]][$i][\"symbol\"].\":\".($array[$array_stockname[$j]][$i][\"no_of_shares\"]*$array[$array_stockname[$j]][$i][\"price\"]).\"\\n\";\n $sum=($array[$array_stockname[$j]][$i][\"no_of_shares\"]*$array[$array_stockname[$j]][$i][\"price\"]);\n $totalvalue=$totalvalue+$sum;\n }\n echo \"Total value of \".$array_stockname[$j].\":\".$totalvalue.\"\\n\";\n $array_total=array($totalvalue);\n array_push($array_totalvalue,$array_total);\n $totalvalue=0;\n }\n echo \"\\n\";\n return $array_totalvalue;\n \n }", "function payCheq($connection,$cheq_ref){\r\n\r\n //pay cheque\r\n $sql = \"SELECT accno ,debit,cheqto,cheq_amount FROM _transactionshistory WHERE check_ref=:cheq_ref AND cheqpaid=0 \";\r\n $stmt = $connection->prepare($sql);\r\n $stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n $row = $stmt->fetch();\r\n // echo $row['debit'];\r\n if($row['cheq_amount']>0){\r\n //deduct drawer amount debited + charges and update balance\r\n try {\r\n\r\n $connection->beginTransaction();\r\n //balance before debit and charges\r\n $balance = Services::getforAccountsBalance($connection,$row['accno']);\r\n $payee_sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $charges = Services::charges($row['cheq_amount']);\r\n $stmt = $connection->prepare($payee_sql);\r\n $stmt->execute(array(':balance'=>$balance-$row['cheq_amount']-$charges,':account'=>$row['accno']));\r\n\r\n //get account to pay to\r\n $payee_balSQL = \"SELECT balance FROM _accounts WHERE accno=:payee_acc\";\r\n $statement_p = $connection->prepare($payee_balSQL);\r\n\r\n $statement_p->execute(array(':payee_acc'=>$row['cheqto']));\r\n $payee_bal = $statement_p->fetch();\r\n\r\n //update payee account balance\r\n $update_accounts = \"UPDATE _accounts SET balance=:bala WHERE accno=:acc\";\r\n $up_stmt = $connection->prepare($update_accounts);\r\n $new_bal = $payee_bal['balance']+$row['cheq_amount'];\r\n $up_stmt->execute(array(':bala'=>$new_bal,':acc'=>$row['cheqto']));\r\n\r\n //record the transaction history\r\n $history_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:cancelled,:balance)\";\r\n $history_stmt = $connection->prepare($history_sql);\r\n $history_stmt->execute(array(':accno'=>$row['cheqto'],':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$row['cheq_amount'],\r\n ':check_ref'=>$cheq_ref,':cancelled'=>1,':balance'=>$new_bal));\r\n\r\n //record drawer transaction details for drawer\r\n $history_sql2 = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,charges,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:charges,:cancelled,:balance)\";\r\n $history_stmt2 = $connection->prepare($history_sql2);\r\n $history_stmt2->execute(array(':accno'=>$row['accno'],':date'=>date(\"Y/m/d\"),':debit'=>$row['cheq_amount'],':credit'=>0,\r\n ':check_ref'=>$cheq_ref,':charges'=>$charges,':cancelled'=>1,':balance'=>$balance-$row['cheq_amount']-$charges));\r\n\r\n\r\n //mark cheque as paid\r\n $t_sql = \"UPDATE _transactionshistory SET cheqpaid=1 WHERE check_ref=:cheq_ref\";\r\n $t_stmt = $connection->prepare($t_sql);\r\n $t_stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n // if($payee_sql->rowCount()<1 && $up_stmt->rowCount()<1 && $history_stmt->rowCount()<1 && $up_stmt->rowCount()<1){\r\n // $connection->rollBack();\r\n // return false;\r\n // }\r\n $connection->commit();\r\n\r\n return true;\r\n\r\n } catch (Exception $e) {\r\n $connection->rollBack();\r\n //echo \"Failed: \" . $e->getMessage();\r\n return false;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function wallets();", "function sellStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qtyRequested = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n\n //check how many of the stock you own\n $qtyYouOwn = getStockQuantity($username,$sym);\n \n //Make sure you have more or equal qty in portfolio compared to what you wanna sell\n if($qtyYouOwn >= $qtyRequested)\n {\n //Calculate the total value of your sell.\n $totalValue = $currentCost * $qtyRequested;\n }\n else //Placeholder for now, should probably not do this.\n {\n //Sell only the amount that you have in portfolio\n $totalValue = $currentCost * $qtyYouOwn;\n }\n \n \n //Call addtoAccountBalance and add $totalValue to the account balance\n $currentBalance = addtoAccountBalance($username,$totalValue,$sym);\n \n //Call deleteFromPortfolioDB and delete the previous entry\n deleteFromPortfolioDB($username, $qtyRequested, $sym);\n\n $returnString = \"Sell Order Confirmed!\";\n \n return($returnString);\n}", "function generate_cash_v2($param)\r\n\t{\r\n\t\t$this->view = false;\r\n\t\t$this->layout_name = false;\r\n\t\t//debug($param);\r\n\r\n\t\t$_SQL = Singleton::getInstance(SQL_DRIVER);\r\n\r\n\t\t// get list of lines to be updated in audit_tree_v2\r\n\t\t$sql = \"SELECT * from audit_tree_v2 where '1'\";\r\n\t\tif ( !empty($param[0]) )\r\n\t\t{\r\n\t\t\t$sql .= \" and table_name='\" . $param[0] . \"'\";\r\n\t\t}\r\n\t\tif ( !empty($param[1]) )\r\n\t\t{\r\n\t\t\t$sql .= \" and field_name='\" . $param[1] . \"'\";\r\n\t\t}\r\n\t\tif ( !empty($param[2]) )\r\n\t\t{\r\n\t\t\t$sql .= \" and error_name='\" . $param[2] . \"'\";\r\n\t\t}\r\n\t\t$sql .= \" order by table_name, field_name, error_name asc\";\r\n\r\n\t\t$_SQL->sql_query($sql);\r\n\t\t$res = $_SQL->sql_query($sql);\r\n\t\t//debug($res);\r\n\t\t// get ARKADI_AUDIT mssql server infos\r\n\t\t$sql2 = \"SELECT * FROM data_dictionary_server where id=1\";\r\n\t\t$res2 = $_SQL->sql_query($sql2);\r\n\r\n\t\twhile ( $ob = $_SQL->sql_fetch_object($res2) ) // only 1 line\r\n\t\t{\r\n\t\t\t//open connection to ARKADIN_AUDIT DB\r\n\t\t\t$db = @mssql_connect($ob->ip, $ob->login, $ob->password);\r\n\r\n\t\t\tif ( !$db )\r\n\t\t\t{\r\n\t\t\t\techo(\"ERROR : impossible to connect to \" . $ob->ip . \" - (mx : \" . $ob->mx . \")\\n\");\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tmssql_select_db(\"ARKADIN_AUDIT\");\r\n\r\n\t\t\t// process list of lines to be updated in audit_tree_v2\r\n\t\t\twhile ( $to_be_updated = $_SQL->sql_fetch_object($res) )\r\n\t\t\t{\r\n\t\t\t\t//debug($to_be_updated);\r\n\t\t\t\t$output = array();\r\n\r\n\t\t\t\t//total: get count of all element for the given table in ARKADIN_AUDIT related PIV\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"]\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$ob2 = mssql_fetch_object($res3);\r\n\t\t\t\t$output['total'] = $ob2->cpt;\r\n\r\n\t\t\t\t// total number of lines in error in current run\r\n\t\t\t\t//$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=\" . $_GET['run_current'] . \"\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=2\r\n\t\t\t\t\tAND ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$ob2 = mssql_fetch_object($res3);\r\n\t\t\t\t$output['run_current'] = $ob2->cpt;\r\n\r\n\t\t\t\t// total number of lines in error in reference run\r\n\t\t\t\t//$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=\" . $_GET['run_reference'] . \"\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN=1\r\n\t\t\t\t\tAND ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$ob2 = mssql_fetch_object($res3);\r\n\t\t\t\t$output['run_reference'] = $ob2->cpt;\r\n\r\n\t\t\t\t// added number of lines in error in current run (nb of new lines)\r\n\t\t\t\t// deleted number of lines in error from reference run (nb of deleted lines)\r\n\t\t\t\t//$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] where ID_RUN in (\" . $_GET['run_current'] . \",\" .\r\n\t\t\t\t// $_GET['run_reference'] . \")\r\n\t\t\t\t// where t.ID_RUN in ($_GET['run_current'],$_GET['run_refernce'])\r\n\t\t\t\t$sql3 = \"SELECT count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] t\r\n\t\t\t\t\tjoin [HASH_\" . $to_be_updated->table_name . \"_V2] h on t.AUDIT_OID=h.AUDIT_OID\r\n\t\t\t\t\twhere t.ID_RUN in (1,2)\r\n\t\t\t\t\tAND t.ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\r\n\t\t\t\t\tGROUP BY h.HASH HAVING COUNT(1)=2\";\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\t\t\t\t$total_in_both_run = mssql_fetch_object($res3);\r\n\t\t\t\t$output['add'] = $output['run_current'] - $total_in_both_run;\r\n\t\t\t\t$output['del'] = $output['run_reference'] - $total_in_both_run;\r\n\r\n\t\t\t\t// total number of lines in current run with accepted status\r\n\t\t\t\t// total number of lines in current run with to_be_corrected status\r\n\t\t\t\t// total number of lines in current run with in_wait status\r\n\t\t\t\t// AND t.ID_RUN = \"2\" . $_GET['run_current'] . \"\r\n\t\t\t\t$sql3 = \"SELECT f.STATUS, count(1) as cpt FROM [\" . $to_be_updated->table_name . \"_V2] t\r\n\t\t\t\t\tjoin [HASH_\" . $to_be_updated->table_name . \"_V2] h on t.AUDIT_OID=h.AUDIT_OID\r\n\t\t\t\t\tleft join [AUDIT_BLUESKY_FOLLOWED] f on h.HASH=f.HASH\t\t\t\t\r\n\t\t\t\t\twhere t.ERROR_\" . $to_be_updated->field_name . \"_\" . $to_be_updated->error_name . \" is not null\r\n\t\t\t\t\t\tAND t.ID_RUN = 2\r\n\t\t\t\t\tGROUP BY f.STATUS\";\r\n\t\t\t\tdebug($sql3);\r\n\t\t\t\t$res3 = mssql_query($sql3);\r\n\r\n\t\t\t\t$output['accpeted'] = 0;\r\n\t\t\t\t$output['to_be_corrected'] = 0;\r\n\t\t\t\t$output['in_wait'] = 0;\r\n\t\t\t\twhile ( $ob2 = mssql_fetch_object($res3) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( ($ob2->STATUS == 2 ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$output['accpeted'] += $ob2->cpt;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( ($ob2->STATUS == 2 ) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$output['accpeted'] += $ob2->cpt;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( is_null($ob2->STATUS) || ($ob2->STATUS == 1) )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$output['in_wait'] += $ob2->cpt;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdie('unexpected status found in ARKADIN_AUDIT..AUDIT_BLUESKY_FOLLOWED table');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\t$sql4=\"UPDATE audit_tree_v2 a set\r\n\t\t\t\t total=\".$output['total'].\",\r\n\t\t\t\t run_current=\".$output['run_current'].\",\r\n\t\t\t\t run_reference=\".$output['run_reference'].\",\r\n\t\t\t\t run_reference=\".$output['run_reference'].\",\r\n\t\t\t\t add=\".$output['add'].\",\r\n\t\t\t\t del=\".$output['del'].\",\r\n\t\t\t\t accpeted=\".$output['accpeted'].\",\r\n\t\t\t\t to_be_corrected=\".$output['to_be_corrected'].\",\r\n\t\t\t\t in_wait=\".$output['in_wait'].\"\r\n\t\t\t\t where a.table_name=\" . $to_be_updated->table_name . \" AND\r\n\t\t\t\t a.field_name=\" . $to_be_updated->field_name . \" AND\r\n\t\t\t\t a.error_name=\" . $to_be_updated->error_name;\r\n\t\t\t\t\r\n\t\t\t\tdebug($sql4);\r\n\t\t\t\tdebug($output);\r\n\t\t\t}\r\n\t\t\t//close connection to ARKADIN_AUDIT DB\r\n\t\t\tmssql_close();\r\n\t\t}\r\n\t}", "function usdt_bal()\n{\n try {\n require_once app_path('jsonRPCClient.php');\n $bitcoin_username = owndecrypt(get_wallet_keydetail('USDT', 'XDC_username'));\n $bitcoin_password = owndecrypt(get_wallet_keydetail('USDT', 'XDC_password'));\n $bitcoin_portnumber = owndecrypt(get_wallet_keydetail('USDT', 'portnumber'));\n $bitcoin_host = owndecrypt(get_wallet_keydetail('USDT', 'host'));\n $bitcoin = new jsonRPCClient(\"http://$bitcoin_username:$bitcoin_password@$bitcoin_host:$bitcoin_portnumber/\");\n\n if ($bitcoin) {\n $address_list = $bitcoin->omni_getwalletbalances();\n $bal = 0;\n if ($address_list) {\n foreach ($address_list as $list) {\n if ($list['propertyid'] == 31) {\n $bal = $list['balance'];\n }\n }\n }\n\n return $bal;\n }\n\n } catch (\\Exception $exception) {\n return 0;\n }\n}", "public function run()\n {\n $sync_data = [1=>['base_price' => 10000, 'vat' => 1500, ], 2=>['base_price' => 15000, 'vat' => 1500, ], 3=>['base_price' => 20000, 'vat' => 1500, ], 4=>['base_price' => 25000, 'vat' => 1500, ], 5=>['base_price' => 30000, 'vat' => 1500, ], 6=>['base_price' => 35000, 'vat' => 1500, ], 7=>['base_price' => 40000, 'vat' => 1500, ], 8=>['base_price' => 45000, 'vat' => 1500, ]] ;\n $audit1 = new Audit();\n $audit1->audit_name = 'BSCI';\n $audit1->slug = 'bsci';\n $audit1->save();\n $audit1->auditors()->sync($sync_data);\n \n $sync_data = [1=>['base_price' => 10000, 'vat' => 1500, ], 2=>['base_price' => 15000, 'vat' => 1500, ], 3=>['base_price' => 20000, 'vat' => 1500, ], 4=>['base_price' => 25000, 'vat' => 1500, ], 5=>['base_price' => 30000, 'vat' => 1500, ], 6=>['base_price' => 35000, 'vat' => 1500, ], 7=>['base_price' => 40000, 'vat' => 1500, ], 8=>['base_price' => 45000, 'vat' => 1500, ]] ;\n $audit2 = new Audit();\n $audit2->audit_name = 'SEDEX';\n $audit2->slug = 'sedex';\n $audit2->save();\n $audit2->auditors()->sync($sync_data);\n \n $sync_data = [1=>['base_price' => 15000, 'vat' => 1500, ], 2=>['base_price' => 25000, 'vat' => 1500, ], 3=>['base_price' => 30000, 'vat' => 1500, ], 4=>['base_price' => 35000, 'vat' => 1500, ], 5=>['base_price' => 40000, 'vat' => 1500, ]] ;\n $audit3 = new Audit();\n $audit3->audit_name = 'WRAP';\n $audit3->slug = 'wrap';\n $audit3->save();\n $audit3->auditors()->sync($sync_data);\n }", "public function store(Request $request)\n {\n \n $validator = Validator::make($request->all(),[\n 'buyer' => 'nullable',\n 'promo' => 'nullable',\n 'item' => 'required',\n 'total' => 'required',\n ]);\n \n if ($validator->fails()) {\n $error['status'] = 'error';\n $error['message'] = $validator->errors();\n return response()->json($error, 400);\n }\n \n \n //trx number generator\n $rmdash = str_replace(\"-\",\"\",Carbon::now()->toDateTimeString());\n $rmcolon = str_replace(\":\",\"\",$rmdash);\n $rmspace = str_replace(\" \",\"\",$rmcolon).substr(str_shuffle('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'),1,3);\n $trx_number = 'TRX'.$rmspace;\n \n \n //get item id stock/remain\n $items = $request->item;//json_decode($request->item);\n $change = 0;\n \n $dataStock = [];\n foreach($items as $item){\n $init = Product::where('id', $item['productId'])->get()->first();\n $latest = Stock::where('product_id', $item['productId'])->get()->last();\n \n //check if there's any product data in stock\n if($latest)\n $change = $latest->remain - $item['quantity'];\n else\n $change = $init->stock - $item['quantity'];\n \n $stock = [\n 'product_id' => $item['productId'],\n 'trx_id' => $trx_number,\n 'increase' => 0,\n 'decrease' => $item['quantity'],\n 'remain' => $change,\n 'status' => 'trx',\n 'desc' => 'penjualan',\n 'created_at' => Carbon::now()->toDateTimeString(),\n ];\n array_push($dataStock, $stock);\n \n }\n Stock::insert($dataStock);\n $buyer = (!$request->buyer) ? 0 : $request->buyer;\n \n $dataDetails = (object) array(\n 'buyer' => $buyer,\n 'promo' => $request->promo,\n 'persen_discount' => $request->persen_disc,\n 'price_before' => $request->price_before_disc,\n 'total_potongan' => $request->total_discount,\n 'price_after' => $request->total,\n );\n\n $transaction = new Transactions;\n $transaction->cashier = Auth::user()->id;\n $transaction->promo = $request->promo;\n $transaction->trx_number = $trx_number;\n $transaction->buyer = $buyer;\n $transaction->details = json_encode($dataDetails);\n $transaction->item = json_encode($request->item);\n $transaction->total = $request->total;\n $transaction->save();\n \n $transaction->item = json_decode($transaction->item);\n $success['status'] = 'success';\n $success['data_transaction'] = $transaction;\n $success['data_stock'] = $dataStock;\n\n return response()->json($success);\n }", "public function blockchain(Request $request2){\n\n\n $customer_id = $request2->session()->get(\"customer_id\");\n// $package = $this->getUserPendingPackage(Session::get('customer_id'));\n//\n// $cpackage = CustomerPackages::find($customer->last_package_hsitory);\n// $price = $cpackage->quantity * $package->price;\n\n\n $customer = Customer::find(Session::get('customer_id'));\n $package = Package::find($customer->next_package);\n $cpackage = CustomerPackages::find($customer->last_package_hsitory);\n $price = $cpackage->quantity * $package->price;\n\n\n $old_address = \\App\\blockchain::where([[\"customer_id\",$customer_id],[\"package_id\",$package->id],[\"status\",\"pending\"]])->orderBy(\"id\",\"desc\")->first();\n\n\n if(empty($old_address)){\n\n $api_key = env(\"BLOCKCHAIN_API_KEY\");\n $xpub = env(\"BLOCKCHAIN_UPUB_KEY\");\n $secret = env(\"BLOCKCHAIN_SECRIT\");\n\n\n\n\n\n $payment_h = new PaymentsHistory;\n $payment_h->customer_id = $customer_id;\n $payment_h->package_id = $package->id;\n $payment_h->payment_value = $price;\n $payment_h->payment_type = \"pay\";\n $payment_h->gateway = \"BlockChain\";\n $payment_h->status = \"PaymentPending\";\n $payment_h->save();\n\n $payment_id = $payment_h->id;\n\n\n $callbackURL = url(\"/blockchain/callback?payment=\".$payment_id.\"&secret=\".$secret);\n\n\n\n\n $receive_url = \"https://api.blockchain.info/v2/receive?key=\".$api_key.\"&xpub=\".$xpub.\"&callback=\".urlencode($callbackURL).\"&gap_limit=10000\";\n\n $request = curl_init();\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($request, CURLOPT_URL, $receive_url);\n $response = curl_exec($request);\n\n $response = json_decode($response, true);\n\n\n//return $response;\n $paymentAddress = $response['address'];\n\n\n\n\n\n\n\n\n\n\n\n $btc_value = file_get_contents(\"https://www.blockchain.com/tobtc?currency=usd&value=\" .$price);\n\n\n\n\n\n $oaddress = new \\App\\blockchain();\n $oaddress->customer_id = $customer_id;\n $oaddress->address = $paymentAddress;\n $oaddress->value = $btc_value;\n $oaddress->package_id = $package->id;\n $oaddress->payment_id = $payment_id;\n $oaddress->status = \"pending\";\n $oaddress->save();\n\n\n }else{\n\n\n\n $paymentAddress = $old_address->address;\n $btc_value = $old_address->value;\n\n\n }\n\n\n\n\n\n\n return view(\"FrontEnd.Payments.Checkout.blockchain\",compact(\"paymentAddress\",\"btc_value\"));\n\n\n }", "function addPayment($data) {\n //Sample code from the reference\n $db = configDB();\n\t$q2 = $db->prepare('SELECT pid FROM products WHERE name = ?');\n if (is_array($data)) {\n\t\t// TODO: reconstruct the hash using the same algorithm\n $q = $db->prepare('UPDATE payment_info SET txnid = ?, payment_status = ? WHERE payment_amount = ? AND order_hash = ? AND order_id = ?');\n\t\t$q3 = $db->prepare('SELECT order_salt FROM payment_info WHERE payment_amount = ? AND itemid = ? AND order_id = ?');\n\t\t$temp_cart_content = '';\n\t\t$salt = '';\n\t\tfor($k = 1; $k<1000; $k++){\n\t\t\tif(array_key_exists(\"item_name_\".$k, $data) == true){\n\t\t\t\t$res = $q2->execute(array($data[\"item_name_\".$k]));\n\t\t\t\t$temp = $q2->fetchAll();\n\t\t\t\t//error_log(print_r($temp, true));\n\t\t\t\tif(count($temp)==0){\n\t\t\t\t\t$temp_cart_content.= 999;\n\t\t\t\t}else{\n\t\t\t\t\t$temp_cart_content .= $temp[0][\"pid\"];\n\t\t\t\t}\n\t\t\t\t$temp_cart_content .= \",\";\n\t\t\t\t$temp_cart_content .= $data[\"quantity_\".$k];\n\t\t\t\t// $temp_cart_content .= '1';\n\t\t\t\t$temp_cart_content .= \"@\";\n\t\t\t}else{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// $temp_cart_content = \"123\";\n\t\terror_log(print_r($temp_cart_content, true));\n\t\t$return_salt = '0';\n\t\t//CAST($data['payment_amount'] AS DECIMAL(10,1))\n\t\tif($q3->execute(array($data['payment_amount'], $temp_cart_content, $data['invoice']))){\n\t\t\t$return_salt = $q3->fetchAll();\n\t\t\t// error_log(print_r($return_salt, true));\n\t\t\tif(count($return_salt)==0){\n\t\t\t\t$return_salt = '0';\n\t\t\t}else{\n\t\t\t\t$return_salt = $return_salt[count($return_salt)-1][\"order_salt\"];\n\t\t\t}\n\t\t}\n\t\terror_log(print_r($return_salt, true));\n\t\t//$digest = hash(\"sha256\",$currency.\"|\".$email.\"|\".$salt.$shopping_cart_content.\"|\".$total_price, false);\n\t\t$recalculate_hash = hash(\"sha256\",$data['payment_currency'].\"|\".$data['receiver_email'].\"|\".$return_salt.$temp_cart_content.\"|\".$data['payment_amount'], false);\n\t\terror_log(print_r($recalculate_hash, true));\n\t\t// $date = new DateTime(\"now\", new DateTimeZone('Asia/Hong_Kong') );\n // $current_time = $date->format('Y-m-d H:i:s');\n if($q->execute(array($data['txn_id'], $data['payment_status'], $data['payment_amount'], $recalculate_hash, $data['invoice'])))\n \treturn $q->rowCount();\n }\n\n return false;\n}", "function installIndicCaller ($api, $unixTime, $pairSymbol, $moduleName, $interval) {\n\t$days = 30;\n\t$since = $unixTime-(60*60*24*$days);\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairSymbol, $interval, $since);\n\n\tif (is_array($ohlc)) {\n\n\t\t$currentFile=$moduleName.'-'.$pairSymbol.'-';\n\t\t$output = installIndicR($currentFile, $ohlc);\n\n\t\tif ($output!=null) {\n\t\t\tprint_r ($pairSymbol.' '.$output. ' installed<br>');\n\t\t}\n\t} else {\n\t\texit ('not array');\n\t}\n\treturn $output;\n}", "public function actionHystorical()\n {\n HystoricalData::deleteAll('total_supply IS NULL');\n\n $skipRows = 1;\n $loadFileName = \\Yii::$app->basePath . $this->loadDir . 'hystorical1.csv';\n $errorFileName = \\Yii::$app->basePath . $this->loadDir . 'hystorical.err';\n $errors = '';\n $loadFileName = FileHelper::normalizePath($loadFileName);\n if(!file_exists($loadFileName)) return ExitCode::NOINPUT;\n $handle = fopen($loadFileName, \"r\");\n $row = 1;\n echo \"0++\";\n $lastProject = '';\n while (($fileop = fgetcsv($handle, 2000, \";\")) !== false)\n {\n $row++;\n if($skipRows-- > 0) continue;\n if($row % 5000 == 0) echo \"$row++\";\n\n $curId = Currencies::check($fileop[1]);\n $modelProject = Projects::getProjectByAttr($fileop[0], $fileop[1], $fileop[2]);\n\n if(empty($modelProject)) {\n $project_id = null;\n if($lastProject != $fileop[0]) {\n $message = \"\\nProject {$fileop[0]} not found\\n\";\n $errors .= $message;\n echo $message;\n $lastProject = $fileop[0];\n }\n// continue;\n } else {\n $project_id = $modelProject->id;\n }\n\n $data = [\n 'name' => $fileop[0],\n 'date_added' => strtotime($fileop[3]),\n 'project_id' => $project_id,\n 'currency_id' => $curId,\n 'price' => str_replace(',', '.', $fileop[5]),\n 'volume_24h' => (double)str_replace([',', '-'], ['.', ''], $fileop[6]),\n 'market_cap' => (double)str_replace([',', '-'], ['.', ''], $fileop[7]),\n 'created_at' => $fileop[4],\n 'updated_at' => $fileop[4],\n ];\n\n HystoricalData::insertOrReplace($data);\n\n// print_r($fileop);die();\n }\n echo \"\\n\";\n fclose($handle);\n file_put_contents($errorFileName, $errors);\n return ExitCode::OK;\n }", "protected function applyUpdatesAlertTable()\n\t{\n\t\tif (Configuration::get('ADN_ALTER_TABLE') != 2)\n\t\t{\n\t\t\tif(!$this->isColumnExistInTable('details', 'authorizedotnet_refund_history')) { \n\t\t\t\tDb::getInstance()->Execute(\"ALTER TABLE `\"._DB_PREFIX_.\"authorizedotnet_refund_history` ADD `details` varchar(255) AFTER `amount`\");\n\t\t\t}\n\t\t\t\n\t\t\tif(!$this->isColumnExistInTable('auth_code', 'authorizedotnet_refunds')) { \n\t\t\t\tDb::getInstance()->Execute(\"ALTER TABLE `\"._DB_PREFIX_.\"authorizedotnet_refunds` ADD `auth_code` varchar(10) NOT NULL AFTER `card`\");\n\t\t\t}\n\n\t\t\tif(!$this->isColumnExistInTable('captured', 'authorizedotnet_refunds')) { \n\t\t\t\tDb::getInstance()->Execute(\"ALTER TABLE `\"._DB_PREFIX_.\"authorizedotnet_refunds` ADD `captured` TINYINT(1) NOT NULL DEFAULT '0' AFTER `auth_code`\");\n\t\t\t}\n\n\t\t\tConfiguration::updateValue('ADN_ALTER_TABLE','2');\n\t\t}\n\t}", "function getVerus( $command, $hash, $amt ) {\n global $phpextconfig;\n global $curl_requests;\n\n $verusexp_curl = curl_init();\n \n// Execute commands availabel for to interact with Verus Daemon\n switch ( $command ) {\n case 'getbalance':\n if ( ! isset( $hash ) ) {\n return \"Error 2 - Hash Call\";\n }\n else {\n return curlRequest( $phpextconfig['explorer'] . '/ext/getbalance/' . $hash, $verusexp_curl );\n }\n break;\n case 'lowestconfirm':\n if ( ! isset( $hash ) ) {\n return \"Error 2 - Hash\";\n }\n else {\n $results = json_decode( curlRequest( $phpextconfig['explorer'] . '/ext/getaddress/' . $hash, $verusexp_curl, true ), true );\n $results = $results['last_txs'];\n $wc_veruspay_confirmations = array();\n foreach ( $results as $item ) {\n $r = json_decode( curlRequest( $phpextconfig['explorer'] . '/api/getrawtransaction?txid=' . $item['addresses'] . '&decrypt=1', $verusexp_curl, true ), true );\n array_push($wc_veruspay_confirmations,$r['confirmations']);\n }\n return min($wc_veruspay_confirmations);\n }\n break;\n case 'getrawtx':\n if ( ! isset( $hash ) ) {\n return \"Error 2 - Hash Call\";\n }\n else {\n $results = json_decode( curlRequest( $phpextconfig['explorer'] . '/api/getrawtransaction?txid=' . $hash . '&decrypt=1', $verusexp_curl, true ), true );\n return $results['confirmations'];\n }\n break;\n case 'getblockcount':\n return curlRequest( $phpextconfig['explorer'] . '/api/getblockcount', $verusexp_curl );\n break;\n case 'getdifficulty':\n return curlRequest( $phpextconfig['explorer'] . '/api/getdifficulty', $verusexp_curl );\n break;\n case 'getsupply':\n return curlRequest( $phpextconfig['explorer'] . '/ext/getmoneysupply', $verusexp_curl );\n }\n}", "function asset_depreciation($arr, $_cb, $cb) {\n\n $connection = $arr['connection'];\n $sessint_id = $_SESSION['int_id'];\n\n// Pull all assets\n$ifdo = mysqli_query($connection, \"SELECT * FROM assets WHERE int_id = {$sessint_id}\");\nwhile($pd = mysqli_fetch_array($ifdo)){\n $aorp = $pd['id'];\n $int_id = $pd['int_id'];\n $asset_name = $pd['asset_name'];\n $asset_type_id = $pd['asset_type_id'];\n $type = $pd['type'];\n $qty = $pd['qty'];\n $unit_price = $pd['unit_price'];\n $amount = $pd['amount'];\n $asset_no = $pd['asset_no'];\n $location = $pd['location'];\n $date = $pd['date'];\n $dep = $pd['depreciation_value'];\n $current_year = $pd['current_year_depreciation'];\n $current_month = $pd['current_month_depreciation'];\n $curr_year = date('Y-m-d');\n $curr_month = date('m');\n $branch_id = $pd['branch_id'];\n $incomeGl = $pd[\"gl_code\"];\n $expenseGl = $pd[\"expense_gl\"];\n $digits = 6;\n $randms = str_pad(rand(0, pow(10, $digits) - 1), $digits, '0', STR_PAD_LEFT);\n\n \n $transactionId = $randms;\n\n // to get difference in years\n $purdate = strtotime($date);\n $currentdate = strtotime($curr_year);\n $datediff = $currentdate - $purdate;\n $datt = round($datediff / (60 * 60 * 24 * 365));\n\n // to get percentage\n $dom = ($dep/100) * $unit_price;\n // to get current year depreciation\n $currentyear = $unit_price - ($dom * $datt);\n\n // to get current month depreciation\n $curr_mon = $dom / 12;\n $amount_2 = $curr_mon;\n // last year plus number of months spent = this month depreciation\n\n $lasty = $unit_price - ($dom * ($datt - 1));\n if($currentyear != $unit_price){\n $current_month = $lasty + ($curr_mon * $curr_month);\n \n }\n else{\n $current_month = $unit_price -($curr_mon * $curr_month);\n }\n\n $idof = \"UPDATE assets SET current_year_depreciation = '$currentyear', current_month_depreciation = '$current_month' WHERE int_id = '$int_id' AND id = '$aorp'\";\n $dos = mysqli_query($connection, $idof);\n if($dos){\n\n \n \n $incomeConditions = [\n 'gl_code' => $incomeGl,\n 'int_id' =>$sessint_id,\n 'branch_id' => $branch_id\n ];\n $findIncomeGl = selectOne('acc_gl_account', $incomeConditions);\n $currentIncomeBalance = $findIncomeGl['organization_running_balance_derived'];\n $incomeParentId = $findIncomeGl['parent_id'];\n $incomeGlId = $findIncomeGl['id'];\n if ($currentIncomeBalance >= $amount_2) {\n $newincomeBalance = $currentIncomeBalance - $amount_2;\n // now find necessary details for expense gl\n $expenseConditions = [\n 'gl_code' => $expenseGl,\n 'int_id' => $sessint_id,\n 'branch_id' => $branch_id,\n ];\n $findExpenseGl = selectOne('acc_gl_account', $expenseConditions);\n $currentExpenseBalance = $findExpenseGl['organization_running_balance_derived'];\n $expenseParentId = $findExpenseGl['parent_id'];\n $expenseGlId = $findExpenseGl['id'];\n $newExpenseBalance = $currentExpenseBalance + $amount_2;\n\n // update income balance so as to show dedection and provide\n // transaction details\n $updateGlDetails = [\n 'organization_running_balance_derived' => $newincomeBalance\n ];\n $updateIncomeGL = update('acc_gl_account', $incomeGlId, 'id', $updateGlDetails);\n if ($updateIncomeGL) {\n $updateExpenseGlDetails = [\n 'organization_running_balance_derived' => $newExpenseBalance\n ];\n $updateExpanseGl = update('acc_gl_account', $expenseGlId, 'id', $updateExpenseGlDetails);\n } else {\n if (!$updateIncomeGL) {\n printf('Error: %s\\n', mysqli_error($connection)); //checking for errors\n exit();\n }\n }\n if ($updateExpanseGl) {\n $incomeTransactionDetails = [\n 'int_id' => $sessint_id,\n 'branch_id' => $branch_id,\n 'gl_code' => $incomeGl,\n 'parent_id' => $incomeParentId,\n 'transaction_id' => $transactionId,\n 'description' =>\"ASSET_DEPRECIATION\",\n 'transaction_type' => \"debit\",\n 'transaction_date' => date('Y-m-d'),\n 'amount' => $amount_2,\n 'gl_account_balance_derived' => $newincomeBalance,\n 'overdraft_amount_derived' => $amount_2,\n 'cumulative_balance_derived' => $newincomeBalance,\n 'debit' => $amount_2\n ];\n\n $storeIncomeTransaction = insert('gl_account_transaction', $incomeTransactionDetails);\n if ($storeIncomeTransaction) {\n $expenseTransactionDetails = [\n 'int_id' => $sessint_id,\n 'branch_id' => $branch_id,\n 'gl_code' => $expenseGl,\n 'parent_id' => $expenseParentId,\n 'transaction_id' => $transactionId,\n 'description' => \"ASSET_DEPRECIATION\",\n 'transaction_type' => \"credit\",\n 'transaction_date' => date('Y-m-d'),\n 'amount' => $amount_2,\n 'gl_account_balance_derived' => $newExpenseBalance,\n 'overdraft_amount_derived' => $amount_2,\n 'cumulative_balance_derived' => $newExpenseBalance,\n 'credit' => $amount_2\n ];\n\n $storeExpenseTransaction = insert('gl_account_transaction', $expenseTransactionDetails);\n if ($storeExpenseTransaction) {\n // $_SESSION[\"Lack_of_intfund_$randms\"] = \"Transaction Successful!\";\n // echo header(\"Location: ../../mfi/gl_postings.php?message=$randms\");\n } else {\n // everything was fine until the last moment\n // could not store transaction details for expense gl\n // $_SESSION[\"Lack_of_intfund_$randms\"] = \"Error storing record for expense GL!\";\n // echo header(\"Location: ../../mfi/gl_postings.php?message1=$randms\");\n }\n } else {\n // income transaction not stored for some weird reason\n // $_SESSION[\"Lack_of_intfund_$randms\"] = \"Error storing record for income GL!\";\n // echo header(\"Location: ../../mfi/gl_postings.php?message2=$randms\");\n }\n }\n } else {\n // not enough funds\n $_SESSION[\"Lack_of_intfund_$randms\"] = \"not enough funds!\";\n echo header(\"Location: ../../mfi/gl_postings.php?message3=$randms\");\n }\n\n\n // $cb('Asset Depreciation successful');\n $arr['response'] = 0;\n if(is_callable($cb)) {\n call_user_func($cb,$_cb,$arr);\n }\n // echo 'Depreciation Value for '.$asset_name.' with int_id '.$int_id.' was calculated</br>';\n }\n}\n}", "public function store(Request $request)\r\n {\r\n $validator = Validator::make($request->all(), [\r\n //'user_id' =>'required',\r\n 'package_id' => 'required',\r\n 'description' => 'required',\r\n //'amount' => 'required',\r\n //'coins' => 'required',\r\n //'balance_coins' => 'required',\r\n ]);\r\n\r\n if ($validator->fails()) {\r\n $response = api_create_response($validator->errors(), $this->failureText, 'Please enter valid input.');\r\n return response()->json($response, $this->statusCodes->bad_request);\r\n }\r\n\r\n $packageId = $request->package_id;\r\n $packageDetails = PackageModel::find($packageId);\r\n\r\n if(empty($packageDetails)) {\r\n // NOT FOUND\r\n $response = api_create_response(2, $this->failureText, 'Package Not Found.');\r\n return response()->json($response, $this->statusCodes->not_found);\r\n\r\n }\r\n\r\n $userData = Auth::user();\r\n $balanceCoin = $userData->balance_coins;\r\n $newBalanceCoin = $balanceCoin + $packageDetails->coins;\r\n\r\n // Update balance in user table\r\n User::where('id', $userData->id)->update(['balance_coins' => $newBalanceCoin]);\r\n\r\n\r\n $transaction = [\r\n 'user_id' => $userData->id,\r\n 'package_article_id' => $packageDetails->package_id,\r\n 'description' => $request->description,\r\n 'amount' => $packageDetails->price,\r\n 'coins' => $packageDetails->coins,\r\n 'balance_coins' => $newBalanceCoin,\r\n 'transaction_mode' => 'CR',\r\n 'created_at' => date('Y-m-d H:i:s')\r\n ];\r\n\r\n $result = CoinModel::insertGetId($transaction);\r\n \r\n if (!empty($result)) {\r\n\r\n $transaction['id'] = $result;\r\n $this->responseStatusCode = $this->statusCodes->success;\r\n $response = api_create_response($transaction, $this->successText, 'Coins Added Successfully.');\r\n\r\n } else {\r\n\r\n $this->responseStatusCode = $this->statusCodes->bad_request;\r\n $response = api_create_response(2, $this->failureText, 'Something went wrong.');\r\n\r\n }\r\n \r\n return response()->json($response, $this->responseStatusCode);\r\n }", "function updateMarketInfo( $market_id ){\n global $mysqli, $block_24hr, $debug;\n\n // Timer to track each market update\n $profile = new Profiler();\n\n // Define some default values\n $price1_last = 0; // Asset1 - Last traded price\n $price1_ask = 0; // Asset1 - Price Sellers are asking\n $price1_bid = 0; // Asset1 - Price Buyers are paying\n $price1_high = 0; // Asset1 - 24-hour price high\n $price1_low = 0; // Asset1 - 24-hour price low\n $price1_24hr = 0; // Asset1 - Price 24-hours ago\n $price2_last = 0; // Asset2 - Last traded price\n $price2_ask = 0; // Asset2 - Price Sellers are asking\n $price2_bid = 0; // Asset2 - Price Buyers are paying\n $price2_high = 0; // Asset2 - 24-hour price high\n $price2_low = 0; // Asset2 - 24-hour price low\n $price2_24hr = 0; // Asset2 - Price 24-hours ago\n $price_change = 0; // 24-hour price change (%)\n $asset1_volume = 0; // 24-hour volume (asset1)\n $asset2_volume = 0; // 24-hour volume (asset2)\n\n // Lookup basic information on this market/assets\n $sql = \"SELECT\n a1.asset as asset1,\n a2.asset as asset2,\n a1.divisible as asset1_divisible,\n a2.divisible as asset2_divisible,\n m.asset1_id,\n m.asset2_id\n FROM\n markets m,\n assets a1,\n assets a2\n WHERE \n a1.id=m.asset1_id AND\n a2.id=m.asset2_id AND\n m.id='{$market_id}'\";\n // print $sql;\n $results = $mysqli->query($sql);\n if($results && $results->num_rows){\n $row = $results->fetch_assoc();\n $asset1 = $row['asset1'];\n $asset2 = $row['asset2'];\n $asset1_id = intval($row['asset1_id']);\n $asset2_id = intval($row['asset2_id']);\n $asset1_divisible = intval($row['asset1_divisible']);\n $asset2_divisible = intval($row['asset2_divisible']);\n } else {\n byeLog(\"Error while trying to lookup market info\");\n }\n\n if($debug)\n print \"\\nUpdating market information for {$asset1} / {$asset2}...\";\n\n // Lookup last trade price\n $sql = \"SELECT\n m.tx0_index,\n m.tx1_index,\n m.forward_asset_id,\n m.forward_quantity,\n m.backward_asset_id,\n m.backward_quantity\n FROM \n order_matches m\n WHERE\n ((m.forward_asset_id='{$asset1_id}' AND m.backward_asset_id='{$asset2_id}') OR\n (m.forward_asset_id='{$asset2_id}' AND m.backward_asset_id='{$asset1_id}')) AND\n m.status='completed'\n ORDER BY tx1_index DESC \n LIMIT 1\";\n // print $sql;\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n $forward = ($row['forward_asset_id']==$asset1_id) ? $row['forward_quantity'] : $row['backward_quantity'];\n $backward = ($row['forward_asset_id']==$asset1_id) ? $row['backward_quantity'] : $row['forward_quantity'];\n $forward_qty = ($asset1_divisible) ? bcmul($forward, '0.00000001',8) : intval($forward);\n $backward_qty = ($asset2_divisible) ? bcmul($backward, '0.00000001',8) : intval($backward);\n $price1_last = bcdiv($backward_qty, $forward_qty,8);\n $price2_last = bcdiv($forward_qty, $backward_qty,8);\n }\n } else {\n byeLog(\"Error while trying to lookup last trade price for {$asset1} / {$asset2}\");\n }\n\n // Lookup trade price exactly 24-hours ago\n $sql = \"SELECT\n m.tx0_index,\n m.tx1_index,\n m.forward_asset_id,\n m.forward_quantity,\n m.backward_asset_id,\n m.backward_quantity\n FROM \n order_matches m\n WHERE\n ((m.forward_asset_id='{$asset1_id}' AND m.backward_asset_id='{$asset2_id}') OR\n (m.forward_asset_id='{$asset2_id}' AND m.backward_asset_id='{$asset1_id}')) AND\n m.status='completed' AND\n m.block_index<='{$block_24hr}'\n ORDER BY tx1_index DESC \n LIMIT 1\";\n // print $sql;\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n $forward = ($row['forward_asset_id']==$asset1_id) ? $row['forward_quantity'] : $row['backward_quantity'];\n $backward = ($row['forward_asset_id']==$asset1_id) ? $row['backward_quantity'] : $row['forward_quantity'];\n $forward_qty = ($asset1_divisible) ? bcmul($forward, '0.00000001',8) : intval($forward);\n $backward_qty = ($asset2_divisible) ? bcmul($backward, '0.00000001',8) : intval($backward);\n $price1_24hr = bcdiv($backward_qty, $forward_qty,8);\n $price2_24hr = bcdiv($forward_qty, $backward_qty,8);\n }\n } else {\n byeLog(\"Error while trying to lookup last trade price for {$asset1} / {$asset2}\");\n }\n\n // Lookup 'bid' price\n $sql = \"SELECT \n o.get_quantity,\n o.give_quantity,\n o.tx_index\n FROM \n orders o\n WHERE\n o.get_asset_id='{$asset1_id}' AND\n o.give_asset_id='{$asset2_id}' AND\n o.status='open'\n ORDER BY o.tx_index\";\n // print $sql;\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n while($row = $results->fetch_assoc()){\n $give_quantity = ($asset2_divisible) ? bcmul($row['give_quantity'], '0.00000001',8) : intval($row['give_quantity']);\n $get_quantity = ($asset1_divisible) ? bcmul($row['get_quantity'], '0.00000001',8) : intval($row['get_quantity']);\n $price1 = bcdiv($give_quantity, $get_quantity,8);\n $price2 = bcdiv($get_quantity, $give_quantity,8);\n // print \"price1={$price1} price2={$price2} tx={$row['tx_index']}\\n\";\n if($price1==0||$price2==0)\n continue;\n if($price1_bid==0) $price1_bid = $price1;\n if($price2_bid==0) $price2_bid = $price2;\n if($price1>$price1_bid) $price1_bid = $price1;\n if($price2>$price2_bid) $price2_bid = $price2;\n }\n }\n } else {\n byeLog(\"Error while trying to lookup ask price\");\n }\n\n // Lookup 'ask' price\n $sql = \"SELECT \n o.get_quantity,\n o.give_quantity,\n o.tx_index\n FROM \n orders o\n WHERE\n o.get_asset_id='{$asset2_id}' AND\n o.give_asset_id='{$asset1_id}' AND\n o.status='open'\n ORDER BY o.tx_index\";\n // print $sql;\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n while($row = $results->fetch_assoc()){\n $give_quantity = ($asset1_divisible) ? bcmul($row['give_quantity'], '0.00000001',8) : intval($row['give_quantity']);\n $get_quantity = ($asset2_divisible) ? bcmul($row['get_quantity'], '0.00000001',8) : intval($row['get_quantity']);\n $price1 = bcdiv($get_quantity, $give_quantity,8);\n $price2 = bcdiv($give_quantity, $get_quantity,8);\n // print \"price1={$price1} price2={$price2} tx={$row['tx_index']}\\n\";\n if($price1==0||$price2==0)\n continue;\n if($price1_ask==0) $price1_ask = $price1;\n if($price2_ask==0) $price2_ask = $price2;\n if($price1<$price1_ask) $price1_ask = $price1;\n if($price2<$price2_ask) $price2_ask = $price2;\n }\n }\n } else {\n byeLog(\"Error while trying to lookup ask price\");\n }\n\n // Lookup all order matches in the last 24-hours\n $sql = \"SELECT\n m.tx0_index,\n m.tx1_index,\n m.forward_asset_id,\n m.forward_quantity,\n m.backward_asset_id,\n m.backward_quantity\n FROM \n order_matches m\n WHERE\n ((m.forward_asset_id='{$asset1_id}' AND m.backward_asset_id='{$asset2_id}') OR\n (m.forward_asset_id='{$asset2_id}' AND m.backward_asset_id='{$asset1_id}')) AND\n m.status='completed' AND\n m.block_index>='{$block_24hr}'\n ORDER BY tx1_index DESC\"; \n // print $sql;\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n while($row = $results->fetch_assoc()){\n $forward = ($row['forward_asset_id']==$asset1_id) ? $row['forward_quantity'] : $row['backward_quantity'];\n $backward = ($row['forward_asset_id']==$asset1_id) ? $row['backward_quantity'] : $row['forward_quantity'];\n $forward_qty = ($asset1_divisible) ? bcmul($forward, '0.00000001',8) : intval($forward);\n $backward_qty = ($asset2_divisible) ? bcmul($backward, '0.00000001',8) : intval($backward);\n $price1 = bcdiv($backward_qty, $forward_qty,8);\n $price2 = bcdiv($forward_qty, $backward_qty,8);\n if($price1_high==0 && $price1_low==0){\n $price1_high = $price1_24hr;\n $price1_low = $price1_24hr;\n }\n if($price2_high==0 && $price2_low==0){\n $price2_high = $price2_24hr;\n $price2_low = $price2_24hr;\n }\n // 24-hour high\n if($price1 > $price1_high) $price1_high = $price1;\n if($price2 > $price2_high) $price2_high = $price2;\n // 24-hour low\n if($price1 < $price1_low) $price1_low = $price1;\n if($price2 < $price2_low) $price2_low = $price2;\n // 24-hour volumes\n $asset1_volume += $forward_qty;\n $asset2_volume += $backward_qty;\n }\n }\n } else {\n byeLog(\"Error while trying to lookup 24-hour stats\");\n } \n\n\n // Calculate price change percentage\n // $price_change = number_format(((($price1_last - $price1_24hr) / $price1_24hr) * 100), 2, '.','');\n $price1_change = bcmul(bcdiv(bcsub($price1_last, $price1_24hr,8), $price1_24hr, 8), '100', 2);\n $price2_change = bcmul(bcdiv(bcsub($price2_last, $price2_24hr,8), $price2_24hr, 8), '100', 2);\n\n // Pass last trade price forward\n if($price1_high==0) $price1_high = $price1_last;\n if($price2_high==0) $price2_high = $price2_last;\n if($price1_low==0) $price1_low = $price1_last;\n if($price2_low==0) $price2_low = $price2_last;\n\n // Convert the amounts from floating point to integers\n $price1_ask_int = bcmul($price1_ask, '100000000',0);\n $price1_bid_int = bcmul($price1_bid, '100000000',0);\n $price1_high_int = bcmul($price1_high, '100000000',0);\n $price1_low_int = bcmul($price1_low, '100000000',0);\n $price1_24hr_int = bcmul($price1_24hr, '100000000',0);\n $price1_last_int = bcmul($price1_last, '100000000',0);\n $price2_ask_int = bcmul($price2_bid, '100000000',0); // flip bid = ask\n $price2_bid_int = bcmul($price2_ask, '100000000',0); // flip ask = bid\n $price2_high_int = bcmul($price2_high, '100000000',0);\n $price2_low_int = bcmul($price2_low, '100000000',0);\n $price2_last_int = bcmul($price2_last, '100000000',0);\n $price2_24hr_int = bcmul($price2_24hr, '100000000',0);\n $price1_change_int = bcmul($price1_change, '100',0);\n $price2_change_int = bcmul($price2_change, '100',0);\n $asset1_volume_int = bcmul($asset1_volume, '100000000',0);\n $asset2_volume_int = bcmul($asset2_volume, '100000000',0);\n\n // Update the market info\n $sql = \"UPDATE \n markets \n SET \n price1_ask='{$price1_ask_int}',\n price1_bid='{$price1_bid_int}',\n price1_high='{$price1_high_int}',\n price1_low='{$price1_low_int}',\n price1_last='{$price1_last_int}',\n price1_24hr='{$price1_24hr_int}',\n price2_ask='{$price2_ask_int}',\n price2_bid='{$price2_bid_int}',\n price2_high='{$price2_high_int}',\n price2_low='{$price2_low_int}',\n price2_last='{$price2_last_int}',\n price2_24hr='{$price2_24hr_int}',\n price1_change='{$price1_change_int}',\n price2_change='{$price2_change_int}',\n asset1_volume='{$asset1_volume_int}',\n asset2_volume='{$asset2_volume_int}',\n last_updated=now()\n WHERE \n id='{$market_id}'\";\n // if($debug)\n // print \"{$sql}\\n\";\n $results = $mysqli->query($sql);\n if(!$results){\n bye('Error when trying to update market information');\n }\n\n // Report time to process block\n $time = $profile->finish();\n if($debug)\n print \" Done [{$time}ms]\\n\";\n\n // Print out an update on the current state of the market\n if($debug){\n print \"price1_ask : {$price1_ask}\\n\";\n print \"price1_bid : {$price1_bid}\\n\";\n print \"price1_high : {$price1_high}\\n\";\n print \"price1_low : {$price1_low}\\n\";\n print \"price1_last : {$price1_last}\\n\";\n print \"price1_24hr : {$price1_24hr}\\n\";\n print \"price2_ask : {$price2_ask}\\n\";\n print \"price2_bid : {$price2_bid}\\n\";\n print \"price2_high : {$price2_high}\\n\";\n print \"price2_low : {$price2_low}\\n\";\n print \"price2_last : {$price2_last}\\n\";\n print \"price2_24hr : {$price2_24hr}\\n\";\n print \"price1_change : {$price1_change}\\n\";\n print \"price2_change : {$price2_change}\\n\";\n print \"asset1_volume : {$asset1_volume}\\n\";\n print \"asset2_volume : {$asset2_volume}\\n\";\n // print \"---\\n\";\n // print \"price_ask_int : {$price_ask_int}\\n\";\n // print \"price_bid_int : {$price_bid_int}\\n\";\n // print \"price_high_int : {$price_high_int}\\n\";\n // print \"price_low_int : {$price_low_int}\\n\";\n // print \"price_24hr_int : {$price_24hr_int}\\n\";\n // print \"price_last_int : {$price_last_int}\\n\";\n // print \"price_change_int : {$price_change_int}\\n\";\n // print \"asset1_volume_int : {$asset1_volume_int}\\n\";\n // print \"asset2_volume_int : {$asset2_volume_int}\\n\";\n }\n\n}", "function synchronizeItems($username, $password, $item_json_array, $storeid = 1, $others)\n {\n global $set_Special_Price, $set_Short_Description;\n $storeId=$this->getDefaultStore($storeid);\n $status=$this->checkUser($username, $password);\n if ($status != \"0\") {\n return $status;\n }\n $Items = $this->_objectManager->get('Webgility\\EccM2\\Model\\Items');\n $Items->setStatusCode('0');\n $Items->setStatusMessage('All Ok');\n $requestArray = $item_json_array;\n $pos = strpos($others, '/');\n if (isset($pos)) {\n $array_others = explode(\"/\", $others);\n } else {\n $array_others= [];\n $array_others[0]=$others; \n }\n if (!is_array($requestArray)) {\n $Items->setStatusCode('9997');\n $Items->setStatusMessage('Unknown request or request not in proper format');\n return $this->WgResponse($Items->getItems());\n }\n if (count($requestArray) == 0) {\n $Items->setStatusCode('9996');\n $Items->setStatusMessage('REQUEST array(s) doesnt have correct input format');\n return $this->WgResponse($Items->getItems());\n }\n $itemsProcessed = 0;\n $i = 0;\n $version = $this->getVersion();\n $stockRegistryInterface = $this->_objectManager->get('\\Magento\\CatalogInventory\\Api\\StockRegistryInterface');\n foreach ($requestArray as $k => $v4) {\n $status = \"Success\";\n $productID = $v4['ProductID'];\n $Price = $v4['Price'];\n $ProductName = $v4['ProductName'];\n $CostPrice = $v4['Cost']; \n $productsCollection = $this->_objectManager->get('Magento\\Catalog\\Model\\Product')->getCollection()\n ->addAttributeToSelect('entity_id')\n ->addAttributeToFilter('sku', $v4['Sku'])\n ->load();\n\n $productsCollection = $productsCollection->toArray();\n if (empty($productsCollection) || !isset($productsCollection)) {\n $Item->setStatus('Failed');\n $Item->setProductID($v4['ProductID']);\n $Item->setSku($v4['Sku']);\n $Item->setProductName($ProductName); \n $Item->setQuantity($v4['Qty']);\n $Item->setPrice($Price); \n $Item->setItemUpdateStatus('Failed'); \n $Items->setItems($Item->getItem());\n } else {\n foreach ($array_others as $ot) {\n if ($others == \"QTY\" || $others == \"BOTH\" || $ot == \"QTY\") {\n\n $informationObj = $this->_objectManager->get('Magento\\CatalogInventory\\Model\\Configuration');\n $configItemMinQty = $informationObj->getMinQty($storeId);\n \n $stockItem = $stockRegistryInterface->getStockItem($productID);\n $product_stack_detail = $stockItem->toArray();\n \n $ConfigBackordersValue = $this->_objectManager->get('Magento\\CatalogInventory\\Api\\StockConfigurationInterface')\n ->getBackorders($storeId);\n \n $stockItem->setQty($v4['Qty']);\n\n if ($product_stack_detail['use_config_min_qty'] == 1) {\n $config_qty = $configItemMinQty;\n } else {\n $config_qty = $product_stack_detail['min_qty'];\n }\n\n if ($product_stack_detail['use_config_backorders'] == 1) {\n // In this if when product geting values from config as config check box checked\n if ($ConfigBackordersValue == 0) {\n // In this if when config has NoBackorders option\n if ($v4['Qty'] <= $config_qty) {\n $stockItem->setIs_in_stock(0);\n } elseif ($v4['Qty'] == 0 && $config_qty != 0) {\n $stockItem->setIs_in_stock(1);\n } else {\n $stockItem->setIs_in_stock(1);\n }\n } else { \n $stockItem->setIs_in_stock(1);\n }\n } else {\n if ($product_stack_detail['backorders'] == 0) {\n\n if ($v4['Qty'] <= $config_qty) {\n $stockItem->setIs_in_stock(0);\n } elseif ($v4['Qty'] == 0 && $config_qty != 0) {\n $stockItem->setIs_in_stock(1);\n } else { \n $stockItem->setIs_in_stock(1);\n }\n } else {\n $stockItem->setIs_in_stock(1);\n } \n }\n $stockItem->save();\n }\n if ($others == \"PRICE\" || $others == \"BOTH\" || $ot == \"PRICE\") {\n $p = $this->_objectManager->get('Magento\\Catalog\\Model\\Product');\n $p->load($productID);\n\n if ($set_Special_Price) {\n $p->special_price = $v4['Price'];\n $p->save();\n if ($p->getSpecialPrice() != $v4['Price']) {\n $Product = $this->_editproduct($storeId, $productID);\n $Product->setSpecialPrice($v4['Price']);\n $Product->save();\n }\n } else {\n $p->price = $v4['Price'];\n $p->save();\n if ($p->getPrice() != $v4['Price']) {\n $Product = $this->_editproduct($storeId, $productID);\n $Product->setPrice($v4['Price']);\n $Product->save();\n }\n }\n }\n\n if ($others == \"COST\" || $ot == \"COST\") {\n $p = $this->_objectManager->get('Magento\\Catalog\\Model\\Product');\n $p->load($productID);\n $p->cost =$CostPrice;\n $p->save();\n if ($p->getCost() != $CostPrice) {\n $Product = $this->_editproduct($storeId, $productID);\n $Product->setCost($CostPrice);\n $Product->save();\n } else {\n $status =\"Cost Price for this product not found\";\n }\n }\n\n $Item = $this->_objectManager->get('Webgility\\EccM2\\Model\\Item');\n $Item->setStatus('Success');\n $Item->setProductID($v4['ProductID']);\n $Item->setSku($v4['Sku']);\n $Item->setProductName($ProductName); \n $Item->setQuantity($v4['Qty']);\n $Item->setPrice($Price); \n $Item->setItemUpdateStatus('Success'); \n $Items->setItems($Item->getItem());\n } \n }\n }\n return $this->WgResponse($Items->getItems());\n }", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function install() {\n global $wpdb;\n\n // cancel the installation process, if the requirements check returns errors\n $notices = (array) $this->check_requirements();\n if ( count( $notices ) ) {\n $this->logger->warning( __METHOD__, $notices );\n return;\n }\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\n $table_terms_price = $wpdb->prefix . 'laterpay_terms_price';\n $table_history = $wpdb->prefix . 'laterpay_payment_history';\n $table_post_views = $wpdb->prefix . 'laterpay_post_views';\n $table_passes = $wpdb->prefix . 'laterpay_passes';\n\n $sql = \"\n CREATE TABLE $table_terms_price (\n id int(11) NOT NULL AUTO_INCREMENT,\n term_id int(11) NOT NULL,\n price double NOT NULL DEFAULT '0',\n revenue_model enum('ppu','sis') NOT NULL DEFAULT 'ppu',\n PRIMARY KEY (id)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;\";\n dbDelta( $sql );\n\n $sql = \"\n CREATE TABLE $table_history (\n id int(11) NOT NULL AUTO_INCREMENT,\n mode enum('test','live') NOT NULL DEFAULT 'test',\n post_id int(11) NOT NULL DEFAULT 0,\n currency_id int(11) NOT NULL,\n price float NOT NULL,\n date datetime NOT NULL,\n ip int NOT NULL,\n hash varchar(56) NOT NULL,\n revenue_model enum('ppu','sis') NOT NULL DEFAULT 'ppu',\n pass_id int(11) NOT NULL DEFAULT 0,\n code varchar(6) NULL DEFAULT NULL,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\";\n dbDelta( $sql );\n\n $sql = \"\n CREATE TABLE $table_post_views (\n id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,\n post_id int(11) NOT NULL,\n mode enum('test','live') NOT NULL DEFAULT 'test',\n date datetime NOT NULL,\n user_id varchar(32) NOT NULL,\n ip varbinary(16) NOT NULL,\n has_access int(1) NOT NULL DEFAULT 0,\n KEY idx_post_views_date_mode (date,mode),\n KEY idx_post_views_post_id_date_mode (post_id,date,mode)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\";\n dbDelta( $sql );\n\n $sql = \"\n CREATE TABLE IF NOT EXISTS $table_passes (\n pass_id int(11) NOT NULL AUTO_INCREMENT,\n duration int(11) NULL DEFAULT NULL,\n period int(11) NULL DEFAULT NULL,\n access_to int(11) NULL DEFAULT NULL,\n access_category bigint(20) NULL DEFAULT NULL,\n price decimal(10,2) NULL DEFAULT NULL,\n revenue_model varchar(12) NULL DEFAULT NULL,\n title varchar(255) NULL DEFAULT NULL,\n description varchar(255) NULL DEFAULT NULL,\n is_deleted int(1) NOT NULL DEFAULT 0,\n PRIMARY KEY (pass_id),\n KEY access_to (access_to),\n KEY period (period),\n KEY duration (duration)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;\";\n dbDelta( $sql );\n\n add_option( 'laterpay_teaser_content_only', '1' );\n add_option( 'laterpay_plugin_is_in_live_mode', '0' );\n add_option( 'laterpay_sandbox_merchant_id', $this->config->get( 'api.sandbox_merchant_id' ) );\n add_option( 'laterpay_sandbox_api_key', $this->config->get( 'api.sandbox_api_key' ) );\n add_option( 'laterpay_live_merchant_id', '' );\n add_option( 'laterpay_live_api_key', '' );\n add_option( 'laterpay_global_price', $this->config->get( 'currency.default_price' ) );\n add_option( 'laterpay_global_price_revenue_model', 'ppu' );\n add_option( 'laterpay_currency', $this->config->get( 'currency.default' ) );\n add_option( 'laterpay_ratings', false );\n add_option( 'laterpay_bulk_operations', '' );\n add_option( 'laterpay_voucher_codes', '' );\n add_option( 'laterpay_gift_codes', '' );\n add_option( 'laterpay_voucher_statistic', '' );\n add_option( 'laterpay_gift_statistic', '' );\n add_option( 'laterpay_gift_codes_usages', '' );\n add_option( 'laterpay_purchase_button_positioned_manually', '' );\n add_option( 'laterpay_time_passes_positioned_manually', '' );\n add_option( 'laterpay_landing_page', '' );\n add_option( 'laterpay_only_time_pass_purchases_allowed', 0 );\n add_option( 'laterpay_is_in_visible_test_mode', 0 );\n add_option( 'laterpay_hide_free_posts', 0 );\n\n // advanced settings\n add_option( 'laterpay_sandbox_backend_api_url', 'https://api.sandbox.laterpaytest.net' );\n add_option( 'laterpay_sandbox_dialog_api_url', 'https://web.sandbox.laterpaytest.net' );\n add_option( 'laterpay_live_backend_api_url', 'https://api.laterpay.net' );\n add_option( 'laterpay_live_dialog_api_url', 'https://web.laterpay.net' );\n add_option( 'laterpay_api_merchant_backend_url', 'https://merchant.laterpay.net/' );\n add_option( 'laterpay_access_logging_enabled', 1 );\n add_option( 'laterpay_caching_compatibility', (bool) LaterPay_Helper_Cache::site_uses_page_caching() );\n add_option( 'laterpay_teaser_content_word_count', '60' );\n add_option( 'laterpay_preview_excerpt_percentage_of_content', '25' );\n add_option( 'laterpay_preview_excerpt_word_count_min', '26' );\n add_option( 'laterpay_preview_excerpt_word_count_max', '200' );\n add_option( 'laterpay_enabled_post_types', get_post_types( array( 'public' => true ) ) );\n add_option( 'laterpay_show_time_passes_widget_on_free_posts', '' );\n add_option( 'laterpay_maximum_redemptions_per_gift_code', 1 );\n add_option( 'laterpay_debugger_enabled', defined( 'WP_DEBUG' ) && WP_DEBUG );\n add_option( 'laterpay_api_fallback_behavior', 0 );\n add_option( 'laterpay_api_enabled_on_homepage', 1 );\n\n // keep the plugin version up to date\n update_option( 'laterpay_version', $this->config->get( 'version' ) );\n\n // update / remove plugin options\n $this->maybe_update_options();\n\n // clear opcode cache\n LaterPay_Helper_Cache::reset_opcode_cache();\n\n // update capabilities\n $laterpay_capabilities = new LaterPay_Core_Capability();\n $laterpay_capabilities->populate_roles();\n }", "function plugin_fin_smscoin_install($action) {\r\n\r\n\tglobal $lang;\r\n\tif ($action != 'autoapply')\r\n\t\tloadPluginLang('fin_smscoin', 'config', '', '', ':');\r\n\t// Fill DB_UPDATE configuration scheme\r\n\t$db_update = array(\r\n\t\tarray(\r\n\t\t\t'table' => 'fin_smscoin_history',\r\n\t\t\t'key' => 'primary key(id)',\r\n\t\t\t'action' => 'cmodify',\r\n\t\t\t'fields' => array(\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'id', 'type' => 'int not null auto_increment'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'success', 'type' => 'int', 'params' => 'default \"0\"'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'dt', 'type' => 'datetime'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'purse', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'order_id', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'amount', 'type' => 'float'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'clear_amount', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'inv', 'type' => 'bigint'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'phone', 'type' => 'char(32)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'sign_v2', 'type' => 'char(32)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'ip', 'type' => 'char(15)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'userid', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'sum', 'type' => 'float'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'trid', 'type' => 'int'),\r\n\t\t\t)\r\n\t\t),\r\n\t\tarray(\r\n\t\t\t'table' => 'fin_smscoin_transactions',\r\n\t\t\t'key' => 'primary key(id)',\r\n\t\t\t'action' => 'cmodify',\r\n\t\t\t'fields' => array(\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'id', 'type' => 'int not null auto_increment'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'dt', 'type' => 'datetime'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'userid', 'type' => 'int'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'username', 'type' => 'char(100)'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'amount', 'type' => 'float'),\r\n\t\t\t\tarray('action' => 'cmodify', 'name' => 'profit', 'type' => 'float'),\r\n\t\t\t)\r\n\t\t),\r\n\t);\r\n\t// Apply requested action\r\n\tswitch ($action) {\r\n\t\tcase 'confirm':\r\n\t\t\tgenerate_install_page('fin_smscoin', $lang['fin_smscoin:desc_install']);\r\n\t\t\tbreak;\r\n\t\tcase 'autoapply':\r\n\t\tcase 'apply':\r\n\t\t\tif (fixdb_plugin_install('fin_smscoin', $db_update, 'install', ($action == 'autoapply') ? true : false)) {\r\n\t\t\t\tplugin_mark_installed('fin_smscoin');\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\treturn true;\r\n}", "public function appr_paid($paid_id) {\n\n\t\t$sql = $this->query(\"SELECT * FROM `app_order` WHERE `id` = '$paid_id'\");\n\n\twhile($fetch = mysql_fetch_array($sql)) {\n\n\n\t\t\t\t$pro_id \t\t\t= $fetch['pro_id'];\n\t\t\t \t$pro_count \t\t\t= $fetch['count'];\n\t\t\t\t$pro_name \t\t\t= $fetch['name'];\n\t\t\t\t$pro_email \t\t\t= $fetch['email'];\n\t\t\t\t$pro_address \t\t= $fetch['address'];\n\t\t\t\t$pro_mobile \t\t= $fetch['mobile'];\n\t\t\t\t$pro_total \t\t\t= $fetch['total'];\n}\n\t\t\t$transfer_data_part_2_array = array($pro_id,$pro_count,$pro_name,$pro_email,$pro_address,$pro_mobile,$pro_total);\n\t\t\t\n\t\t\t\n\t\t\t$this->transfer_data_part_2($transfer_data_part_2_array);\n\n\t\t\t//After Sending them in a function via array........... The next programme delete the Item by using `id`\n\n\t\t\t$this->query(\"DELETE FROM `my_cart`.`app_order` WHERE `app_order`.`id` = '$paid_id'\");\n\n// Add into Main Balance............STARTS\n\t\t\t$balance_sql = $this->query(\"SELECT `total` FROM `balance`\");\n\t\t\t\n\t\t\t$balance_sql_fetch = mysql_fetch_array($balance_sql);\n\t\t\t$main_balance = $balance_sql_fetch['total'];\n\t\t\t$add_total = $main_balance + (int)$pro_total;\n\n\t\t\t$this->query(\"UPDATE `my_cart`.`balance` SET `total` = '$add_total' WHERE `id` = '1'\");\n\n// Add into Main Balance............ENDS\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. STARTS\n\n\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. ENDS\n\t}", "function transaction_add() {\r\n global $con;\r\n $data = json_decode(file_get_contents(\"php://input\"));\r\n $MONTH = $data->month;\r\n $AMOUNT = $data->amount;\r\n $BASKET = $data->basket;\r\n $FROMPERSON = $data->fromPerson;\r\n $BASKETOWNER = $data->basketOwner;\r\n $COMMENT = $data->comment;\r\n $CREATEDBY = $data->modifiedBy;\r\n $MODIFIEDBY = $data->modifiedBy;\r\n\r\n $qry_count = mysqli_query($con,\"SELECT * from ng_piggybank\");\r\n $num_rows = mysqli_num_rows($qry_count);\r\n if($num_rows > 0){\r\n $count = $num_rows + 1;\r\n }else{\r\n $count = 1;\r\n }\r\n $PBID = idCREATOR('PIGBANK', $num_rows);\r\n\r\n $qry = \"INSERT INTO ng_piggybank (\r\n PBID,\r\n AMOUNT, \r\n MONTH, \r\n BASKET, \r\n FROMPERSON,\r\n BASKETOWNER,\r\n COMMENT, \r\n CREATEDBY, \r\n MODIFIEDBY) \r\n VALUES (\r\n '$PBID',\r\n '$AMOUNT', \r\n '$MONTH', \r\n '$BASKET', \r\n '$FROMPERSON', \r\n '$BASKETOWNER',\r\n '$COMMENT', \r\n '$CREATEDBY', \r\n '$MODIFIEDBY')\";\r\n $result = mysqli_query($con,$qry);\r\n if(!$result){\r\n $arr = array('msg' => \"\", 'error' => $qry.'E_UNKNOWN');\r\n $jsn = json_encode($arr);\r\n trigger_error(\"Issue with mysql_query. Please check the detailed log\", E_USER_NOTICE);\r\n trigger_error(mysqli_error());\r\n print_r($jsn);\r\n }else{\r\n $arr = array('msg' => \"SUCCESS_PIGGYBANK_ADDED\", 'error' => '');\r\n $jsn = json_encode($arr);\r\n print_r($jsn);\r\n }\r\n}", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "public function importmagento() {\n error_reporting(E_ALL); ini_set('display_errors', 1);\n\n $base_url=\"http://myshoes.fastcomet.host/Magentos/\";\n //API user\n $api_user=\"apiuser\";\n //API key\n $api_key=\"81eRvINu9r\";\n\n\n $api_url=$base_url.'index.php/api/soap/?wsdl';\n $client = new SoapClient($api_url);\n $session = $client->login($api_user, $api_key);\n $result = $client->call($session, 'order.list');\n $j=0;\n\n\n foreach($result as $key => $value)\n {\n $result1 = $client->call($session, 'order.info', $result[$key]['increment_id']);\n $arr[$j]['Order']['external_orderid'] = $result[$key]['increment_id'];\n $arr[$j]['Order']['schannel_id']= 'Magento';\n $arr[$j]['Order']['shipping_costs']= number_format((float)$result[$key]['base_shipping_amount'], 2, '.', '');\n $arr[$j]['Order']['requested_delivery_date'] ='';\n $arr[$j]['Order']['currency'] =$result[$key]['order_currency_code'];\n $arr[$j]['Order']['remarks'] =$result[$key]['customer_note'];\n $arr[$j]['Order']['createdinsource'] =$result[$key]['created_at'];\n $arr[$j]['Order']['modifiedinsource'] =$result[$key]['updated_at'];\n $arr[$j]['Order']['ship_to_customerid'] = $result[$key]['customer_firstname'].\" \".$result[$key]['customer_lastname'];\n $arr[$j]['Order']['ship_to_city'] =$result[$key]['customer_email'];\n $arr[$j]['Order']['ship_to_street'] =$result1['shipping_address']['street'];\n $arr[$j]['Order']['ship_to_city'] =$result1['shipping_address']['city'];\n $arr[$j]['Order']['ship_to_zip'] =$result1['shipping_address']['postcode'];\n $arr[$j]['Order']['ship_to_stateprovince'] = '';\n $arr[$j]['Order']['state_id'] = '';\n $arr[$j]['Order']['country_id'] =$result1['shipping_address']['country_id'];\n\n $arr[$j]['OrdersLine']=[];\n $adr=$result1['items'];\n $i=0;\n foreach( $adr as $keys => $values){\n $sk =$adr[$keys]['sku'];\n $qo=$adr[$keys]['qty_ordered'];\n $up=$adr[$keys]['price'];\n $arr[$j]['OrdersLine'][$i]['line_number'] = ($i+1) * 10;\n $arr[$j]['OrdersLine'][$i]['sku'] =$sk;\n $arr[$j]['OrdersLine'][$i]['quantity'] = number_format((float)$qo, 2, '.', '');\n $arr[$j]['OrdersLine'][$i]['unit_price'] = number_format((float)$up, 2, '.', '');\n\n $i++;\n }\n $j++;\n }\n $this->importcsv(null,$arr);\n return $this->redirect(array('action' => 'index',1));\n\n }", "public function buy(){\n\n $id=89025555; //id di connessione\n $password=\"test\"; //password di connessione\n\n //è necessario foramttare il totale in NNNNNN.NN\n $importo= number_format(StadiumCart::total(),2,'.','');//importo da pagare\n\n $trackid=\"STDRX\".time(); //id transazione\n\n $urlpositivo=\"http://stadium.reexon.net/cart/receipt\";\n $urlnegativo=\"http://stadium.reexon.net/cart/error\";\n $codicemoneta=\"978\"; //euro\n //prelevo i dati inseriti durante la fase acquisto\n $user = (object)Session::get('user');\n\n $data=\"id=$id\n &password=$password\n &action=4\n &langid=ITA\n &currencycode=$codicemoneta\n &amt=$importo\n &responseURL=$urlpositivo\n &errorURL=$urlnegativo\n &trackid=$trackid\n &udf1=\".$user->email.\"\n &udf2=\".$user->mobile.\"\n &udf3=\".$user->firstname.\"\n &udf4=\".$user->lastname.\"\n &udf5=EE\";\n $curl_handle=curl_init();\n //curl_setopt($curl_handle,CURLOPT_URL,'https://www.constriv.com:443/cg/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle,CURLOPT_URL,'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n $buffer = curl_exec($curl_handle);\n\n if (empty($buffer))\n {\n return curl_error($curl_handle);\n }\n else\n {\n //print $buffer;\n $url=explode(\":\",$buffer);\n $transaction_id=$url[0];\n curl_close($curl_handle);\n //prepara il link per il pagamento\n if(strlen($transaction_id)>0){\n $redirectURL = $url[1].\":\".$url[2].\"?PaymentID=$transaction_id\";\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$redirectURL\\\">\";\n }\n }\n\n }", "public function payAction()\n {\n try {\n $orderId = $this->getRequest()->getParam('id');\n $hash = $this->getRequest()->getParam('hash');\n $this->setSession();\n $this->setOrder($orderId);\n $this->_payment = $this->_order->getPayment();\n $this->checkHash($hash);\n // First time\n if ($this->_payment->getAdditionalInformation('payuplpro_try_number') == 0) {\n $this->forceNewOrderStatus(true);\n $this->setPayment(true);\n }\n $this->_forward('repeat', null, null, array(\n 'id' => $orderId,\n 'hash' => $hash\n ));\n } catch (Mage_Core_Exception $e) {\n Mage::log('Error with pay link: ' . $e->getMessage(), null, 'payuplpro.log');\n $this->_redirect('/');\n }\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function confirm() {\r\n\r\n\t\t$json = array();\r\n\t\tif ($this->session->data['payment_method'] == 'coinremitter') {\r\n\t\t\t\r\n\t\t\tif($this->request->post['coin'] != ''){\r\n\r\n\t\t\t\t$this->load->model('extension/coinremitter/payment/coinremitter');\r\n\r\n\t\t\t\t/*** Get wallet data from 'oc_coinremitter_wallet' with use of `coin` ***/\r\n\t\t\t\t$coin = $this->request->post['coin'];\r\n\t\t\t\t$wallet_info = $this->model_extension_coinremitter_payment_coinremitter->getWallet($coin);\r\n\r\n\t\t\t\tif($wallet_info){\r\n\r\n\t\t\t\t\t$api_key = $wallet_info['api_key'];\r\n\t\t\t\t\t$api_password = $wallet_info['password'];\r\n\t\t\t\t\t$exchange_rate = $wallet_info['exchange_rate_multiplier'];\r\n\r\n\t\t\t\t\t$address_data =[\r\n\t\t\t\t\t\t'url' => 'get-new-address',\r\n\t\t\t\t\t\t'coin' => $coin,\r\n 'api_key' =>$api_key,\r\n 'password' => $api_password\r\n ];\r\n\t\t\t\t\t// print_r($this->obj_curl);\r\n\t\t\t\t\t// die;\r\n // die($this->obj_curl);\r\n $address_res = $this->obj_curl->commonApiCall($address_data);\r\n \r\n if(!empty($address_res) && isset($address_res['flag']) && $address_res['flag'] == 1){\r\n\r\n \t$this->load->model('checkout/order');\r\n\t\t\t\t\t\t$orderId = $this->session->data['order_id'];\r\n\t\t\t\t\t\t$order_cart = $this->model_checkout_order->getOrder($orderId);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Convert amount format in actual currency.\r\n\t\t\t\t\t\t/*** Opencart saves amount in USD only. So you need to covert amount for other currency. Below function converts amount in selected(base) currency. It also work for USD, so no need any other condition for USD ***/\r\n\t\t\t\t\t\t$order_total = $this->currency->format($order_cart['total'], $order_cart['currency_code'], $order_cart['currency_value'],false);\r\n\r\n\t\t\t\t\t\tif ($exchange_rate == 0 || $exchange_rate == '') {\r\n\t\t\t\t\t\t\t$exchange_rate = 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$amount = $order_total * $exchange_rate;\r\n\t\t\t\t\t\t$currency_type = $order_cart['currency_code'];\r\n\r\n \t//now convert order's fiat amount to crypto amount with use of get-fiat-to-crypto-rate api in coinremitter \r\n\r\n \t$fiat_amount_arr = [\r\n \t\t'url' => 'get-fiat-to-crypto-rate',\r\n \t\t'coin' => $coin,\r\n \t\t'api_key' =>$api_key,\r\n \t'password' => $api_password,\r\n \t'fiat_symbol' => $currency_type,\r\n \t'fiat_amount' => $amount\r\n \t];\r\n\r\n \t$fiat_to_crypto_res = $this->obj_curl->commonApiCall($fiat_amount_arr);\r\n\r\n \tif(!empty($fiat_to_crypto_res) && isset($fiat_to_crypto_res['flag']) && $fiat_to_crypto_res['flag'] == 1){\r\n\r\n \t\t\t$address_data = $address_res['data'];\r\n \t\t\t$fiat_to_crypto_res = $fiat_to_crypto_res['data'];\r\n\t\t \t$amountusd = $order_cart['total'];\r\n\t\t \t$crp_amount = $fiat_to_crypto_res['crypto_amount'];\r\n\t\t \t$address = $address_data['address'];\r\n\t\t \t$qr_code = $address_data['qr_code'];\r\n\r\n\t\t $order_data = array(\r\n\t\t \t'order_id' \t\t=> $orderId,\r\n\t\t \t'invoice_id' \t=> '' ,\r\n\t\t \t'amountusd' \t=> $amountusd,\r\n\t\t \t'crp_amount' \t=> $crp_amount,\r\n\t\t \t'payment_status'=> 'pending',\r\n\t\t \t'address' \t\t=> $address,\r\n\t\t \t'qr_code'\t\t=> $qr_code\r\n\t\t );\r\n\r\n\t\t \t/*** Now, insert detail in `oc_coinremitter_order` ***/\r\n\t\t \t$this->model_extension_coinremitter_payment_coinremitter->addOrder($order_data);\r\n\r\n\t\t \t/*** Now, insert detail in `oc_coinremitter_payment` ***/\r\n\t\t \t$invoice_expiry = (int)$this->config->get('payment_coinremitter_invoice_expiry');\r\n\r\n\t\t\t\t\t\t\t\tif($invoice_expiry == 0){\r\n\t\t\t\t\t\t\t\t\t$expire_on = '';\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$newtimestamp = strtotime(date('Y-m-d H:i:s').' + '.$invoice_expiry.' minute');\r\n\t\t\t\t\t\t\t\t\t$expire_on = date('Y-m-d H:i:s', $newtimestamp);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$total_amount = array(\r\n\t\t\t\t\t\t\t\t\t$coin => $crp_amount,\r\n\t\t\t\t\t\t\t\t\t'USD' => $amountusd,\r\n\t\t\t\t\t\t\t\t\t$order_cart['currency_code'] => $order_total\r\n\t\t\t\t\t\t\t\t);\r\n\t\t $payment_data = array(\r\n\t\t \t'order_id' \t\t=> \t$orderId,\r\n\t\t 'invoice_id'\t=>\t'',\r\n\t\t 'address'\t\t=> \t$address,\r\n\t\t 'invoice_name'\t=>\t'',\r\n\t\t 'marchant_name'\t=>\t'',\r\n\t\t 'total_amount'\t=>\tjson_encode($total_amount),\r\n\t\t 'paid_amount'\t=>\t'',\r\n\t\t 'base_currancy'\t=>\t$currency_type,\r\n\t\t 'description'\t=>\t'Order Id #'.$orderId,\r\n\t\t 'coin'\t\t\t=>\t$coin,\r\n\t\t 'payment_history'=> '',\r\n\t\t 'conversion_rate'=> '',\r\n\t\t 'invoice_url'\t=>\t'',\r\n\t\t 'status'\t\t=>\t'Pending',\r\n\t\t 'expire_on'\t\t=>\t$expire_on,\r\n\t\t 'created_at'\t=>\tdate('Y-m-d H:i:s')\r\n\t\t );\r\n\r\n\t\t $this->model_extension_coinremitter_payment_coinremitter->addPayment($payment_data);\r\n\r\n\t\t $enc_order_id = urlencode($this->obj_curl->encrypt($orderId)); // order id in encryption format\r\n\t\t $invoice_url = $this->url->link('extension/coinremitter/module/coinremitter_invoice|detail&order_id='.$enc_order_id,'',true);\r\n\r\n\t\t \t/*** Update order history status to pending, add comment ***/\r\n\t\t $comments = 'View order <a href=\"'.$invoice_url.'\">#' . $orderId . '</a> ';\r\n\t\t $is_customer_notified = true;\r\n\t\t $this->model_checkout_order->addHistory($orderId, 1, $comments, $is_customer_notified); \r\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t// 1 = Pending\r\n\r\n\t\t\t\t\t\t\t\t$json = array();\r\n\t\t\t\t\t\t\t\t$json['flag'] = 1; \r\n\t\t\t\t\t\t\t\t$json['redirect'] = $invoice_url;\r\n\r\n \t}else{\r\n \t\t$msg = 'Something went wrong while converting fiat to crypto. Please try again later';\r\n\t \tif(isset($fiat_to_crypto_res['msg']) && $fiat_to_crypto_res['msg'] != ''){\r\n\t \t\t$msg = $fiat_to_crypto_res['msg'];\r\n\t \t}\r\n\t \t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t$json['msg'] = $msg;\r\n \t}\r\n\r\n }else{\r\n \t$msg = 'Something went wrong while creating address. Please try again later';\r\n \tif(isset($address_res['msg']) && $address_res['msg'] != ''){\r\n \t\t$msg = $address_res['msg'];\r\n \t}\r\n \t$json['flag'] = 0;\r\n\t\t\t\t\t\t$json['msg'] = $msg;\r\n }\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = 'Selected wallet not found. Please try again later';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t$json['msg'] = 'Selected coin not found. Please try again later';\t\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$json['flag'] = 0;\r\n\t\t\t$json['msg'] = 'Please select Coinremitter as payment method';\r\n\t\t}\r\n\t\t$this->response->addHeader('Content-Type: application/json');\r\n\t\t$this->response->setOutput(json_encode($json));\t\t\r\n\t}", "function updateMain ($api, $unixTime, $folioArray, $moduleName, $interval, $quickExt) {\n\t$pairCount = count($folioArray)-2; // last entry is USD\n\n\t$intervalSec = $interval*60;\n\t$intervalSec2 = $intervalSec*2;\n\n\t$date = date('Y-m-d', $unixTime);\n\n\t$since = $unixTime-5400;\n\n\t$compareTime = $unixTime-$intervalSec;\n\n\tif ($quickExt['updateTime']<$compareTime) { //check total update status\n\t\t$pairsUpdated = $quickExt['pairIndex'];\n\t\t$updateTime = 0;\n\n\t\tif ($pairsUpdated+2>=$pairCount) {\n\t\t\t$updateTarget = $pairCount;\n\t\t} else {\n\t\t\t$updateTarget = $pairsUpdated+2;\n\t\t}\n\n\t\tfor ($i=$pairsUpdated; $i<=$updateTarget; $i++) { //for every pair, check time of latest indic row\n\t\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\t\tprint ('mew');\n\t\t\t}\n\t\t\t$currentUpdate = 0;\n\n\t\t\t$pairName = $folioArray[$i]['pairSymbol'];\n\t\t\t$currentFile = $moduleName.'-'.$pairName.'-';\n\n\t\t\t$filepath = 'indic/' . $currentFile . 'emaSet.json';\n\t\t\t$emaSet = file_get_contents($filepath);\n\t\t\t$emaSet = json_decode($emaSet, true);\n\n\t\t\t$compareTime = $unixTime-$intervalSec2;\n\t\t\tif ($emaSet[count($emaSet)-1]['time']>=$compareTime){\n\t\t\t\t$pairsUpdated +=1;\n\t\t\t\t$currentUpdate = 1;\n\t\t\t\t$quickExt['pairIndex'] = $pairsUpdated;\n\t\t\t\t$updateTime = $emaSet[count($emaSet)-1]['time'];\n\t\t\t\tprint_r ($pairName.'-update not needed<br>');\n\t\t\t}\n\t\t\tif ($currentUpdate==0){ // If current pair isn't update, run update functions\n\t\t\t\t$updateTime = updateFunctions ($api, $folioArray, $i, $interval, $date, $since, $unixTime, $intervalSec, $moduleName);\n\t\t\t\tif ($updateTime!=null) {\n\t\t\t\t\t$pairsUpdated +=1;\n\t\t\t\t\t$quickExt['pairIndex'] = $pairsUpdated;\n\n\t\t\t\t\t$filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index\n\t\t\t\t\tfile_put_contents($filepath, json_encode($quickExt));\n\t\t\t\t\tprint ('updateRan ');\n\t\t\t\t} else {\n\t\t\t\t\texit ('error');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset ($emaSet);\n\t\t\tif (is_int($i/3)){\n\t\t\t\tusleep(330000); // sleep for 1/3 of a second\n\t\t\t}\n\t\t}\n\t}\n\tif ($quickExt['pairIndex']==$pairCount+1){\n\t\t$quickExt['updateTime'] = $updateTime;\n\t\t$quickExt['pairIndex'] = 0;\n\t\tprint ('<br>'.$quickExt['updateTime'].'..'.$pairsUpdated.'..</br>');\n\n\t\t$filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index\n\t\tfile_put_contents($filepath, json_encode($quickExt));\n\t}\n\n}", "function updateFunctions ($api, $folioArray, $targetPair, $interval, $date, $since, $unixTime, $intervalSec, $moduleName) {\n\t$ohlc = null;\n\t$rowTime = null;\n\n\t$pairName = $folioArray[$targetPair]['pairSymbol'];\n\n\t$currentFile =$moduleName.'-'.$pairName.'-';\n\n\t$filepath = 'indic/' . $currentFile . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\tend($emaSet);\n\t$lastKey = key($emaSet);\n\n\t// update\n\n\n\t$compareTime = $unixTime-$intervalSec*3;\n\n\tif ($emaSet[$lastKey]['time']<=$compareTime){ //reinstall if too many missing\n\t\t\t$days = 30;\n\t\t\t$since = $unixTime-(60*60*24*$days);\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\t\tif (is_array($ohlc)){\n\t\t\t\t$current = installIndicR($currentFile, $ohlc);\n\t\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\t\t\t\tif ($current!=null) {\n\t\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' '.$current.' ok <br>');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\texit ('Error API JSON empty');\n\t\t\t}\n\n\t}else {\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\tif (is_array($ohlc)) {\n\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\n\t\t\tif ($rowTime > $emaSet[$lastKey]['time']){\n\t\t\t\tindicUPR($currentFile, $emaSet, $ohlc);\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t\tif ($rowTime == $emaSet[$lastKey]['time']){\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t} else {\n\t\t\t$rowTime = null;\n\t\t}\n\t}\n\n\treturn $rowTime;\n}", "function spectra_money_top100 ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Re-Balancing\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t\t$accounts = mysqli_getset ($GLOBALS[\"tables\"][\"ledger\"], \"1 ORDER BY `balance` DESC LIMIT 90 OFFSET 10\");\n\n\t\tif ($accounts[\"success\"] < 1 || $accounts[\"data\"] == \"\")\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Unavailable\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t//\tInitialize Calculation Result\n\t\t$sum_balances = 0;\n\t\t\n\t\tforeach ($accounts[\"data\"] as $account)\n\t\t{\n\t\t\t$sum_balances = bcadd ($sum_balances, $account[\"balance\"], 8);\n\t\t}\n\t\t\n\t\t$calc_perc = bcdiv ($sum_balances, spectra_money_supply (), 8);\n\t\n\t\t$balance_calc[\"total\"] = $sum_balances;\n\t\t$balance_calc[\"percent\"] = ($calc_perc * 100);\n\t\t\n\t\treturn $balance_calc;\n\t}", "function buy($amount,$symbol)\n {\n //balance should be greater than stock value to buy\n if($amount<=$this->totalamount)\n {\n //buy book stock\n if($symbol==\"Book\"){\n echo $this->new_account.\" owned Book Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->bookstock_buy++;\n $this->object_linkedlist->insertfirst(\"Book: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n //buy newspaper stock\n elseif($symbol==\"Newspaper\")\n {\n echo $this->new_account.\" owned Newspaper Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->newspaperstock_buy++;\n $this->object_linkedlist->insertfirst(\"Newspaper: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n }\n //if balance is less than stock value\n else{\n echo \"Your Balance is low than Stock price\\n\";\n }\n }", "public function calculate(array $data){\n $this->carcost=$data['carcost'];\n $this->tax=$data['tax'];\n $this->installments=$data['installments'];\n \n $timestamp = time();\n $hour=date('H', $timestamp);\n $day=date('D', $timestamp);\n \n //Base price of policy is 11% from entered car value, except every Friday 15-20 o’clock (user time) when it is 13%\n if($day=='Fri' && $hour>14 && $hour<21 ){\n $this->basicpercentage=13;\n }else{\n $this->basicpercentage=11;\n }\n \n // calculating the base price, commission, tax and total cost\n $this->basicprice=round(($this->carcost*$this->basicpercentage)/100, 2);\n $this->commission=round(($this->basicprice*17)/100, 2);\n $this->taxamount=round(($this->basicprice*$this->tax)/100, 2);\n $this->totalcost=round(($this->taxamount+$this->commission+$this->basicprice), 2);\n }", "function balance_the_books($p, $val,$code) {\r\n\t\t\r\n\t\t$p_a = myQuery(\"select account_id from accounts where account_type = 'project' and account_owner_id = $p\");\r\n\t\t$p_a = $p_a['account_id'];\r\n\t\t\r\n\t\t// Project has debts?\r\n\t\t\r\n\t $debits = mysql_query($queros=\"select *,sum(transaction_value) as t from transactions,accounts as ac_d, accounts as ac_c where ac_d.account_owner_id = $p and ac_d.account_type = 'project' and ac_d.account_id = transaction_debtor and ac_c.account_id = transaction_creditor and ac_c.account_type = 'pocket' group by ac_c.account_owner_id\");\r\n\t\t //echo $queros.\"<br />\";\r\n\t\t$credits = mysql_query($queros=\"select *,sum(transaction_value) as t from transactions,accounts as ac_d, accounts as ac_c where ac_c.account_owner_id = $p and ac_c.account_type = 'project' and ac_d.account_id = transaction_debtor and ac_c.account_id = transaction_creditor and ac_d.account_type = 'pocket' group by ac_d.account_owner_id\");\r\n\t\t //echo $queros;\r\n\t\t \r\n\t\t \r\n\t\t while($d = mysql_fetch_assoc($debits)) $book[''.$d['transaction_creditor']] = $d['t'];\t\r\n\t\t while($c = mysql_fetch_assoc($credits)) {\r\n\t\t \tif(isset($book[''.$c['transaction_debtor']]))\t$book[''.$c['transaction_debtor']] -= $c['t'];\r\n\t\t\telse $book[''.$c['transaction_debtor']] = -$c['t'];\r\n\t\t }\r\n\t\t \r\n\t\t print_r($book);\r\n\t\t //return;\r\n\t\t \t\t \r\n\t\t $debt_sum = 0;\r\n\t\t foreach($book as $e) $debt_sum += $e;\r\n\t\t $kickback = 0;\r\n\t\t if($val > $debt_sum) { // If we can actually pay back all our debts, do it\r\n\t\t \t$kickback = $val - $debt_sum;\r\n\t\t \t$val = $debt_sum;\r\n\t\t } \r\n\t\t \r\n\t\t\r\n\t\t \t\t \r\n\t\t foreach($book as $k => $e) {\r\n\t\t \t\t// Pay back the individual players\r\n\t\t \t\t\r\n\t\t \t\t$payback = ($e / $debt_sum)*$val; // pay back the correct fraction of the income\r\n\t\t \t\tif(round($payback,2) == 0) continue; // if that fraction is zero, done\r\n\t\t \t\t\r\n\t\t \t\t$code = md5($code);\r\n\t\t\t\t$note = \"project paying off debts owed to members\";\t\t \t\t\r\n\t\t \t\t//\tSend money from the project account into the user account\r\n\t\t \t\tmysql_query (\"insert into transactions (transaction_debtor,transaction_creditor,transaction_note,transaction_value,transaction_code) \r\n\t\t \t\t\t\t\t\t\tvalues ($k,$p_a,'$note',$payback,'$code')\") or die(mysql_error());\r\n\t\t \t\t\r\n\t\t }\r\n\r\n\t\tif($kickback != 0) {\r\n\t\t\t\t\r\n\t\t\t$shareholders = mysql_query(\"select * from accounts where account_type = 'shareholder'\");\r\n\t\t\t\r\n\t\t\t$kickback = $kickback / mysql_num_rows($shareholders);\r\n\t\t\t\r\n\t\t\twhile($s = mysql_fetch_assoc($shareholders)) {\r\n\t\t\t\t$u_a = $s['account_id'];\r\n\t\t\t \t$code = md5($code);\r\n\t\t\t\r\n\t\t\t \t$note = 'project generated extra money, have some kickback';\r\n\t\t\t\tmysql_query (\"insert into transactions (transaction_debtor, transaction_creditor, transaction_note, transaction_value, transaction_code) \r\n\t\t\t\t\t\tvalues ($u_a, $p_a, '$note',$kickback,'$code')\") or die(mysql_error());\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}", "public function updateTransactions($account, $historical = false, $historicalVerbose = true, $historicalLimit = 0) {\n\t\t\t$account->clearTransactions();\n\t\t\t$accountKey = preg_replace('#[^0-9]#', '', $account->getSortCode().$account->getAccountNumber());\n\n\t\t\t// In theory, we could get the data from here which would be nicer.\n\t\t\t//\n\t\t\t// - Need to calculate balance though.\n\t\t\t//\n\t\t\t// $pti = $this->accountData[$accountKey]['creditCardDetails']['productTokenId'];\n\t\t\t// $json = $this->getPage('https://myproducts.tescobank.com/api/transactions?productTokenId=' . $pti);\n\t\t\t// $transactions = json_decide($json, true);\n\t\t\t//\n\t\t\t// Next page would be\n\t\t\t// $lmt = $transactions['metaData']['resultSet']['nextPageReference'];\n\t\t\t// $json = $this->getPage('https://myproducts.tescobank.com/api/transactions?productTokenId=' . $pti . '&lmt=' . $lmt);\n\t\t\t// $transactions = json_decide($json, true);\n\t\t\t//\n\t\t\t// Each transaction would be within $transactions['results']\n\t\t\t//\n\t\t\t// $desc = $t['shortName'] . ' // ' . $t['merchantLocation'];\n\t\t\t// $amount = $t['transactionType'] == 'Purchase' ? 0 - $t['amount'] : $t['amount'];\n\t\t\t// $date = $t['transactionDate'];\n\t\t\t// $t['transactionReferenceNumber'] would be useful to have.\n\t\t\t//\n\t\t\t// Balance needs calculating back based on:\n\t\t\t// $balance = $this->accountData[$accountKey]['creditCardDetails']['creditLimit'] - $this->accountData[$accountKey]['creditCardDetails']['availableCredit'];\n\n\t\t\t$page = $this->getPage($this->accountLinks[$accountKey]);\n\n\t\t\tif (!$this->isLoggedIn($page)) { return false; }\n\n\t\t\t// Get last statement balance.\n\t\t\tpreg_match('#<strong>Statement balance</strong></td>[^\"]+\"normalText\">([^<]+)</td>#', $page, $m);\n\t\t\t$lastBalance = 0 - $this->parseBalance($m[1]);\n\n\t\t\t// Now get most recent transactions.\n\t\t\t$page = $this->getPage('https://onlineservicing.creditcards.tescobank.com/Tesco_Consumer/ViewTransactions.do', true);\n\t\t\t$page = $this->getDocument($page);\n\n\t\t\t$transactions = $this->extractTransactions($page, $lastBalance);\n\n\t\t\t// Get some old shit.\n\t\t\t$dates = $page->find('select[name=\"cycleDate\"] option');\n\t\t\tfor ($i = 0; $i < count($dates); $i++) {\n\t\t\t\t$cycleDate = $dates->eq($i)->attr(\"value\");\n\t\t\t\tif ($cycleDate == '00') { continue; }\n\t\t\t\techo $this->cleanElement($dates->eq($i)), \"\\n\";\n\t\t\t\t$url = 'https://onlineservicing.creditcards.tescobank.com/Tesco_Consumer/Transactions.do?cycleDate=' . $cycleDate;\n\t\t\t\t$page = $this->getPage($url, true);\n\t\t\t\t$page = $this->getDocument($page);\n\n\t\t\t\t$lastBalance = '';\n\t\t\t\t$items = $page->find('table tr td.normalText');\n\t\t\t\t$next = false;\n\t\t\t\tforeach ($items as $col) {\n\t\t\t\t\t$content = $this->cleanElement($col);\n\t\t\t\t\tif ($content == 'Previous balance') {\n\t\t\t\t\t\t$next = true;\n\t\t\t\t\t} else if ($next) {\n\t\t\t\t\t\t$lastBalance = 0 - $this->parseBalance($this->cleanElement($col));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$olderTransactions = $this->extractTransactions($page, $lastBalance);\n\t\t\t\t$transactions = array_merge($transactions, $olderTransactions);\n\n\t\t\t\t// Set the current account balance based on the balance after the\n\t\t\t\t// most recent transaction.\n\t\t\t\t$account->setBalance($transactions[0]['balance']);\n\n\t\t\t\t// If we're not asking for historical, then we don't need to\n\t\t\t\t// go back any further.\n\t\t\t\tif (!$historical) { break; }\n\t\t\t\telse if ($olderTransactions[count($olderTransactions) - 1]['date'] <= $historicalLimit) { break; }\n\t\t\t}\n\n\t\t\t// Now go through the transactions bottom-top so that we have them in the\n\t\t\t// order that they occured.\n\t\t\t$transactions = array_reverse($transactions);\n\n\t\t\t// To make ordering the transactions easier, rather than having\n\t\t\t// all the days transactions having the same time, we add a second\n\t\t\t// each time. (so the first transaction of the day happened at\n\t\t\t// 00:00:00 the second at 00:00:01 and so on.\n\t\t\t$dayCount = 0;\n\t\t\t$lastDate = 0;\n\n\t\t\t// Ignore transactions on the last date, as there may be more that we don't see\n\t\t\tif (count($transactions) > 0) {\n\t\t\t\t$skipDate = $transactions[0]['date'];\n\t\t\t\tforeach ($transactions as $transaction) {\n\t\t\t\t\t// Skip the last day, cos we can't be sure we have all the\n\t\t\t\t\t// transactions for it.\n\t\t\t\t\tif ($transaction['date'] == $skipDate) { continue; }\n\n\t\t\t\t\tif ($lastDate == $transaction['date']) {\n\t\t\t\t\t\t$dayCount++;\n\t\t\t\t\t\t$transaction['date'] += $dayCount;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$lastDate = $transaction['date'];\n\t\t\t\t\t\t$dayCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$account->addTransaction(new Transaction($this->__toString(), $account->getAccountKey(), $transaction['date'], $transaction['type'], $transaction['typecode'], $transaction['description'], $transaction['amount'], $transaction['balance'], $transaction['extra']));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Reset the stream context.\n\t\t\t$this->browser->setStreamContext(array());\n\t\t}", "public function calculateAssetsAndLiabilities($startDate, $endDate){\t\t\t\n\t\t\t$user = Session::get('user');\n\t\t\t$user_id = $user -> id;\n\t\t\t$accounts = DB::select('select * from accounts where user_id = :user_id' , ['user_id' => $user_id]);\n\t\t\t$valid_account_ids = array();\n\t\t\tforeach($accounts as $account){\n\t\t\t\t$valid_id = $account->id;\n\t\t\t\tarray_push($valid_account_ids, $valid_id);\n\t\t\t}\n\n\t\t\t$transactions = Transaction::get()->toArray();\n\n\t\t\t$transactionManager = new TransactionManager();\n\t\t\t$transactions = $transactionManager -> sortTransactionsByDates($transactions);\n\t\t\t$transactions = array_reverse($transactions);\n\n\t\t\t$prevBalanceAssets = 0;\n\t\t\t$prevBalanceLiabilities = 0;\n\t\t\t$prevBalanceNetWorth = 0;\n\t\t\t$transactionBeforeStartExistsAssets = false;\n\t\t\t$transactionBeforeStartExistsLiabilities = false;\n\t\t\t$transactionBeforeStartExistsNetWorth = false;\n\n\t\t\tif(empty($transactions)){\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\t$assetsData = array();\n\t\t\t$liabilitiesData = array();\n\t\t\t$netWorthData = array();\n\t\t\tforeach($transactions as $t){\n\t\t\t\t/*if date is before startDate, skip this transaction*/\n\t\t\t\tif($transactionManager->rawDateCompare($t['date'], $startDate) > 0){\n\t\t\t\t\tif($t['amount'] > 0){\n\t\t\t\t\t\t$prevBalanceAssets += $t['amount'];\n\t\t\t\t\t\t$transactionBeforeStartExistsAssets = true;\n\t\t\t\t\t\t$prevBalanceNetWorth += $t['amount'];\n\t\t\t\t\t\t$transactionBeforeStartExistsNetWorth = true;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$prevBalanceAssets += -1 * $t['amount'];\n\t\t\t\t\t\t$transactionBeforeStartExistsLiabilities = true;\n\t\t\t\t\t\t$prevBalanceNetWorth += $t['amount'];\n\t\t\t\t\t\t$transactionBeforeStartExistsNetWorth = true;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t/*if date is after endDate, skip this transaction*/\n\t\t\t\tif($transactionManager->rawDateCompare($t['date'], $endDate) < 0){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t/*amount is greater than zero, therefore an asset*/\n\t\t\t\tif($t['amount'] > 0){\n\t\t\t\t\tif(!array_key_exists($t['date'], $assetsData)){\n\t\t\t\t\t\t$assetsData[$t['date']] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(!array_key_exists($t['date'], $netWorthData)){\n\t\t\t\t\t\t$netWorthData[$t['date']] = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$assetsData[$t['date']] += $t['amount'];\n\t\t\t\t\t$netWorthData[$t['date']] += $t['amount'];\n\t\t\t\t}\n\t\t\t\t/*amount is less than zero, therefore a liability*/\n\t\t\t\telse{\n\t\t\t\t\tif(!array_key_exists($t['date'], $liabilitiesData)){\n\t\t\t\t\t\t$liabilitiesData[$t['date']] = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(!array_key_exists($t['date'], $netWorthData)){\n\t\t\t\t\t\t$netWorthData[$t['date']] = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$liabilitiesData[$t['date']] += -1 * $t['amount'];\n\t\t\t\t\t$netWorthData[$t['date']] += $t['amount'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t//cumulate each data point for assets and liabilities\n\t\t\t$netAssets = $prevBalanceAssets;\n\t\t\t$netLiabilities = $prevBalanceLiabilities;\n\t\t\t$netNetWorth = $prevBalanceNetWorth;\n\t\t\tforeach($assetsData as &$data){\n\t\t\t\t$netAssets += $data;\n\t\t\t\t$data = $netAssets;\n\t\t\t}\n\n\t\t\tforeach($liabilitiesData as &$data){\n\t\t\t\t$netLiabilities += $data;\n\t\t\t\t$data = $netLiabilities;\n\t\t\t}\n\t\t\tforeach($netWorthData as &$data){\n\t\t\t\t$netNetWorth += $data;\n\t\t\t\t$data = $netNetWorth;\n\t\t\t}\n\n\t\t\t$paddingLeftAssets = array();\n\t\t\t$paddingRightAssets = array();\n\n\t\t\t$paddingLeftLiabilities = array();\n\t\t\t$paddingRightLiabilities = array();\n\n\t\t\t$paddingLeftNetWorth = array();\n\t\t\t$paddingRightNetWorth = array();\n\n\t\t\tif($transactionBeforeStartExistsAssets){\n\t\t\t\tif(!array_key_exists($startDate, $assetsData)){\n\t\t\t\t\t$paddingLeftAssets[$startDate] = $prevBalanceAssets;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!array_key_exists($endDate, $assetsData)){\n\t\t\t\t$paddingRightAssets[$endDate] = $netAssets;\n\t\t\t}\n\n\t\t\t$fullAssetsData = array_merge($paddingLeftAssets, $assetsData, $paddingRightAssets);\n\n\t\t\tif($transactionBeforeStartExistsLiabilities){\n\t\t\t\tif(!array_key_exists($startDate, $liabilitiesData)){\n\t\t\t\t\t$paddingLeftLiabilities[$startDate] = $prevBalanceLiabilities;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!array_key_exists($endDate, $liabilitiesData)){\n\t\t\t\t$paddingRightLiabilities[$endDate] = $netLiabilities;\n\t\t\t}\n\n\t\t\t$fullLiabilitiesData = array_merge($paddingLeftLiabilities, $liabilitiesData, $paddingRightLiabilities);\n\n\t\t\tif($transactionBeforeStartExistsNetWorth){\n\t\t\t\tif(!array_key_exists($startDate, $netWorthData)){\n\t\t\t\t\t$paddingLeftNetWorth[$startDate] = $prevBalanceNetWorth;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!array_key_exists($endDate, $netWorthData)){\n\t\t\t\t$paddingRightNetWorth[$endDate] = $netNetWorth;\n\t\t\t}\n\n\t\t\t$fullNetWorthData = array_merge($paddingLeftNetWorth, $netWorthData, $paddingRightNetWorth);\n\t\t\t\n\t\t\t$totalData = array(\"Assets\" => $fullAssetsData, \"Liabilities\" => $fullLiabilitiesData, \"Net Worth\" => $fullNetWorthData);\n\n\t\t\t\n\t\t\treturn $totalData;\n\t\t\n\t}", "public function updateHistories($bill,$type = 'bill',$timestamp)\n {\n $object = $bill[0];\n switch($type)\n {\n case 'bill':\n default:\n $bill_details = unserialize($object['params']);\n $total = $bill_details['total_amount'];\n $number_songs = 0;\n $number_albums = 0;\n foreach ($bill_details['items'] as $it)\n {\n if ($it['type'] =='song')\n {\n $number_songs++;\n }\n if ($it['type'] =='album')\n {\n $number_albums++;\n }\n }\n \n $history = Mp3music_Api_Cart::getHistory($timestamp);\n $params = Mp3music_Api_Cart::getParamHistory(array('sold_songs'=>$number_songs,'sold_albums'=>$number_albums,'total_amount'=>$total,'transaction_succ'=>$object['status_bill'])); \n \n if ($history == null)\n {\n //insert new history\n Mp3music_Api_Cart::insertHistory($timestamp,$params);\n \n \n }\n else\n {\n //update infor\n $params = $history;\n $params['selling_sold_songs'] = $params['selling_sold_songs']+ $number_songs;\n $params['selling_sold_albums'] = $params['selling_sold_albums']+ $number_albums;\n $params['selling_total_amount'] = $params['selling_total_amount']+ $total ;\n $params['selling_transaction_succ'] = $params['selling_transaction_succ']+ $object['status_bill'] ;\n \n Mp3music_Api_Cart::updateHistory($timestamp,$params);\n \n \n }\n \n break;\n }\n }", "function ppt_resources_get_consumptions_stocks_per_product($data)\n{\n if (!isset($data['year']) || (!isset($data['uid']))) {\n return services_error('Year or UID are not defined!', 500);\n }\n\n global $user;\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid']) && !empty($data['uid'])) {\n $uid = $data['uid'];\n } else {\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n } else {\n $is_rep = FALSE;\n if (is_rep($user)) {\n $is_rep = TRUE;\n }\n $reps = ppt_resources_get_sales_manager_reps($uid, $countries, $is_rep);\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $consumptions = sum_records_per_field_grouped_by_account($entries_records, 'field_product');\n\n return $consumptions;\n}", "public function postImportContractAdd(){\n\t\t$inputs = \\Input::all();\n\t\t$val = true; /*Validator::make($input,Contract::$contractRule);*/\n\t\tif($val){\n\t\t\t$feederSteerQty = \\Input::get('feedersteer_quantity');\n\t\t\t$feederHeiferQty = \\Input::get('feederheifer_quantity');\n\t\t\t$breederBullQty = \\Input::get('breederbull_quantity');\n\t\t\t$breederHeiferQty = \\Input::get('breederheifer_quantity');\n\t\t\t$feederSteerWeight = \\Input::get('feedersteer_weight');\n\t\t\t$feederHeiferWeight = \\Input::get('feederheifer_weight');\n\t\t\t$breederBullWeight = \\Input::get('breederbull_weight');\n\t\t\t$breederHeiferWeight = \\Input::get('breederheifer_weight');\n\t\t\t$feederSteerPrice = \\Input::get('feedersteer_price');\n\t\t\t$feederHeiferPrice = \\Input::get('feederheifer_price');\n\t\t\t$breederBullPrice = \\Input::get('breederbull_price');\n\t\t\t$breederHeiferPrice = \\Input::get('breederheifer_price');\n\t\t\t//\n\t\t\t$importDate = date(\"Y-m-d\",strtotime(\\Input::get('import_date')));\n\t\t\t$openLcDate = date(\"Y-m-d\",strtotime(\\Input::get('lc_open_last_date')));\n\t\t\t$contractInsert = array(\n\t\t\t\t'feedersteer_quantity' => $feederSteerQty,\n\t\t\t\t'feederheifer_quantity' => $feederHeiferQty,\n\t\t\t\t'breederbull_quantity' => $breederBullQty,\n\t\t\t\t'breederheifer_quantity' => $breederHeiferQty,\n\t\t\t\t'feedersteer_weight'\t=> $feederSteerWeight,\n\t\t\t\t'feederheifer_weight'\t=> $feederHeiferWeight,\n\t\t\t\t'breederbull_weight'\t=> $breederBullWeight,\n\t\t\t\t'breederheifer_weight'\t=> $breederHeiferWeight,\n\t\t\t\t'feedersteer_price'\t=>$feederSteerPrice,\n\t\t\t\t'feederheifer_price'\t=> $feederHeiferPrice,\n\t\t\t\t'breederbull_price'\t\t=>$breederBullPrice,\n\t\t\t\t'breederheifer_price'\t=> $breederHeiferPrice,\n\t\t\t\t'name'\t=> $inputs['imp_contract_name'],\n\t\t\t\t'import_date'=>$importDate,\n\t\t\t\t'lc_open_last_date' => $openLcDate,\n\t\t\t\t'imp_status_text' => \\input::get('imp_status_text'),\n\t\t\t\t'partner_id' => $inputs['partner_id'],\n\t\t\t\t'farm_id'\t=>$inputs['farm_id'],\n\t\t\t\t'company_id' => $inputs['company_id'],\n\t\t\t\t'port_id' => $inputs['port_id']\n\t\t\t);\n\n\t\t\t// Tinh so lan nhap cua doi tac\t\t\t\n\t\t\t$importCounts = Contract::where('partner_id',$inputs['partner_id'])->count() + 1;\n\t\t\t//Tinh don gia trung binh nhap\n\t\t\t$partner = Partner::find($inputs['partner_id']);\t\t\t\n\t\t\t$newAvgPrice = array();\n\t\t\tif($partner){\n\t\t\t\t$currentAvgPrices = json_decode($partner->import_avg_prices,true);\n\t\t\t\tforeach ($currentAvgPrices as $key => $price) {\n\t\t\t\t\t$varName = $key.'Price';\n\t\t\t\t\t$newAvgPrice[$key] = (($importCounts - 1) * $price + $$varName) / ($importCounts);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tContract::create($contractInsert);\n\t\t\t\t$partner->update(array(\n\t\t\t\t\t'import_counts'=>$importCounts,\n\t\t\t\t\t'import_avg_prices' => json_encode($newAvgPrice)\n\t\t\t\t));\n\t\t\t\treturn \\Redirect::route('admin_report_import_contract_get')->with('success',\"Thêm thành hợp đồng nhập bò\");\n\t\t\t}catch(exp $e ){\n\t\t\t\treturn \\Redirect::route('admin_report_import_contract_get')->with('error',\"Lỗi hệ thống, vui lòng liên hệ quản trị\");\n\t\t\t}\t\t\t\t\n\t\t}else{\n\t\t\treturn $val->errors();\n\t\t}\n\t}", "public function install()\r\n\t{\r\n\t\tif (!parent::install() || !$this->registerHook('payment') || !$this->registerHook('adminOrder') || !$this->registerHook('paymentReturn') || !$this->registerHook('orderConfirmation'))\r\n\t\t\treturn false;\r\n\r\n\r\n\t\t$this->registerHook('displayPayment');\r\n\t\t$this->registerHook('header');\r\n $this->registerHook('actionOrderStatusUpdate');\r\n\t\tif (!Configuration::get('BILLMATE_PAYMENT_ACCEPTED'))\r\n\t\t\tConfiguration::updateValue('BILLMATE_PAYMENT_ACCEPTED', $this->addState('Billmate : Payment accepted', '#DDEEFF'));\r\n\t\tif (!Configuration::get('BILLMATE_PAYMENT_PENDING'))\r\n\t\t\tConfiguration::updateValue('BILLMATE_PAYMENT_PENDING', $this->addState('Billmate : payment in pending verification', '#DDEEFF'));\r\n\r\n $include = array();\r\n $hooklists = Hook::getHookModuleExecList('displayBackOfficeHeader');\r\n foreach($hooklists as $hooklist)\r\n {\r\n if(!in_array($hooklist['module'],array('billmatebank','billmateinvoice','billmatepartpayment'))){\r\n $include[] = true;\r\n }\r\n }\r\n if(in_array(true,$include))\r\n $this->registerHook('displayBackOfficeHeader');\r\n\t\t/*auto install currencies*/\r\n\t\t$currencies = array(\r\n\t\t\t'Euro' => array('iso_code' => 'EUR', 'iso_code_num' => 978, 'symbole' => '€', 'format' => 2),\r\n\t\t\t'Danish Krone' => array('iso_code' => 'DKK', 'iso_code_num' => 208, 'symbole' => 'DAN kr.', 'format' => 2),\r\n\t\t\t'krone' => array('iso_code' => 'NOK', 'iso_code_num' => 578, 'symbole' => 'NOK kr', 'format' => 2),\r\n\t\t\t'Krona' => array('iso_code' => 'SEK', 'iso_code_num' => 752, 'symbole' => 'SEK kr', 'format' => 2)\r\n\t\t);\r\n\r\n\r\n\t\tforeach ($currencies as $key => $val)\r\n\t\t{\r\n\t\t\tif (_PS_VERSION_ >= 1.5)\r\n\t\t\t\t$exists = Currency::exists($val['iso_code_num'], $val['iso_code_num']);\r\n\t\t\telse\r\n\t\t\t\t$exists = Currency::exists($val['iso_code_num']);\r\n\t\t\tif (!$exists)\r\n\t\t\t{\r\n\t\t\t\t$currency = new Currency();\r\n\t\t\t\t$currency->name = $key;\r\n\t\t\t\t$currency->iso_code = $val['iso_code'];\r\n\t\t\t\t$currency->iso_code_num = $val['iso_code_num'];\r\n\t\t\t\t$currency->sign = $val['symbole'];\r\n\t\t\t\t$currency->conversion_rate = 1;\r\n\t\t\t\t$currency->format = $val['format'];\r\n\t\t\t\t$currency->decimals = 1;\r\n\t\t\t\t$currency->active = true;\r\n\t\t\t\t$currency->add();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tCurrency::refreshCurrencies();\r\n\t\t\r\n\t\t$version = str_replace('.', '', _PS_VERSION_);\r\n\t\t$version = Tools::substr($version, 0, 2);\r\n\t\t\r\n\t\t\r\n\t\t/* The hook \"displayMobileHeader\" has been introduced in v1.5.x - Called separately to fail silently if the hook does not exist */\r\n\r\n\r\n\t\treturn true;\r\n\t}", "public function redeemAction(){\n $txtRedeemPoints = $_POST['txtRedeemPoints'];\n $quoteData = Mage::getSingleton('checkout/session')->getQuote();\n \n $CartContentsTotal = $quoteData['subtotal'];\n $CartTotal = $quoteData['grand_total'];\n \n if(!empty($txtRedeemPoints)){\n $LB_Session = $_SESSION['LB_Session'];\n if (!empty($LB_Session)) {\n // confirm loyalty points available or not and update to session if available.\n $CardOrPhoneNumber = $LB_Session['Phone Number'];\n $CardPoints = Lb_Points_Helper_Data::getCardPoints($CardOrPhoneNumber);\n $InquiryResult = $CardPoints->InquiryResult;\n $balances = $InquiryResult->balances;\n $Balance = $balances->balance;\n foreach ($Balance as $balValue) {\n if ($balValue->valueCode == 'Discount') {\n $_SESSION['LB_Session']['lb_discount'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_discount_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_discount_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'Points') {\n $_SESSION['LB_Session']['lb_points'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_points_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_points_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'ZAR') {\n $_SESSION['LB_Session']['lb_zar'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_zar_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_zar_exchangeRate'] = $balValue->exchangeRate;\n }\n }\n Lb_Points_Helper_Data::debug_log(\"LB API called : Inquiry to check Points Balance\", true);\n \n $totalRedeemPoints = 0;\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $totalRedeemPoints = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n }\n \n if($totalRedeemPoints == 0){\n $totalRedeemPoints = $txtRedeemPoints;\n }\n \n if ($txtRedeemPoints > 0 && $totalRedeemPoints <= $CartTotal && is_numeric($txtRedeemPoints)) {\n \n if ($_SESSION['LB_Session']['lb_points'] >= $totalRedeemPoints) {\n //self::generate_discount_coupon($txtRedeemPoints, 'fixed_cart', 'REDEEM');\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $_SESSION['LB_Session']['totalRedeemPoints'] = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n else\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n else\n {\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n $message = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and applied discount to your cart.\";\n $messageJson = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and discount is being applied to your cart.\";\n Mage::getSingleton('core/session')->addSuccess($message);\n echo json_encode(array('status' => 1, 'message' => $messageJson));\n }else {\n echo json_encode(array('status' => 0, 'message' => \"You don't have sufficient Loyalty Points to redeem.\"));\n }\n } else {\n echo json_encode(array('status' => 0, 'message' => \"Please enter valid Loyalty Points.\"));\n }\n }\n else\n echo json_encode(array('status' => 0, 'message' => Lb_Points_Helper_Data::$rewardProgrammeName.\" session expired.\"));\n }\n else\n echo json_encode(array('status' => 0, 'message' => \"Please enter loyalty points.\"));\n die;\n }", "public function ReGem() {\n\n try{\n $gemcalc = new GemstoneHardnessCalculator();\n $gemcalc->generateHashValues(); \n\n echo \"Step 1 : Running Gemstone Task\".\"<br>\";\n\n try{\n $gemhash = new GemstoneHasher();\n $gemhash->storeHashedValues();\n echo \"Step 2 : New Gemstone Encryptions\";\n\n }catch(Throwable $e) {\n echo \"error:\".$e->getMessage();\n }\n\n }catch(Throwable $e){\n echo \"error:\".$e->getMessage();\n }\n \n }", "public function importRates() {\n // This process can take a while\n @set_time_limit( 0 );\n @ignore_user_abort( true );\n\n $this->newRates = array();\n $this->freightTaxableRates = array();\n $rate = Mage::getModel('taxjar/rate');\n $filename = $this->getTempFileName();\n $rule = Mage::getModel('taxjar/rule');\n $shippingTaxable = Mage::getStoreConfig('taxjar/config/freight_taxable');\n $ratesJson = unserialize( file_get_contents( $filename ) );\n\n foreach( $ratesJson as $rateJson ) {\n $rateIdWithShippingId = $rate->create( $rateJson );\n\n if ( $rateIdWithShippingId[1] ) {\n $this->freightTaxableRates[] = $rateIdWithShippingId[1];\n }\n\n $this->newRates[] = $rateIdWithShippingId[0];\n }\n\n $this->setLastUpdateDate( date( 'm-d-Y' ) );\n $rule->create( 'Retail Customer-Taxable Goods-Rate 1', 2, 1, $this->newRates );\n\n if ( $shippingTaxable ) {\n $rule->create( 'Retail Customer-Shipping-Rate 1', 4, 2, $this->freightTaxableRates ); \n }\n\n @unlink( $filename );\n Mage::getSingleton('core/session')->addSuccess(\"TaxJar has added new rates to your database! Thanks for using TaxJar!\");\n }", "function install() {\n global $db;\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Paymentech Module', 'MODULE_PAYMENT_PAYMENTECH_STATUS', 'True', 'Do you want to accept Paymentech payments?', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Transaction Mode', 'MODULE_PAYMENT_PAYMENTECH_TESTMODE', 'Test', 'Transaction mode used for processing orders.', '6', '0', 'cfg_select_option(array(\\'Test\\', \\'Production\\'), ', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (Test Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a test account. This is only used when in testing mode.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (USD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have USD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID (CAD Account)', 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD', '', 'Your Paymentech assigned Merchant ID (6 or 12 digit). Leave blank if you do not have a CAD account.', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Bin Number', 'MODULE_PAYMENT_PAYMENTECH_BIN', '000002', 'Bin Number assigned by Paymentech.', '6', '0', now())\"); \n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Terminal ID', 'MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID', '001', 'Most are 001. Only change if instructed by Paymentech', '6', '0', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Authorization Type', 'MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE', 'Authorize/Capture', 'Do you want submitted credit card transactions to be authorized only, or authorized and captured?', '6', '0', 'cfg_select_option(array(\\'Authorize\\', \\'Authorize/Capture\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Request CVV Number', 'MODULE_PAYMENT_PAYMENTECH_USE_CVV', 'True', 'Do you want to ask the customer for the card\\'s CVV number', '6', '0', 'cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYMENTECH_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())\");\n\t$db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Currencies Accepted', 'MODULE_PAYMENT_PAYMENTECH_CURRENCIES', 'USD only', 'Accept Canadian dollars, US dollars, or both? If you have a Merchant ID set up for both then the currency will matched appropriately.', '6', '0', 'cfg_select_option(array(\\'CAD only\\', \\'USD only\\', \\'CAD and USD\\'), ', now())\");\n }", "public function index() {\r\n\t\t$this->load->model('extension/coinremitter/payment/coinremitter');\r\n\t\t$add_column_if_not_exists = $this->model_extension_coinremitter_payment_coinremitter->checkIsValidColumn();\r\n\t\t$data['wallets'] = $this->model_extension_coinremitter_payment_coinremitter->getAllWallets();\r\n\t\t// echo '<pre>';\r\n\t\t// print_r($data['wallets']);\r\n\t\t$this->load->model('checkout/order');\r\n\t\t$orderId = $this->session->data['order_id'];\r\n\t\t// $this->session->data['agree'] = true;\r\n\t\t$order_cart = $this->model_checkout_order->getOrder($orderId);\r\n\t\t$currency_code = $this->config->get('config_currency');\r\n\t\t$cart_total = $order_cart['total'];\r\n\t\t$validate_coin['wallets'] = array();\r\n\r\n\t\tforeach ($data['wallets'] as $key => $value) {\r\n\t\t\r\n\t\t\t$get_fiat_rate_data = [\r\n\t\t\t\t'url' => 'get-fiat-to-crypto-rate',\r\n\t\t\t\t'coin' => $value['coin'],\r\n\t\t\t\t'api_key' =>$value['api_key'],\r\n\t\t\t\t'password' => $value['password'],\r\n\t\t\t\t'fiat_symbol' => $currency_code,\r\n\t\t\t\t'fiat_amount' => $cart_total * $value['exchange_rate_multiplier']\r\n\t\t\t];\r\n\r\n\t\t\t$fiat_to_crypto_response = $this->obj_curl->commonApiCall($get_fiat_rate_data);\r\n\t\t\t// print_r($fiat_to_crypto_response);\r\n\t\t\tif(!empty($fiat_to_crypto_response) && isset($fiat_to_crypto_response['flag']) && $fiat_to_crypto_response['flag'] == 1){\r\n\t\t\t\tif($fiat_to_crypto_response['data']['crypto_amount'] >= $value['minimum_value']){\r\n\t\t\t\t\tarray_push($validate_coin['wallets'],$value);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this->load->view('extension/coinremitter/payment/coinremitter',$validate_coin);\r\n\t}", "public function handle()\n {\n $currencyRequestsClass = new CurrencyRequestsClass();\n $rates = $currencyRequestsClass->getCurrencyRatesList('EURUSD,BTCUSD,RUBCHF,USDRUB');\n $rates['USDCHF'] = $rates['RUBCHF'] * $rates['USDRUB'];\n\n foreach ($rates as $currency_pair => $rate) {\n $c1_id = Currency::where('name', '=', substr($currency_pair, 0, 3))->first()->id;\n $c2_id = Currency::where('name', '=', substr($currency_pair, 3, 3))->first()->id;\n\n $currencyPairRecord = CurrencyPairs::where('c1_id', $c1_id)->where('c2_id', $c2_id)->first();\n if (empty($currencyPairRecord)) {\n $currencyPairModel = new CurrencyPairs();\n } else {\n $currencyPairModel = $currencyPairRecord;\n if (empty($currencyPairModel->history)) {\n $history_data[0] = [\n 'price' => Arr::get($currencyPairModel, 'price', null),\n 'updated_at' => Arr::get($currencyPairModel, 'updated_at', null)\n ];\n $currencyPairModel->history = $history_data;\n } else {\n $history_data = json_decode($currencyPairModel->history, true);\n $history_data[count($history_data)] = [\n 'price' => Arr::get($currencyPairModel, 'price', null),\n 'updated_at' => Arr::get($currencyPairModel, 'updated_at', null)\n ];\n $currencyPairModel->history = $history_data;\n }\n }\n $currencyPairModel->c1_id = $c1_id;\n $currencyPairModel->c2_id = $c2_id;\n $currencyPairModel->price = $rate;\n $currencyPairModel->save();\n }\n }", "public function implement_local_activation($sum,$symbol,$id_trader,$acc_number)\n\t{\n $this->db->trans_start();\n\t\t $this->db->query(\"UPDATE investroom_personal_accounts SET $symbol = $symbol-$sum WHERE id=$id_trader\");\n $this->db->trans_complete();\n\n\t $data['active'] = '1';\n\t return $this->db->where('login',$acc_number)\n\t ->update('pamm_accounts', $data);\n\n\t}", "public function actionStatus()\n {\n \n $merchant_pass = $GLOBALS['env']['fch_merch_pass']; //укажите Ваш пароль мерчанта\n\n $post_hash = $_POST['verificate_hash'];\n unset($_POST['verificate_hash']);\n \n $my_hash = \"\";\n foreach ($_POST AS $key_post=>$one_post) if ($my_hash==\"\") {$my_hash = $one_post;}\n else $my_hash = $my_hash.\"::\".$one_post;\n \n $my_hash = $my_hash.\"::\".$merchant_pass;\n $my_hash = hash ( \"sha256\", $my_hash);\n \n if ($my_hash==$post_hash){\n $date = date(\"Y-m-d\");\n $dtime = date(\"Y-m-d H:i:s\");\n $id = $_POST['user_id'];\n $sum = $_POST['amount'];\n $cur = 'usd';\n if(Journal::checkBatch($id, $post_hash)){\n Log::add($id.' '.$_POST['payed_paysys'].\" fchange batch error \".$sum);\n exit('fchange batch error');\n }\n\n $wallet_types=['balance', 'gridPay'];\n $wallet_type = (isset($_POST['wallet_type'])&&\n in_array($_POST['wallet_type'],$wallet_types))? $_POST['wallet_type']:'balance' ;\n \n User::addVal($id,$sum,$wallet_type);\n if($wallet_type == 'gridPay'){\n Journal::addFromArray(['type'=>'gridpay_add_fchange',\n 'user'=>$id,\n 'sum'=>$sum,\n 'date'=>$dtime,\n 'cur'=>$cur,\n //'rate'=>$stage['price'],\n 'name'=>'GridPay addition',\n 'detail'=>$post_hash,\n 'adr'=>'fchange',\n ]);\n }else{\n Journal::add('add',$id,$sum,$dtime,\"Addition\",0,\"complete\",1, $cur,$post_hash, 'fchange'); \n } \n //Log::add($id.' '. $dtime.' '.$cur.\" fchange payment is complete\".' '.$sum);\n echo \"*ok*\";\n }else{\n Log::add($id.' '.$_POST['payed_paysys'].\" fchange hash error \".$sum);\n exit('fchange hash error');\n }\n exit;\n }", "function calculatePriceForRabatt(){\r\n// @ToDo remove static Values \r\n\r\n\t $basketIns = array_merge($this->basket->get_articles_by_article_type_uid_asuidlist(1)); //,$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponNormalType']),$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponRelatedType'])); // 4 and 5\r\n\t $value = array('net'=>0,'gross'=>0);\r\n\t \r\n\t foreach ($basketIns as $itemObjId) {\r\n\t\t$temp = $this->basket->basket_items[$itemObjId];\r\n\t\t$temp->recalculate_item_sums();\r\n\t\t\r\n\t\t$value['net'] += $temp->get_item_sum_net();\r\n\t\t$value['gross'] += $temp->get_item_sum_gross();\r\n\t }\r\n\r\n\t if($value['net']< 0){\r\n\t\t$value['net'] = 0;\r\n\t }\r\n\r\n\t if($value['gross'] < 0){\r\n\t\t$value['gross'] = 0;\r\n\t }\r\n\t return $value;\r\n\t}", "public function pay_wallet(){\n\t\t\n\t\t\t\n\t\t$data['wal_debit'] \t= $this->ledger_model->total_wallet_debit();\n\t\t$data['wal_credit'] \t= $this->ledger_model->total_wallet_credit();\n\t\t\n\t\t//Get Decision who in online?\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\n\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['users'] = $this->db->order_by('id', 'desc')->get_where('users', ['active' => '1']);\n\t\t}\n\t\telseif ($user['role'] == 'user')\n\t\t{\n\t\t\t$data['users'] = $this->db->order_by('id', 'desc')->get_where('users', ['role' => 'user']);\n\t\t}\n\t\t\n\t\telseif ($user['role'] == 'agent')\n\t\t{\n\t\t\t$data['users'] = $this->db->where('created_by', $userID)->order_by('id', 'desc')->get_where('users', ['role' => 'agent']);\n\t\t}\n\t\t\n\t\t$data['client'] = $this->db->order_by('id', 'desc')->get_where('users', ['active' => '1']);\n\t\t\n\t\t\n\t\t\t$data['category'] = $this->db->where('parentid', '0')->order_by('id', 'asc')->get_where('acct_categories', ['visible' => '0']);\n\t\n\t\t\t$data['main_account'] = $this->db->get_where('acct_categories', ['category_type' => 'main']);\n\t\t\t\n\t\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['sub_account'] = $this->db->get_where('acct_categories', ['category_type' => 'sub']);\n\t\t}\n\t\telseif ($user['role'] == 'agent')\n\t\t{\n\t\t\t$data['sub_account'] = $this->db->get_where('acct_categories', ['category_type' => 'sub']);\n\t\t}\n\t\t\n\t\telseif ($user['role'] == 'user')\n\t\t{\n\t\t\t$data['sub_account'] = $this->db->get_where('acct_categories', ['visible' => '2']); \n\t\t}\n\t\t\t\t\t//Wallet********Points///\t\t\n\n\n\t\tif($this->input->post()) {\n\t\t\tif ($this->input->post('submit') != 'pay_wallet') die('Error! sorry');\n\t\t\t\n\t\t\t$this->form_validation->set_rules('price', 'Cost', 'required|trim'); \t\n\t\t\t\n\n\t\t\t$sellProduct = $this->product_model->pay_wallet();\n\t\t\tif($sellProduct){\n\t\t\t\tredirect(base_url('product/invoice/'.$sellProduct));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsetFlashGoBack('errorMsg', 'Something went wrong! please try again later.');\n\t\t\t}\n\n\t\t\t//print_r($this->input->post());\n\t\t}\n\n\t\t\ttheme('pay_wallet', $data);\n\t}", "function checkPairing($user_id, $user_name, $pkg_id, $trans_datetime, $trans_date, $auto_flush)\n{\n\t//$max_daily_point = 100;\n \t$sql = \"SELECT max_daily_point\n FROM product_package\n WHERE pkg_id = $pkg_id\n\t\t limit 1\n \";\n \t$resultPkg=dbQuery($sql);\n\t$row=dbFetchAssoc($resultPkg);\t\n\t$max_daily_point = $row['max_daily_point'];\n\t\n\t$checkPoint = checkPoint($user_id);\n\t$balance_left_point = $checkPoint['balance_left_point'];\n\t$balance_right_point = $checkPoint['balance_right_point'];\n\t\n\tif($balance_left_point > 0 and $balance_right_point > 0)\n\t{\n\t\n\t\tif($balance_left_point > $balance_right_point)\n\t\t{\n\t\t\t$pair_point = $balance_right_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pair_point = $balance_left_point;\n\t\t}\n\t\t\n\t\t$actual_pair_point = $pair_point;\n\t\n\t\t$total_daily_pair_point = checkDailyPairPoint($user_id, $trans_date);\n\t\t$balance_max_daily_point = $max_daily_point - $total_daily_pair_point;\n\t\t\n\t\tif($balance_max_daily_point >= $pair_point)\n\t\t{\n\t\t\t$total_pair_point = $pair_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$total_pair_point = $balance_max_daily_point;\n\t\t}\n\t\t\n\t\tif($total_pair_point > 0 and $max_daily_point > $total_daily_pair_point and $auto_flush ==0)\n\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t$total_bonus = $total_pair_point * 15;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date,pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tcreated_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$total_pair_point', '$total_bonus', \n\t\t\t\t\t\t$_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$bonus_description = 'Pairing Bonus';\n\t\t\t\t$pair_bonus = $total_bonus;\n\t\t\t\t\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, $pair_bonus, 0, $user_name, $trans_datetime);\n\t\t\t\t\n\t\t\t\t$bonus_description = '10% into M-Wallet';\n\t\t\t\t$pair_bonus_deduct = 0.1 * $total_bonus;\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, 0, $pair_bonus_deduct, $user_name, $trans_datetime);\n\t\t\t\twallet('acct_mwallet', 4, $user_id, $bonus_description, $pair_bonus_deduct, 0, $user_name, $trans_datetime);\t\t\n\t\t\n\t\t}\n\t\telse // Flush\n\t\t{\n\t\t\t\t$total_bonus = 0;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date, pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tflush_sw, created_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$actual_pair_point', '$total_bonus', \n\t\t\t\t\t\t1, $_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t}\t\t\n\t}\n\t\n\n\t\n\n}", "function checkBuyBids()\n{\n $mysql_server = '192.168.1.101'; //reference global mysql_server\n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n //Retrieve all Values from BestBidOffer\n $indexQry = \"SELECT * FROM BuyBestBidOffer\";\n $indexResult = $mysqli->query($indexQry);\n \n //Create Info Stacks to store Information\n $stackUsername = array();\n $stackSymbol = array();\n $stackQty = array();\n $stackAsk = array();\n $stackIndexNo = array();\n $stackBidType = array();\n \n //Copy the info into arrays in exact same order\n if($indexResult->num_rows > 0)\n { //if there is something in the DB then...\n while ($row = $indexResult->fetch_assoc())\n {\n array_push($stackUsername, $row['username']);\n array_push($stackSymbol, $row['stockSymbol']);\n array_push($stackQty, $row['qty']);\n array_push($stackIndexNo, $row['indexNo']);\n array_push($stackAsk, $row['askPrice']);\n }\n }\n //Get the size of Arrays\n $arraySize = count($stackUsername);\n \n //Get the List of Unique tickers in BuyBids DB\n $BuyBidsTickers = getBuyBidStockTickers();\n \n //Array that contains Current Price for Stocks\n $currentPriceStack = array();\n \n //get information about DISTINCT tickers only\n foreach($BuyBidsTickers[\"Stocks\"] as $symbol)\n {\n \n $tempVar = getInfo($symbol);\n $tempObj = json_decode($tempVar);\n array_push($currentPriceStack, $tempObj->Close[0]); //get the current prices for Tickers\n }\n \n //var_dump($currentPriceStack);\n \n //Loop and compare each Ticker asking price with Current Prices. Ignore Username at this Level.\n foreach($stackSymbol as $key => $symbol)\n {\n //for each Ticker excluding duplicates in your buy bids DB\n foreach($BuyBidsTickers[\"Stocks\"] as $compareKey => $compareSymbol)\n {\n //if ticker in records matches a ticker in currentPrice data list\n if ($symbol == $compareSymbol)\n {\n if($stackAsk[$key] <= $currentPriceStack[$compareKey])\n {\n //Find the user linked to this current items.\n //var_dump($stackUsername[$key]);\n //Create Data Object and Run Buy function\n $tempArray = array(\"Username\" => $stackUsername[$key],\n \"Symbol\" => $stackSymbol[$key],\n \"Quantity\" => $stackQty[$key]);\n buyStock($tempArray);\n //delete the IndexNo of this record in BuyBestBidOffer Table\n deleteFromBuyBids($stackIndexNo[$key]);\n }\n }\n }\n }\n \n}", "public function update_combinations()\n\t{\n\t\t$data = array();\n\t\t$this->language->load('catalog/stock');\n\t\t$this->load->model('catalog/stock');\n\n\t\t$product_id = $this->request->post['product_id'];\n\n\t\t// check if user has permission to access this page\n\t\tif (!$this->user->hasPermission('modify', 'catalog/stock')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\n\t\t// check that the quantity values are valid numbers\n\t\tif (!$this->error && isset($this->request->post['product_combinations'])) {\n\t\t\t$combinations = $this->request->post['product_combinations'];\n\n\t\t\t$row = 0;\n\t\t\tforeach ($combinations as $combination) {\n\t\t\t\t$quantity = $combination['quantity'];\n\t\t\t\tif (!is_numeric($quantity)) {\n\t\t\t\t\t$this->error['quantity'][$row] = true;\n\t\t\t\t} else if ($quantity < 0) {\n\t\t\t\t\t$this->error['quantity'][$row] = true;\n\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t}\n\t\t\tif (isset($this->error['quantity'])) {\n\t\t\t\t$this->error['warning'] = $this->language->get('sm_error_quantity');\n\t\t\t}\n\t\t}\n\t\tif (!$this->error && !$this->model_catalog_stock->isProductStockEnabled($product_id)) {\n\t\t\t$this->error['warning'] = $this->language->get('sm_error_stale_data');\n\t\t}\n\n\t\tif (isset($this->error['warning'])) {\n\t\t\t$data['error'] = $this->error['warning'];\n\t\t\tif (isset($this->error['quantity'])) {\n\t\t\t\t$data['error_quantity'] = array();\n\t\t\t\tforeach ($this->error['quantity'] as $key => $value) {\n\t\t\t\t\t$data['error_quantity'][] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (isset($this->request->post['product_combinations']) && isset($this->request->post['product_id']) && count($this->request->post['product_combinations']) > 0) {\n\t\t\t\t$combinations = $this->request->post['product_combinations'];\n\t\t\t\t$total_quantity = $this->model_catalog_stock->editStockCombinations($product_id, $combinations);\n\n\t\t\t\tif ($total_quantity == -1) {\n\t\t\t\t\t$data['error'] = $this->language->get('sm_error_stale_data');\n\t\t\t\t} else {\n\t\t\t\t\t$data['product_quantity'] = $total_quantity;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($data));\n\t}", "function install() {\r\n global $db;\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Nochex Module', 'MODULE_PAYMENT_NOCHEX_STATUS', 'True', 'Do you want to accept Nochex payments?', '6', '44', 'zen_cfg_select_option(array(\\'True\\', \\'False\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Nochex Email Address', 'MODULE_PAYMENT_NOCHEX_EMAIL_ADDRESS','\".STORE_OWNER_EMAIL_ADDRESS.\"', 'Registered email address for your Nochex account.<br />NOTE: This must match <strong>EXACTLY </strong>the registered email address on your Nochex account.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Nochex Account Type', 'MODULE_PAYMENT_NOCHEX_ACCOUNT_TYPE', 'Seller', 'Please select the type of Nochex account you are accepting payments with.', '6', '44', 'zen_cfg_select_option(array(\\'Seller\\',\\'Merchant\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Merchant ID', 'MODULE_PAYMENT_NOCHEX_MERCHANT_ID', '', 'For Nochex Merchant account holders, allows you to accept payments using a different merchant ID. Has no effect on Seller accounts.', '6', '44', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_NOCHEX_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '44', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Pending Notification Status', 'MODULE_PAYMENT_NOCHEX_PROCESSING_STATUS_ID', '\" . DEFAULT_ORDERS_STATUS_ID . \"', 'Set the status of orders made with this payment module that are not yet completed to this value<br />(\\'Pending\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_NOCHEX_ORDER_STATUS_ID', '2', 'Set the status of orders made with this payment module that have completed payment to this value<br />(\\'Processing\\' recommended)', '6', '44', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_NOCHEX_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '44', now())\");\r\n\r\n // Nochex testing options go here\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Debug Mode', 'MODULE_PAYMENT_NOCHEX_APC_DEBUG', 'Off', 'Enable debug logging? <br />NOTE: This can REALLY clutter your email inbox!<br />Logging goes to the /includes/modules/payment/nochex_apc/logs folder<br />Email goes to the store-owner address.<strong>Leave OFF for normal operation.</strong>', '6', '44', 'zen_cfg_select_option(array(\\'Off\\',\\'Log File\\',\\'Log and Email\\'), ', now())\");\r\n $db->Execute(\"insert into \" . TABLE_CONFIGURATION . \" (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Status Live/Testing', 'MODULE_PAYMENT_NOCHEX_TESTING', 'Live', 'Set Nochex module to Live or Test. In Test mode no money is transferred.', '6', '44', 'zen_cfg_select_option(array(\\'Live\\', \\'Test\\'), ', now())\");\r\n\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_INSTALLED');\r\n }", "protected function updateCash()\n\t{\n\t\tforeach($this->amount as $line => $amount)\n\t\t{\n\t\t\tif(isset($this->maxFare[$line]) && $this->maxFare[$line])\n\t\t\t{\n\t\t\t\t$mcoCash = new Application_Model_DbTable_McoCash();\n\t\t\t\t$mcoCashNew = $mcoCash->createRow();\n\t\t\t\t$mcoCashNew->mco_id = $this->mcoId;\n\t\t\t\t$mcoCashNew->line = $line;\n\t\t\t\t$mcoCashNew->type = 'DNH';\n\t\t\t\t$mcoCashNew->amount = ($amount - $this->amountCash[$line]);\n\t\t\t\t$mcoCashNew->value = $this->maxFare[$line];\n\t\t\t\t$mcoCashNew->diff = 0;\n\t\t\t\t$mcoCashNew->save();\n\t\t\t}\n\t\t}\t\n\t}", "public function aysnc_get_transactions()\n\t{\n\t\t// some code here\n\t\t$this->load->model('accounts_model');\n\t\t$this->load->model('account_bal_model');\n\t\t$this->load->model('transactions_model');\n\t\t$client_no \t= \t$this->session->userdata('client_no');\n\t\t$start_date = \t$this->input->get('start_date');\n\t\t$end_date = \t$this->input->get('end_date');\n\t\t$ccy = \t\t\t$this->input->get('ccy');\n\t\t$acct_no = \t\t$this->input->get('acct_no');\n\t\t$account = \t\t$this->accounts_model->get_account($client_no,$acct_no);\n\t\t\n\t\tif ( count($account) < 1 ){\n\n\t\t\t//account not found\n\t\t\treturn show_error('Account not found',500);\n\t\t}\n\n\t\t$internal_key = $account[0]->INTERNAL_KEY;\n\t\t$data['transactions'] = $this->transactions_model->get_trans_history($start_date,$end_date,$internal_key);\n\n\t\t $start_balance = $this->account_bal_model->get_start_balance($internal_key,$start_date);\n\t\t// return print $this->transactions_model->get_back_date_amt($internal_key,$start_date);\n\t\t// $end_balance = $this->transactions_model\n\t\t// \t\t\t\t\t->get_end_balance($internal_key,$start_date,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$end_date,$start_balance);\n\t\t\n\t\t$end_balance = $this->account_bal_model->get_end_balance($internal_key,$end_date);\n\t\tif ( count( $account) < 1){\n\n\t\t\treturn new Exception('Account not found');\n\t\t}\n\n\t\t// return $this->output\n\t\t// \t->set_content_type('application/json')\n\t\t// \t->set_output(json_encode($data));\n\t\t\n\t\t$branch_name = $this->get_branch_name($account[0]->BRANCH);\n\t\t$ccy_desc = $this->get_ccy_desc($account[0]->CCY);\n\n\t\t// statement header params\n\t\t$data = array(\n\n\t\t\t\t\t'INTERNAL_KEY'\t\t\t=> $internal_key,\n\t\t\t\t\t'CONTACT_TYPE'\t\t\t=> NULL,\n\t\t\t\t\t'ACCT_NO'\t\t\t\t=> $acct_no,\n\t\t\t\t\t'ACCT_DESC'\t\t\t\t=> $account[0]->ACCT_DESC,\n\t\t\t\t\t'CCY'\t\t\t\t\t=> $account[0]->CCY,\n\t\t\t\t\t'CCY_DESC'\t\t\t\t=> $ccy_desc,\n\t\t\t\t\t'BRANCH'\t\t\t\t=> $account[0]->BRANCH,\n\t\t\t\t\t'BRANCH_NAME'\t\t\t=> $branch_name,\n\t\t\t\t\t'NAME'\t\t\t\t\t=> $account[0]->CLIENT_SHORT,\n\t\t\t\t\t'ADDR1'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'ADDR2'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'ADDR3'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'ADDR4'\t\t\t\t\t=> NULL,\n\t\t\t\t\t'POSTAL_CODE'\t\t\t=> NULL,\n\t\t\t\t\t'START_BALANCE'\t\t\t=> $start_balance,\n\t\t\t\t\t'END_BALANCE'\t\t\t=> $end_balance,\n\t\t\t\t\t'START_DATE'\t\t\t=> $start_date,\n\t\t\t\t\t'END_DATE'\t\t\t\t=> $end_date,\n\t\t\t\t\t'PRINT_PRIORITY'\t\t=> 'N',\n\t\t\t\t\t'STMT_HANDLING'\t\t\t=> 'CO',\n\t\t\t\t\t'OFFICER_ID'\t\t\t=> $this->session->userdata('usrname'),\n\t\t\t\t\t'SID'\t\t\t\t\t=> NULL\n\t\t\t);\n\t\t$seq_no = $this->insert_to_stmt_header($data);\n\n\t\tif ( isset($seq_no) ){\n\n\t\t\t$params = array(\n\n\t\t\t\t\t\t'seq_no' => $seq_no,'response' => 200, \n\t\t\t\t\t\t'msg' => 'eStatement has been prepared successfully.');\n\t\t}else{\n\n\t\t\t$params = array(\n\t\t\t\t\t\t'response' => 500, 'msg' => 'An error occured.Please try again.');\n\n\t\t}\n\n\t\treturn $this->toJson($params);\n\n\n\n\t}", "public function debitOrder(Varien_Event_Observer $observer)\n{ \n\n try {\n $arr = array(); \n$id = Mage::getModel(\"sales/order\")->getCollection()->getLastItem()->getIncrementId();\n\n$order = Mage::getModel('sales/order')->loadByIncrementId($id);\n$_grand = $order->getGrandTotal();\n$custname = $order->getCustomerName();\n//echo \"<br> cumstomer id :\".$order->getCustomerId();\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n$amt =Mage::getSingleton('checkout/session')->getDiscount();\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n$balance = Mage::getSingleton('core/session')->getBalance();\n$arr['c_id'] = $order->getCustomerId();\n$arr['action_credits'] = - $amt;\n$arr['total_credits'] = $balance;\n$arr['store_view'] = Mage::app()->getStore()->getName();\n$arr['state'] = 1;\n$arr['order_id'] = $id;\n$arr['action'] = \"Used\";\n$arr['custom_msg'] = \"By User:Using For Order \" . $arr['order_id'];\n$arr['customer_notification_status'] = 'Notified';\n$arr['action_date'] = $nowdate;\n$arr['website1'] = \"Main Website\";\n \n if($amt > 0) {\n $credits = Mage::getModel('kartparadigm_storecredit/creditinfo');\n\n $model = Mage::getModel('kartparadigm_storecredit/creditinfo')->setData($arr);\n\ntry{\n\n $model->save();\n}\ncatch(Exception $e)\n {\n\n echo $e->getMessage();\n }\n\n $successMessage = Mage::helper('kartparadigm_storecredit')->__('Credits Inserted Successfully');\n Mage::getSingleton('core/session')->addSuccess($successMessage);\n\n \n \n }else{\n //throw new Exception(\"Insufficient Data provided\");\n }\n\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('core/session')->addError($e->getMessage());\n $this->_redirectUrl($this->_getRefererUrl());\n } \n\nMage::getSingleton('checkout/session')->unsCredits();\n Mage::getSingleton('core/session')->unsBalance();\n Mage::getSingleton('core/session')->unsCredits();\nMage::getSingleton('adminhtml/session')->unsValue();\nMage::getSingleton('checkout/session')->unsDiscount();\n \n}", "static public function ctrHistorial(){\n\n\t\t// FACTURAS\n\t\t$tabla = \"cta\";\n\t\t$respuesta = ModeloVentas::mdlHistorial($tabla);\n\t\t\n\n\t\tforeach ($respuesta as $key => $value) {\n\n\t\t\t// veo los items de la factura\n\t\t\t$tabla = \"ctaart\";\n\t\t\t$repuestos = ModeloVentas::mdlHistorialCta_art($tabla,$value['idcta']);\n\t\t\t\n\t\t\t$productos='';\n\n\t\t\tfor($i = 0; $i < count($repuestos)-1; $i++){\n\t\t\t\t\n\t\t\t\t$productos = '{\"id\":\"'.$repuestos[$i][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[$i][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[$i][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[$i][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[$i][\"precio\"].'\"},';\n\t\t\t}\n\n\t\t\t$productos = $productos . '{\"id\":\"'.$repuestos[count($repuestos)-1][\"idarticulo\"].'\",\n\t\t\t \"descripcion\":\"'.$repuestos[count($repuestos)-1][\"nombre\"].'\",\n\t\t\t \"cantidad\":\"'.$repuestos[count($repuestos)-1][\"cantidad\"].'\",\n\t\t\t \"precio\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\",\n\t\t\t \"total\":\"'.$repuestos[count($repuestos)-1][\"precio\"].'\"}';\n\n\t\t\t$productos =\"[\".$productos.\"]\";\n\t\t\t\n\t\t\techo '<pre>'; print_r($productos); echo '</pre>';\n\t\t\t\n\t\t\t// datos para cargar la factura\n\t\t\t$tabla = \"ventas\";\n\t\t\t$datos = array(\"id_vendedor\"=>1,\n\t\t\t\t\t\t \"fecha\"=>$value['fecha'],\n\t\t\t\t\t\t \"id_cliente\"=>$value[\"idcliente\"],\n\t\t\t\t\t\t \"codigo\"=>$key,\n\t\t\t\t\t\t \"nrofc\"=>$value[\"nrofc\"],\n\t\t\t\t\t\t \"detalle\"=>strtoupper($value[\"obs\"]),\n\t\t\t\t\t\t \"productos\"=>$productos,\n\t\t\t\t\t\t \"impuesto\"=>0,\n\t\t\t\t\t\t \"neto\"=>0,\n\t\t\t\t\t\t \"total\"=>$value[\"importe\"],\n\t\t\t\t\t\t \"adeuda\"=>$value[\"adeuda\"],\n\t\t\t\t\t\t \"obs\"=>\"\",\n\t\t\t\t\t\t \"metodo_pago\"=>$value[\"detallepago\"],\n\t\t\t\t\t\t \"fechapago\"=>$value['fecha']);\n\n\t\t\t$respuesta = ModeloVentas::mdlIngresarVenta($tabla, $datos);\n\t\t\t\n\n\t\t}\n\t\t\n\t\treturn $respuesta;\n\n\t\t\n\t\t\n\t}", "private function ml_load_prev()\n\t{\n\t\tif ($this->prod_nums)\n\t\t{\n\t\t\t$prods = array();\n\t\t\tfor ($new_prod_num = 0, $prod_count = count($this->prod_nums); $new_prod_num < $prod_count; ++$new_prod_num)\n\t\t\t{\n\t\t\t\t$old_prod_num = $this->prod_nums[$new_prod_num];\n\t\t\t\t$account = product::create_from_post($old_prod_num);\n\t\t\t\t$prods[] = $account;\n\t\t\t}\n\t\t\tcgi::add_js_var('prods', $prods);\n\t\t}\n\t}", "function sync_market_data($service) {\n\n\tmysqli_query($GLOBALS['connect'],\"START TRANSACTION\");\n\n\techo \"sync market data.. \\r\\n\";\n\n\t //remove all data\n\t$sql = \"DELETE FROM market_data\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\n\tif (!$result) {\n\t\tadd_logs(\"error clear old market data. sql: $sql\");\n\t\tmysqli_query($GLOBALS['connect'],\"ROLLBACK\");\n\t\treturn false;\n\t}\n\n\t//get g sheet data and push to database\n\n\t$range = 'Market!A2:J9999';\n\t$spreadsheetId = $GLOBALS['sheets']['general'];\n\n\t$response = $service->spreadsheets_values->get($spreadsheetId, $range);\n\t$values = $response->getValues();\n\n\tif (empty($values)) {\n\t\tadd_logs(\"google sheet not contain data\");\n\t\tmysqli_query($GLOBALS['connect'],\"ROLLBACK\");\n\t\treturn false;\n\t}\n\telse {\n\t\tforeach ($values as $row) {\n\t\t\t//push data to db\n\n\t\t\t$data = [\n\t\t\t\t'address' => $row[2],\n\t\t\t\t'objecttype' => trim($row[3]),\n\t\t\t\t'price' => only_digit($row[4]),\n\t\t\t\t'square_meter_price' => only_digit($row[6]),\n\t\t\t\t'house' => get_address_data($row[2])['house'],\n\t\t\t\t'street' => get_address_data($row[2])['street']\n\t\t\t];\n\n\t\t\t$sql = \"INSERT INTO market_data \n ( \n id, \n address, \n objecttype, \n price, \n square_meter_price, \n house, \n street \n ) \n VALUES \n ( \n NULL, \n '{$data['address']}', \n '{$data['objecttype']}', \n {$data['price']}, \n {$data['square_meter_price']}, \n '{$data['house']}', \n '{$data['street']}' \n ) \n \";\n\n\t\t\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\n\t\t\tif (!$result) {\n\t\t\t\tadd_logs(\"error push market data to google sheet. row:\" . json_encode($row) . \". sql: $sql\");\n\t\t\t\tmysqli_query($GLOBALS['connect'],\"ROLLBACK\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t}\n\t}\n\n\tmysqli_query($GLOBALS['connect'],\"COMMIT\");\n\treturn true;\n}", "function task_verify_probed_wallets() {\n\n require 'Tasks/verify_probed_wallets/verify_probed_wallets.php';\n\n }", "public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}", "function updateRawcoins()\n{\n // debuglog(__FUNCTION__);\n\n exchange_set_default('alcurex', 'disabled', true);\n exchange_set_default('binance', 'disabled', true);\n exchange_set_default('empoex', 'disabled', true);\n exchange_set_default('coinbene', 'disabled', true);\n exchange_set_default('coinexchange', 'disabled', true);\n exchange_set_default('coinsmarkets', 'disabled', true);\n exchange_set_default('escodex', 'disabled', true);\n exchange_set_default('gateio', 'disabled', true);\n exchange_set_default('jubi', 'disabled', true);\n exchange_set_default('nova', 'disabled', true);\n exchange_set_default('stocksexchange', 'disabled', true);\n exchange_set_default('tradesatoshi', 'disabled', true);\n\n settings_prefetch_all();\n\n if (!exchange_get('bittrex', 'disabled')) {\n $list = bittrex_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bittrex'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bittrex', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bittrex', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('bitz', 'disabled')) {\n $list = bitz_api_query('tickerall');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bitz'\");\n foreach ($list as $c => $ticker) {\n $e = explode('_', $c);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('bitz', $symbol);\n }\n }\n }\n\n if (!exchange_get('bleutrade', 'disabled')) {\n $list = bleutrade_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bleutrade'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bleutrade', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bleutrade', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('coinbene', 'disabled')) {\n $data = coinbene_api_query('market/symbol');\n $list = objSafeVal($data, 'symbol');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinbene'\");\n foreach ($list as $ticker) {\n if ($ticker->quoteAsset != 'BTC')\n continue;\n $symbol = $ticker->baseAsset;\n updateRawCoin('coinbene', $symbol);\n }\n }\n }\n\n if (!exchange_get('crex24', 'disabled')) {\n $list = crex24_api_query('currencies');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='crex24'\");\n foreach ($list as $currency) {\n $symbol = objSafeVal($currency, 'symbol');\n $name = objSafeVal($currency, 'name');\n if ($currency->isFiat || $currency->isDelisted)\n continue;\n updateRawCoin('crex24', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('poloniex', 'disabled')) {\n $poloniex = new poloniex;\n $tickers = $poloniex->get_currencies();\n if (!$tickers)\n $tickers = array();\n else\n dborun(\"UPDATE markets SET deleted=true WHERE name='poloniex'\");\n foreach ($tickers as $symbol => $ticker) {\n if (arraySafeVal($ticker, 'disabled'))\n continue;\n if (arraySafeVal($ticker, 'delisted'))\n continue;\n updateRawCoin('poloniex', $symbol);\n }\n }\n\n if (!exchange_get('c-cex', 'disabled')) {\n $ccex = new CcexAPI;\n $list = $ccex->getPairs();\n if ($list) {\n sleep(1);\n $names = $ccex->getCoinNames();\n\n dborun(\"UPDATE markets SET deleted=true WHERE name='c-cex'\");\n foreach ($list as $item) {\n $e = explode('-', $item);\n $symbol = strtoupper($e[0]);\n\n updateRawCoin('c-cex', $symbol, arraySafeVal($names, $e[0], 'unknown'));\n }\n }\n }\n\n if (!exchange_get('yobit', 'disabled')) {\n $res = yobit_api_query('info');\n if ($res) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='yobit'\");\n foreach ($res->pairs as $i => $item) {\n $e = explode('_', $i);\n $symbol = strtoupper($e[0]);\n updateRawCoin('yobit', $symbol);\n }\n }\n }\n\n if (!exchange_get('coinexchange', 'disabled')) {\n $list = coinexchange_api_query('getmarkets');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinexchange'\");\n foreach ($list->result as $item) {\n if ($item->BaseCurrencyCode != 'BTC')\n continue;\n $symbol = $item->MarketAssetCode;\n $label = objSafeVal($item, 'MarketAssetName');\n updateRawCoin('coinexchange', $symbol, $label);\n }\n }\n }\n\n if (!exchange_get('coinsmarkets', 'disabled')) {\n $list = coinsmarkets_api_query('apicoin');\n if (!empty($list) && is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinsmarkets'\");\n foreach ($list as $pair => $data) {\n $e = explode('_', $pair);\n if ($e[0] != 'BTC')\n continue;\n $symbol = strtoupper($e[1]);\n updateRawCoin('coinsmarkets', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptopia', 'disabled')) {\n $list = cryptopia_api_query('GetMarkets');\n if (isset($list->Data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptopia'\");\n foreach ($list->Data as $item) {\n $e = explode('/', $item->Label);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptopia', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptobridge', 'disabled')) {\n $list = cryptobridge_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptobridge'\");\n foreach ($list as $ticker) {\n $e = explode('_', $ticker->id);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptobridge', $symbol);\n }\n }\n }\n\n if (!exchange_get('escodex', 'disabled')) {\n $list = escodex_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='escodex'\");\n foreach ($list as $ticker) {\n #debuglog (json_encode($ticker));\n if (strtoupper($ticker->base) !== 'BTC')\n continue;\n $symbol = strtoupper($ticker->quote);\n updateRawCoin('escodex', $symbol);\n }\n }\n }\n\n if (!exchange_get('hitbtc', 'disabled')) {\n $list = hitbtc_api_query('symbols');\n if (is_object($list) && isset($list->symbols) && is_array($list->symbols)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='hitbtc'\");\n foreach ($list->symbols as $data) {\n $base = strtoupper($data->currency);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($data->commodity);\n updateRawCoin('hitbtc', $symbol);\n }\n }\n }\n\n if (!exchange_get('kraken', 'disabled')) {\n $list = kraken_api_query('AssetPairs');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kraken'\");\n foreach ($list as $pair => $item) {\n $pairs = explode('-', $pair);\n $base = reset($pairs);\n $symbol = end($pairs);\n if ($symbol == 'BTC' || $base != 'BTC')\n continue;\n if (in_array($symbol, array(\n 'GBP',\n 'CAD',\n 'EUR',\n 'USD',\n 'JPY'\n )))\n continue;\n if (strpos($symbol, '.d') !== false)\n continue;\n $symbol = strtoupper($symbol);\n updateRawCoin('kraken', $symbol);\n }\n }\n }\n\n if (!exchange_get('alcurex', 'disabled')) {\n $list = alcurex_api_query('market', '?info=on');\n if (is_object($list) && isset($list->MARKETS)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='alcurex'\");\n foreach ($list->MARKETS as $item) {\n $e = explode('_', $item->Pair);\n $symbol = strtoupper($e[0]);\n updateRawCoin('alcurex', $symbol);\n }\n }\n }\n\n if (!exchange_get('binance', 'disabled')) {\n $list = binance_api_query('ticker/allBookTickers');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='binance'\");\n foreach ($list as $ticker) {\n $base = substr($ticker->symbol, -3, 3);\n // XXXBTC XXXETH BTCUSDT (no separator!)\n if ($base != 'BTC')\n continue;\n $symbol = substr($ticker->symbol, 0, strlen($ticker->symbol) - 3);\n updateRawCoin('binance', $symbol);\n }\n }\n }\n\n if (!exchange_get('gateio', 'disabled')) {\n $json = gateio_api_query('marketlist');\n $list = arraySafeVal($json, 'data');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='gateio'\");\n foreach ($list as $item) {\n if ($item['curr_b'] != 'BTC')\n continue;\n $symbol = trim(strtoupper($item['symbol']));\n $name = trim($item['name']);\n updateRawCoin('gateio', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('nova', 'disabled')) {\n $list = nova_api_query('markets');\n if (is_object($list) && !empty($list->markets)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='nova'\");\n foreach ($list->markets as $item) {\n if ($item->basecurrency != 'BTC')\n continue;\n $symbol = strtoupper($item->currency);\n updateRawCoin('nova', $symbol);\n //debuglog(\"nova: $symbol\");\n }\n }\n }\n\n if (!exchange_get('stocksexchange', 'disabled')) {\n $list = stocksexchange_api_query('markets');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='stocksexchange'\");\n foreach ($list as $item) {\n if ($item->partner != 'BTC')\n continue;\n if ($item->active == false)\n continue;\n $symbol = strtoupper($item->currency);\n $name = trim($item->currency_long);\n updateRawCoin('stocksexchange', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('empoex', 'disabled')) {\n $list = empoex_api_query('marketinfo');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='empoex'\");\n foreach ($list as $item) {\n $e = explode('-', $item->pairname);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('empoex', $symbol);\n }\n }\n }\n\n if (!exchange_get('kucoin', 'disabled')) {\n $list = kucoin_api_query('currencies');\n if (kucoin_result_valid($list) && !empty($list->data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kucoin'\");\n foreach ($list->data as $item) {\n $symbol = $item->name;\n $name = $item->fullName;\n updateRawCoin('kucoin', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('livecoin', 'disabled')) {\n $list = livecoin_api_query('exchange/ticker');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='livecoin'\");\n foreach ($list as $item) {\n $e = explode('/', $item->symbol);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('livecoin', $symbol);\n }\n }\n }\n\n if (!exchange_get('shapeshift', 'disabled')) {\n $list = shapeshift_api_query('getcoins');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='shapeshift'\");\n foreach ($list as $item) {\n $status = $item['status'];\n if ($status != 'available')\n continue;\n $symbol = strtoupper($item['symbol']);\n $name = trim($item['name']);\n updateRawCoin('shapeshift', $symbol, $name);\n //debuglog(\"shapeshift: $symbol $name\");\n }\n }\n }\n\n if (!exchange_get('tradesatoshi', 'disabled')) {\n $data = tradesatoshi_api_query('getcurrencies');\n if (is_object($data) && !empty($data->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='tradesatoshi'\");\n foreach ($data->result as $item) {\n $symbol = $item->currency;\n $name = trim($item->currencyLong);\n updateRawCoin('tradesatoshi', $symbol, $name);\n }\n }\n }\n\n //////////////////////////////////////////////////////////\n\n $markets = dbocolumn(\"SELECT DISTINCT name FROM markets\");\n foreach ($markets as $exchange) {\n if (exchange_get($exchange, 'disabled')) {\n $res = dborun(\"UPDATE markets SET disabled=8 WHERE name='$exchange'\");\n if (!$res)\n continue;\n $coins = getdbolist('db_coins', \"id IN (SELECT coinid FROM markets WHERE name='$exchange')\");\n foreach ($coins as $coin) {\n // allow to track a single market on a disabled exchange (dev test)\n if (market_get($exchange, $coin->getOfficialSymbol(), 'disabled', 1) == 0) {\n $res -= dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND coinid={$coin->id}\");\n }\n }\n debuglog(\"$exchange: $res markets disabled from db settings\");\n } else {\n $res = dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND disabled=8\");\n if ($res)\n debuglog(\"$exchange: $res markets re-enabled from db settings\");\n }\n }\n\n dborun(\"DELETE FROM markets WHERE deleted\");\n\n $list = getdbolist('db_coins', \"not enable and not installed and id not in (select distinct coinid from markets)\");\n foreach ($list as $coin) {\n if ($coin->visible)\n debuglog(\"{$coin->symbol} is no longer active\");\n // todo: proper cleanup in all tables (like \"yiimp coin SYM delete\")\n // if ($coin->symbol != 'BTC')\n // $coin->delete();\n }\n}", "private function _autoRefundRecharge() {\n $where = array('state' => 0, 'add_time' => array('lt', time() - 5 * 3600));\n $list = $this->db->table('rides_recharge')->where($where)->select();\n $this->load->library('sys_model/deposit');\n $this->load->library('sys_model/orders');\n //print_r($this->db->getLastSql());\n\t//print_r($list);exit;\n foreach ($list as $rides_recharge) {\n //申请退款表里有记录\n $cashInfo = $this->sys_model_deposit->getDepositCashInfo(array('pdr_sn' => $rides_recharge['recharge_sn']));\n if ($cashInfo) {\n //$this->_changeRidesRechargeStatus($rides_recharge['recharge_sn']);\n //continue;\n }\n //print_r($cashInfo);exit;\n $order_info = $this->sys_model_orders->getOrdersInfo(array('order_sn' => $rides_recharge['order_sn']));\n if (!$order_info) {\n //$this->_changeRidesRechargeStatus($rides_recharge['recharge_sn']);\n //continue;\n }\n //print_r($order_info);exit;\n if ($order_info['order_state'] != 2) { \n //$this->_changeRidesRechargeStatus($rides_recharge['recharge_sn']);\n // continue;\n }\n\n $recharge_info = $this->sys_model_deposit->getRechargeInfo(array('pdr_sn' => $rides_recharge['recharge_sn']));\n //print_r($recharge_info);exit;\n if ($recharge_info) {\n if ($recharge_info['pdr_payment_state'] != 1) {\n continue;\n }\n\n if ($order_info['pay_amount'] >= $recharge_info['pdr_amount']) {\n $this->_changeRidesRechargeStatus($rides_recharge['recharge_sn']);\n continue;\n }\n\n $amount = $recharge_info['pdr_amount'] - $order_info['pay_amount'];\n //部分退款反映到充值表\n\t\t//print_r($amount);exit;\n $recharge_info['cash_amount'] = $amount;\n $recharge_info['admin_id'] = 0;\n $recharge_info['admin_name'] = 'system';\n\n $result = $this->sys_model_deposit->cashApply($recharge_info);\n //$result['state'] = true;\n if ($result['state']) {\n $pdc_info = array(\n 'pdc_id' => $result['data']['pdc_id'],\n 'pdc_sn' => $result['data']['pdc_sn'],\n 'pdc_user_id' => $recharge_info['pdr_user_id'],\n 'pdc_user_name' => $recharge_info['pdr_user_name'],\n 'pdc_payment_name' => $recharge_info['pdr_payment_name'],\n 'pdc_payment_code' => $recharge_info['pdr_payment_code'],\n 'pdc_payment_type' => $recharge_info['pdr_payment_type'],\n 'pdc_payment_state' => '0',\n 'pdr_amount' => $recharge_info['pdr_amount'],\n 'has_cash_amount' => 0,\n 'cash_amount' => $recharge_info['cash_amount'],\n 'pdr_sn' => $recharge_info['pdr_sn'],\n 'trace_no' => $recharge_info['trace_no'],\n 'admin_id' => $recharge_info['admin_id'],\n 'admin_name' => $recharge_info['admin_name'],\n 'pdc_type' => $recharge_info['pdr_type'],\n );\n //print_r($pdc_info);exit;\n $ssl_cert_path = DIR_SYSTEM . 'library/payment/cert/' . $this->config->get('config_wxpay_ssl_cert_path') . '/' . $recharge_info['pdr_payment_type'] . '/apiclient_cert.pem';\n $ssl_key_path = DIR_SYSTEM . 'library/payment/cert/' . $this->config->get('config_wxpay_ssl_cert_path') . '/' . $recharge_info['pdr_payment_type'] . '/apiclient_key.pem';\n //print_r($ssl_cert_path);\n //print_r($ssl_key_path);exit;\n define('WX_SSLCERT_PATH', $ssl_cert_path);\n define('WX_SSLKEY_PATH', $ssl_key_path);\n $result = $this->sys_model_deposit->wxPayRefund($pdc_info);\n if ($result['state'] == true) {\n $this->_changeRidesRechargeStatus($rides_recharge['recharge_sn']);\n $this->sys_model_orders->updateOrders(array('order_id' => $order_info['order_id']), array('refund_state' => 1));\n }\n\t\t echo 'success', \"\\n\";\n }\n }\n }\n }", "public function assestLedgerEntry()\n {\n $items = $this->getVoucherItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $assestLedgerRecord = $financeLedger->fetchByName('Current Asset');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId; \n \n $dataToInsert = array(\n 'debit' => $amount,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $assestLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "function spgateway_credit_refund($params) {\n\n $amount = $params['amount']; # Format: ##.##\n $TotalAmount = round($amount);\n $transid = $params['transid'];\n\n # 是否為測試模式\n $posturl = ($params['testMode']==\"on\") ? 'https://ccore.spgateway.com/MPG/mpg_gateway'\n : 'https://core.spgateway.com/MPG/mpg_gateway' ;\n\n // post data\n $PostData = http_build_query(\n array( 'RespondType' => 'String',\n 'Version' => '1.0',\n 'Amt' => $TotalAmount,\n 'TradeNo' => $transid,\n 'TimeStamp' => time(),\n 'IndexType' => '2',\n 'CloseType' => '2'\n ));\n $PostData = trim(\n bin2hex(\n mcrypt_encrypt( MCRYPT_RIJNDAEL_128,\n $params['HashKey'],\n spgateway_credit_addpadding($PostData),\n MCRYPT_MODE_CBC,\n $params['HashIV'])\n )\n );\n\n // post\n $post = array( 'MerchantID_' => $params['MerchantID'],\n 'PostData_' => $PostData);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $posturl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n if ($params['testMode']=='on') curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // On dev server only!\n $result = curl_exec($ch);\n curl_close($ch);\n\n parse_str(trim($result),$result);\n\n switch($result['Status']){\n case 'SUCCESS':\n case 'TRA10045':\n return array('status'=>'success', 'rawdata'=>$result, 'transid'=>$result['TradeNo'], 'fees'=>0);\n case 'TRA10058':\n case 'TRA10675':\n case 'TRA10013':\n case 'TRA10035':\n return array('status'=>'declined', 'rawdata'=>$result);\n default:\n return array('status'=>'error', 'rawdata'=>$result);\n }\n}", "public function actionCreate()\n {\n \n // generate purchase Order Number\n \n $adjustment_number = TransactionCode::generate_transaction_number('AD--');\n \n if(empty($adjustment_number)){\n $adjustment_number = '';\n }\n \n\n $modelAdjustmentHead = new ImAdjustHead;\n $modelsAdjustmentDetail = [new ImAdjustDetail];\n\n // Set Default Data\n $modelAdjustmentHead->transaction_no = $adjustment_number; \n $modelAdjustmentHead->status = 'open'; \n\n $modelAdjustmentHead->branch_id = 1;\n $modelAdjustmentHead->currency_id = 1;\n\n // Currency Data\n $currency_data = Currency::find()->where(['id'=>$modelAdjustmentHead->currency_id])->one();\n\n if(!empty($currency_data)){\n $modelAdjustmentHead->exchange_rate = $currency_data->exchange_rate;\n }\n \n if ($modelAdjustmentHead->load(Yii::$app->request->post())) {\n\n $modelsAdjustmentDetail = Model::createMultiple(ImAdjustDetail::classname());\n Model::loadMultiple($modelsAdjustmentDetail, Yii::$app->request->post());\n\n // validate all models\n $valid = $modelAdjustmentHead->validate();\n $valid = Model::validateMultiple($modelsAdjustmentDetail) && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n\n try {\n $modelAdjustmentHead->status = 'open';\n if ($flag = $modelAdjustmentHead->save(false)) {\n foreach ($modelsAdjustmentDetail as $modelAdjustmentDetail) {\n $modelAdjustmentDetail->im_adjust_head_id = $modelAdjustmentHead->id;\n if (! ($flag = $modelAdjustmentDetail->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n\n if ($flag) {\n\n // Update transaction code data\n $update_transaction = TransactionCode::update_transaction_number('AD--');\n\n if($update_transaction){\n echo 'successfully updated';\n }else{\n echo 'successfully not updated';\n }\n\n // Set success data\n \\Yii::$app->getSession()->setFlash('success', 'Successfully Inserted');\n\n \n $transaction->commit();\n return $this->redirect(['view', 'id' => $modelAdjustmentHead->id]);\n }\n } catch (\\Exception $e) {\n\n // Set success data\n \\Yii::$app->getSession()->setFlash('error', $e->getMessage());\n\n $transaction->rollBack();\n }\n }\n }\n\n return $this->render('create', [\n 'modelAdjustmentHead' => $modelAdjustmentHead,\n 'modelsAdjustmentDetail' => (empty($modelsAdjustmentDetail)) ? [new ImAdjustDetail] : $modelsAdjustmentDetail\n ]);\n\n }", "public function installDependencies($mbooth_xml){\n\t\tdefine('DIR_ROOT', substr_replace(DIR_SYSTEM, '/', -8));\n\t\tforeach($this->getDependencies($mbooth_xml) as $extension){\n\t\t\tif(isset($extension['codename'])){\n\t\t\t\t$this->download_extension($extension['codename'], $extension['version']);\n\t\t\t\t$this->extract_extension();\n\t\t\t\tif(file_exists(DIR_SYSTEM . 'mbooth/xml/'.$mbooth_xml)){\n\t\t\t\t\t$result = $this->backup_files_by_mbooth($mbooth_xml, 'update');\n\t\t\t\t}\n\t\t\t\t$this->move_dir(DIR_DOWNLOAD . 'upload/', DIR_ROOT, $result);\n\t\t\t}\n\t\t}\n\t}", "public function update()\n {\n $uniqueId = uniqid();\n echo sprintf(\"Start updating gopax ticker[%s]! Time: %s\\n\", $uniqueId, time());\n\n $gopaxTokenList = GOPAX_API::getAssets();\n if (isset($gopaxTokenList['code']) && isset($gopaxTokenList['message'])) {\n echo sprintf(\"get gopaxTokenList failed. Code: %s, Message: %s, File: %s, Line: %s\\n\",\n $gopaxTokenList['code'], $gopaxTokenList['message'], __FILE__, __LINE__);\n return ;\n }\n\n $gopaxTradingList = GOPAX_API::getTradingPairs();\n if (isset($gopaxTradingList['code']) && isset($gopaxTradingList['message'])) {\n echo sprintf(\"get gopaxTradingList failed. Code: %s, Message: %s, File: %s, Line: %s\\n\",\n $gopaxTradingList['code'], $gopaxTradingList['message'], __FILE__, __LINE__);\n return ;\n }\n\n $tokenHash = array_combine(array_column($gopaxTokenList, 'id'), $gopaxTokenList);\n\n // exchange name[the section key] from conf/app.ini\n $tickerModel = new TickerModel('gopax');\n foreach ($gopaxTradingList as $tickerInfo) {\n sleep(1);\n $tradingPairInfo = GOPAX_API::getTickerPairs($tickerInfo['name']);\n $data = [\n 'symbol_key' => $tickerInfo['baseAsset'],\n 'symbol_name' => $tokenHash[$tickerInfo['baseAsset']]['name'],\n 'anchor_key' => $tickerInfo['quoteAsset'],\n 'anchor_name' => $tokenHash[$tickerInfo['quoteAsset']]['name'],\n 'price' => $tradingPairInfo['price'],\n 'price_updated_at' => $tradingPairInfo['time'],\n 'volume_24h' => $tradingPairInfo['volume'],\n 'volume_anchor_24h' => $tradingPairInfo['volume'] * $tradingPairInfo['price'],\n ];\n $res = $tickerModel->create($data);\n if (isset($res['code']) && isset($res['message'])) {\n echo sprintf(\"update ticker failed. Data: %s, Code: %s, Message: %s\\n\", json_encode($data), $res['code'], $res['message']);\n }\n }\n\n echo sprintf(\"Finish updating gopax ticker[%s]! Time: %s\\n\", $uniqueId, time());\n }", "public function execute()\n {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n $connection = $resource->getConnection();\n $tableName = $resource->getTableName('sales_order');\n $writer = new \\Zend\\Log\\Writer\\Stream(BP . '/var/log/payout.log');\n $logger = new \\Zend\\Log\\Logger();\n $logger->addWriter($writer);\n //seller id between 7 to 14 aug 2018\n $sellerIds = array(631, 634, 638, 639, 640, 641, 646, 649, 650, 654,\n 656, 657, 660, 671, 682, 731, 784, 789, 826, 830, 850, 853, 861,\n 913, 967, 1070, 1098, 1164, 1176, 1266, 1267, 1374, 1637, 1691,\n 1699, 1700, 1706, 1728, 1773, 1774, 1850, 1954, 1989, 2015, 2017,\n 2194, 2602, 3230, 3252, 3289, 3315, 3404, 3406, 3408, 3447, 3478,\n 3540, 3546, 3648\n );\n\n $currentDateTime = new \\DateTime('now',\n new \\DateTimezone(\"Asia/Kolkata\"));\n $currentDateString = $currentDateTime->format('Y-m-d H:i:s');\n $startInterval = date('Y-m-d H:i:s',\n strtotime('-7 days', strtotime($currentDateString)));\n try {\n foreach ($sellerIds as $sellerId) {\n $salesLists = $this->salesListCollection->create()->addFieldToFilter('seller_id',\n $sellerId)\n ->addFieldToFilter('main_table.created_at',\n ['gteq' => $startInterval])\n ->addFieldToFilter('main_table.created_at',\n ['lteq' => $currentDateString]);\n foreach ($salesLists as $sales) {\n $orderId = $sales->getOrderId();\n $logger->info('Oder Id: ' . $orderId);\n $order = $this->order->create()->load($orderId);\n $createdAt = $order->getCreatedAt();\n $sql = \"Update \" . $tableName . \" set updated_at ='\" . $createdAt . \"' where entity_id = $orderId\";\n $connection->query($sql);\n \n $saleslisttable = \"marketplace_saleslist\";\n $salesListId = $sales->getEntityId();\n $logger->info('Sales List Id: ' . $salesListId);\n $salesModel = $this->sales->load($salesListId);\n $salesCreatedAt = $salesModel->getCreatedAt();\n $salesModel->setUpdatedAt($salesCreatedAt);\n $salesModel->setPaidStatus(0);\n $salesModel->setCpprostatus(1);\n $salesModel->setTransId(0);\n $salesModel->save();\n $sql = \"Update \" . $saleslisttable . \" set updated_at ='\" . $salesCreatedAt . \"' where entity_id = $salesListId\";\n $connection->query($sql);\n }\n $transactionCollection = $this->salerTransaction->getCollection()->addFieldToFilter('seller_id',\n $sellerId)\n ->addFieldToFilter('main_table.created_at',\n ['gteq' => $startInterval])\n ->addFieldToFilter('main_table.created_at',\n ['lteq' => $currentDateString]);\n foreach ($transactionCollection as $transaction) {\n $entityId = $transaction->getEntityId();\n $transactionModel = $this->salerTransaction->load($entityId);\n $transactionModel->delete();\n }\n }\n } catch (Exception $e) {\n $logger->info($e->getMessage());\n }\n }", "public function buy($basket){\n $data = array();\n $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n //echo \"basketid = \".$basket['basketID'];\n try{\n $this->pdo->beginTransaction();\n $this->pdo->exec(\"insert into ShoppingBasket(basketID,username) values('\".$basket['basketID'].\"','\".$basket['username'].\"')\");\n foreach($basket['items'] as $item){\n $this->pdo->exec(\"insert into Contains(ISBN,basketID,number) values('\".$item['isbn'].\"','\".$basket['basketID'].\"','\".$item['number'].\"')\");\n $this->pdo->exec(\"insert into ShippingOrder(ISBN,warehouseCode,username,number) values('\".$item['isbn'].\"','w100','\".$basket['username'].\"','\".$item['number'].\"') on duplicate key update number=\".$item['number']);\n if($item['isMultiWarehouseUpdate']){\n $counter = $item['number'];\n foreach($item['warehouseUpdate'] as $warehouseUpdate){\n $warehouseCode = $warehouseUpdate['warehouseCode'];\n $counter -= $warehouseUpdate['stock'];\n if($counter>=0){\n //echo \"updating \".$warehouseCode.\" with counter = \".$counter;\n $this->pdo->exec(\"update stocks set number=0 where ISBN=\".$item['isbn'].\" and warehouseCode='\".$warehouseCode.\"'\");\n }else{\n /*10 6 4\n 7 1 -3\n 8 2 -2\n 9 3 -1\n 10 4 0*/\n $newstock = $warehouseUpdate['stock']+$counter; // counter is negative here\n //echo \"updating \".$warehouseCode.\" with new stock = \".$newstock;\n $this->pdo->exec(\"update stocks set number=\".$newstock.\" where ISBN=\".$item['isbn'].\" and warehouseCode='\".$warehouseCode.\"'\");\n }\n \n }\n }else{\n $warehouseCode = $item['warehouseUpdate']['warehouseCode'];\n //echo \"updating \".$warehouseCode;\n $this->pdo->exec(\"update stocks set number=number-\".$item['number'].\" where ISBN=\".$item['isbn'].\" and warehouseCode='\".$warehouseCode.\"'\");\n }\n \n }\n $this->pdo->commit();\n $data['success']=true;\n }catch(PDOException $pe){\n $this->pdo->rollback();\n $data['success']=false;\n $data['errmsg']=$pe->getMessage();\n }\n return $data;\n }", "public function handle()\n {\n $string = \"\";\n $crypt = json_decode($string);\n foreach ($crypt as $key => $value) {\n \n Cryptocurrency::where('cryptocurrency_id', $value->cryptocurrency_id)->update(['ath' => $value->ath, 'ath_date' => $value->ath_date]);\n }\n dd('finish');\n $crypt = Cryptocurrency::select('cryptocurrency_id', 'ath', 'ath_date')->whereNotNull('ath')->get()->toArray();\n $crypt = json_encode(json_encode($crypt));\n dd($crypt);\n dd();\n\n $min = $this->option('min');\n \t$max = $this->option('max');\n $cryptocurrency = Cryptocurrency::select('cryptocurrency_id', 'slug')->orderBY('cryptocurrency_id', 'asc')->whereNull('ath')->get()->toArray();\n $client = new Client();\n $start = time();\n foreach ($cryptocurrency as $key => $value) {\n dump($value['slug']);\n \n try {\n $response = $client->get('https://coinmarketcap.com/currencies/' . $value['slug']);\n $response = $response->getBody()->getContents();\n $str = substr($response, strpos($response, 'All Time High'));\n $str = substr($str, 0,strpos($str, '</td>'));\n $str = strip_tags($str);\n $str = explode(\"\\n\", $str);\n // $str = str_replace(\"\\n\", \"\", $str);\n $array = [];\n foreach ($str as $key1 => $value1) {\n if (($value1 != '') && ($value1 != ' ')) {\n $array[] = $value1;\n }\n }\n dump($array);\n if (count($array) > 3) {\n $ath = (float)$array[1];\n $date = str_replace('(', '', $array[3]);\n $date = str_replace(')', '', $date);\n $date = str_replace(',', '', $date);\n dump($date);\n $date = date('Y-m-d H:i:s', strtotime($date));\n\n \n dump($date);\n dump($ath);\n \n\n Cryptocurrency::where('cryptocurrency_id', $value['cryptocurrency_id'])->update(['ath' => $ath, 'ath_date' => $date]);\n }else{\n Cryptocurrency::where('cryptocurrency_id', $value['cryptocurrency_id'])->update(['ath' => 0]);\n }\n dump($value['cryptocurrency_id']);\n } catch (ClientException $exception) {\n dump($exception->getResponse()->getStatusCode());\n }\n\n dump('TIME: '. ((int)time() - (int)$start) . ' sek');\n \n sleep(rand( $min , $max ));\n }\n \t\n\n }", "public function perBill()\n\t{\n\t\t$this->restart( 'shop/finish' );\n\t}" ]
[ "0.5270505", "0.5177063", "0.5092866", "0.4989667", "0.49541387", "0.49124584", "0.48646542", "0.48317075", "0.48221484", "0.47898033", "0.47822908", "0.47066605", "0.46965504", "0.46854994", "0.4679103", "0.46619135", "0.4612151", "0.46062076", "0.4601263", "0.45802557", "0.4580105", "0.45732367", "0.45710057", "0.45653683", "0.4557181", "0.4545427", "0.45434842", "0.4533024", "0.4530539", "0.4514208", "0.4490769", "0.44801104", "0.44707426", "0.4463896", "0.4460797", "0.44581872", "0.44565505", "0.44440776", "0.44409359", "0.44227955", "0.4420219", "0.44101343", "0.44084585", "0.4408366", "0.44068727", "0.44059435", "0.44033036", "0.44023356", "0.43946686", "0.43869114", "0.43735528", "0.43660706", "0.43642256", "0.43567818", "0.43558395", "0.43509048", "0.4350487", "0.43444538", "0.43440422", "0.4340012", "0.43394047", "0.43323675", "0.43310666", "0.43282038", "0.43278152", "0.43259335", "0.4325714", "0.43237743", "0.43236426", "0.43235028", "0.431679", "0.4311786", "0.4311396", "0.43076763", "0.42960533", "0.42930785", "0.42923585", "0.42920512", "0.42841074", "0.42658505", "0.42637405", "0.4259423", "0.42561933", "0.42495644", "0.42475834", "0.42449284", "0.4241787", "0.42416474", "0.42411196", "0.42385888", "0.42262107", "0.42241085", "0.42223194", "0.42211294", "0.4221045", "0.42186818", "0.42183772", "0.42175895", "0.4215892", "0.42152777" ]
0.66171366
0
Gets OHLC of 1 pair and passes it to indic calculator
function installIndicCaller ($api, $unixTime, $pairSymbol, $moduleName, $interval) { $days = 30; $since = $unixTime-(60*60*24*$days); global $exchange; $ohlc = getOHLC($api, $exchange, $pairSymbol, $interval, $since); if (is_array($ohlc)) { $currentFile=$moduleName.'-'.$pairSymbol.'-'; $output = installIndicR($currentFile, $ohlc); if ($output!=null) { print_r ($pairSymbol.' '.$output. ' installed<br>'); } } else { exit ('not array'); } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOHLC ($api, $exchange, $pairSymbol, $interval, $since) {\n if ($exchange=='binance') {\n $interval = $interval.'m';\n $ohlc = $api->candlesticks($pairSymbol, $interval, $since, null, null, 1000);\n $ohlc = ohlcRekey ($ohlc);\n } elseif ($exchange=='kraken') {\n $ohlc = $api->QueryPublic('OHLC', array('pair' => $pairSymbol,'interval' => $interval, 'since' => $since));\n $ohlc = ohlcRekey($ohlc, $pairSymbol);\n }\n\n return $ohlc;\n}", "function getTicker ($api, $exchange, $folioArray) {\n $pairSymbols = array_column ($folioArray, 'pairSymbol');\n\n if ($exchange=='binance') {\n // Binance gives all pairs, and this code gets the desired pairs from the result\n $ticker = $api->prices();\n for($i=0; $i<count($pairSymbols)-1; $i++) {\n $price[$i]=$ticker[$pairSymbols[$i]];\n }\n $ticker = $price;\n } elseif ($exchange=='kraken') {\n // Kraken uses a comma separated string for the symbols\n \tarray_pop ($pairSymbols);\n\n \t$pairsString = implode(\", \",$pairSymbols);\n \t$ticker = $api->QueryPublic('Ticker', array('pair'=>$pairsString));\n \t$ticker = $ticker['result'];\n\n $i=0;\n foreach ($ticker as $key => $value) {\n\n $price[$i] = $value['c'][0];\n\t\t\tsettype ($price[$i], 'float');\n $i++;\n }\n $ticker = $price;\n }\n\n return $ticker;\n}", "function getPairValue($pair,$type='ask') { \r\n\t$curl = new Curl;\r\n\t$ticker = (array)$curl->get(\"https://api.bitfinex.com/v1/pubticker/$pair\");\r\n\treturn $ticker[$type];\r\n}", "function returnDamwidiOHLC($verbose, $debug){\n $dbc = connect();\n $stmt = $dbc->prepare(\"SELECT `date`, `open`, `high`, `low`, `close` FROM `data_value` ORDER BY `date` DESC\");\n $stmt->execute();\n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n\n $damwidiOHLC = array();\n foreach($result as $candle){\n $damwidiOHLC['Time Series (Daily)'][$candle['date']] = array(\n \"1. open\" => round($candle['open'],2),\n \"2. high\" => round($candle['high'],2),\n \"3. low\" => round($candle['low'],2),\n \"4. close\" => round($candle['close'],2),\n );\n }\n\n if ($verbose) show($damwidiOHLC);\n if (!$verbose) echo json_encode($damwidiOHLC);\n}", "function retrieveDataFromAlphavantage() {\n // Variables needed to created a url to use the alphavantage api\n $requestTypeURL = \"function=TIME_SERIES_INTRADAY\";\n $apiKey = 'F65M552NK586I4QJ';\n\n if (isset($_POST['submit']) && !empty($_POST['symbols'])) {\n $symbol = $_POST['symbols'];\n $url = 'https://www.alphavantage.co/query?'. $requestTypeURL . '&symbol='\n . $symbol . '&interval=1min&outputsize=compact&apikey=' . $apiKey;\n\n // Retrieving data from the url in JSON format\n // Returns false if it fails\n $content = @file_get_contents($url);\n\n if(!$content){\n throw new Exception('Unable to retrieve ticker stock info (invalid ticker symbol)');\n }\n\n $jsonData = json_decode($content, true);\n\n // Saves only the first element of the retrieved data\n $metadata = current($jsonData);\n\n // Append data\n echo '<div id=\"lasttrade\">';\n echo '<h2>' . $metadata['2. Symbol'] . '</h2>';\n echo '<p>Time Zone: ' . $metadata['6. Time Zone'] . '</p>';\n echo '<p>Last Refreshed: ' . $metadata['3. Last Refreshed'] . '</p>';\n\n // Validation to make sure 'Time Series (1min)' exists\n if(isset($jsonData['Time Series (1min)'])){\n $lastTrade = current($jsonData['Time Series (1min)']);\n echo '<p>Last trade closing value: ' . $lastTrade['4. close'] . '</p>';\n }\n\n echo '</div>';\n } else {\n // if submit and smbols aren't set\n throw new Exception('Ticker symbol not specified.');\n }\n }", "function calculateEURX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURX '.$shortDate);\n\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDSEK = $data['USDSEK']['bars'];\n $index = [];\n\n foreach ($EURUSD as $i => $bar) {\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdsek = $USDSEK[$i]['open'];\n $open = 34.38805726\n * pow($eurusd/100000 * $usdchf/100000, 0.1113)\n * pow($eurusd / $gbpusd , 0.3056)\n * pow($eurusd/100000 * $usdjpy/1000 , 0.1891)\n * pow($eurusd/100000 * $usdsek/100000, 0.0785)\n * pow($eurusd/100000 , 0.3155);\n $iOpen = (int) round($open * 1000);\n\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdsek = $USDSEK[$i]['close'];\n $close = 34.38805726\n * pow($eurusd/100000 * $usdchf/100000, 0.1113)\n * pow($eurusd / $gbpusd , 0.3056)\n * pow($eurusd/100000 * $usdjpy/1000 , 0.1891)\n * pow($eurusd/100000 * $usdsek/100000, 0.0785)\n * pow($eurusd/100000 , 0.3155);\n $iClose = (int) round($close * 1000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function getIndicator() ;", "function returnMarketValue($date, $historicalData){\n $openPositions = returnOpenPositions($date);\n\n // list of data providers\n $dataProviders = array_keys($historicalData);\n\n // $historicalData = $historicalData['alphaVantage'];\n\n foreach($dataProviders as $provider){\n\n $marketValue[$provider] = array(\n 'open' => 0,\n 'high' => 0,\n 'low' => 0,\n 'close' => 0,\n );\n foreach($openPositions as $symbol => $data){\n if (array_key_exists($symbol, $historicalData[$provider])){\n $marketValue[$provider]['open'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['open'] ,3);\n $marketValue[$provider]['high'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['high'] ,3);\n $marketValue[$provider]['low'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['low'] ,3);\n $marketValue[$provider]['close'] += $data['shares']*round($historicalData[$provider][$symbol][$date]['close'] ,3);\n }\n }\n }\n\n return $marketValue;\n}", "function getPrice ($api, $exchange, $pairSymbol) {\n if ($exchange=='binance') {\n $price = $api->price($pairSymbol);\n } elseif ($exchange=='kraken') {\n $price = $api->QueryPublic('Ticker', array('pair'=>$pairSymbol));\n \t$price = $price['result'][$pairSymbol]['c'][0];\n }\n return $price;\n}", "function get_market_default($pair,$print=false){\n\t$url_coin_price = \"https://graviex.net/api/v2/tickers/\".$pair.\".json\";\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch,CURLOPT_TIMEOUT,20);\n\tcurl_setopt($ch, CURLOPT_URL, $url_coin_price);\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\t$obj = json_decode($result);\n\t//print_r($obj);\n\t$coin_buy_price = $obj->ticker->buy;\n\t$coin_sell_price = $obj->ticker->sell;\n\t$coin_volume = $obj->ticker->vol;\n\t$coin_btc_volume = $obj->ticker->volbtc;\n\tif($print){\n\t\techo \"<br /><b>Pair</b>: \".$pair;\n\t\techo \"<br /><br /><b>Ofertas</b>\";\n\t\techo \"<br />Compra: \".$coin_buy_price;\n\t\techo \"<br />Venda: \".$coin_sell_price;\n\t\techo \"<br /><br /><b>Volume last 24h</b>\";\n\t\techo \"<br />Coins: \".$coin_volume;\n\t\techo \"<br />BTC: \".$coin_btc_volume; \n\t}\n\treturn array('buy' => $coin_buy_price,'sell' => $coin_sell_price,'vol' => $coin_volume,'volbtc' => $coin_btc_volume);\n}", "function getComexData($symbol,$type = null) {\n\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"[email protected]\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"F8F0E4AB52D34B6E85E21D48FD3B0E25\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"FDFDBEAF9B004b2eBB2D7A9D1D39F24F\"));\n\t\t\t\t$client = new soapclient('http://www.xignite.com/xFutures.asmx?WSDL', array('trace' => 1));\n\t\t\t\t$client->__setSoapHeaders(array($xignite_header));\n\n\t\t\t\tswitch ($type) {\n\t\t\t\t\tcase 'strip':\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'StripType' => \"EighteenMonth\"\n\t\t\t\t\t\t );\n\t\t\t\t\t\t // call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t $result = $client->GetDelayedFutureStrip($param);\n\t\t\t\t\t\t // assess the results\n\t\t\t\t\t\t if (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t \techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \techo '</pre>';\n\t\t\t\t\t\t } elseif (isset($_GET['xml'])) {\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t \tprint_r($comex);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t \t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'Day' => \"0\",\n\t\t\t\t\t\t 'Month' => \"0\",\n\t\t\t\t\t\t 'Year' => date('Y')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t$result = $client->GetDelayedFuture($param);\n\t\t\t\t\t\t// assess the results\n\t\t\t\t\t\tif (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t\techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t\tprint_r($result);\n\t\t\t\t\t\t\techo '</pre>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t\treturn $comex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "function getComexData($symbol,$type = null) {\n\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"[email protected]\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"F8F0E4AB52D34B6E85E21D48FD3B0E25\"));\n//\t\t\t\t$xignite_header = new SoapHeader('http://www.xignite.com/services/', 'Header', array(\"Username\" => \"FDFDBEAF9B004b2eBB2D7A9D1D39F24F\"));\n\t\t\t\t$client = new soapclient('http://www.xignite.com/xFutures.asmx?WSDL', array('trace' => 1));\n\t\t\t\t$client->__setSoapHeaders(array($xignite_header));\n\n\t\t\t\tswitch ($type) {\n\t\t\t\t\tcase 'strip':\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'StripType' => \"EighteenMonth\"\n\t\t\t\t\t\t );\n\t\t\t\t\t\t // call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t $result = $client->GetDelayedFutureStrip($param);\n\t\t\t\t\t\t // assess the results\n\t\t\t\t\t\t if (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t \techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \techo '</pre>';\n\t\t\t\t\t\t } elseif (isset($_GET['xml'])) {\n\t\t\t\t\t\t \tprint_r($result);\n\t\t\t\t\t\t \t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t \tprint_r($comex);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t break;\n\t\t\t\t\t\t \t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// create an array of parameters\n\t\t\t\t\t\t$param = array(\n\t\t\t\t\t\t 'Symbol' => $symbol,\n\t\t\t\t\t\t 'Day' => \"0\",\n\t\t\t\t\t\t 'Month' => \"0\",\n\t\t\t\t\t\t 'Year' => date('Y')\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// call the service, passing the parameters and the name of the operation\n\t\t\t\t\t\t$result = $client->GetDelayedFuture($param);\n\t\t\t\t\t\t// assess the results\n\t\t\t\t\t\tif (is_soap_fault($result) && isset($_GET['xml'])) {\n\t\t\t\t\t\t\techo '<h2>Fault</h2><pre>';\n\t\t\t\t\t\t\tprint_r($result);\n\t\t\t\t\t\t\techo '</pre>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$comex = array(\"cash\"=>number_format($result->GetDelayedFutureResult->Last,2));\n\t\t\t\t\t\t\treturn $comex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}", "public function getOpenOrders($pair='all')\n {\n return $this->trading([\n 'command' => 'returnOpenOrders',\n 'currencyPair' => strtoupper($pair)\n ]);\n }", "abstract function getPriceFromAPI($pair);", "function returnOpenPositions($date, $verbose = false, $debug = false){\n $dbc = connect();\n $stmt = $dbc->prepare(\"SELECT * FROM `data_transactions`\n WHERE `transaction_date` <= :date\n AND `symbol` IS NOT NULL\n AND `symbol` <> ''\n ORDER BY `transaction_date` ASC\");\n $stmt->bindParam(':date', $date);\n $stmt->execute();\n $result = $stmt->fetchall(PDO::FETCH_ASSOC);\n\n $openPositions = array();\n\n foreach($result as $transaction){\n switch($transaction['type']){\n case 'B':\n if (array_key_exists ( $transaction['symbol'] , $openPositions )){\n // symbol in array\n $openPositions[$transaction['symbol']]['shares'] += $transaction['shares'];\n $openPositions[$transaction['symbol']]['purchase'] += $transaction['amount'];\n array_push($openPositions[$transaction['symbol']]['purchases'], $transaction['transaction_date'] );\n } else {\n // new symbol\n $openPositions[$transaction['symbol']] = array(\n 'shares' => $transaction['shares'],\n 'purchase' => $transaction['amount'],\n 'purchases' => array($transaction['transaction_date']),\n 'dividend' => 0\n );\n }\n break;\n case 'S':\n $openPositions[$transaction['symbol']]['shares'] += $transaction['shares'];\n $openPositions[$transaction['symbol']]['purchase'] += $transaction['amount'];\n if (round($openPositions[$transaction['symbol']]['shares'],5) == 0) unset($openPositions[$transaction['symbol']]);\n break;\n case 'D':\n if (array_key_exists ( $transaction['symbol'] , $openPositions )){\n $openPositions[$transaction['symbol']]['dividend'] += $transaction['amount'];\n }\n break;\n default:\n break;\n }\n }\n\n //add basis data\n foreach($openPositions as &$position){\n $position['basis'] = round(-1*($position['purchase']+$position['dividend'])/$position['shares'],3);\n }\n\n if ($verbose) show($openPositions);\n return $openPositions;\n}", "public function strategy_sma_stoch_rsi($data, $indicator = false)\n {\n $price = array_pop($data['close']);\n\n $sma = @array_pop(trader_sma($data['close'], 150)) ?? 0;\n $ema = @array_pop($this->ema($data['close'], 150)) ?? 0;\n\n $smoothness = config('dbot.type.sma');\n $stoch = trader_stoch($data['high'], $data['low'], $data['close'], 14, 3, $smoothness, 3, $smoothness);\n $slowk = @array_pop($stoch[0]);\n $slowd = @array_pop($stoch[1]);\n\n $rsi = @array_pop(trader_rsi($data['close'], 14));\n\n // TODO EMA is here for testing only remove when we have more information\n\n $return = [\n 'strategy' => 'sma_stoch_rsi',\n 'price' => $price,\n 'sma' => $sma,\n 'ema' => $ema,\n 'slowk' => $slowk ?? 0,\n 'slowd' => $slowd ?? 0,\n 'rsi' => $rsi ?? 0,\n 'side' => '',\n 'state' => 0,\n ];\n\n if ($rsi < 30) {\n $rsiColor = 'green';\n } elseif ($rsi > 70) {\n $rsiColor = 'red';\n } else {\n $rsiColor = 'white';\n } // if\n\n if ($slowk < 30) {\n $slowkColor = 'green';\n } elseif ($slowk > 70) {\n $slowkColor = 'red';\n } else {\n $slowkColor = 'white';\n } // if\n\n $return['colors'] = [\n 'sma' => $price > $sma ? 'green' : 'red',\n 'slowk' => $slowkColor,\n 'slowd' => $slowk > $slowd ? 'green' : 'red',\n 'rsi' => $rsiColor,\n ];\n\n if ($price > $sma && $rsi < 30 && $slowk < 30 && $slowk > $slowd) {\n $return['side'] = 'long';\n $return['state'] = 1;\n return ($indicator ? 1 : $return);\n } // if\n\n if ($price < $sma && $rsi > 70 && $slowk > 70 && $slowk < $slowd) {\n $return['side'] = 'short';\n $return['state'] = -1;\n return ($indicator ? -1 : $return);\n } // if\n\n return ($indicator ? 0 : $return);\n }", "function balanceCheck ($api, $moduleName, $folioArray, $threshold, $unixTime) {\n\n\n // get trade balance would go here\n\n\n\t// get current % of each coin and ema or other indicators\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$pairSymbols = array_column($folioArray, 'pairSymbol');\n\tarray_pop($pairSymbols);\n\n\t$pairCount = count($folioArray)-1; //last is USD\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('USD');\n\t\t}\n\t\t$currentPair = $folioArray[$i]['pairSymbol'];\n\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\n\t\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t $ohlcOld = file_get_contents($filepath);\n\t $ohlcOld = json_decode($ohlcOld, true);\n\n\t\tend($ohlcOld);\n\t\t$lastKey = key($ohlcOld);\n\n\t\t$price[$i] = $ohlcOld[$lastKey]['close'];\n\t\t$priceT[$i] = $ticker[$currentPair]['c'][0];\n\n\t\t$currentValue[$i] = $main[$i]['quantity']*$price[$i];\n\t\t$holdValue[$i] = $main[$i]['startQuantity']*$price[$i];\n\n\t}\n\t$totalValue = array_sum($currentValue);\n\t$totalValue += $main[$pairCount]['quantity']; // add USD\n\n // Hold value is the value if one only holds from the beginning\n\t$holdValue = array_sum($holdValue);\n\t$holdValue += $main[$pairCount]['startQuantity']; // add USD\n\n\t$operation = null;\n\n\t// based on deviation from planned % of folio, do stuff for each thing\n\tfor ($i=0; $i<$pairCount; $i++) { // count($folioArray)-1 since last is USD\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('squeak');\n\t\t}\n\n\t\tif ($folioArray[$i]['coinSymbol']!='ZUSD') {\n\t\t\t$currentPercent[$i] = round ($currentValue[$i]/$totalValue*100, 3, PHP_ROUND_HALF_UP);\n\t\t\t$deviation = $currentPercent[$i]-$main[$i]['targetPercent'];\n\n //Potential checks if it is worth buying or selling, depending on status of indicators\n\t\t\tif ($deviation>$threshold) {\n\t\t\t\tsellPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i], $unixTime, $threshold);\n\t\t\t}\n\t\t\tif ($deviation<-$threshold) {\n\t\t\t\tbuyPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i]);\n\t\t\t}\n\t\t\t$operation[] = $folioArray[$i]['pairSymbol'].' balance checked';\n\t\t}\n\t}\n\n\n\n\t$filepath = ''.$moduleName.'-'.'QuickExt.json';\n\t$quickExt = file_get_contents($filepath);\n\t$quickExt = json_decode($quickExt, true);\n\n\t$quickExt['tempTotalValue'] = $totalValue;\n\t$quickExt['holdValue'] = $holdValue;\n\n\tfor ($i=0; $i<=$pairCount; $i++) { // includes USD\n\t\t$quickExt['volChange'][$folioArray[$i]['coinSymbol']] = round($main[$i]['quantity']/$main[$i]['startQuantity']*100, 2, PHP_ROUND_HALF_UP);\n\t}\n\n\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\tprint_r ($operation);\n}", "function calculateCHFLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CHFLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdchf * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdchf * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function __invoke(array $data, int $period1 = 12, int $period2 = 26, int $period3 = 9): int\n {\n\n $macd = trader_macd(\n $data['close'], \n $period1, \n $period2, \n $period3\n );\n \n if (false === $macd) {\n throw new \\RuntimeException('Not enough data points');\n }\n\n \n $macd_raw = $macd[0];\n $signal = $macd[1];\n $hist = $macd[2];\n\n //If not enough Elements for the Function to complete\n if (!$macd || !$macd_raw) {\n throw new \\RuntimeException('Not enough data points');\n }\n\n //$macd = $macd_raw[count($macd_raw)-1] - $signal[count($signal)-1];\n $macd = (array_pop($macd_raw) - array_pop($signal));\n \n // Close position for the pair when the MACD signal is negative\n \n if ($macd < 0) {\n return static::SELL;\n // Enter the position for the pair when the MACD signal is positive\n } elseif ($macd > 0) {\n return static::BUY;\n } else {\n return static::HOLD;\n }\n }", "function calculateAUDLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] AUDLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $audusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $audusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function updateFunctions ($api, $folioArray, $targetPair, $interval, $date, $since, $unixTime, $intervalSec, $moduleName) {\n\t$ohlc = null;\n\t$rowTime = null;\n\n\t$pairName = $folioArray[$targetPair]['pairSymbol'];\n\n\t$currentFile =$moduleName.'-'.$pairName.'-';\n\n\t$filepath = 'indic/' . $currentFile . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\tend($emaSet);\n\t$lastKey = key($emaSet);\n\n\t// update\n\n\n\t$compareTime = $unixTime-$intervalSec*3;\n\n\tif ($emaSet[$lastKey]['time']<=$compareTime){ //reinstall if too many missing\n\t\t\t$days = 30;\n\t\t\t$since = $unixTime-(60*60*24*$days);\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\t\tif (is_array($ohlc)){\n\t\t\t\t$current = installIndicR($currentFile, $ohlc);\n\t\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\t\t\t\tif ($current!=null) {\n\t\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' '.$current.' ok <br>');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\texit ('Error API JSON empty');\n\t\t\t}\n\n\t}else {\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\tif (is_array($ohlc)) {\n\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\n\t\t\tif ($rowTime > $emaSet[$lastKey]['time']){\n\t\t\t\tindicUPR($currentFile, $emaSet, $ohlc);\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t\tif ($rowTime == $emaSet[$lastKey]['time']){\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t} else {\n\t\t\t$rowTime = null;\n\t\t}\n\t}\n\n\treturn $rowTime;\n}", "function calculateCADLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CADLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdcad * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdcad * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function SCn_eco_oth($level)\n{\n\t//return(800+400*$level+4*pow(2*$level,2)+pow(2*$level,3));\n\t$value=array(\"0\"=>800,\"1\"=>1224,\"2\"=>1728,\"3\"=>2360,\"4\"=>3168,\"5\"=>4200,\"6\"=>5504,\"7\"=>7128,\"8\"=>9120,\"9\"=>11528,\"10\"=>14400,\"11\"=>17784,\"12\"=>21728,\"13\"=>26280,\"14\"=>31488,\"15\"=>37400,\"16\"=>44064,\"17\"=>51528,\"18\"=>59840,\"19\"=>69048,\"20\"=>79200,\"21\"=>90344,\"22\"=>102528,\"23\"=>115800,\"24\"=>130208,\"25\"=>145800,\"26\"=>162624,\"27\"=>180728,\"28\"=>200160,\"29\"=>220968,\"30\"=>243200);\n\treturn $value[$level];\n}", "function calculateEURLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $eurusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $eurusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function sellPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price, $unixTime, $threshold) {\n\t$filename = $moduleName. '-';\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\t$history = file_get_contents($filepath);\n\t$history = json_decode($history, true);\n\n\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\tif (!isset($history)) {\n\t\tprint ('zero history');\n\t}\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n\t// Sell if higher than threshold\n\t// || $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow']\n\n\tif ($folioEntry['dumpable']==0 || $ohlcOld[$lastKey]['close']>=$emaSet[$lastKey]['priceEMASlow']) {\n\t\t$devPercent = $currentPercent - $folioEntry['targetPercent'];\n\t\t$dev = round($devPercent*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t$toSell = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\n\t\t$soldValue = $toSell*$price;\n\t\t$fee = 0.004*$soldValue;\n\t\t$soldValue = $soldValue- $fee; // fee and drift\n\n\t\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t// History Stuff\n\t\t$originalValue = $toSell*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$toSell,\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t// Main Stuff\n\n\t\t$newAveragePrice = round(($main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toSell * $price)/($main[$mainEntry]['quantity'] + $toSell),5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] -=$toSell;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold');\n\t}\n\n\t// Sell all aka dump. Only dumpable ones apply.\n\n\tif ($folioEntry['dumpable']==1 && $ohlcOld[$lastKey]['close']<$emaSet[$lastKey]['priceEMASlow'] && $devPercent>$threshold) {\n\n\t\t$soldValue = $main[$mainEntry]['quantity']*$price;\n\t\t$soldValue -= 0.004*$soldValue; // fee and drift\n\n\t\t$fee = 0.004*$soldValue;\n\n\t\t// History Stuff\n\t\t$originalValue = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$main[$mainEntry]['quantity'],\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t$main[$mainEntry]['quantity'] = 0;\n\t\t$main[$mainEntry]['averageBuyPrice'] = 0;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold (dump)');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\tfile_put_contents($filepath, json_encode($history));\n}", "function getCalcs($masterIndex, $indexNumber, $marketnum1, $marketnum2, $TempPoll) {\r\n\t//get database info\r\nglobal $db;\r\n$db = new mysqli(\"localhost\", \"root\", \"\", \"trading\");\r\n\r\n//check connection to database\r\nif($db->connect_errno > 0){\r\n die('Unable to connect to database [' . $db->connect_error . ']');\r\n\t$errors = 1;\r\n}\r\n\t\r\n\t//if statement used to tell which market we should focus on. \r\n\t//our only option $marketnum1 and marketnum2 are ===== 1, 2, 3, 4,\r\n\t$master1code;\r\n\t$market1code ;\r\n\t$master2code;\r\n\t$market2code ;\r\n\tif (($marketnum1 == 1)) \r\n\t{\r\n\t\t$master1code = \"Master1code\";\r\n\t\t$market1code = \"Market1code\";\r\n\t} \r\n\telse if ($marketnum1 == 2) \r\n\t{\r\n\t\t$master1code = \"Master2code\";\r\n\t\t$market1code = \"Market2code\";\r\n\t} \r\n\telse if ($marketnum1 == 3) \r\n\t{\r\n\t\t$master1code = \"Master3code\";\r\n\t\t$market1code = \"Market3code\";\r\n\t} \r\n\telse if ($marketnum1 == 4) \r\n\t{\r\n\t\t$master1code = \"Master4code\";\r\n\t\t$market1code = \"Market4code\";\r\n\t\t\r\n\t} \r\n\t\r\n\r\n\t$firstCalc; \r\n//\t\t M1toM2 DOUBLE, M1toM3 DOUBLE, M1toM4 DOUBLE,\r\n//\t\t M2toM1 DOUBLE, M2toM3 DOUBLE, M2toM4 DOUBLE,\r\n//\t\t M3toM1 DOUBLE, M3toM2 DOUBLE, M3toM4 DOUBLE,\r\n//\t\t M4toM1 DOUBLE, M4toM2 DOUBLE, M4toM3 DOUBLE,\r\n\t//get the markets we will be saving to. \r\n\t//\t\t M1toM2 DOUBLE, M2toM1 DOUBLE,\r\n\t\tif ($marketnum1 == 1 && $marketnum2 == 2) \r\n\t{\r\n\t\t$firstCalc = 'M1toM2';\r\n\t\t\r\n\t} \r\n\t\r\n\telse if ($marketnum1 == 1 && $marketnum2 == 3) \r\n\t{\r\n\t\t$firstCalc = 'M1toM3';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 1 && $marketnum2 == 4) \r\n\t{\r\n\t\t$firstCalc = 'M1toM4';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 2 && $marketnum2 == 1) \r\n\t{\r\n\t\t$firstCalc = 'M2toM1';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 2 && $marketnum2 == 3) \r\n\t{\r\n\t\t$firstCalc = 'M2toM3';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 2 && $marketnum2 == 4) \r\n\t{\r\n\t\t$firstCalc = 'M2toM4';\r\n\t\t\r\n\t} \r\n\telse if ($marketnum1 == 3 && $marketnum2 == 1) \r\n\t{\r\n\t\t$firstCalc = 'M3toM1';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 3 && $marketnum2 == 2) \r\n\t{\r\n\t\t$firstCalc = 'M3toM2';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 3 && $marketnum2 == 4) \r\n\t{\r\n\t\t$firstCalc = 'M3toM4';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 4 && $marketnum2 == 1) \r\n\t{\r\n\t\t$firstCalc = 'M4toM1';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 4 && $marketnum2 == 2) \r\n\t{\r\n\t\t$firstCalc = 'M4toM2';\t\t\r\n\t}\r\n\telse if ($marketnum1 == 4 && $marketnum2 == 3) \r\n\t{\r\n\t\t$firstCalc = 'M4toM3';\t\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t//put all variables into tempvars\r\n\t//check to see if a first market exist\r\n\t//if not were done. \r\n\tif ($masterIndex[$indexNumber][$master1code] != \"NULL\")\r\n\t{\r\n\t\t//Create a master1currcode for easy access.\r\n\t\t$Master1CurrCode = $masterIndex[$indexNumber][$master1code];\r\n\t\t//Create Martet1code for this variable\r\n\t\t$tSlaveMarketcode1 = $masterIndex[$indexNumber][$market1code];\r\n\t\t//if we pass this marker\r\n\t\t//we have atleast two markets for this currency.\r\n\t\tif ($masterIndex[$indexNumber][$master2code] != \"NULL\")\r\n\t\t\t{\t\r\n\t\t\t//get the master2currcode\r\n\t\t\t$Master2CurrCode = $masterIndex[$indexNumber][$master2code];\r\n\t\t\t//get masketCurrency2\r\n\t\t\t$tSlaveMarketcode2 = $masterIndex[$indexNumber][$market2code];\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//find master1currcode last trade value\r\n\t\t\t$SlaveValueInMarket1 = GetLastTrade($tSlaveMarketcode1, $TempPoll);\r\n\t\t\t$SlaveValueInMarket2 = GetLastTrade($tSlaveMarketcode2, $TempPoll);\r\n\r\n\r\n\r\n\t\t\t//Mission: Get second market currency code\r\n\t\t\t$masterSlaveMASTERIndex = getMasterIndex($Master2CurrCode);\r\n\t\t\t$masterSlaveValue;\r\n\t\t\t//create var for secondary market code \r\n\t\t\t$MSMarketCode; \r\n\t\t\t$didwegetamatch = 0; //if set to one we recieved a match in our search for a second market\r\n\t\t\t\r\n\t\t\t//check to see whether it is traded in the same market as our slave currency \r\n\t\t\tfor ($p = 1; $p < 5; $p++) \r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t//if a master currency of our master-slave currnecy matches our slave currency's master currency\r\n\t\t\t\t//insert it into $MSMarketCode so we can look up its last trade value.\r\n\t\t\t\tif ($masterSlaveMASTERIndex['Master' . $p . 'code'] == $masterIndex[$indexNumber][$master1code]) \r\n\t\t\t\t\t{ \r\n\t\t\t\t\t$MSMarketCode = $masterIndex[$indexNumber][$market1code];\r\n\t\t\t\t\t$p = 5;\r\n\t\t\t\t\t$didwegetamatch = 1;\r\n\t\t\t\t\t}\r\n\t\t\t}//end for loop\r\n\t\t\t//if it does exist, get its last trade value within that market.\r\n\t\t\tif ($didwegetamatch == 1) { \r\n\t //get the value of the masterslave currency within the first market\r\n\t\t\t$masterSlaveValue = GetLastTrade($MSMarketCode, $TempPoll);\r\n\t\t\t}\r\n\r\n\t\t\t//how many slave currencies can we buy with one master slave currency. \r\n\t\t\t//lets find out. \r\n\t\t\t//Divide M1-MasterSlaveValue by M1-CurrValue \r\n\t\t\t//Get SlavePerSlave Value\r\n\t\t\t$amountperCurr1M = $masterSlaveValue / $SlaveValueInMarket1;\r\n\t\t\t \t//Divide 1 by lasttradevalue\r\n\t\t\t$amountperCurr2M = 1 / $SlaveValueInMarket2;\r\n\t\t\t\r\n\t\t\t$firstMarketAdvantageValue = $amountperCurr1M - $amountperCurr2M;\r\n\t\t\t$firstMarketAdvantagePercentage = $firstMarketAdvantageValue / $amountperCurr2M;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tUpdateM2MAtPoll($masterIndex[$indexNumber]['LongName'],$TempPoll, $firstCalc,\t$firstMarketAdvantagePercentage);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\r\n\t}\r\n\t}\r\n}", "function calculateAUDFX6($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] AUDFX6 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $audusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $audusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getPairPriceHandle($response, $first_currency, $second_currency)\n {\n $response = json_decode($response, true);\n\n if (isset($response['error_code'])) {\n return null;\n }\n\n return (float) $response['ticker']['last'];\n }", "public function getStock();", "function getSMA_sub_real ($company, $from=\"1900-01-01 00:00:00\", $to=null, \n\t\t\t\t\t$dataorg=\"json\", $samplePeriod=15, $enSignals=false,\n\t\t\t\t\t$host, $db, $user, $pass) {\n\t\t$intervalPeriod = $samplePeriod * 1.5;\n\t\t//from date has to be adjusted for the bollinger bands\n\t\t$date = date_create($from);\n\t\tdate_add($date,date_interval_create_from_date_string(\"-$intervalPeriod days\"));\n\t\t$fromAdjusted = date_format($date,\"Y-m-d\");\n\n\t\t$dataOhlc = [];\n\n\t\t//OHLC data format [timestamp,open,high,low,close,volume]\n\t\tif ($dataorg == \"highchart\") {\n\t\t\t$dataOhlc = getOHLC ($company, $fromAdjusted, $to, \"array2\", $host, $db, $user, $pass);\n\t\t} else {\n\t\t\t$dataOhlc = getOHLC ($company, $fromAdjusted, $to, \"array\", $host, $db, $user, $pass);\n\t\t}\n\n\t\t//Return if $dataOhlc is null\n\t\tif ( ($dataOhlc == []) || ($dataOhlc == 0) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t//Input for SMA functions should be [timestamp,close]\n\t\t$ctr = 0;\n\t\tforeach ((array)$dataOhlc as $ohlc) {\n\t\t\t$dbreturn[$ctr][0] = $ohlc[0];\t//timestamp\n\t\t\t$dbreturn[$ctr++][1] = $ohlc[4];\t//close\n\t\t}\n\n\t\treturn $dbreturn;\n\t}", "function calculateEverything($symbolSpecificData,$noOfDays){\n $calculationResults = array();\n $closingPrices = array();\n $volumes = array();\n $candleHeight = array();\n $candleBody = array();\n $change=array();\n $percentageChange=array();\n $closingPrices20 = array();\n $count=0;\n for($i=1;$i<sizeof($symbolSpecificData);$i++){\n $prevclose=$symbolSpecificData[$i-1]['close'];\n $closingPrices[] = $symbolSpecificData[$i]['close'];\n $volumes[] = $symbolSpecificData[$i]['volume'];\n $candleBodies[] = abs($symbolSpecificData[$i]['close']-$symbolSpecificData[$i]['open']);\n $candleHeights[] =abs($symbolSpecificData[$i]['high']-$symbolSpecificData[$i]['low']);\n $candleType = getCandleType($symbolSpecificData[$i]['open'],$symbolSpecificData[$i]['high'],$symbolSpecificData[$i]['low'],$symbolSpecificData[$i]['close']);\n $change = round($symbolSpecificData[$i]['close']-$prevclose,2);\n $changePercent=calculateChangePercent($symbolSpecificData[$i]['close'],$prevclose);\n if($i>=50){\n $ma20= calculateAverage(array_slice($closingPrices, -20));\n $ma50= calculateAverage(array_slice($closingPrices, -50));\n $avgVol= calculateAverage(array_slice($volumes, -50));\n $avgCandleBody=calculateAverage(array_slice($candleBodies, -50));\n $avgCandleHeight=calculateAverage(array_slice($candleHeights, -50));\n $calculationResults[] = createCalculationsArray($symbolSpecificData[$i]['symbol'],$symbolSpecificData[$i]['recorddate'],$symbolSpecificData[$i]['open'],$symbolSpecificData[$i]['high'],$symbolSpecificData[$i]['low'],$symbolSpecificData[$i]['close'],$prevclose,$symbolSpecificData[$i]['volume'],$candleBodies[$i-1],$candleHeights[$i-1],$candleType,$change,$changePercent,$avgVol,$ma20,$ma50,$avgCandleBody,$avgCandleHeight);\n }\n }\n return $calculationResults;\n}", "public function strategy_sma_stoch($data, $indicator = false)\n {\n $smoothness = config('dbot.type.sma');\n\n /* Get latest price */\n $price = array_pop($data['close']);\n\n $sma = @array_pop(trader_sma($data['close'], 150)) ?? 0;\n $stoch = trader_stoch($data['high'], $data['low'], $data['close'], 14, 3, $smoothness, 3, $smoothness);\n $slowk = @array_pop($stoch[0]);\n $slowd = @array_pop($stoch[1]);\n\n $return = [\n 'strategy' => 'sma_stoch',\n 'price' => $price,\n 'sma' => $sma,\n 'slowk' => $slowk ?? 0,\n 'slowd' => $slowd ?? 0,\n 'side' => '',\n 'state' => 0,\n ];\n\n if ($slowk < 30) {\n $slowkColor = 'green';\n } elseif ($slowk > 70) {\n $slowkColor = 'red';\n } else {\n $slowkColor = 'white';\n } // if\n\n $return['colors'] = [\n 'sma' => $price > $sma ? 'green' : 'red',\n 'slowk' => $slowkColor,\n 'slowd' => $slowk > $slowd ? 'green' : 'red',\n ];\n\n if ($price > $sma && $slowk < 30 && $slowk > $slowd) {\n $return['side'] = 'long';\n $return['state'] = 1;\n return ($indicator ? 1 : $return);\n } // if\n\n if ($price < $sma && $slowk > 70 && $slowk < $slowd) {\n $return['side'] = 'short';\n $return['state'] = -1;\n return ($indicator ? -1 : $return);\n } // if\n\n return ($indicator ? 0 : $return);\n }", "function getLitecoinPrice()\r\n{\r\n\t // Fetch the current rate from MtGox\r\n\t$ch = curl_init('https://mtgox.com/api/0/data/ticker.php');\r\n\tcurl_setopt($ch, CURLOPT_REFERER, 'Mozilla/5.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')');\r\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"CakeScript/0.1\");\r\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n\t$mtgoxjson = curl_exec($ch);\r\n\tcurl_close($ch);\r\n\r\n\t// Decode from an object to array\r\n\t$output_mtgox = json_decode($mtgoxjson);\r\n\t$output_mtgox_1 = get_object_vars($output_mtgox);\r\n\t$mtgox_array = get_object_vars($output_mtgox_1['ticker']);\r\n\r\n\techo '\r\n\t\t\t<ul>\r\n\t\t\t<li><strong>Last:</strong>&nbsp;&nbsp;', $mtgox_array['last'], '</li>\r\n\t\t\t<li><strong>High:</strong>&nbsp;', $mtgox_array['high'], '</li>\r\n\t\t\t<li><strong>Low:</strong>&nbsp;&nbsp;', $mtgox_array['low'], '</li>\r\n\t\t\t<li><strong>Avg:</strong>&nbsp;&nbsp;&nbsp;', $mtgox_array['avg'], '</li>\r\n\t\t\t<li><strong>Vol:</strong>&nbsp;&nbsp;&nbsp;&nbsp;', $mtgox_array['vol'], '</li>\r\n\t\t\t</ul>';\r\n}", "public function getPairPriceHandle($response, $first_currency, $second_currency)\n {\n $response = json_decode($response, true);\n\n if (!$response || !is_array($response)) {\n return null;\n }\n\n return (float) $response['ticker']['last'];\n }", "public function handle() {\n\t\t$curl = curl_init();\n\t\tcurl_setopt_array($curl, array(\n\t\t CURLOPT_URL => config('app.opskins_api_url') . \"/IPricing/GetAllLowestListPrices/v1/?appid=1912\",\n\t\t CURLOPT_RETURNTRANSFER => true,\n\t\t CURLOPT_FOLLOWLOCATION => true,\n\t\t CURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t 'authorization: Basic ' . base64_encode(config('app.opskins_api_key') . ':'),\n\t\t )\n\t\t));\n\t\t$lowest_data = curl_exec($curl);\n\t\t$lowest_err = curl_error($curl);\n\t\t#print_r(curl_getinfo($curl));\n\t\tcurl_close($curl);\n\t\t$lowest_data = json_decode($lowest_data, true);\n\n\t\t// now we get the price list\n\t\t$curl = curl_init();\n\t\tcurl_setopt_array($curl, array(\n\t\t CURLOPT_URL => config('app.opskins_api_url') . \"/IPricing/GetPriceList/v2/?appid=1912\",\n\t\t CURLOPT_RETURNTRANSFER => true,\n\t\t CURLOPT_FOLLOWLOCATION => true,\n\t\t CURLOPT_CUSTOMREQUEST => \"GET\"\n\t\t));\n\t\t$price_data = curl_exec($curl);\n\t\t$price_err = curl_error($curl);\n\t\t#print_r(curl_getinfo($curl));\n\t\tcurl_close($curl);\n\t\t$price_data = json_decode($price_data, true);\n\n\t\tif ($price_data['status'] == 1) {\n\t\t\tif ($price_data['time'] < 1000) {\n\t\t\t\t$price_data['time'] = strtotime(date(\"Ymd\"));\n\t\t\t}\n\t\t\tforeach ($price_data['response'] as $name => $data) {\n\t\t\t\t$skip = 0;\n\n\t\t\t\tif (empty($name)) {\n\t\t\t\t\t$skip = 1;\n\t\t\t\t}\n\n\t\t\t\tif ($skip == 0) {\n\t\t\t\t\t$data = array_slice($data, -7, 7, true);\n\n\t\t\t\t\t$means = array();\n\t\t\t\t\t$total = 0;\n\t\t\t\t\tforeach ($data as $day) {\n\t\t\t\t\t\t$total = $total + $day['normalized_mean'];\n\t\t\t\t\t\t$means[] = $day['normalized_mean'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$means = self::remove_outliers($means, 1);\n\n\t\t\t\t\t$total = 0;\n\t\t\t\t\tforeach ($means as $mean) {\n\t\t\t\t\t\t$total += $mean;\n\t\t\t\t\t}\n\n\t\t\t\t\t$price = $total / count($means);\n\n\t\t\t\t\t// compare with lowest listed, if lower then use it\n\t\t\t\t\tif($lowest_data['status'] == 1 && array_key_exists($name, $lowest_data['response'])) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t$lowest_data['response'][$name]['price'] > 0\n\t\t\t\t\t\t\t&& $lowest_data['response'][$name]['price'] < $price\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$price = $lowest_data['response'][$name]['price'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($price < 2) {\n\t\t\t\t\t\t$price = 2;\n\t\t\t\t\t}\n\n\t\t\t\t\t// uncomment this if we're storing as decimal\n\t\t\t\t\t$price = number_format($price / 100, 2, '.', '');\n\n\t\t\t\t\tDB::table('item_index')\n\t\t\t ->where('name', $name)\n\t\t\t ->update(['suggested_price' => $price]);\n\t\t\t\t\t\n\t\t\t\t\techo $name . \" - $\" . $price . \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t \n }\n }", "function calculateEURFX6($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURFX6 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $eurusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/1000), 1/6) * $eurusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function get_market_price($cianId) {\n\n\t$price = 0;\n\t$cnt = 0;\n\t$accuracy = 0;\n\n\t//--------------------------------\n\t//Точность зависит от кол-ва транзакций и как далеко мы уточнили критерии поиска (до дома квартиры и тд)\n\n\t//1 ищем тип квартиры такой же как и у нашей. выоводим ср. цену рыночную и кол-во сделок\n\t//точность = 50%\n\t//цена = средняя цена\n\t//<0 (может быть студия). Возврат прошлого результата (все по нулям)\n\n\t//добавляем в запрос еще и улицу. \n\t//< 0 сделок возврат ПРОШЛОГО результата \n\t//==1. точность 70%. Цена = средняя цена\n\t//>1. точность 80%. Цена = средняя цена\n\t\n\t//Добавляем дом.\n\t//< 0 сделок - возврат прошлого результата\n\t//==1. точность 90%. Цена = средняя цена.\n\t//>1. Точность 100%. цена = средняя цена\n\t//--------------------------------\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId}\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.type: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse {\n\t\t$price = $data['price'];\n\t\t$accuracy = 50;\n\t}\n\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 70;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 80;\n\t}\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street and cg.house=mrk.house\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street + house: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 90;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 100;\n\t}\n\n\n\n\n\treturn [\n\t\t'price' => $price,\n\t\t'accuracy' => $accuracy\n\t];\n}", "public static function trade_close_all($pair) {\n\t\t\tif (! self::valid($trades = self::trade_pair($pair)))\n\t\t\t\treturn $trades;\n\n\t\t\t$result = (object) array('trades' => array());\n\t\t\tforeach ($trades->trades as $trade)\n\t\t\t\tif (isset($trade->id))\n\t\t\t\t\t$result->trades[] = self::trade_close($trade->id);\n\t\t\treturn $result;\n\t\t}", "function updateMain ($api, $unixTime, $folioArray, $moduleName, $interval, $quickExt) {\n\t$pairCount = count($folioArray)-2; // last entry is USD\n\n\t$intervalSec = $interval*60;\n\t$intervalSec2 = $intervalSec*2;\n\n\t$date = date('Y-m-d', $unixTime);\n\n\t$since = $unixTime-5400;\n\n\t$compareTime = $unixTime-$intervalSec;\n\n\tif ($quickExt['updateTime']<$compareTime) { //check total update status\n\t\t$pairsUpdated = $quickExt['pairIndex'];\n\t\t$updateTime = 0;\n\n\t\tif ($pairsUpdated+2>=$pairCount) {\n\t\t\t$updateTarget = $pairCount;\n\t\t} else {\n\t\t\t$updateTarget = $pairsUpdated+2;\n\t\t}\n\n\t\tfor ($i=$pairsUpdated; $i<=$updateTarget; $i++) { //for every pair, check time of latest indic row\n\t\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\t\tprint ('mew');\n\t\t\t}\n\t\t\t$currentUpdate = 0;\n\n\t\t\t$pairName = $folioArray[$i]['pairSymbol'];\n\t\t\t$currentFile = $moduleName.'-'.$pairName.'-';\n\n\t\t\t$filepath = 'indic/' . $currentFile . 'emaSet.json';\n\t\t\t$emaSet = file_get_contents($filepath);\n\t\t\t$emaSet = json_decode($emaSet, true);\n\n\t\t\t$compareTime = $unixTime-$intervalSec2;\n\t\t\tif ($emaSet[count($emaSet)-1]['time']>=$compareTime){\n\t\t\t\t$pairsUpdated +=1;\n\t\t\t\t$currentUpdate = 1;\n\t\t\t\t$quickExt['pairIndex'] = $pairsUpdated;\n\t\t\t\t$updateTime = $emaSet[count($emaSet)-1]['time'];\n\t\t\t\tprint_r ($pairName.'-update not needed<br>');\n\t\t\t}\n\t\t\tif ($currentUpdate==0){ // If current pair isn't update, run update functions\n\t\t\t\t$updateTime = updateFunctions ($api, $folioArray, $i, $interval, $date, $since, $unixTime, $intervalSec, $moduleName);\n\t\t\t\tif ($updateTime!=null) {\n\t\t\t\t\t$pairsUpdated +=1;\n\t\t\t\t\t$quickExt['pairIndex'] = $pairsUpdated;\n\n\t\t\t\t\t$filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index\n\t\t\t\t\tfile_put_contents($filepath, json_encode($quickExt));\n\t\t\t\t\tprint ('updateRan ');\n\t\t\t\t} else {\n\t\t\t\t\texit ('error');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset ($emaSet);\n\t\t\tif (is_int($i/3)){\n\t\t\t\tusleep(330000); // sleep for 1/3 of a second\n\t\t\t}\n\t\t}\n\t}\n\tif ($quickExt['pairIndex']==$pairCount+1){\n\t\t$quickExt['updateTime'] = $updateTime;\n\t\t$quickExt['pairIndex'] = 0;\n\t\tprint ('<br>'.$quickExt['updateTime'].'..'.$pairsUpdated.'..</br>');\n\n\t\t$filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index\n\t\tfile_put_contents($filepath, json_encode($quickExt));\n\t}\n\n}", "private function _request()\n {\n if (!$this->history) {\n $file = 'http://download.finance.yahoo.com/d/quotes.csv?s=' . $this->symbol . '&f=' . $this->_convertStat($this->stat) . '=.csv';\n } elseif (is_array($this->history)) {\n \n //Make sure they aren't trying to use multiple stocks. Unsupported as of 11-5-14.\t\n if (strstr($this->symbol, \"+\")) {\n trigger_error(\"This method is not supported by the Yahoo! Finance API. You cannot select a date range AND multiple stocks.\");\n return;\n }\n \n $this->history['start'] = isset($this->history['start']) ? $this->history['start'] : '1-1-' . (date('Y') - 1);\n $start = explode('-', $this->history['start']); // dd-mm-yyyy\n $a = $start[0] - 1; // Month\n $b = $start[1]; // Day\n $c = $start[2]; // Year\n \n $this->history['end'] = isset($this->history['end']) ? $this->history['end'] : '12-31-' . date('Y');\n $end = explode('-', $this->history['end']); // dd-mm-yyyy\n $d = $end[0] - 1; // Month\n $e = $end[1]; // Day\n $f = $end[2]; // Year\n \n $g = isset($this->history['interval']) ? $this->history['interval'] : 'd'; // d = Daily, w = Weekly, m = Monthly\n \n $file = 'http://ichart.yahoo.com/table.csv?s=' . $this->symbol . '&a=' . $a . '&b=' . $b . '&c=' . $c . '&d=' . $d . '&e=' . $e . '&f=' . $f . '&g=' . $g . '&ignore=.csv';\n }\n \n $handle = fopen($file, \"r\");\n if (!$this->history) {\n while (($data = fgetcsv($handle, false, \",\")) !== FALSE) {\n $return[] = $data;\n } //Loop through and store each item in an indice\n \n } elseif (is_array($this->history)) {\n $return = array();\n $row = 0;\n while (($data = fgetcsv($handle, false, ',')) !== FALSE) {\n $num = count($data);\n $return[$this->symbol][$row] = array();\n for ($c = 0; $c < $num; $c++) {\n switch ($c) {\n case 0:\n $key = 'date';\n break;\n case 1:\n $key = 'open';\n break;\n case 2:\n $key = 'high';\n break;\n case 3:\n $key = 'low';\n break;\n case 4:\n $key = 'close';\n break;\n case 5:\n $key = 'volume';\n break;\n case 6:\n $key = 'adj_close';\n break;\n }\n $return[$this->symbol][$row][$key] = $data[$c];\n }\n $row++;\n } //end while\n \n }\n \n fclose($handle);\n return $return;\n }", "public function getData($symbol = '', $stat = '')\n {\n \n if (is_array($this->symbol)) {\n $symbol = implode(\"+\", $this->symbol); //The Yahoo! API will take multiple symbols\n }\n \n if ($symbol)\n $this->_setParam('symbol', $symbol);\n if ($stat)\n $this->_setParam('stat', $stat);\n \n $data = $this->_request();\n \n if (!$this->history) {\n if ($this->stat === 'all') {\n foreach ($data as $item) {\n \n //Add to $return[$symbol] array. Indice 23 is the symbol.\n $return[$item[23]] = array(\n 'price' => strip_tags($item[0]),\n 'change' => strip_tags($item[1]),\n 'volume' => strip_tags($item[2]),\n 'avg_daily_volume' => strip_tags($item[3]),\n 'stock_exchange' => strip_tags($item[4]),\n 'market_cap' => strip_tags($item[5]),\n 'book_value' => strip_tags($item[6]),\n 'ebitda' => strip_tags($item[7]),\n 'dividend_per_share' => strip_tags($item[8]),\n 'dividend_yield' => strip_tags($item[9]),\n 'earnings_per_share' => strip_tags($item[10]),\n 'fiftytwo_week_high' => strip_tags($item[11]),\n 'fiftytwo_week_low' => strip_tags($item[12]),\n 'fiftyday_moving_avg' => strip_tags($item[13]),\n 'twohundredday_moving_avg' => strip_tags($item[14]),\n 'price_earnings_ratio' => strip_tags($item[15]),\n 'price_earnings_growth_ratio' => strip_tags($item[16]),\n 'price_sales_ratio' => strip_tags($item[17]),\n 'price_book_ratio' => strip_tags($item[18]),\n 'short_ratio' => strip_tags($item[19]),\n 'name' => strip_tags($item[20])\n );\n }\n } else {\n foreach ($data as $item)\n $return[] = array(\n $this->stat => $item\n );\n }\n } elseif (is_array($this->history)) {\n $return = $data;\n }\n \n return $return;\n }", "function calculateUSDX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] USDX '.$shortDate);\n\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDSEK = $data['USDSEK']['bars'];\n $index = [];\n\n foreach ($EURUSD as $i => $bar) {\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdsek = $USDSEK[$i]['open'];\n $open = 50.14348112\n * pow($usdcad/100000, 0.091) * pow($usdchf/100000, 0.036) * pow($usdjpy/1000, 0.136) * pow($usdsek/100000, 0.042)\n / pow($eurusd/100000, 0.576) / pow($gbpusd/100000, 0.119);\n $iOpen = (int) round($open * 1000);\n\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdsek = $USDSEK[$i]['close'];\n $close = 50.14348112\n * pow($usdcad/100000, 0.091) * pow($usdchf/100000, 0.036) * pow($usdjpy/1000, 0.136) * pow($usdsek/100000, 0.042)\n / pow($eurusd/100000, 0.576) / pow($gbpusd/100000, 0.119);\n $iClose = (int) round($close * 1000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function calculateNOKFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] NOKFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDNOK = $data['USDNOK']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdnok = $USDNOK[$i]['open'];\n $open = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdnok * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdnok = $USDNOK[$i]['close'];\n $close = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdnok * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getTickerPrice($symbol = NULL);", "function stock_array() {\n\t\t$row = 0;\n\t\t$stock_array = array();\n\t\t\t\t\n\t\tif ($handle = fopen(STOCK_CSV, \"r\")) {\n\t\t\t while ($data = fgetcsv($handle, 1000, \",\")) {\n\t\t\t\t$new_tick = array();\n\t\t\t\tif ($row != 0) {\n\t\t\t\t\t$new_tick['ticker'] = $data[0];\n\t\t\t\t\t$new_tick['name'] = $data[1];\n\t\t\t\t\t$new_tick['exchange'] = $data[2];\n\t\t\t\t\t\n\t\t\t\t\tarray_push($stock_array, $new_tick);\n\t\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t }\n\t\t\t fclose($handle);\n\t\t\t}\n\t\telse {\n\t\t\techo \"Could not open file\";\n\t\t\t}\n\t\treturn $stock_array;\n\t}", "public function ticker(string $symbol) : array;", "function calculateJPYLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] JPYLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = 100 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdjpy * 1000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = 100 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdjpy * 1000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function haeHistoria($nimi, $fm, $fd, $fy, $tm, $td, $ty, $interval){\n\t$static = '&ignore=.csv';\t\n\n\t$url = \"http://ichart.yahoo.com/table.csv?s=\".$nimi.'&a'.'='.$fm.'&b'.'='.$fd.'&c'.'='.$fy.'&d'.'='.$tm.'&e'.'='.$td.'&f'.'='.$ty.'&g'.'='.$interval.$static;\t\n\t//print_r ($url);\n\t$arr = array();\n\t$taulu = array();\n\t$i=0;\n\t$file = @fopen($url, \"r\");\t\t\n\twhile(! feof($file))\n\t{\t\t\n\t\t$taulu = (@fgetcsv($file));\t\n\t\t$arr[] = ($taulu[4]);\n\t}\n\treturn ($arr);\n@fclose($file);\n\t}", "function calculateUSDLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] USDLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7);\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7);\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getContractOpenInterest($symbol): array\n {\n $params = [\n \"symbol\" => $symbol,\n ];\n return self::$cloudClient->request(CloudConst::API_CONTRACT_OPEN_INTEREST_URL, CloudConst::GET, $params);\n }", "function createCalculationsArray($symbol,$recorddate,$open,$high,$low,$close,$prevclose,$volume,$candleBody,$candleHeight,$candleType,$change,$changePercent,$avgVol,$ma20,$ma50,$avgCandleBody,$avgCandleHeight){\n return array('symbol' => $symbol,\n 'recorddate' => $recorddate,\n 'open' => $open,\n 'high' => $high,\n 'low' => $low,\n 'close' => $close,\n 'prevclose' => $prevclose,\n 'volume' => $volume,\n 'candleBody' => $candleBody,\n 'candleHeight' => $candleHeight,\n 'candleType' => $candleType,\n 'change'=>$change,\n 'changePercent'=>$changePercent,\n 'avgVol'=>$avgVol,\n 'ma20'=>$ma20,\n 'ma50'=>$ma50,\n 'avgCandleBody'=>$avgCandleBody,\n 'avgCandleHeight'=>$avgCandleHeight\n );\n}", "public function getTicker24hr($symbol = NULL);", "function calculateAUDFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] AUDFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd), 1/7) * $audusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$eurusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd), 1/7) * $audusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function calculateGBPLFX($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] GBPLFX '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $gbpusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $gbpusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getTickerBookTicker($symbol = NULL);", "function calculatePercentLow($previousClose, $low)\n{\n\n}", "function get_gainers(){\r\n $string=\"SELECT * from nse group by TICKER\";\r\n\r\n $result=mysqli_query($GLOBALS['conn'],$string);\r\n $ticker=array();\r\n $current=array();\r\n $chance=array();\r\n $array=array();\r\n $count=0;\r\n while($row=mysqli_fetch_array($result)){\r\n\r\n $chance1=($row['CURRENT']-$row['PREV CLOSE'])/$row['PREV CLOSE']*100;\r\n $chance1=round($chance1,2);\r\n array_push($array,array($row['TICKER'],$row['CURRENT'],$chance1));\r\n\r\n $count=$count+1;\r\n\r\n }\r\n\r\n\r\n\r\n array_sort_by_column($array,'2');\r\n\r\n\r\n\r\n for($i=0;$i<6;$i++){\r\n echo \"<div style='display:flex;' id='stock_gain'>\";\r\n for($j=0;$j<3;$j++){\r\n if($j==0){\r\n $id='ticker';\r\n }\r\n else if($j==1){\r\n $id='current';\r\n }\r\n else{\r\n $id='chance';\r\n }\r\n\r\n echo \"<div id=\".$id.\"> \".$array[$i][$j].\" </div><br>\";\r\n }\r\n echo \"<i class='material-icons'>arrow_drop_up</i></div>\";\r\n }\r\n}", "public function getOpenOrders($symbol = NULL, $recvWindow = NULL);", "public function getPairsTicker($pairs) {\n\t\treturn $this->makePublicMethod( self::PUBLIC_METHOD_TICKER, $pairs);\n\t}", "function buyPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price) {\n\t$filename = $moduleName. '-'. $folioEntry['pairSymbol'].'-';\n\n\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n global $exchange;\n $price = getPrice ($api, $exchange, $pairSymbol);\n\n\tif (!isset($price)) {\n\t\tprint ('no price');\n\t}\n\n\n\t// Buy if lower than threshold\n\tif ($currentPercent>1 && $ohlcOld[$lastKey]['close']>$emaSet[$lastKey]['priceEMAMed'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent']-$currentPercent;\n\t\t$dev = round($dev*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy-$toBuy*0.004; // fee and drift\n\t\t$newAveragePrice = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toBuy * $price;\n\t\t$newAveragePrice = $newAveragePrice/($main[$mainEntry]['quantity'] + $toBuy);\n\t\t$newAveragePrice = round($newAveragePrice,5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] +=$toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought');\n\t}\n\n\t// Re-buy if preveiously sold all. Only dumpable ones apply.\n\n\tif ($currentPercent<=1 && $ohlcOld[$lastKey]['close']<$ohlcOld[$lastKey-1]['close'] && $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent'];\n\t\t$dev = $dev*$totalValue/100;\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy- $toBuy*0.004; // fee and drift\n\n\t\t$main[$mainEntry]['quantity'] = $toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $price;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought from zero');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n}", "function get_inverter_data() {\n\t$context = stream_context_create(array(\n\t\t\t'http' => array(\n\t\t\t\t\t'header' => \"Authorization: Basic \" . base64_encode(\"pvserver:pvwr\"))));\n\t$data = file_get_contents('http://inverter.fritz.box', false, $context);\n\n\t$search_string = '<td width=\"70\" align=\"right\" bgcolor=\"#FFFFFF\">';\n\t$sl = strlen($search_string);\n\n\t/* Locate fields in order current, total, totalDaily */\n\t$cur_pos = strpos($data, $search_string, 0) + $sl;\n\t$total_pos = strpos($data, $search_string, $cur_pos+1) + $sl;\n\t$total_daily_pos = strpos($data, $search_string, $total_pos+1) + $sl;\n\n\t/* echo \"${cur_pos}, ${total_pos}, ${total_daily_pos}\"; */\n\n\t$cur = get_field($data, $cur_pos);\n\tif (strpos($cur, ' x x') != FALSE)\n\t\t$cur = 0;\n\t$total = get_field($data, $total_pos);\n\t$total_daily = get_field($data, $total_daily_pos);\n\t\n\t/* Next are: string voltage 1(V), L1(V), string 1 current (A), L1 power(W), string 2 voltage (V), L2(V), string 2 current (A) */\n\t/* Aim is to calculate DC input and thereby efficiency */\n\t$s1_v_pos = strpos($data, $search_string, $total_daily_pos+1) + $sl;\n\t$l1_v_pos = strpos($data, $search_string, $s1_v_pos+1) + $sl;\n\t$s1_a_pos = strpos($data, $search_string, $l1_v_pos+1) + $sl;\n\t$l1_w_pos = strpos($data, $search_string, $s1_a_pos+1) + $sl;\n\t$s2_v_pos = strpos($data, $search_string, $l1_w_pos+1) + $sl;\n\t$l2_v_pos = strpos($data, $search_string, $s2_v_pos+1) + $sl;\n\t$s2_a_pos = strpos($data, $search_string, $l2_v_pos+1) + $sl;\n\t\n\t$s1_v = get_field($data, $s1_v_pos);\n\t$s1_a = get_field($data, $s1_a_pos);\n\t$s2_v = get_field($data, $s2_v_pos);\n\t$s2_a = get_field($data, $s2_a_pos);\n\t\n\tif ($cur == 0) {\n\t\t$dc = 0;\n\t\t$eff = 0;\n\t} else {\n\t\t$dc = $s1_v * $s1_a + $s2_v * $s2_a;\n\t\t$eff = round (100.0 * $cur / $dc, 1);\n\t}\n\t\n\t/* echo \"${s1_v} ${s1_a} ${s2_v} ${s2_a} .. ${dc} .. ${eff}\\n\"; */\n\t\n\n\treturn join(\",\", array($cur, $total_daily, $total, $eff));\n}", "public function get_historical_prices($start_date,$end_date,$period) {\n\t\tlist($month_from, $day_from, $year_from) = explode('-',$start_date);\n\t\tlist($month_to, $day_to, $year_to) = explode('-',$end_date);\n\t\t\n\t\t$month_from -= 1;\n\t\t$month_to -= 1;\n\t\t\n\t\t$url = \"http://ichart.yahoo.com/table.csv?s={$this->ticker}&a={$month_from}&b={$day_from}&c={$year_from}&d={$month_to}&e={$day_to}&f={$year_to}&g={$period}&ignore=.csv\";\n\n\t\tif ($file = fopen($url,\"r\")){\n\t\t\t$row = 0;\n\t\t\t$hist_data = array();\n\t\t\twhile ($data = fgetcsv($file,200,\",\")) {\n\t\t\t\tif ($row != 0) {\n\t\t\t\t\t$daily = array();\n\t\t\t\t\t$daily[\"Date\"] = $data[0];\n\t\t\t\t\t$daily[\"Open\"] = $data[1];\n\t\t\t\t\t$daily[\"High\"] = $data[2];\n\t\t\t\t\t$daily[\"Low\"] = $data[3];\n\t\t\t\t\t$daily[\"Close\"] = $data[4];\n\t\t\t\t\t$daily[\"Volume\"] = $data[5];\n\t\t\t\t\t$daily[\"Adj Close\"] = $data[6];\n\t\t\t\t\t\n\t\t\t\t\tarray_push($hist_data, $daily);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$row++;\n\t\t\t\t}\n\t\t\tfclose($file);\n\t\t\t}\n\t\telse {\n\t\t\t//echo \"Error opening the file for $this->ticker.<br />\";\n\t\t\t$hist_data = '';\n\t\t\t}\n\n\t\treturn $hist_data;\t\n\t\t}", "function computeMarket($obj, $socket_id, $channel_id, $_DATA)\n{\n $dp=$this->dp;\n $script=\"\";\n\n$slider = $_DATA['objId'];\n$ses = $_DATA['ses'];\n\n\n$q= \"SELECT max( SUBT ) FROM `imk_MF` WHERE session=$ses\";\n$dp->setQuery($q);\n$total_phases = $dp->loadResult();\n\n\n$q= \"SELECT fdate,securities,HELLENIC_MARKET_NAME FROM imk_imarket_cfg,imk_IA WHERE id=$ses AND market=MARKET_ID\";\n$dp->setQuery($q);\n$dp->loadObject($row);\n\n$fdate = $row->fdate;\n$date_ar=explode(\"-\",$fdate);\n$fdate=implode($date_ar);\n\n$secs = $row->securities;\n$sec_r=explode(\",\",$secs);\n\n$str_secs=\"\";\n\nforeach($sec_r as $sec)\n{\n if ($str_secs!=\"\")\n $str_secs.=\",\";\n $str_secs.=\"'\".$sec.\"'\";\n }\n$market_name = $row->HELLENIC_MARKET_NAME;\n\n$q= \"SELECT ISIN_CODE,START_OF_DAY_PRICE FROM imk_II WHERE ISIN_CODE IN ($str_secs) LIMIT 0,\".count($sec_r);\n\n$dp->setQuery($q);\n$secs_price = $dp->loadObjectList();\nforeach($secs_price as $sec_price)\n{\n $price=$sec_price->START_OF_DAY_PRICE;\n $script.= \"isinAr[\\\"\".$sec_price->ISIN_CODE.\"\\\"].push(\".((int)$price / pow(10,2)).\");\";\n }\n\n$q= \"SELECT ID,ISIN_CODE,OASIS_TIME,END_TIME,PHASE,SUBT,PTOTAL,OPEN_CMNT FROM `imk_MF` WHERE ISIN_CODE IN ($str_secs) ORDER BY ID\";\n$dp->setQuery($q);\n$rows = $dp->loadObjectList();\n$n=0;\n$ar=array();\n$font_size=1;\n$width=1;\n//$scale_factor=280/$total_phases;\n//$char_size=imagefontwidth($font_size)*1;\n$cur_isin=\"\";\n\nforeach($rows as $row){\n\t\t//if ($row->OPEN_CMNT =='N')\n\t\t // continue;\n\t\t if ($row->ISIN_CODE != $cur_isin)\n\t\t {\n\t\t if ( $cur_isin!=\"\") {\n\t\t \t\t//print \"mkt_secs=\".timeDiff(substr($start_time,0,6),substr($ar[count($ar)-1][1],0,6)).\";\";\n\t\t\t\t$seconds = $this->timeDiff(substr($start_time,0,6),substr($ar[count($ar)-1][1],0,6));\n\t\t\t\t$script.= \"isinAr[\\\"\".$cur_isin.\"\\\"].push($seconds);\";\n\t\t\t\t}\n\t\t $cur_isin=$row->ISIN_CODE;\n\t\t $start_time=$row->OASIS_TIME;\n\t\t }\n\t\t \n\t\t$ar[$row->ID]=array($row->OASIS_TIME, $row->END_TIME, $this->timeDiff(substr($row->OASIS_TIME,0,6),substr($row->END_TIME,0,6)), $row->PHASE, $row->PTOTAL);\n\t\t$text.= $row->PHASE;\n\t\t$text2.= $row->OASIS_TIME;\n\t\t$time_len=imagefontwidth($font_size)*strlen($row->OASIS_TIME);\n\t\t//$width2=round(($row->PTOTAL*$scale_factor)/$char_size);\n\t\t//$width2-=$time_len;\n\t\t//$width=round(($row->PTOTAL*$scale_factor)/$char_size);\n//print \"sf=\".$scale_factor. \"; PTOTAL=\".$row->PTOTAL.\"; W=\".$width.\"; Cs=\".$char_size.\";\"; \n\t\t//for ($i=0;$i<$width;$i++)\n\t\t//\t$text.=' ';\n\t\t//for ($i=0;$i<$width2;$i++)\n\t\t//\t$text2.=' ';\n\t\t//$len=imagefontwidth($font_size)*$width;\n\t\t}\n\n $seconds = $this->timeDiff(substr($start_time,0,6),substr($row->END_TIME,0,6));\n $script.= \"isinAr[\\\"\".$row->ISIN_CODE.\"\\\"].push($seconds);\";\n\n $q= \"SELECT SECURITY_ISIN, count( SECURITY_ISIN ) as TOT FROM imk_IS WHERE TRADE_DATE='$fdate' AND SECURITY_ISIN IN ($str_secs) GROUP BY SECURITY_ISIN\";\n $dp->setQuery($q);\n $total_trades = $dp->loadObjectList();\n foreach($total_trades as $total_trade)\n {\n $tot=$total_trade->TOT;\n $script.= \"isinAr[\\\"\".$total_trade->SECURITY_ISIN.\"\\\"].push($tot);\";\n }\n\n foreach ($ar as $ar_num => $phases)\n {\n $script.= \"phasesAr[$ar_num]=[];\";\n foreach ($phases as $phases_num => $phase)\n\t{ \t \n\t $script.= \"phasesAr[$ar_num].push(\\\"$phase\\\" );\"; // This line updates the script array with new entry\n\t }\n }\t \n\n $script.= \"market_name='$market_name';\";\n \n $obj->write($socket_id, $channel_id, $script);\n}", "function getCryptoLivePrice(){\n \n //$url = \"https://api.coinmarketcap.com/v1/ticker/ethereum/\";\n $url = \"https://api.coinmarketcap.com/v2/ticker/?limit=10&structure=array\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 60);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n $data = curl_exec($ch);\n $transaction = json_decode($data, TRUE);\n curl_close($ch);\n \n //BTC\n $btcUsdPrice = 0;\n $cryptoSymbol_1 = isset($transaction['data'][0]['symbol'])?$transaction['data'][0]['symbol']:'';\n \n if($cryptoSymbol_1==\"BTC\"){\n $btcUsdPrice = isset($transaction['data'][0]['quotes']['USD']['price'])?$transaction['data'][0]['quotes']['USD']['price']:0;\n }\n //ETH\n $ethUsdPrice = 0;\n $cryptoSymbol_2 = isset($transaction['data'][1]['symbol'])?$transaction['data'][1]['symbol']:'';\n if($cryptoSymbol_2==\"ETH\"){\n $ethUsdPrice = isset($transaction['data'][1]['quotes']['USD']['price'])?$transaction['data'][1]['quotes']['USD']['price']:0;\n }\n //LTC\n $ltcUsdPrice = 0;\n $cryptoSymbol_3 = isset($transaction['data'][5]['symbol'])?$transaction['data'][5]['symbol']:'';\n if($cryptoSymbol_3==\"LTC\"){\n $ltcUsdPrice = isset($transaction['data'][5]['quotes']['USD']['price'])?$transaction['data'][5]['quotes']['USD']['price']:0;\n } \n \n return ['eth_price_usd'=>$ethUsdPrice,'btc_price_usd'=>$btcUsdPrice,'ltc_price_usd'=>$ltcUsdPrice];\n}", "public static function candles($pair, $gran, $rest = null) {\n\n\t\t\t//Defaults for $rest\n\t\t\t$rest = is_array($rest) ? $rest : array('count' => 1);\n\n\t\t\t//If we passed an array with no start time, then choose one candle\n\t\t\tif (!isset($rest['count']) && !isset($rest['start']))\n\t\t\t\t$rest['count'] = 1;\n\n\t\t\t//Setup stamdard options\n\t\t\t$candleOptions = array(\n 'candleFormat' => 'midpoint',\n 'instrument' => $pair,\n 'granularity' => strtoupper($gran)\n );\n\n\t\t\t//Check for rest processing\n\t\t\tif (is_array($rest))\n\t\t\t\tforeach ($rest as $key => $value)\n\t\t\t\t\t$candleOptions[$key] = $value;\n\n\t\t\t//Check the object\n\t\t\treturn (self::valid($candles = self::get('candles', $candleOptions))) ?\n self::candles_times_to_seconds($candles) : $candles;\n\t\t}", "function getRates($currencies){\n $response=array();\n $json = file_get_contents('https://blockchain.info/ticker');\n $result = json_decode($json, true);\n foreach ($currencies as $currency) {\n $response[$currency]=$result[$currency]['last'];\n }\n return $response;\n}", "public static function trade_pair($pair, $number=50) {\n\t\t\treturn self::get(self::trade_index(), array('instrument' => $pair, 'count' => $number));\n\t\t}", "function calculateCADFX6($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CADFX6 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdchf/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * 100, 1/6) / $usdcad * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdchf/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * 100, 1/6) / $usdcad * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function handle()\n {\n $this->info('Start save ohlcv for top 100 ' . date('H:i:s d-m-Y'));\n // get ids from 100\n // save historical data for 100 with convert value USD\n $interval = !empty($this->option('interval')) ? $this->option('interval') : 'hourly';\n $timePeriod = !empty($this->option('time_period')) ? $this->option('time_period') : 'hourly';\n\n if ($interval == 'hourly') {\n $allCrypts = TopCryptocurrency::select('cryptocurrency_coin_id as id', 'cryptocurrency_id')->limit(100)->get();\n } else {\n $allCrypts = Cryptocurrency::select('id', 'cryptocurrency_id')->get();\n }\n $query['interval'] = $interval;\n $query['time_period'] = $timePeriod;\n $convert = self::DEFAULT_COINS_QUOTES_SYMBOL;\n $timeEnd = !empty($this->option('time_end')) ? date('Y-m-d 23:59:59',\n strtotime($this->option('time_end'))) : date('Y-m-d 23:59:59', strtotime(\"-1 day\"));\n $timeStart = !empty($this->option('time_start')) ? date('Y-m-d 23:59:59',\n strtotime($this->option('time_start'))) : date('Y-m-d H:i:s', strtotime($timeEnd . \"-1 day\"));\n $query['time_end'] = $timeEnd;\n $query['time_start'] = $timeStart;\n $service = new CurrencyOhlcvService();\n $quote = Cryptocurrency::where('symbol', $convert)->first();\n\n foreach ($allCrypts as $currency) {\n if (!$quote) {\n return false;\n }\n\n $quoteId = $quote->cryptocurrency_id;\n $result = $service->getCryptoCurrencyOhlcvApiData($currency->id, '', $timePeriod, $interval, $timeEnd,\n $timeStart, $convert);\n if (!empty($result['status']) && $result['status']['error_code'] == 0) {\n $service->saveCryptoCurrencyOhlcvData($result['data']['quotes'], self::INTERVAL_MODELS[$interval],\n $currency->cryptocurrency_id, $quoteId, $convert);\n $this->info('Done for ' . $result['data']['symbol'] . ' / ' . $convert);\n\n } else {\n if (!empty($result['status'])) {\n $this->info('cryptocurrency_id ' . $currency->cryptocurrency_id . ' ' . $result['status']['error_message']);\n Log::info($this->description . ' fails for pair ' . $currency->cryptocurrency_id . ' / ' . $convert . ' ' . $result['status']['error_message']);\n }\n }\n $microSec = 1000000;\n if (((int)date('i') == 0) || ((int)date('i') == 2)) {\n $timeSleep = 2.8;\n }else{\n $timeSleep = 1.2;\n }\n usleep($timeSleep * $microSec);\n\n }\n $sleep = new SleepService;\n\n $this->info('finish ' . $interval . ' save ohlcv for top 100 ' . date('H:i:s d-m-Y'));\n\n if ($interval === 'hourly' && $timePeriod === 'hourly') {\n sleep($sleep->intervalSleep('everyHour'));\n } elseif ($interval === 'daily' && $timePeriod === 'daily') {\n sleep($sleep->intervalSleepEveryDayByTime(Config::get('commands_sleep.cryptocurrency_historical_daily')));\n }\n }", "function getCurrentTicker( $id){\n\t\n\n\tif($id == 1) //Bitstamp\n\t{\n\t\t$url = BITSTAMP_GET_TICKER;\n\t}\n\t\n\t\n\t/*\n\t$tempTicker = _get($url);\n\t\n\t$tempTicker = json_decode($tempTicker[0]);\n\t\n\t$a = new stdClass();\n\t\n\t$a->high = number_format($tempTicker->high,2);\n\t$a->last = number_format($tempTicker->last,2);\n\t$a->bid = number_format($tempTicker->bid,2);\n\t$a->volume = $tempTicker->volume;\n\t$a->low = number_format($tempTicker->low,2);\n\t$a->ask = number_format($tempTicker->ask,2);\n\t\n\t$t = new Ticker($a, $id);\n\tgetPreviousTicker($previous, $id, $currency = \"btc\");\n\tupdateTrend($t, $previous);\n\t\n\t//$ticker[] = $t;\n\treturn $t;\n\t * */\n}", "function calculateEURFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] EURFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $eurusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$gbpusd) * ($usdjpy/$nzdusd) * 100, 1/7) * $eurusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public static function ticker(){\n\t\t\t$request = new Request('https://blockchain.info');\n\t\t\t$ticker = $request -> makeRequest('GET', '/ticker');\n\t\t\treturn $ticker['USD']['15m'];\n\t\t}", "function SchedullerPO(){\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Cek --> Update PO List, Update Quantity PO Open\n\t\t// echo \"hahah\";\t\t\n\t\trequire_once APPPATH.'third_party/sapclasses/sap.php';\n\t\t$sap = new SAPConnection();\n\t\t$sap->Connect(APPPATH.\"third_party/sapclasses/logon_dataDev.conf\");\n\t\tif ($sap->GetStatus() == SAPRFC_OK ) $sap->Open ();\n\t\tif ($sap->GetStatus() != SAPRFC_OK ) {\n\t\t\techo $sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\n\t\t$fce = &$sap->NewFunction (\"Z_ZCMM_VMI_PO_DETAILC\");\n\t\t\n\t\tif ($fce == false) {\n\t\t\t$sap->PrintStatus();\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$start \t= date(\"20170101\");\t\t\t\t\t// Date start VMI apps\n\t\t$end \t= date(\"Ymd\");\t\t\t\t\t\t// Date Now\n\t\t$opco\t\t\t\t\t= '7000';\n\t\t$fce->COMPANY \t\t\t= \"$opco\";\t\t// BUKRS\n\t\t// $fce->PO_TYPE \t\t= 'ZK17';\n\t\t// $fce->VENDOR \t\t= ;\n\t\t$fce->DATE['SIGN'] \t= 'I';\n\t\t$fce->DATE['OPTION']\t= 'BT';\n\t\t$fce->DATE['LOW'] \t= $start;\n\t\t$fce->DATE['HIGH'] \t= $end;\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK10';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\n\t\t$fce->PO_TYPE->row['SIGN'] \t= 'I';\n\t\t$fce->PO_TYPE->row['OPTION'] \t= 'EQ';\n\t\t$fce->PO_TYPE->row['LOW'] \t= 'ZK17';\n\t\t$fce->PO_TYPE->row['HIGH'] \t= '';\n\t\t$fce->PO_TYPE->Append($fce->PO_TYPE->row);\n\t\t\t\n $fce->call();\n\n if ($fce->GetStatus() == SAPRFC_OK) {\n $fce->T_ITEM->Reset();\n $data=array();\n $empty=0;\n $tampildata=array();\n while ($fce->T_ITEM->Next()) {\n\t\t\t\t$matnr \t\t= $fce->T_ITEM->row[\"MATNR\"];\t// Kode Material\n\t\t\t\t$lifnr \t\t= $fce->T_ITEM->row[\"LIFNR\"];\t// Kode Vendor\n\t\t\t\t$ebeln \t\t= $fce->T_ITEM->row[\"EBELN\"];\t// No PO\n\t\t\t\t$menge \t\t= intval($fce->T_ITEM->row[\"MENGE\"]);\t// Quantity PO\n\t\t\t\t$sisaqty\t= intval($fce->T_ITEM->row[\"DELIV_QTY\"]);\t// Quantity PO Open\n\t\t\t\t$werks \t\t= $fce->T_ITEM->row[\"WERKS\"];\t// Plant\n\t\t\t\t$vendor\t\t= $fce->T_ITEM->row[\"VENDNAME\"];\t// Nama Vendor\n\t\t\t\t$material \t= $fce->T_ITEM->row[\"MAKTX\"];\t// Nama Material\n\t\t\t\t$potype \t= $fce->T_ITEM->row[\"BSART\"];\t// Type PO\n\t\t\t\t// $mins \t\t= $fce->T_ITEM->row[\"EISBE\"];\t// Safety Stock\n\t\t\t\t$mins \t\t= $fce->T_ITEM->row[\"MINBE\"];\t// Re Order Point\n\t\t\t\t$maxs \t\t= $fce->T_ITEM->row[\"MABST\"];\t// Max\n\t\t\t\t$statuspo\t= $fce->T_ITEM->row[\"ELIKZ\"];\t// Max\n\t\t\t\t$start \t\t= date_format(date_create($fce->T_ITEM->row[\"BEDAT\"]),'d M Y');\n\t\t\t\t$end \t\t= date_format(date_create($fce->T_ITEM->row[\"EINDT\"]),'d M Y');\n\t\t\t\t\n\t\t\t\tif($statuspo == 'X' || $statuspo == 'x')\n\t\t\t\t{\n\t\t\t\t\t$sts = 0;\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$sts = 1;\n\t\t\t\t}\n\t\t\t\t$sqlread= \"SELECT count(id_list) ADA\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t$jum \t= $this->db->query($sqlread)->row();\n\t\t\t\t$nilai \t= $jum->ADA;\n\t\t\t\t// echo $nilai.\"->\".$matnr.\" | \".$lifnr.\" | \".$ebeln.\" | \".$menge.\" | \".$werks.\" | \".$vendor.\" | \".$material.\" | \".$start.\" | \".$end.\" ==> \".$potype.\"<br/>\";\n\t\t\t\t// $ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\")\n\t\t\t\t\n\t\t\t\tif($nilai < 1){\n\t\t\t\t\tif($ebeln == \"6310000038\" || $ebeln == \"6310000039\" || $ebeln == \"6310000040\" || $ebeln == \"6310000041\" || $ebeln == \"6310000042\" || $ebeln == \"6310000043\"\n\t\t\t\t\t\t|| $lifnr == \"0000113004\" || $lifnr == \"0000110091\" || $lifnr == \"0000110253\" || $lifnr == \"0000110015\" || $lifnr == \"0000112369\" || $lifnr == \"0000110016\"){\t\t\t\t\t\t\n\t\t\t\t\t\t$sqlcount \t= \"SELECT max(ID_LIST) MAXX FROM VMI_MASTER\";\n\t\t\t\t\t\t$maxid \t\t= $this->db->query($sqlcount)->row();\t\t\n\t\t\t\t\t\t$max_list \t= $maxid->MAXX+1;\n\t\t\t\t\t\t$insert\t\t= \"insert into VMI_MASTER(ID_LIST,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPLANT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_MATERIAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUNIT,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tKODE_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNAMA_VENDOR,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNO_PO,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tPO_ITEM,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_ACTIVE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tCONTRACT_END,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tDOC_DATE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSLOC,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMIN_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMAX_STOCK,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_AWAL,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTOCK_VMI,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tQUANTITY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tID_COMPANY,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS)\n\t\t\t\t\t\t\t\t\t\t\t\tvalues('$max_list',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$werks',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$matnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$material',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MEINS\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$lifnr',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$vendor',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$ebeln',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EBELP\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($end),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTO_DATE('\".date_format(date_create($start),'Y-m-d').\"','YYYY-MM-DD'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"LGORT\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"EISBE\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'\".$fce->T_ITEM->row[\"MABST\"].\"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'0',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$opco',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\";\n\t\t\t\t\t\t$save \t= $this->db->query($insert);\n\t\t\t\t\t\techo \"Baru ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco | $werks | $potype<br/>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($nilai >= 1){\n\t\t\t\t\t$sqlread1 = \"SELECT ID_LIST\n\t\t\t\t\t\t\tFROM VMI_MASTER \n\t\t\t\t\t\t\twhere NO_PO = '$ebeln' and\n\t\t\t\t\t\t\tKODE_MATERIAL = '$matnr' and \n\t\t\t\t\t\t\tKODE_VENDOR = '$lifnr' and\n\t\t\t\t\t\t\tPLANT = '$werks' \n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t//and QUANTITY = '$menge'\n\t\t\t\t\t$getlist= $this->db->query($sqlread1)->row();\n\t\t\t\t\t$idlist = $getlist->ID_LIST;\n\t\t\t\t\t$update\t\t= \"update VMI_MASTER set quantity = '$sisaqty',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin_stock = '$mins',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmax_stock = '$maxs',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSTATUS = '$sts'\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere ID_LIST = '$idlist'\n\t\t\t\t\t\t\t\t\";\n\t\t\t\t\t$update_data\t= $this->db->query($update);\n\t\t\t\t\t\techo \"$update <br/>\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\techo \"Skip ==> $ebeln | $material | $vendor | $opco| $werks | $potype<br/>\";\n\t\t\t\t}\n\t\t\t\t// echo \"<hr/>\"; \n\t\t\t}\n\t\t// echo \"<pre>\";\n\t\t// print_r($fce);\n\t\t// echo \"hahaha\";\n $fce->Close();\n\t\t}\n }", "function installHistory ($api, $moduleName, $folioArray, $installTime) {\n\n\t$pairSymbols = array_column ($folioArray, 'pairSymbol');\n\tarray_pop ($pairSymbols);\n\n\t$pairsString = implode(\", \",$pairSymbols);\n\n global $exchange;\n $ticker = getTicker ($api, $exchange, $folioArray);\n\n\t$pairCount = count($folioArray)-1;\n\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\t$pairSymbol = $folioArray[$i]['pairSymbol'];\n\t\t$coinSymbol = $folioArray[$i]['coinSymbol'];\n\n\t\t/*\n\t\tif (isset($balance['result'][$coinSymbol])) {\n\t\t\t$quantity = $balance['result'][$coinSymbol];\n\t\t\tsettype($quantity,'float');\n\t\t} else {\n\t\t\t$quantity = 0;\n\t\t}\n\t\t*/\n\n\t\tif ($i<$pairCount) {\n\t\t\t$price = $ticker[$i];\n\t\t\tsettype ($price, 'float');\n\t\t} else {\n\t\t\t$price = 1;\n\t\t}\n\n\t\t$quantity = round($folioArray[$i]['targetPercent']/$price*10, 5, PHP_ROUND_HALF_UP);\n\n\n\t\t$main[$i] = array ('pairSymbol'=>$pairSymbol, 'coinSymbol'=> $coinSymbol, 'targetPercent'=>$folioArray[$i]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>$price, 'startQuantity'=>$quantity);\n\n\t\t$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\n\t\t$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t$filename = $moduleName. '-'. $folioArray[$i]['pairSymbol'].'-';\n\t\t$filepath = '' . $filename . 'history.json';\n\t\tfile_put_contents($filepath, json_encode($history));\n\t}\n\n\n\t$quantity = $folioArray[$pairCount]['targetPercent']*10;\n\t$main[] = array ('pairSymbol'=>'ZUSD', 'coinSymbol'=>'ZUSD','targetPercent'=>$folioArray[$pairCount]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>1, 'startQuantity'=>$quantity);\n\t$filename = $moduleName. '-';\n\t$filepath = '' . $filename . 'main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\n\t$quickExt = array ('lastPosInt'=>$installTime, 'pairIndex'=>0, 'updateTime'=>$installTime, 'indicCurrent'=>'current');\n\t$filepath = '' . $filename . 'QuickExt.json';\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\n\t$ledgerTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\n\t$ledger = array ('ledger'=>null, 'totals'=>$ledgerTotals);\n\n\t$filepath = '' . $moduleName . '-ledger.json';\n\tfile_put_contents($filepath, json_encode($ledger));\n}", "function intRate($type=null){\n\t\tglobal $driver;\n if($type==2){\n return 11.1;\n }else{\n $sql =\t\"SELECT interestrate FROM settings\"; //Retrieve the interest rate\n if($results\t= $driver->perform_request($sql)):\n $row\t= $driver->load_data($results,MYSQL_ASSOC);\n $interest = ($row['interestrate']>0)?($row['interestrate']):20;\n else:\n die('<p class=\"error\">Interest rate Error: '.mysql_error().'</p>');\n endif;\n return $interest; //The interest rate\n }\n}", "function calculateNZDLFX($day, array $data, $name='NZDLFX') {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] '.$name.' '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $nzdusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) * $nzdusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function dbotStochAdx(array $data)\n {\n $stochastic = $this->indicators->dbotStochastic($data, 14, 3, 3, 14, 3);\n $adx = $this->indicators->dbotAdx($data, 10);\n\n if ($stochastic == 1 && $adx == 1) {\n return 1;\n } elseif ($stochastic == -1 && $adx == 1) {\n return -1;\n } // if\n return 0;\n }", "function calculateGBPFX6($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] GBPFX6 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/1000), 1/6) * $gbpusd;\n $iOpen = (int) round($open);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/1000), 1/6) * $gbpusd;\n $iClose = (int) round($close);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function updateTicker()\n {\n \n $val = $this->mtgox->getTicker();\n \n $arr = [\"value\"=>\"\", \"value_int\"=>\"\", \"display\"=>\"\", \"currency\"=>\"\"];\n \n $defs = [\n \"high\" => $arr,\n \"low\" => $arr,\n \"avg\" => $arr,\n \"vwap\" => $arr,\n \"vol\" => $arr,\n \"last_all\" => $arr,\n \"last_local\" => $arr,\n \"last_orig\" => $arr,\n \"last\" => $arr,\n \"buy\" => $arr,\n \"sell\" => $arr,\n ];\n \n $val = array_merge($defs, $val);\n \n $this->insert($val);\n \n $this->setPercentChange();\n \n $this->tickerPear();\n }", "function calculateCHFFX6($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CHFFX6 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * 100, 1/6) / $usdchf * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * 100, 1/6) / $usdchf * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function getOpen( $store, $dayInput ) {\n\t\t$result = false;\n\t\tforeach ( $this->getStoreOpenings( $store ) as $day => $openings ) {\n\t\t\tif( $day === $dayInput ) {\n\t\t\t\t$amount = count( $openings );\n\t\t\t\t$now = time();\n//\t\t\t\t$now = strtotime( '12:31' ); // debug\n\t\t\t\t// Has open today?\n\t\t\t\tif( $amount === 0 ) return $result;\n\t\t\t\tif ( $amount > 2 ) {\n\t\t\t\t\t// we have more than one open and close time\n\t\t\t\t\tif( $now >= strtotime( $openings[0] ) && $now <= strtotime( $openings[1] ) ) {\n\t\t\t\t\t\t$result = $openings[0] . ' - ' . $openings[1] . '<br />' . $openings[2] . ' - ' . $openings[3];\n\t\t\t\t\t} else if( $now >= strtotime( $openings[2] ) && $now <= strtotime( $openings[3] ) ) {\n\t\t\t\t\t\t$result = $openings[2] . ' - ' . $openings[3];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunset( $this->dataOut[ $store ] );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// only one open and close times\n\t\t\t\t\t// is now between open and close \n\t\t\t\t\tif( $now >= strtotime( $openings[0] ) && $now <= strtotime( $openings[1] ) ) {\n\t\t\t\t\t\t$result = $openings[0] . ' - ' . $openings[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunset( $this->dataOut[ $store ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // wrong day\n\t\t}\n\t\t// set new object data\n\t\tif( $result ) {\n\t\t\t$this->dataOut[ $store ] = $this->data[ $store ];\n\t\t\t$this->dataOut[ $store ]->geöffnet = $result;\n\t\t}\n\t\t$this->setTotal( count($this->dataOut) );\n\t\treturn $result;\n\t}", "public function getExchangeRate();", "public function handle(Binance $binance)\n {\n\n\n $markets = Market::all();;\n foreach ($markets as $m) {\n // dd($m);\n $symbol = $m->symbol_id;\n $params = [\n 'symbol' => $symbol,\n 'interval' => '1M',\n 'limit' => 6\n ];\n $markets = $binance->klines($params);\n $max = collect($markets)->max(2);\n\n\n MaxPrice::firstOrCreate(\n ['symbol' => $symbol],\n ['symbol' => $symbol, 'value' => $max]\n );\n }\n\n // $maxPrice->value = $max\n\n\n\n return 0;\n }", "function getCryptoDailyPricesForCryptoAndFiatWithDateRangeWithAutoAmountForIdenticalPairMembers($cryptoCurrency, $cryptoCurrencyAssetTypeID, $fiatCurrency, $fiatCurrencyAssetTypeID, $testDate, $endingDate, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\terrorLog(\"getCryptoDailyPricesForCryptoAndFiatWithDateRangeWithAutoAmountForIdenticalPairMembers($cryptoCurrency, $cryptoCurrencyAssetTypeID, $fiatCurrency, $fiatCurrencyAssetTypeID, $testDate, $endingDate, $globalCurrentDate, $sid\", $GLOBALS['debugCoreFunctionality']);\n\t\t\n\t\t$responseObject\t\t\t\t\t\t\t\t\t= array();\n\t\t$responseObject['pulledData']\t\t\t\t\t= false;\n\t\t\n/*\n\t\tif ($cryptoCurrencyAssetTypeID == 0 || $fiatCurrencyAssetTypeID == 0)\n\t\t{\n\t\t\terrorLog(\"ERROR: one or more assets is type 0: $cryptoCurrency, $cryptoCurrencyAssetTypeID, $fiatCurrency, $fiatCurrencyAssetTypeID\");\n\t\t\treturn $responseObject;\t\n\t\t}\n*/\n\t\t\n\t\ttry\n \t{\n\t\t\t$createDailyCryptoPriceRecord\t\t\t\t= $dbh->prepare(\"REPLACE DailyCryptoSpotPrices\n(\n\tFK_CryptoAssetID,\n\tFK_FiatCurrencyAssetID,\n\tpriceDate,\n\tfiatCurrencySpotPrice\n)\nVALUES\n(\n\t:FK_CryptoAssetID,\n\t:FK_FiatCurrencyAssetID,\n\t:priceDate,\n\t:fiatCurrencySpotPrice\n)\");\n\n\t\t\twhile ($testDate < $endingDate)\n\t\t\t{\n\t\t\t\t$formattedTestDate\t\t\t\t\t\t= date_format($testDate, \"Y-m-d\");\n\t\t\t\t\n\t\t\t\terrorLog($formattedTestDate);\n\t\t\t\t\n\t\t\t\terrorLog(\"https://api.coinbase.com/v2/prices/$cryptoCurrency-$fiatCurrency/spot?date=$formattedTestDate\");\n\t\t\t\t\n\t\t\t\tif ($cryptoCurrencyAssetTypeID == $fiatCurrencyAssetTypeID)\n\t\t\t\t{\n\t\t\t\t\t$responseObject['pulledData']\t\t= true;\n\t\t\t\t\t\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':FK_CryptoAssetID', $cryptoCurrencyAssetTypeID);\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':FK_FiatCurrencyAssetID', $fiatCurrencyAssetTypeID);\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':priceDate', $formattedTestDate);\n\t\t\t\t\t$createDailyCryptoPriceRecord -> bindValue(':fiatCurrencySpotPrice', 1);\n\t\t\t\t\t\t\n\t\t\t\t\tif ($createDailyCryptoPriceRecord -> execute())\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"REPLACE DailyCryptoSpotPrices\n\t(\n\t\tFK_CryptoAssetID,\n\t\tFK_FiatCurrencyAssetID,\n\t\tpriceDate,\n\t\tfiatCurrencySpotPrice\n\t)\n\tVALUES\n\t(\n\t\t$cryptoCurrencyAssetTypeID,\n\t\t$fiatCurrencyAssetTypeID,\n\t\t'$priceDate',\n\t\t$amount\n\t)\");\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ch \t\t\t\t\t\t\t\t\t= curl_init();\n\t\t\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://api.coinbase.com/v2/prices/$cryptoCurrency-$fiatCurrency/spot?date=$formattedTestDate\");\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\t\n\t\t\t\t\t$headers \t\t\t\t\t\t\t= array();\n\t\t\t\t\t$headers[] \t\t\t\t\t\t\t= \"Content-Type: application/x-www-form-urlencoded\";\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t\t\t\n\t\t\t\t\t$result \t\t\t\t\t\t\t\t= curl_exec($ch);\n\t\t\t\t\t\n\t\t\t\t\tif (curl_errno($ch)) \n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog('Error:' . curl_error($ch));\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$responseObject['pulledData']\t= true;\n\t\t\t\t\t\terrorLog($result);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tcurl_close ($ch);\n\t\t\t\t\t\n\t\t\t\t\t# Get JSON as a string, return empty JSON if nothing returned\n\t\t\t\t\t$jsonObject\t\t\t\t\t\t\t= json_decode($result);\t\n\t\t\t\t\t\n\t\t\t\t\tcleanJSONDailyPriceData($jsonObject, \"data\", $formattedTestDate, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$testDate -> modify('+1 day');\n\t\t\t}\n\t\n\t \t}\n\t \tcatch (Exception $e)\n\t \t{\n\t\t errorLog(\"ERROR: $name not found in JSON object\");\t\n\t \t}\n\t\t\n\t\treturn $responseObject;\t\n\t}", "function calculateCHFFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CHFFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdcad/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * (100000/$nzdusd) * 100, 1/7) / $usdchf * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdcad/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * (100000/$nzdusd) * 100, 1/7) / $usdchf * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "public function histogram($feedid, $time_now, $value)\n {\n \n ///return $value;\n\n $feedname = \"feed_\" . trim($feedid) . \"\";\n $new_kwh = 0;\n // Allocate power values into pots of varying sizes\n if ($value < 500)\n {\n $pot = 50;\n }\n elseif ($value < 2000)\n {\n $pot = 100;\n }\n else\n {\n $pot = 500;\n }\n $new_value = round($value / $pot, 0, PHP_ROUND_HALF_UP) * $pot;\n\n $time = mktime(0, 0, 0, date(\"m\",$time_now), date(\"d\",$time_now), date(\"Y\",$time_now));\n\n // Get the last time\n $lastvalue = $this->feed->get_timevalue($feedid);\n $last_time = strtotime($lastvalue['time']);\n \n // kWh calculation\n if ((time()-$last_time)<7200) {\n $time_elapsed = ($time_now - $last_time);\n $kwh_inc = ($time_elapsed * $value) / 3600000;\n } else {\n $kwh_inc = 0;\n }\n \n // Get last value\n $result = $this->mysqli->query(\"SELECT * FROM $feedname WHERE time = '$time' AND data2 = '$new_value'\");\n\n if (!$result) return $value;\n\n $last_row = $result->fetch_array();\n\n if (!$last_row)\n {\n $result = $this->mysqli->query(\"INSERT INTO $feedname (time,data,data2) VALUES ('$time','0.0','$new_value')\");\n\n $this->feed->set_update_value_redis($feedid, $new_value, $time_now);\n $new_kwh = $kwh_inc;\n }\n else\n {\n $last_kwh = $last_row['data'];\n $new_kwh = $last_kwh + $kwh_inc;\n }\n\n // update kwhd feed\n $this->mysqli->query(\"UPDATE $feedname SET data = '$new_kwh' WHERE time = '$time' AND data2 = '$new_value'\");\n\n $this->feed->set_update_value_redis($feedid, $new_value, $time_now);\n return $value;\n }", "public function advance_invoice_not_issue_fun($highest_value, $i, $object) {\n $tax_adv_no_invoice = array();\n $data_arr_adv_no_invoice = array();\n\n $highest_value_without_GT = $highest_value; // got last value here for if\n\n $char = 'G';\n while ($char !== $highest_value_without_GT) {\n $values[] = $object->getActiveSheet()->getCell($char . $i)->getValue();\n $char++;\n }\n $cnt = count($values);\n// exit;\n//For getting the value for tax inter state \n $data_arr_adv_no_in = array();\n\n for ($a_dr = 0; $a_dr < $cnt; $a_dr++) {\n $Dr_values = $values[$a_dr];\n $data_arr_adv_no_in[] = $values[$a_dr];\n }\n\n $aa1 = array();\n// echo sizeof($values);\n for ($a_dr = 1; $a_dr < $cnt; $a_dr++) {\n\n if ($a_dr % 5 != 0) {\n\n $aa1[] = $values[$a_dr];\n }\n }\n $a1 = (sizeof($aa1));\n $a2 = $a1 % 1;\n $a3 = $a1 - $a2;\n for ($k = 0; $k < ($a3); $k = $k + 4) {\n\n $tax_adv_no_invoice[] = $aa1[$k] + $aa1[$k + 1] + $aa1[$k + 2] + $aa1[$k + 3];\n }\n// $cnt = count($values);\n for ($aa = 0; $aa < $cnt; $aa++) {\n// $data1 = $values[$aa];\n $data_arr_adv_no_invoice[] = $values[$aa];\n $aa = ($aa * 1 + 4);\n }\n// return $tax_inter_state;\n return array($data_arr_adv_no_invoice, $tax_adv_no_invoice);\n }", "public function getCurrencyAndSymbol()\n {\n if($this->custom_checkbox1 == 'y'){\n return array('currency' => 'USD', 'symbol' => '$');\n }\n else if($this->location_1){\n return DBQuery::execute(function(){\n $main = DBConnection::getInstance()->getMain();\n $sql = $main->prepare(\"SELECT currency, symbol FROM Location_1 \"\n . \"WHERE id=:id\");\n $sql->bindParam(':id', $this->location_1);\n $sql->execute();\n return $sql->fetch(\\PDO::FETCH_BOTH);\n });\n }\n else{\n return array('currency' => 'USD', 'symbol' => '$');\n } \n }", "function getLow() { return $this->readLow(); }", "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}", "public function getCurrentPrice($ticker)\n {\n if (!$ticker) {\n return false;\n }\n $uri = env('STOCKS_API');\n $uri .= 'latest_price' . '?ticker=' . $ticker;\n $response = Http::get($uri);\n if (!$response->status() === 200) {\n return false;\n }\n $body = json_decode($response->body());\n return $body->{'1. open'};\n }", "public function getCurrentPriceData() {\n $priceData = new \\stdClass();\n $priceData->ask = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->bid = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->high = $this->rates[$this->rateIndex]['high_mid'];\n $priceData->open = $this->rates[$this->rateIndex]['open_mid'];\n $priceData->low = $this->rates[$this->rateIndex]['low_mid'];\n $priceData->id = $this->rates[$this->rateIndex]['id'];\n $priceData->dateTime = $this->rates[$this->rateIndex]['rate_date_time'];\n $priceData->rateUnixTime = $this->rates[$this->rateIndex]['rate_unix_time'];\n $priceData->instrument = $this->exchange->exchange;\n\n Config::set('bt_rate_time', $this->rates[$this->rateIndex]['rate_unix_time']);\n\n $this->currentPriceData = $priceData;\n }", "function sma($candles) {\n $sma = 0.0;\n $count = count($candles);\n for($i = 0; $i < $count; $i++) {\n $sma += $candles[$i]->get_close();\n }\n return $sma / $count;\n }", "function calculateCADFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] CADFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $NZDUSD = $data['NZDUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $nzdusd = $NZDUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $open = pow(($usdchf/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * (100000/$nzdusd) * 100, 1/7) / $usdcad * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $nzdusd = $NZDUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $close = pow(($usdchf/$audusd) * ($usdjpy/$eurusd) * (100000/$gbpusd) * (100000/$nzdusd) * 100, 1/7) / $usdcad * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function index($input)\n{\n $dataConfig = new DataConfig($input['ticker'], $input['startDate'], $input['startTime'], $input['endDate'], $input['endTime'], $input['timeScale']);\n $connection = new Connection($dataConfig);\n //die($connection->getConnection());\n if(!$connection->getHTML()) {\n return \"Date: {$dataConfig->getStartDate()}, time: {$dataConfig->getStartTime()}, ticker: {$dataConfig->getTicker()}. <b>Result: Error. Page not found</b>\";\n }\n\n $data = new Data($connection->getHTML());\n $signal = new Signal($input['buy'], $input['open'], $input['TP'], $input['SL']);\n\n $signalResult = new SignalResult($data, $signal, $dataConfig);\n\n //check signal and return result\n return $signalResult->checkSignal()->printResult();\n}", "function getCandleType($open,$high,$low,$close){\n //Marubozu :Body greater than 80% of total length of candle\n //Doji : When top shadow is greater than 25% and bottom shadow is also greater than 25% of candle length.\n //Shooting Star : When top shadow is greater than 40% of candle length and body is less than 30% of candle length and body greater than 5% of candle length\n //Hanging Man : When bottom shadow is greater than 40% of candle length and body is less than 30% of candle length and body greater than 5% of candle length\n \n if($close >= $open){\n $topShadow = $high -$close;\n $bottomShadow = $open - $low;\n $body = $close - $open;\n $candleLength = $high - $low;\n }else{\n $topShadow = $high -$open;\n $bottomShadow = $close -$low;\n $body = $open - $close;\n $candleLength = $high - $low;\n }\n \n if(getPercentage($body,$candleLength)>80){\n return 'Marubozu';\n }else if(getPercentage($topShadow,$candleLength)>25 && getPercentage($bottomShadow,$candleLength)>25){\n return 'Doji';\n }else if(getPercentage($topShadow,$candleLength)>40 && getPercentage($body,$candleLength)<30 && getPercentage($body,$candleLength)>5){\n return 'Shooting Star';\n }else if(getPercentage($bottomShadow,$candleLength)>40 && getPercentage($body,$candleLength)<30 && getPercentage($body,$candleLength)>5){\n return 'Hammer';\n }else{\n return 'None';\n }\n}", "function lookup($symbol)\n {\n // reject symbols that start with ^\n if (preg_match(\"/^\\^/\", $symbol))\n {\n return false;\n }\n\n // reject symbols that contain commas\n if (preg_match(\"/,/\", $symbol))\n {\n return false;\n }\n\n // open connection to Yahoo nsl1op snl1&\n //http://download.finance.yahoo.com/d/quotes.csv?f=nsl1op&s=%40%5EDJI,\n $handle = @fopen(\"http://download.finance.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgn&s=$symbol\", \"r\");\n if ($handle === false)\n {\n // trigger (big, orange) error\n /*trigger_error(\"Could not connect to Yahoo!\", E_USER_ERROR);\n exit;*/\n apologize(\"Could not connect to Yahoo! Check your Internet Connection\");\n }\n\n // download first line of CSV file\n $data = fgetcsv($handle);\n if ($data === false || count($data) == 1)\n {\n return false;\n }\n\n // close connection to Yahoo\n fclose($handle);\n\n // ensure symbol was found\n if ($data[2] === \"0.00\")\n {\n return false;\n }\n\n // return stock as an associative array\n return [\n \"symbol\" => $data[0],\n \"name\" => trim($data[8]),\n \"price\" => $data[1],\n \"open\" => $data[5],\n \"high\" => $data[6],\n \"low\" => $data[7],\n \"change\" => $data[4]\n ];\n }", "function calculateSEKFX7($day, array $data) {\n if (!is_int($day)) throw new IllegalTypeException('Illegal type of parameter $day: '.getType($day));\n $shortDate = gmDate('D, d-M-Y', $day);\n\n global $verbose;\n if ($verbose > 1) echoPre('[Info] SEKFX7 '.$shortDate);\n\n $AUDUSD = $data['AUDUSD']['bars'];\n $EURUSD = $data['EURUSD']['bars'];\n $GBPUSD = $data['GBPUSD']['bars'];\n $USDCAD = $data['USDCAD']['bars'];\n $USDCHF = $data['USDCHF']['bars'];\n $USDJPY = $data['USDJPY']['bars'];\n $USDSEK = $data['USDSEK']['bars'];\n $index = [];\n\n foreach ($AUDUSD as $i => $bar) {\n $audusd = $AUDUSD[$i]['open'];\n $eurusd = $EURUSD[$i]['open'];\n $gbpusd = $GBPUSD[$i]['open'];\n $usdcad = $USDCAD[$i]['open'];\n $usdchf = $USDCHF[$i]['open'];\n $usdjpy = $USDJPY[$i]['open'];\n $usdsek = $USDSEK[$i]['open'];\n $open = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdsek * 100000;\n $iOpen = (int) round($open * 100000);\n\n $audusd = $AUDUSD[$i]['close'];\n $eurusd = $EURUSD[$i]['close'];\n $gbpusd = $GBPUSD[$i]['close'];\n $usdcad = $USDCAD[$i]['close'];\n $usdchf = $USDCHF[$i]['close'];\n $usdjpy = $USDJPY[$i]['close'];\n $usdsek = $USDSEK[$i]['close'];\n $close = 10 * pow(($usdcad/$audusd) * ($usdchf/$eurusd) * ($usdjpy/$gbpusd) * 100, 1/7) / $usdsek * 100000;\n $iClose = (int) round($close * 100000);\n\n $index[$i]['time' ] = $bar['time'];\n $index[$i]['open' ] = $iOpen;\n $index[$i]['high' ] = $iOpen > $iClose ? $iOpen : $iClose; // min()/max() ist nicht performant\n $index[$i]['low' ] = $iOpen < $iClose ? $iOpen : $iClose;\n $index[$i]['close'] = $iClose;\n $index[$i]['ticks'] = $iOpen==$iClose ? 1 : (abs($iOpen-$iClose) << 1);\n }\n return $index;\n}", "function get_inventory_onhand($pcservno){\n\t$oConn = get_coneccion(\"CIA\");\n\t$lcsqlcmd = \"SELECT aradjt.cservno,\n\t\t\t\t\t sum(aradjt.nqty) as nqty\n\t\t\t\t FROM aradjm\n\t\t\t\t left outer join aradjt on aradjm.cadjno = aradjt.cadjno\n\t\t\t\t left outer join arserm on arserm.cservno = aradjt.cservno\n\t\t\t\t left outer join arcate on arcate.ccateno = aradjm.ccateno AND arcate.ctypecate = 'A'\n\t\t\t\t where arserm.lupdateonhand = true AND \n\t\t\t\t \t aradjm.lvoid = false and \n\t\t\t\t\t aradjt.cservno = '$pcservno' \n\t\t\t\t group by 1\n\t\t\t\t union all \n\t\t\t\t SELECT arinvt.cservno,\n\t\t\t\t\t\tsum(arinvt.nqty * -1) as nqty\n\t\t\t\tFROM arinvc\n\t\t\t\tLEFT OUTER JOIN arinvt on arinvc.cinvno = arinvt.cinvno\n\t\t\t\tLEFT OUTER JOIN arserm on arserm.cservno = arinvt.cservno\n\t\t\t\tleft outer join artcas on artcas.cpaycode = arinvc.cpaycode\n\t\t\t\twhere arserm.lupdateonhand = true and\n\t\t\t\t\t arinvc.lvoid = false and \n\t\t\t\t\t arinvt.cservno = '$pcservno' \n\t\t\t\tgroup by 1\n\t\t\t\";\t\n\t// determinando cuanto producto queda segun el caso \n\t$lnqty = 0;\n\t$lcresult = mysqli_query($oConn,$lcsqlcmd);\n\twhile($lnrowqty = mysqli_fetch_assoc($lcresult)){\n\t\t$lnqty += $lnrowqty[\"nqty\"];\t\n\t}\n\techo $lnqty;\n\t\n\t/*\t\n\t$lcResult = mysqli_query($oConn,$lcsqlcmd); // $oConn->query($lcSqlCmd);\n\t// convirtiendo estos datos en un array asociativo\n\t$ldata = mysqli_fetch_assoc($lcResult);\n\t// convirtiendo este array en archivo jason.\n\t$jsondata =json_encode($ldata,true);\n\t// retornando objeto json\n\techo $jsondata;\n\t*/\n}", "function island_reversal($candles) {\n echo \"Testing Island Reversal\\n\";\n return $candles[0]->get_open() < 0.97*$candles[1]->get_low();\n }" ]
[ "0.6889895", "0.5771252", "0.56322235", "0.559364", "0.5588228", "0.5384905", "0.537162", "0.5356297", "0.5341666", "0.5331892", "0.5232272", "0.5232272", "0.52055407", "0.5136441", "0.51258624", "0.5108028", "0.50653046", "0.504553", "0.49625245", "0.49538302", "0.49537593", "0.4938344", "0.49375707", "0.49146897", "0.49052757", "0.48817405", "0.48758763", "0.48558694", "0.48514977", "0.48441526", "0.48331758", "0.4829028", "0.48247743", "0.48028907", "0.4795982", "0.4760592", "0.4736804", "0.47331965", "0.47305554", "0.4715324", "0.47124496", "0.47116753", "0.47041807", "0.46911702", "0.46845978", "0.46816045", "0.46734533", "0.46730965", "0.467159", "0.46582356", "0.4654352", "0.46442312", "0.4642095", "0.4636858", "0.4632859", "0.46282616", "0.46276268", "0.4626721", "0.46188512", "0.46171474", "0.46162882", "0.46132174", "0.46117985", "0.45937207", "0.45843512", "0.45800892", "0.4571885", "0.45683292", "0.45588148", "0.45564076", "0.45550928", "0.45439166", "0.4529971", "0.44998488", "0.44918606", "0.4490141", "0.44879958", "0.4484491", "0.44834346", "0.44741714", "0.4470841", "0.44675487", "0.44539756", "0.4452522", "0.44466022", "0.44428214", "0.44347328", "0.44286284", "0.44252717", "0.4423053", "0.44190452", "0.44151688", "0.44134864", "0.44131145", "0.44074583", "0.4406301", "0.44024816", "0.43992892", "0.4396267", "0.43924832" ]
0.5813242
1
gets called by updateMain
function updateFunctions ($api, $folioArray, $targetPair, $interval, $date, $since, $unixTime, $intervalSec, $moduleName) { $ohlc = null; $rowTime = null; $pairName = $folioArray[$targetPair]['pairSymbol']; $currentFile =$moduleName.'-'.$pairName.'-'; $filepath = 'indic/' . $currentFile . 'emaSet.json'; $emaSet = file_get_contents($filepath); $emaSet = json_decode($emaSet, true); end($emaSet); $lastKey = key($emaSet); // update $compareTime = $unixTime-$intervalSec*3; if ($emaSet[$lastKey]['time']<=$compareTime){ //reinstall if too many missing $days = 30; $since = $unixTime-(60*60*24*$days); global $exchange; $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since); if (is_array($ohlc)){ $current = installIndicR($currentFile, $ohlc); $rowTime = $ohlc[count($ohlc)-1]['time']; if ($current!=null) { print ($folioArray[$targetPair]['pairSymbol'].' '.$current.' ok <br>'); } } else { exit ('Error API JSON empty'); } }else { global $exchange; $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since); if (is_array($ohlc)) { $rowTime = $ohlc[count($ohlc)-1]['time']; if ($rowTime > $emaSet[$lastKey]['time']){ indicUPR($currentFile, $emaSet, $ohlc); print ($folioArray[$targetPair]['pairSymbol'].' ok <br>'); } if ($rowTime == $emaSet[$lastKey]['time']){ print ($folioArray[$targetPair]['pairSymbol'].' ok <br>'); } } else { $rowTime = null; } } return $rowTime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n\n\t\t\t}", "function after_update() {}", "function update_start()\n {\n }", "protected function _update()\n\t{\n\t}", "protected function _preupdate() {\n }", "function update_end()\n {\n }", "protected function afterUpdating()\n {\n }", "abstract protected function update ();", "public function after_update() {}", "protected function afterUpdate() {\n\t}", "function startUpdate()\r\n {\r\n $this->_updatecounter++;\r\n }", "protected function afterUpdate()\n {\n }", "protected function afterUpdate()\n {\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function preUpdate()\n {\n }", "public function update() {\n\t\treturn;\n\t}", "protected function update() {}", "public static function update(){\r\n }", "public function runDefaultUpdates()\n {\n }", "abstract protected function needRefresh();", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "protected function _postUpdate()\n\t{\n\t}", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function update()\r\n {\r\n \r\n }", "function update_info()\n {\n }", "function before_update() {}", "public function update() {\r\n\r\n\t}", "private function init()\n\t{\n\t\treturn;\n\t}", "public function update()\n\t{\n\n\t}", "public static function update(){\n }", "function do_undismiss_core_update()\n {\n }", "public function update();", "public function update();", "public function update();", "public function update();", "abstract public function update();", "abstract public function update();", "abstract function update();", "public function update() {\n parent::update();\n }", "protected function beforeUpdating()\n {\n }", "protected function updateHead()\n\t{\n\t}", "public function update() {\r\n }", "public function update() {\n \n }", "protected function _afterInit() {\n\t}", "protected function performUpdate() {}", "public function update()\r\n {\r\n //\r\n }", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "public function update()\n {\n }", "public function updateAnalysis() {\n return;\n }", "function init()\r\n \t{\r\n \t}", "function _maybe_update_core()\n {\n }", "public abstract function update();", "public function preUpdate()\n {\n \t$this->dateFound = new \\DateTime(\"now\");\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public static function Update(){\r\n }", "public function updating()\n {\n # code...\n }", "function endUpdate()\r\n {\r\n $this->_updatecounter--;\r\n // let's just make sure that if the endUpdate() is called too many times\r\n // that the $this->_updatecounter is valid and the font is updated\r\n if ($this->_updatecounter < 0)\r\n {\r\n $this->_updatecounter = 0;\r\n }\r\n // when finished updating call the modified() function to notify the control.\r\n if ($this->_updatecounter == 0)\r\n {\r\n $this->modified();\r\n }\r\n }", "function init() {\n\t\t\n\t}", "private function Reload(){\t\t\t\t\r\n\t $this->valueLatestPeriod();\t \r\n\t $this->prepareGridData(); //ADDING TO OUTPUT\t\t\r\n\t}", "public function updateRootline() {}", "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 }", "function sync() {\n\t\t// TODO\n\t}", "protected function beforeUpdate()\n {\n }", "abstract public function refresh();", "function main_section() {\n\t\t\t\t// GNDN\n\t\t}", "private function updateOperation() {\n sleep(1);\n }", "function initialize() ;", "protected function init()\n\t{\n\t\t\n\t}", "public function setMain(): void;", "public function update () {\n\n }", "public function update(): void\n {\n }", "function refresh();", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "protected function main()\n /**/\n {\n parent::run();\n }", "function init()\n\t{\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "function _setup() \n {\n if (!$this->changed) {\n return;\n }\n\n $this->w = $this->dw = array();\n parent::_setup();\n\n $this->dw = array_reverse($this->dw);\n $w = array_pop($this->w);\n $dw = array_pop($this->dw);\n foreach ($this->w as $r => $wr) {\n foreach ($wr as $c => $wc) {\n $w[] = $wc;\n $dw[] = $this->dw[$r][$c];\n }\n }\n $this->w = $w;\n $this->dw = $dw;\n }", "public function Update() {\n }", "function do_dismiss_core_update()\n {\n }", "public function reinit()\n {\n }", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "function refresh() {\n $missing = array_keys($this->dl + $this->en);\n $this->dl = array();\n $this->en = array();\n $this->visited = array();\n $this->requireModules($missing, '(missing)');\n }", "public function offsetsUpdated() {}", "function core_auto_updates_settings()\n {\n }", "protected function _init(){\n\t\t//Hook called at the beginning of self::run();\n\t}" ]
[ "0.7119174", "0.697152", "0.6737771", "0.66504693", "0.6610527", "0.6555895", "0.65523845", "0.6518774", "0.6506705", "0.6492783", "0.63904524", "0.6382163", "0.6382163", "0.63783115", "0.63783115", "0.6335027", "0.62205553", "0.62111014", "0.6206732", "0.613728", "0.61096805", "0.61045134", "0.61045134", "0.61045134", "0.6084991", "0.6084402", "0.60699946", "0.6038935", "0.60175866", "0.600519", "0.59868425", "0.59853226", "0.5981585", "0.59620214", "0.5943437", "0.5943437", "0.5943437", "0.5943437", "0.5937027", "0.5937027", "0.59341174", "0.59234995", "0.58431", "0.58348835", "0.58188075", "0.58099884", "0.5794667", "0.5785808", "0.5771347", "0.57383174", "0.57383174", "0.57313454", "0.5731107", "0.5723965", "0.5678642", "0.5676681", "0.56595355", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56355906", "0.56241983", "0.56217396", "0.56198967", "0.5614439", "0.5609444", "0.5601727", "0.55960464", "0.5588956", "0.55726194", "0.5572329", "0.55672383", "0.55658084", "0.55634236", "0.5532848", "0.5528738", "0.55267394", "0.55264074", "0.5526384", "0.55245346", "0.55245346", "0.55201757", "0.5512518", "0.55073017", "0.5502356", "0.54867345", "0.54843414", "0.5470998", "0.54653937", "0.5452196", "0.54353297", "0.54322845", "0.54091597" ]
0.0
-1
/ updatemain Checks each pair for updatedness and calls updateFunctions() which in turn calls indicUPR().
function updateMain ($api, $unixTime, $folioArray, $moduleName, $interval, $quickExt) { $pairCount = count($folioArray)-2; // last entry is USD $intervalSec = $interval*60; $intervalSec2 = $intervalSec*2; $date = date('Y-m-d', $unixTime); $since = $unixTime-5400; $compareTime = $unixTime-$intervalSec; if ($quickExt['updateTime']<$compareTime) { //check total update status $pairsUpdated = $quickExt['pairIndex']; $updateTime = 0; if ($pairsUpdated+2>=$pairCount) { $updateTarget = $pairCount; } else { $updateTarget = $pairsUpdated+2; } for ($i=$pairsUpdated; $i<=$updateTarget; $i++) { //for every pair, check time of latest indic row if ($folioArray[$i]['coinSymbol']=='ZUSD') { print ('mew'); } $currentUpdate = 0; $pairName = $folioArray[$i]['pairSymbol']; $currentFile = $moduleName.'-'.$pairName.'-'; $filepath = 'indic/' . $currentFile . 'emaSet.json'; $emaSet = file_get_contents($filepath); $emaSet = json_decode($emaSet, true); $compareTime = $unixTime-$intervalSec2; if ($emaSet[count($emaSet)-1]['time']>=$compareTime){ $pairsUpdated +=1; $currentUpdate = 1; $quickExt['pairIndex'] = $pairsUpdated; $updateTime = $emaSet[count($emaSet)-1]['time']; print_r ($pairName.'-update not needed<br>'); } if ($currentUpdate==0){ // If current pair isn't update, run update functions $updateTime = updateFunctions ($api, $folioArray, $i, $interval, $date, $since, $unixTime, $intervalSec, $moduleName); if ($updateTime!=null) { $pairsUpdated +=1; $quickExt['pairIndex'] = $pairsUpdated; $filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index file_put_contents($filepath, json_encode($quickExt)); print ('updateRan '); } else { exit ('error'); } } unset ($emaSet); if (is_int($i/3)){ usleep(330000); // sleep for 1/3 of a second } } } if ($quickExt['pairIndex']==$pairCount+1){ $quickExt['updateTime'] = $updateTime; $quickExt['pairIndex'] = 0; print ('<br>'.$quickExt['updateTime'].'..'.$pairsUpdated.'..</br>'); $filepath = ''.$moduleName.'-'.'QuickExt.json'; // update pair index file_put_contents($filepath, json_encode($quickExt)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function update();", "abstract protected function update ();", "function updateFunctions ($api, $folioArray, $targetPair, $interval, $date, $since, $unixTime, $intervalSec, $moduleName) {\n\t$ohlc = null;\n\t$rowTime = null;\n\n\t$pairName = $folioArray[$targetPair]['pairSymbol'];\n\n\t$currentFile =$moduleName.'-'.$pairName.'-';\n\n\t$filepath = 'indic/' . $currentFile . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\tend($emaSet);\n\t$lastKey = key($emaSet);\n\n\t// update\n\n\n\t$compareTime = $unixTime-$intervalSec*3;\n\n\tif ($emaSet[$lastKey]['time']<=$compareTime){ //reinstall if too many missing\n\t\t\t$days = 30;\n\t\t\t$since = $unixTime-(60*60*24*$days);\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\t\tif (is_array($ohlc)){\n\t\t\t\t$current = installIndicR($currentFile, $ohlc);\n\t\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\t\t\t\tif ($current!=null) {\n\t\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' '.$current.' ok <br>');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\texit ('Error API JSON empty');\n\t\t\t}\n\n\t}else {\n\n global $exchange;\n $ohlc = getOHLC($api, $exchange, $pairName, $interval, $since);\n\n\t\tif (is_array($ohlc)) {\n\t\t\t$rowTime = $ohlc[count($ohlc)-1]['time'];\n\n\t\t\tif ($rowTime > $emaSet[$lastKey]['time']){\n\t\t\t\tindicUPR($currentFile, $emaSet, $ohlc);\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t\tif ($rowTime == $emaSet[$lastKey]['time']){\n\t\t\t\tprint ($folioArray[$targetPair]['pairSymbol'].' ok <br>');\n\t\t\t}\n\t\t} else {\n\t\t\t$rowTime = null;\n\t\t}\n\t}\n\n\treturn $rowTime;\n}", "abstract public function update();", "abstract public function update();", "static function process_updates($args=array()){\n\n if (empty($_SESSION['bList_vm_reimbursementRates_rates_updated'])) return;\n \n // recalculate travel/subsistence reimbursement estimates\n foreach(array_keys($_SESSION['bList_vm_reimbursementRates_rates_updated']) as $parent_ID){\n b_debug::xxx(\"parent $parent_ID\");\n locateAndInclude('bForm_vm_Expenses');\n bForm_vm_Expenses::_updateEstimates($parent_ID); \n \n \n //\n // Integrate the change of reimbursement policy into Event and/or Ogranization\n //\n if ($parent_ID == myOrg_ID){\n\t$e = Null;\n\t$reimbursementRates = bList::getListInstance(myOrg_ID,'bList_vm_reimbursementRates');\n\t$visit_types = VM_reimbursable_visits();\n }else{\n\t$e = loader::getInstance_new('bForm_vm_Event',$parent_ID,'fatal');\n\t$reimbursementRates = $e->reimbursementRates();\n\t$visit_types = array(VISIT_TYPE_PROGRAM);\n }\n \n // look for updates\n foreach($visit_types as $type){\n\t$was_p = $now_p = array();\n\t$now = $was = VM_visit_policies($type,$e);\n\tforeach($reimbursementRates->get_policies($type) as $policy=>$is_ON){\n\t if ($is_ON && !in_array($policy,$was)) $now[] = $policy;\n\t if(!$is_ON && in_array($policy,$was)) $now = array_diff($now,array($policy));\n\t}\n\t\n\tforeach($was as $p) $was_p[] = x('li',VM::$v_policies[$p]['d']);\n\tb_debug::xxx(strip_tags(join(', ',$was_p)));\n\t\n\t// Are there any changes?\n\tif ($was !== $now){\n\t \n\t // Save the updated policies in the database\n\t sort($now); // kill association\n\t VM_visit_policies($type,$now,$e);\n\t \n\t // Print a message\n\t foreach($now as $p) $now_p[] = x('li',VM::$v_policies[$p]['d']);\n\t \n\t if ($add = array_diff($now_p,$was_p)) $changes[] = \"Added:\".x('ul', join(\"\\n\",$add));\n\t if ($rem = array_diff($was_p,$now_p)) $changes[] = \"Removed:\".x('ul',join(\"\\n\",$rem));\n\t MSG::INFO($changes,VM::$description[$type]['d'].' visits policy is changed for '.$reimbursementRates->title);\n\t}\n }\n }\n unset($_SESSION['bList_vm_reimbursementRates_rates_updated']);\n }", "function updates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['updates'] == 1 ) ? 'Database Update' : 'Database Updates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'reverted' : 'executed';\n\t\t\n\t\tforeach ( $this->xml_array['updates_group']['update'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['new_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $v['old_value'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['old_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['updates']} {$object} {$operation}....\" );\n\t}", "public abstract function update();", "public function update();", "public function update();", "public function update();", "public function update();", "public static function update(){\r\n }", "function update() {\n\n\t\t\t}", "public static function updateAll()\r\n\t{\r\n\t}", "protected function _update()\n\t{\n\t}", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "function complete_update() {\n // Extract the relevant day of the week for which to update link times\n // N.B. php function: 6=Saturday, 7=Sunday, 1=Monday\n // \t postgres function: 6=Saturday, 0=Sunday, 1=Monday\n $dow = date('N',strtotime('yesterday', $this->backup_time)) % 7;\n\n echo \"Deleting stale information\".\"\\n\";\n $this->delete_stale_information($dow);\n echo \"Stale information deleted. Starting to process new average times\".\"\\n\";\n\n for($hod = 0; $hod < 24; $hod++) { // for each hour of the day\n $journey_times = $this->extract_journey_times($dow, $hod);\n $this->insert_into_database($journey_times, $dow, $hod);\n echo \"Update complete for hour \".$hod.\"\\n\";\n }\n }", "public static function update(){\n }", "public function testUpdateAll()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function onUpdate();", "public function onUpdate();", "public function onUpdate();", "public function runDefaultUpdates()\n {\n }", "function after_update() {}", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "protected function update() {}", "public function update()\n\t{\n\n\t}", "function update_vvrecusers() {\n\t\t$updt = $this->query_AS400(\"select * from (select clirs1, clirs2,clizk6 from pgmcomet/cophycli where stgrp='1' and stdos='399')a inner join (select * from vvbase/vvrecusers )b on upper(a.clirs1)=upper(b.nom) and upper(a.clirs2)=upper(b.prenom)\");\n\t\t//$updt = $this->query_AS400(\"select * from (select clirs1, clirs2,clizk6 from pgmcomet/cophycli where stgrp='1' and stdos='399')a inner join (select * from vvbase/vvrecusers )b on trim(a.clizk6)=trim(b.numfid)\");\n\n\t\t$connection_parameters = array(I5_OPTIONS_JOBNAME=>'I5JOB',I5_OPTIONS_INITLIBL=>'PGMCOMET',I5_OPTIONS_LOCALCP=>'UTF-8;ISO8859-1'); //i5_OPTIONS_IDLE_TIMEOUT=>120,I5_OPTIONS_LOCALCP=>'CCSID'\n\t\tif ($conn_updt = @i5_connect ( '127.0.0.1', 'hdh', 'hdh', $connection_parameters )) {\n\n\n\n\n\n\t\t\ti5_transaction(I5_ISOLEVEL_NONE,$conn_updt);\n\n\t\t\t//$res = array();\n\t\t\tfor ($i=0;$i<count($updt);$i++) {\n\n\t\t\t\t@i5_query(\"UPDATE VVBASE/VVRECUSERS SET NUMFID='\".$updt[$i][\"CLIZK6\"].\"' WHERE UPPER(NOM)='\".strtoupper($updt[$i][\"CLIRS1\"]).\"' AND UPPER(PRENOM)='\".strtoupper($updt[$i][\"CLIRS2\"]).\"'\");\n\t\t\t\t//array_push($res,\"UPDATE VVBASE/VVRECUSERS SET NUMFID='\".$updt[$i][\"CLIZK6\"].\"' WHERE UPPER(NOM)='\".strtoupper($updt[$i][\"CLIRS1\"]).\"' AND UPPER(PRENOM)='\".strtoupper($updt[$i][\"CLIRS2\"]).\"'\");\n\t\t\t}\n\n\n\t\t\t$result = !(i5_commit($conn_updt));\n\n\t\t\tif (!i5_close($conn_updt)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t}", "public function update() {\r\n\r\n\t}", "public function update()\n {\n $ipodates = $this->fetchList();\n foreach ($ipodates as $key => $ipo) {\n $this->updateIPO($ipo[0], $ipo[1]);\n }\n }", "function do_undismiss_core_update()\n {\n }", "protected function run_updater() {\r\n\r\n\t\t/*\r\n\t\t* Version 1.6\r\n\t\t* add `active` to table categories\r\n\t\t*/\r\n\t\tif (version_compare(LUMISE, '1.4') >=0 ){\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}categories` LIKE 'active'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}categories` ADD `active` INT(1) NOT NULL DEFAULT '1' AFTER `order`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.5') >=0 ){\r\n\t\t\t$list_tables = array(\r\n\t\t\t\t'products' => 'color',\r\n\t\t\t\t'products' => 'printings',\r\n\t\t\t);\r\n\r\n\t\t\tforeach ($list_tables as $k => $v) {\r\n\t\t\t\t$columns = $this->main->db->rawQuery(\"SHOW COLUMNS FROM `{$this->main->db->prefix}{$k}` LIKE '{$v}'\");\r\n\t\t\t\tif(count($columns) > 0){\r\n\t\t\t\t\t$this->main->db->rawQuery(\r\n\t\t\t\t\t\t\"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `{$v}` `{$v}` TEXT NOT NULL\"\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7') >=0 ){\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'upload_ttf'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `upload_ttf` TEXT NOT NULL AFTER `upload`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.1') >=0 ){\r\n\r\n\t\t\t$this->upgrade_1_7();\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'variations';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `variations` TEXT NOT NULL AFTER `stages`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\r\n\t\t\t// do the convert old data\r\n\t\t\t// 1. convert colors to attribute\r\n\t\t\t// 2. convert all old attribute structure to new structure\r\n\t\t\t// 3. convert stages\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'orientation';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) > 0){\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `orientation`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `min_qty`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `max_qty`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `size`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `change_color`;\");\r\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `color`;\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.3') >=0 ){\r\n\t\t\t$this->upgrade_1_7_3();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.4') >=0 ) {\r\n\r\n\t\t\t$tables = $this->main->db->rawQuery(\"SHOW TABLES LIKE '{$this->main->db->prefix}sessions'\");\r\n\r\n\t\t\tif (count($tables) === 0) {\r\n\r\n\t\t\t\t$this->main->db->rawQuery(\r\n\t\t\t\t\t\"CREATE TABLE IF NOT EXISTS `{$this->main->db->prefix}sessions` (\r\n\t\t\t\t\t `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,\r\n\t\t\t\t\t `name` varchar(255) NOT NULL,\r\n\t\t\t\t\t `value` varchar(255) NOT NULL,\r\n\t\t\t\t\t `expires` int(11) NOT NULL,\r\n\t\t\t\t\t `session_id` varchar(255) NOT NULL,\r\n\t\t\t\t\t PRIMARY KEY (`id`)\r\n\t\t\t\t\t) ENGINE=InnoDB AUTO_INCREMENT=1 CHARSET=utf8mb4\"\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}order_products` LIKE 'cart_id';\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}order_products` ADD `cart_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `product_id`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.7.5') >=0 ) {\r\n\t\t\t$this->upgrade_1_7_5();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.2') >=0 ) {\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'name_desc'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `name_desc` varchar(255) NOT NULL DEFAULT '' AFTER `upload`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.3') >=0 ) {\r\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'active_description'\";\r\n\t\t\t$columns = $this->main->db->rawQuery($sql);\r\n\t\t\tif(count($columns) == 0){\r\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `active_description` INT(1) NOT NULL DEFAULT '0' AFTER `description`\";\r\n\t\t\t\t$this->main->db->rawQuery($sql_active);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '1.9.9') >=0 ) {\r\n\t\t\t$this->upgrade_1_9_9();\r\n\t\t}\r\n\r\n\t\tif (version_compare(LUMISE, '2.0') > 0 ) {\r\n\t\t\t$this->upgrade_2_0();\r\n\t\t}\r\n\t\t/*\r\n\t\t*\tCreate subfolder upload\r\n\t\t*/\r\n\r\n\t\t$this->main->check_upload();\r\n\r\n\t}", "function update_end()\n {\n }", "public function runUpdateScript()\n {\n $current_schema = get_config('schema');\n if ($current_schema < 2) {\n // 20150727\n $this->schema2();\n $this->updateSchema(2);\n }\n if ($current_schema < 3) {\n // 20150728\n $this->schema3();\n $this->updateSchema(3);\n }\n if ($current_schema < 4) {\n // 20150801\n $this->schema4();\n $this->updateSchema(4);\n }\n if ($current_schema < 5) {\n // 20150803\n try {\n $this->schema5();\n } catch (Exception $e) {\n die($e->getMessage());\n }\n $this->updateSchema(5);\n }\n // place new schema functions above this comment\n $this->cleanTmp();\n $msg_arr = array();\n $msg_arr[] = \"[SUCCESS] You are now running the latest version of eLabFTW. Have a great day! :)\";\n return $msg_arr;\n }", "function applyCustomUpdates()\n\t{\n\t\tglobal $ilCtrlStructureReader;\n\n\t\t$ilCtrlStructureReader->setIniFile($this->setup->getClient()->ini);\n\n\t\tinclude_once \"./Services/Database/classes/class.ilDBUpdate.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacAdmin.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacReview.php\";\n\t\tinclude_once \"./Services/AccessControl/classes/class.ilRbacSystem.php\";\n\t\tinclude_once \"./Services/Tree/classes/class.ilTree.php\";\n\t\tinclude_once \"./Services/Xml/classes/class.ilSaxParser.php\";\n\t\tinclude_once \"./Services/Object/classes/class.ilObjectDefinition.php\";\n\n\t\t// referencing db handler in language class\n\t\t$ilDB = $this->setup->getClient()->db;\n\t\t$this->lng->setDbHandler($ilDB);\n\n\t\t// run dbupdate\n\t\t$dbupdate = new ilDBUpdate($ilDB);\n\t\t$dbupdate->applyCustomUpdates();\n\n\t\tif ($dbupdate->updateMsg == \"no_changes\")\n\t\t{\n\t\t\t$message = $this->lng->txt(\"no_changes\").\". \".$this->lng->txt(\"database_is_uptodate\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sep = \"\";\n\t\t\tforeach ($dbupdate->updateMsg as $row)\n\t\t\t{\n\t\t\t\tif ($row[\"msg\"] == \"update_applied\")\n\t\t\t\t{\n\t\t\t\t\t$a_message.= $sep.$row[\"nr\"];\n\t\t\t\t\t$sep = \", \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$e_message.= \"<br/>\".$this->lng->txt($row[\"msg\"]).\": \".$row[\"nr\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($a_message != \"\")\n\t\t\t{\n\t\t\t\t$a_message = $this->lng->txt(\"update_applied\").\": \".$a_message;\n\t\t\t}\n\t\t}\n\n\t\tilUtil::sendInfo($a_message.$e_message, true);\n\t\tilUtil::redirect(\"setup.php?cmd=displayDatabase\");\n\t}", "function update_info()\n {\n }", "function ApplyUpdates($update_dir, $update_list)\n\t{\n\t\t$update_files = $this->GetUpdatesFilesList($update_dir);\n\t\t//var_dump($update_files);\n\t\t\n\t\tforeach ($update_list as $update_item) {\n\t\t\t//list($update_rev, $update_type) = explode('-', $update_item);\n\t\t\t//$update_type = strtoupper($update_type);\n\t\t\t\n\t\t\tif (!empty($update_files[$update_item])) {\n\t\t\t\t$itm =& $update_files[$update_item];\n\t\t\t\t\n\t\t\t\t// try to apply update\n\t\t\t\tswitch ($itm['type']) {\n\t\t\t\t\tcase 'SQL':\n\t\t\t\t\t\t$query = file_get_contents($update_dir.$itm['filename']);\n\n\t\t\t\t\t\t$this->db->exception_on_error = false;\n\t\t\t\t\t\t$is_error = !$this->db->script($query);\n\t\t\t\t\t\t$this->db->exception_on_error = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ids = array (\n\t\t\t\t\t\t\t'rev_num' => $itm['rev_num'],\n\t\t\t\t\t\t\t'type' => $itm['type'],\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check db for current update\n\t\t\t\t\t\t$this->db->q('SELECT rev_num, type, status FROM #_PREF_updates', $ids);\n\t\t\t\t\t\t$res = $this->db->fetchAssoc();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// try to apply update\n\t\t\t\t\t\tif (is_array($res)) {\n\t\t\t\t\t\t\tif ($res['status'] != 'ok') {\n\t\t\t\t\t\t\t\t$this->db->qI('#_PREF_updates', array ('status' => $is_error ? 'error' : 'ok'), 'UPDATE', $ids);\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\t$ids['status'] = $is_error ? 'error' : 'ok';\n\t\t\t\t\t\t\t$this->db->qI('#_PREF_updates', $ids);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t\n\t}", "public static function Update(){\r\n }", "protected function processUpdates()\n {\n $this->importStaticData();\n }", "function GroupPress_update() {\n\t// no PHP timeout for running updates\n\tset_time_limit( 0 );\n\n\tglobal $GroupPress;\n\n\t// this is the current database schema version number\n\t$current_db_ver = get_option( 'GroupPress_db_ver' );\n\n\t// this is the target version that we need to reach\n\t$target_db_ver = GroupPress::DB_VER;\n\n\t// run update routines one by one until the current version number\n\t// reaches the target version number\n\twhile ( $current_db_ver < $target_db_ver ) {\n\t\t// increment the current db_ver by one\n\t\t$current_db_ver ++;\n\n\t\t// each db version will require a separate update function\n\t\t// for example, for db_ver 3, the function name should be solis_update_routine_3\n\t\t$func = \"GroupPress_update_routine_{$current_db_ver}\";\n\t\t\tif ( function_exists( $func ) ) {\n\t\t\t\tcall_user_func( $func );\n\t\t\t}\n\n\t\t//update the option in the database, so that this process can always\n\t\t// pick up where it left off\n\t\tupdate_option( 'GroupPress_db_ver', $current_db_ver );\n\t}\n}", "public function update(): void\n {\n }", "public function update() {\n \n }", "function update_start()\n {\n }", "function run_triggers() {\n// 2. run those triggers that are activated.\n// 3. update locked pins (locked by triggers)\n$trigger1_go = false;\n$trigger_laistisana_go = false;\n$trigger_internets_riits_vakars = false;\n$process_trigger_combined_laistisana = false;\n\n$static_db = open_static_data_db(true);\n$results = $static_db->query('SELECT id FROM `triggers` where state = 1;');\nwhile ($row = $results->fetchArray()) {\n\t\t$trigger_id = $row['id'];\n\t\tif ($trigger_id == 1) $trigger1_go = true;\n\t\tif ($trigger_id == 3) $trigger_laistisana_go = true;\n\t\tif ($trigger_id == 4) $trigger_internets_riits_vakars = true;\n\t\tif ($trigger_id == 5) $process_trigger_combined_laistisana = true;\n\t\t\t//print (\"process trigger $trigger_id\");\n}\n$static_db->close();\n\nif ($trigger1_go) process_trigger_1();\nif ($trigger_laistisana_go) process_trigger_laistisana();\nif ($trigger_internets_riits_vakars) trigger_internets_riits_vakars ();\nif ($process_trigger_combined_laistisana) process_trigger_combined_laistisana ();\n}", "public function processUpdate()\n {\n // Clear SWAPPED state bit\n $this->_state &= ~self::SWAPPED;\n\n $this->_memManager->processUpdate($this, $this->_id);\n }", "public function update() {\r\n }", "public function performTableModification () {\n\n\t\t$this->output( \"\\n#\\n# Starting major table modifications\\n#\");\n\t\tforeach ( $this->wikiDBs as $wikiID => $db ) {\n\n\t\t\t$this->output( \"\\n# Starting major modifications to $wikiID\");\n\n\t\t\t// // For tables with username and id columns: replace the id with the id from $this->userArray\n\t\t\t// foreach( $this->userArray as $userName => $newUserId ) {\n\t\t\t// \tforeach( $tablesWithUsernameAndId as $tableName => $tableInfo ) {\n\t\t\t// \t\t$idField = $tableInfo['idField'];\n\t\t\t// \t\t$userNameField = $tableInfo['userNameField'];\n\n\t\t\t// \t\t$stmt = $db->mysqli->prepare( \"UPDATE $tableName SET $idField=? WHERE $userNameField=?\" );\n\t\t\t// \t\t$stmt->bind_param( 'is', $newUserId, $userName );\n\t\t\t// \t\t$stmt->execute();\n\t\t\t// \t}\n\t\t\t// }\n\n\t\t\t// Lookup the ID in the user table, use username to get new ID from $this->userArray, update ID\n\t\t\t// $this->originalUserIDs[$wikiID][$userName] = old user id\n\t\t\t// $thisWikiUserTable = $db->query( \"SELECT user_id, user_name FROM user\" );\n\t\t\t// print_r( $thisWikiUserTable );\n\n\t\t\t// $usernameToOldId = array();\n\t\t\t$newIdToOld = array(); // array like $newIdToOld[ newId ] = oldId\n\t\t\t$tempToNew = array(); // opposite of above...\n\n\t\t\t// foreach( $thisWikiUserTable as $row ) {\n\t\t\tforeach( $this->temporaryUserIDs[$wikiID] as $userName => $tempUserID ) {\n\n\t\t\t\t$newUserId = $this->userArray[$userName]['user_id'];\n\n\t\t\t\t// quick convert-from-this-to-that arrays\n\t\t\t\t// $usernameToOldId[$userName] = $tempUserID;\n\t\t\t\t// $newIdToOld[$newUserId] = $tempUserID;\n\t\t\t\t$tempToNew[$tempUserID] = $newUserId;\n\n\n\t\t\t\tforeach( $this->tablesToModify as $tableName => $tableInfo ) {\n\t\t\t\t\t$idField = $tableInfo['idField'];\n\n\t\t\t\t\t$db->update(\n\t\t\t\t\t\t$tableName,\n\t\t\t\t\t\tarray( $idField => $newUserId ), // set values\n\t\t\t\t\t\tarray( $idField => $tempUserID ), // conditions: set this where ID field = old value\n\t\t\t\t\t\t__METHOD__\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t\t// fix ipblocks table\n\t\t\t\t$db->update(\n\t\t\t\t\t'ipblocks',\n\t\t\t\t\tarray( 'ipb_user' => $newUserId ),\n\t\t\t\t\tarray( 'ipb_user' => $tempUserID ),\n\t\t\t\t\t__METHOD__\n\t\t\t\t);\n\t\t\t\t$db->update(\n\t\t\t\t\t'ipblocks',\n\t\t\t\t\tarray( 'ipb_by' => $newUserId ),\n\t\t\t\t\tarray( 'ipb_by' => $tempUserID ),\n\t\t\t\t\t__METHOD__\n\t\t\t\t);\n\t\t\t}\n\n\n\t\t\t// Get contents of user_properties, prep for insert into common\n\t\t\t// user_properties table\n\t\t\t$oldUserProps = $db->query( \"SELECT * FROM user_properties\" );\n\t\t\t// $this->output( \"\\n\\nOLDUSERPROPS:\\n\");\n\t\t\t// print_r( $oldUserProps );\n\t\t\t// $this->output( \"\\n\\tempToNew:\\n\");\n\t\t\t// print_r( $tempToNew );\n\n\t\t\twhile( $row = $oldUserProps->fetchRow() ) {\n\t\t\t\tif ( isset( $tempToNew[ $row['up_user'] ] ) ) {\n\t\t\t\t\t$newPropUserId = $tempToNew[ $row['up_user'] ];\n\n\t\t\t\t\t$row['up_user'] = $newPropUserId; // could be dupes across wikis...need to upsert at end\n\t\t\t\t\t$this->newUserProps[] = $row;\n\t\t\t\t} else {\n\t\t\t\t\t$oldId = $row['up_user'];\n\t\t\t\t\t$this->output( \"\\nUser ID #$oldId not found in tempToNew array for $wikiID.\" );\n\t\t\t\t\t//$this->output( print_r( array( \"id\" => $row['up_user'], \"array\" => $tempToNew ), true ) );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Empty the user table for this wiki, since it will just use the common\n\t\t\t// one created at the end. Same for user_properties\n\t\t\t$db->query( \"DELETE FROM user\" );\n\t\t\t$db->query( \"DELETE FROM user_properties\" );\n\n\t\t\t$this->output( \"\\n# Complete with major modifications to $wikiID\" );\n\n\t\t}\n\n\t\t$this->output( \"\\n# Complete with major modifications to all wikis\\n\" );\n\n\t}", "public function updateAll() {\n $this->Corporations->update();\n $this->MemberTracking->update();\n $this->Facilities->update();\n $this->Industry->update();\n $this->Markets->update();\n $this->Contracts->update();\n $this->Wallet->update();\n $this->Assets->update();\n $this->Killmails->update();\n }", "public function update() {\n\t\treturn;\n\t}", "public function update()\r\n {\r\n \r\n }", "function startUpdate()\r\n {\r\n $this->_updatecounter++;\r\n }", "function esiUpdateAll() {\n $a = esiUpdateApicorps();\n $b = esiCreateCfgesitoken();\n $c = esiCreateEsistatus();\n $d = esiUpdateApiCorpMembers();\n $e = esiUpdateApiIndustryJobsCrius();\n $f = esiUpdateApimarketorders();\n $g = esiUpdateApiContractItems();\n return $a && $b && $c && $d && $e && $f && $g;\n}", "public function updating()\n {\n # code...\n }", "public function notifyObservers() {\n\t\tforeach ( $this->observers as $obs => $key )\n\t\t\t$key->update ( $this->actTemp, $this->maxTemp, $this->minTemp, $this->actPressure );\n\t}", "function update($mult){\nglobal $hrsPerSample,$sumpRate,$sumpCnt,$rainRate,$rainCnt,$oldRainCnt,$pwrCnt,$curPwrCnt,$pwrTime,$curPwrTime,$StempCnt,$StempAvg,$StempSum,$RtempCnt,$RtempAvg,$RtempSum,$sample,$oldSumpCnt,$daysAgo,$rainTot,$rainTotOld,$rainZero,$rzThresh,$logtime,$lineTS,$now,$WtempCnt,$WtempAvg,$WtempSum,$OtempCnt,$OtempAvg,$OtempSum,$waterRate,$waterCnt,$oldWaterCnt,$waterTot,$waterTotOld,$waterZero,$wzThresh,$spinnerCal;\n\nif ($mult> 100) {$mult=100;} # just in case\n\n// here's a timestamp in days everybody can use, indexed by $sample:\n$daysAgo[]=($lineTS-$now)/(3600*24);\n\n\n//print \"Sample $sample sumpCnt $sumpCnt oldSumpCnt $oldSumpCnt\\n\";\n$sumpRate[$sample]=$mult*($sumpCnt-$oldSumpCnt)/$hrsPerSample; # cycles/hr\nif($sumpRate[$sample]<0){$sumpRate[$sample]=\"\";}\n$oldSumpCnt=$sumpCnt;\n\n\n//$rainRate[$sample]=$mult*((($rainCnt-$oldRainCnt)/$hrsPerSample)/100)+.0048; //inches/hr\n$rainRate[$sample]=$mult*((($rainCnt-$oldRainCnt)/$hrsPerSample)/100); //inches/hr\nif($rainRate[$sample]<0){$rainRate[$sample]=\"\";}\n$oldRainCnt=$rainCnt;\n//print \"$sample:$rainRate[$sample]<br>\\n\";\n\n\nif($rainCnt<$rainTotOld){$rainTotOld=$rainCnt;}\n$rainTot[$sample]=($rainCnt-$rainTotOld)/100;\nif(($rainRate[$sample]==0) && ($rainTot[$sample]>0)){$rainZero++;}\nelse{$rainZero=0;}\nif($rainZero>$rzThresh){$rainTotOld=$rainCnt;}\n//print \"$sample:$rainCnt[$sample]<br>\\n\";\n\t\t\n\t\t\n$waterRate[$sample]=$mult*((($waterCnt-$oldWaterCnt)/$hrsPerSample)/$spinnerCal); //gal/hr?\nif($waterRate[$sample]<0){$waterRate[$sample]=\"\";}\n$oldWaterCnt=$waterCnt;\n//print \"$sample:$rainRate[$sample]<br>\\n\";\n\n\nif($waterCnt<$waterTotOld){$waterTotOld=$waterCnt;}\n$waterTot[$sample]=(($waterCnt-$waterTotOld)/$spinnerCal);\nif(($waterRate[$sample]==0) && ($waterTot[$sample]>0)){$waterZero++;}\nelse{$waterZero=0;}\nif($waterZero>$wzThresh){$waterTotOld=$waterCnt;}\n//print \"$sample:w:$waterTot[$sample]<br>\\n\";\n\t\t\n\t\t\n$pC=$curPwrCnt-$oldPwrCnt;\n$pwrCnt[$sample]=($pC<0)?\"\":$pC;\n$oldPwrCnt=$curPwrCnt;\n\n\n$pT=$curPwrTime-$oldPwrTime;\n$pwrTime[$sample]=($pT<0)?\"\":$pT;\n$oldPwrTime=$curPwrTime;\n\n\nif($StempCnt!=0){$StempAvg[$sample]=$StempSum/$StempCnt+.04;}\nelse{$StempAvg[$sample]=\"\";}\n$StempSum=0;$StempCnt=0;\n\n\t\t\nif($RtempCnt!=0){$RtempAvg[$sample]=$RtempSum/$RtempCnt+.04;}\nelse{$RtempAvg[$sample]=\"\";}\n$RtempSum=0;$RtempCnt=0;\n\t\t\nif($WtempCnt!=0){$WtempAvg[$sample]=$WtempSum/$WtempCnt+.04;}\nelse{$WtempAvg[$sample]=\"\";}\n$WtempSum=0;$WtempCnt=0;\n\n\t\t\nif($OtempCnt!=0){$OtempAvg[$sample]=$OtempSum/$OtempCnt+.04;}\nelse{$OtempAvg[$sample]=\"\";}\n$OtempSum=0;$OtempCnt=0;\n\n//print\"S R W O $StempAvg[$sample] $RtempAvg[$sample] $WtempAvg[$sample] $OtempAvg[$sample] <br>\\n\";\n\t\t\n$sample++;\n//print \".\";\n\n\n}", "public function background_update() {\n\t\tadd_action( 'wp_update_plugins', [ $this, 'get_meta_plugins' ] );\n\t\tadd_action( 'wp_update_themes', [ $this, 'get_meta_themes' ] );\n\t\tadd_action( 'gu_get_remote_plugin', [ $this, 'run_cron_batch' ], 10, 1 );\n\t\tadd_action( 'gu_get_remote_theme', [ $this, 'run_cron_batch' ], 10, 1 );\n\t}", "public function update()\r\n {\r\n //\r\n }", "abstract public function updateData();", "protected function performUpdate() {}", "public function update()\n {\n \n }", "public function update()\n {\n \n }", "protected function _preupdate() {\n }", "public function updateMultiple_data()\n {\n \n }", "public function callAjaxAfterUpdate () {\n $this->progressBar('afterUpdate');\n try {\n $iStartTime = microtime(true);\n $aUpdateClasses = MLFilesystem::gi()->getClassCollection('/^update_.*$/', false);\n $iTotal = count($aUpdateClasses);\n $aParams = MLRequest::gi()->data();\n unset($aParams['do'], $aParams['method'], $aParams['ajax'], $aParams['unique']);\n MLController::gi('widget_progressbar')\n ->addLog('Parameters: <span style=\"color:silver;\">'. json_encode($aParams).'</span>')\n ;\n $iDone = MLRequest::gi()->data('done');\n $iDone = is_numeric($iDone) ? $iDone : 0;\n $iCurrent = 0;\n $this->setProgressBarPercent($iDone, $iTotal, 'afterUpdate');\n $aUpdateClassParameters = array('done' => $iDone);\n foreach ($aUpdateClasses as $sUpdateClassKey => $aUpdateClassValue) {\n ++$iCurrent;\n if ($iCurrent > $iDone) {\n $this->setProgressBarPercent($iCurrent, $iTotal, 'afterUpdate');\n $iUpdateClassTime = microtime(true);\n $aUpdateClass = current($aUpdateClassValue);\n $sLog = 'Ident <span style=\"color:#32CD32;\" title=\"'.'./'.substr($aUpdateClass['path'], strlen(MLFilesystem::getLibPath())).'\">'.$sUpdateClassKey.'</span> ';\n try {\n require_once $aUpdateClass['path'];\n $oReflection = new ReflectionClass($aUpdateClass['class']);\n if (\n !$oReflection->isSubclassOf('ML_Core_Update_Abstract')\n || $oReflection->isAbstract()\n || $oReflection->isInterface()\n ) {\n $aUpdateClassParameters = array('done' => $iCurrent);\n $sLog .= 'skipped (no concrete update class)';\n } else {\n $oUpdateClass = new $aUpdateClass['class'];\n if ($oUpdateClass->needExecution()) {\n $oUpdateClass->execute();\n $sLog .= 'executed in <span style=\"color:#6495ED;\">'. microtime2human(microtime(true)-$iUpdateClassTime).'</span>.';\n $aParameters = $oUpdateClass->getParameters();\n if (is_array($aParameters) && !empty($aParameters)) {\n $aUpdateClassParameters = array_merge($aUpdateClassParameters, $aParameters);\n MLController::gi('widget_progressbar')->addLog($sLog);\n break;\n } else {\n $aUpdateClassParameters = array('done' => $iCurrent);\n }\n } else {\n $aUpdateClassParameters = array('done' => $iCurrent);\n $sLog .= 'skipped (don\\'t need execution)';\n }\n }\n MLController::gi('widget_progressbar')->addLog($sLog);\n } catch (Exception $oEx) {\n MLController::gi('widget_progressbar')\n ->addLog($sLog.'threw Exception with the message \"<span style=\"color: #FF0000\">'.$oEx->getMessage().'</span>\" after <span style=\"color:#6495ED;\">'. microtime2human(microtime(true)-$iUpdateClassTime).'</span>.')\n ->addLog('\n <span>\n <a class=\"global-ajax\" data-ml-global-ajax=\\'{\"triggerAfterSuccess\":\"currentUrl\"}\\' onclick=\"jqml(this).siblings().remove();\" style=\"color:gray;font-size:inherit;\" href=\"'.$this->getCurrentUrl(array('method'=>'afterUpdate', 'done'=>$iCurrent - 1)).'\">Again</a>\n <span> or </span>\n <a class=\"global-ajax\" data-ml-global-ajax=\\'{\"triggerAfterSuccess\":\"currentUrl\"}\\' onclick=\"jqml(this).siblings().remove();\" style=\"color:gray;font-size:inherit;\" href=\"'.$this->getCurrentUrl(array('method'=>'afterUpdate', 'done'=>$iCurrent)).'\">Skip current class.</a>\n </span>\n ')\n ->setContent(MLI18n::gi()->get('sUpdateError_doAgain', array(\n 'link' => $this->getCurrentUrl(array('method'=>'afterUpdate')\n ))))\n ;\n throw new $oEx;\n } \n if ($iStartTime + 10 >= microtime(true)) {\n $this->progressBar('afterUpdate', false);\n break;\n }\n } else {\n // echo 'skip: '.$sUpdateClassKey.\"\\n\";\n }\n }\n if ($iCurrent >= $iTotal) {\n MLHelper::getFilesystemInstance()->write(\n $this->getPath('plugin') . 'ClientVersion', MLHelper::gi('remote')->fileGetContents($this->getPath('clientversion'))\n );\n// MLMessage::gi()->addSuccess(\n// MLI18n::gi()->get('ML_TEXT_UPDATE_SUCCESS', array('url'=> MLHttp::gi()->getUrl(array('content'=>'changelog'))))\n// );\n MLDatabase::factory('config')->set('mpid', 0)->set('mkey', 'after-update')->set('value', true)->save();\n $this->progressBar('afterUpdate', true);\n } else {\n $this->progressBar('afterUpdate', $aUpdateClassParameters);\n }\n } catch (Exception $oEx) {\n $this->progressBar('afterUpdate', $oEx);\n }\n return $this;\n }", "public function updater() {\n\n\t\t// Bail if current user cannot manage plugins.\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if plugin updater is not loaded.\n\t\tif ( ! class_exists( 'Puc_v4_Factory' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Setup the updater.\n\t\t// $updater = Puc_v4_Factory::buildUpdateChecker( 'https://github.com/maithemewp/mai-grid-entries/', __FILE__, 'mai-grid' );\n\t}", "function updateIS4C() {\n\n\tglobal $dbConn2;\n\n//echo \"In updateIS4C\\n\";\n\n\tglobal $updateCustdata;\n\tglobal $updateMeminfo;\n\tglobal $updateMemContact;\n\tglobal $updateMemDates;\n\tglobal $updateMemberCards;\n\tglobal $updateStockpurchases;\n\n\tglobal $debug;\n\n\t$statements = array($updateMeminfo,\n\t\t$updateMemContact,\n\t\t$updateMemDates,\n\t\t$updateMemberCards);\n\t$statement = \"\";\n\n\tif ( count($updateCustdata) > 0 ) {\n\t\tforeach ($updateCustdata as $statement) {\n\t\t\tif ( $debug == 1) \n\t\t\t\techo $statement, \"\\n\";\n//continue;\n\t\t\t$rslt = $dbConn2->query(\"$statement\");\n\t\t\tif ( 1 && $dbConn2->errno ) {\n\t\t\t\treturn(sprintf(\"Error: Update failed: %s\\n\", $dbConn2->error));\n\t\t\t}\n\t\t}\n\t}\n\telse {\n\t\t//echo \"No custdata to update.\\n\";\n\t\t1;\n\t}\n\n\tforeach ($statements as $statement) {\n\t\tif ( $statement != \"\" ) {\n\t\t\tif ( $debug == 1) \n\t\t\t\techo $statement, \"\\n\";\n//continue;\n\t\t\t$rslt = $dbConn2->query(\"$statement\");\n\t\t\tif ( 1 && $dbConn2->errno ) {\n\t\t\t\treturn(sprintf(\"Error: Update failed: %s\\n\", $dbConn2->error));\n\t\t\t}\n\t\t}\n\t}\n\n\t// stockpurchases is in a different db.\n\n\treturn(\"OK\");\n\n// updateIS4C\n}", "public function afterUpdateEvent($self, $pkeys){\n }", "function main()\t{\n\n\t\t$content = '';\n\t\t$update040a = false;\n\t\t$update040b = false;\n\t\t$update040c = false;\n\t\t\n\t\t$tableNames = $GLOBALS['TYPO3_DB']->admin_get_tables();\n\t\tif (!isset($tableNames['tx_myquizpoll_relation_user_id_mm'])) {\n\t\t\t$update040a = true;\n\t\t\t$update040b = true;\n\t\t\t$update040c = true;\n\t\t}\n\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('update040a')) {\n\t\t\t$content .= \"<br />Executing: Update relations-table for advanced statistics\\n\";\n\t\t\t\n\t\t\t$mmArray = array();\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local, uid_foreign',\n\t\t\t\t'tx_myquizpoll_relation_user_id_mm',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\tif ($rows>0) {\t\t\t\t\t\t\t// DB entries found?\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n\t\t\t\t\t$local = $row['uid_local'];\n\t\t\t\t\t$mmArray[$local] = array();\n\t\t\t\t\t$mmArray[$local]['user'] = $row['uid_foreign'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$res2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid_local, uid_foreign',\n\t\t\t\t'tx_myquizpoll_relation_question_id_mm',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res2);\n\t\t\tif ($rows>0) {\t\t\t\t\t\t\t// DB entries found?\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2)){\n\t\t\t\t\t$local = $row['uid_local'];\n\t\t\t\t\t$mmArray[$local]['quest'] = $row['uid_foreign'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$updateArray = array();\n\t\t\tforeach($mmArray as $key => $value) {\n\t\t\t\t//$content .= \"- $key: \".$value['user'].'/'.$value['quest'].\"<br />\\n\";\n\t\t\t\t$updateArray = array('user_id' => $value['user'], 'question_id' => $value['quest']);\n\t\t\t\t$success = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_myquizpoll_relation', 'uid='.$key, $updateArray);\n\t\t\t\tif(!$success){\n\t\t\t\t\t$content.=\"<p>MySQL Update-Error :-(</p>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$update040a = true;\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('update040b')) {\n\t\t\t$content .= \"<br />Executing: - Delete no longer needed relation-data\\n\";\n\t\t\t\n\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t\t'tx_myquizpoll_relation_user_id_mm',\n\t\t\t\t''\n\t\t\t);\n\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t\t'tx_myquizpoll_relation_question_id_mm',\n\t\t\t\t''\n\t\t\t);\n\t\t\t$update040b = true;\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('update040c')) {\n\t\t\t$content .= \"<br />Executing: - Delete no longer needed relation-tables\\n\";\n\t\t\t\n\t\t\tmysql( TYPO3_db, 'DROP TABLE tx_myquizpoll_relation_user_id_mm' );\n\t\t\tmysql( TYPO3_db, 'DROP TABLE tx_myquizpoll_relation_question_id_mm' );\n\t\t\t$update040c = true;\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('updatepoll') && \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid')) {\n\t\t\t$thePID=intval(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid'));\n\t\t\t$timestamp = time();\n\t\t\t$content .= \"<br />Executing: - Converting basic poll data to advanced poll data (folder $thePID)\\n\";\n\t\t\t$res5 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, cruser_id,sys_language_uid,hidden, p_or_a, qids',\n\t\t\t\t'tx_myquizpoll_result',\n\t\t\t\t'pid='.$thePID,\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res5);\n\t\t\tif ($rows>0) {\n\t\t\t\t$statisticsArray = array();\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res5)){ \n\t\t\t\t\t$theUID = $row['uid'];\n\t\t\t\t\tif (intval($row['p_or_a'])>0 && intval($row['p_or_a'])<13) {\n\t\t\t\t\t\t\t$statisticsArray[$theUID] = array(\n\t\t\t\t\t\t\t'pid' => $thePID,\n\t\t\t\t\t\t\t'tstamp' => $timestamp,\n\t\t\t\t\t\t\t'crdate' => $timestamp,\n\t\t\t\t\t\t\t'cruser_id' => $row['cruser_id'],\n\t\t\t\t\t\t\t'hidden' => $row['hidden'],\n\t\t\t\t\t\t\t'user_id' => $theUID,\n\t\t\t\t\t\t\t'question_id' => $row['qids'],\n\t\t\t\t\t\t\t'checked'.$row['p_or_a'] => 1,\n\t\t\t\t\t\t\t'sys_language_uid' => $row['sys_language_uid']\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\tif (is_array($statisticsArray)) {\n\t\t\t\tforeach ($statisticsArray as $type => $element) {\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_myquizpoll_relation', $element);\n\t\t\t\t}\n\t\t\t\t$content .= \"<br />\".count($statisticsArray).\" elements inserted. done.<br />\\n\";\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('updatepoll2a') && \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a')) {\n\t\t\t$thePID=intval(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a'));\n\t\t\t$timestamp = time();\n\t\t\t$content .= \"<br />Executing: - Copy basic poll data to tx_myquizpoll_voting (folder $thePID)\\n\";\n\t\t\t$res5 = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid, crdate,cruser_id,sys_language_uid,hidden, p_or_a, qids, ip',\n\t\t\t\t'tx_myquizpoll_result',\n\t\t\t\t'pid='.$thePID,\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'');\n\t\t\t$rows = $GLOBALS['TYPO3_DB']->sql_num_rows($res5);\n\t\t\tif ($rows>0) {\n\t\t\t\t$votingArray = array();\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res5)){ \n\t\t\t\t\t$theUID = $row['uid'];\n\t\t\t\t\tif (intval($row['p_or_a'])>0 && intval($row['p_or_a'])<13) {\n\t\t\t\t\t\t\t$votingArray[$theUID] = array(\n\t\t\t\t\t\t\t'pid' => $thePID,\n\t\t\t\t\t\t\t'tstamp' => $timestamp,\n\t\t\t\t\t\t\t'crdate' => $row['crdate'],\n\t\t\t\t\t\t\t'cruser_id' => $row['cruser_id'],\n\t\t\t\t\t\t\t'hidden' => $row['hidden'],\n//\t\t\t\t\t\t\t'user_id' => $theUID,\n\t\t\t\t\t\t\t'question_id' => intval($row['qids']),\n\t\t\t\t\t\t\t'answer_no' => $row['p_or_a'],\n\t\t\t\t\t\t\t'ip' => $row['ip'],\n\t\t\t\t\t\t\t'sys_language_uid' => $row['sys_language_uid']\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\tif (is_array($votingArray)) {\n\t\t\t\tforeach ($votingArray as $type => $element) {\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_myquizpoll_voting', $element);\n\t\t\t\t}\n\t\t\t\t$content .= \"<br />\".count($votingArray).\" elements inserted into tx_myquizpoll_voting. done.<br />\\n\";\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('updatepoll2b') && \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a')) {\n\t\t\t$thePID=intval(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GP('pollpid2a'));\n\t\t\t$content .= \"<br />Executing: - Deleting old basic poll data (folder $thePID)\\n\";\n\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_myquizpoll_result', 'pid='.$thePID);\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t// formular\n\t\tif ($content) $content .= \"<br /><br />\\n\";\n\t\t$linkScript = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::linkThisScript(); // htmlspecialchars()\n\t\t//$content.=$linkScript;\n\t\t$content.='<form name=\"myquiz\" action=\"'.$linkScript.'\" method=\"post\">';\n\t\tif (!($update040a && $update040b && $update040c)) {\n\t\t\t$content.='<br /><p>Updates from Version 0.3.0-0.4.2 to 1.0.0:<br />';\n\t\t\tif (!$update040a)\n\t\t\t\t$content.='<input type=\"checkbox\" name=\"update040a\" value=\"1\" checked=\"checked\" /> Update relation-table for advanced statistics<br />';\n\t\t\tif (!$update040b)\n\t\t\t\t$content.='<input type=\"checkbox\" name=\"update040b\" value=\"1\" checked=\"checked\" /> - Delete no longer needed relation-data<br />';\n\t\t\tif (!$update040c)\n\t\t\t\t$content.='<input type=\"checkbox\" name=\"update040c\" value=\"1\" checked=\"checked\" /> - Delete no longer needed relation-tables<br />';\n\t\t\t$content.='</p><br />';\n\t\t}\n\t\t$content.='<p><input type=\"checkbox\" name=\"updatepoll\" value=\"1\" /> Optional: convert basic poll data to advanced poll data. ID of the folder: ';\n\t\t$content.='<input type=\"text\" name=\"pollpid\" value=\"\" /> (be carefully, there is no check if there are really basic poll data). Execute it only once!</p><br />';\n\t\t$content.='<p><input type=\"checkbox\" name=\"updatepoll2a\" value=\"1\" /> Optional: copy basic poll data to the table tx_myquizpoll_voting. ID of the folder: ';\n\t\t$content.='<input type=\"text\" name=\"pollpid2a\" value=\"\" /> (be carefully, there is no check if there are really basic poll data). Execute it only once!';\n\t\t$content.='<br />&nbsp; -&nbsp; <input type=\"checkbox\" name=\"updatepoll2b\" value=\"1\" /> Delete old entries in the table tx_myquizpoll_result with the above ID.</p><br />';\n\t\t\n\t\t//$linkScript = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::slashJS(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::linkThisScript());\n\t\t//$content.=$linkScript;\n\t\t// this.form.action=\\''.$linkScript.'\\';\n\t\t$content.='<input type=\"button\" onclick=\"this.form.submit();\" name=\"send\" value=\"Start\" />';\n\t\t$content.='</form>';\n\t\t\n\t\treturn $content;\n\t}", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "protected function run_updater() {\n\t\t\n\t\t/*\n\t\t* Version 1.6\n\t\t* add `active` to table categories\n\t\t*/\n\t\t\n\t\tif (version_compare(LUMISE, '1.4') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}categories` LIKE 'active';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}categories` ADD `active` INT(1) NULL DEFAULT '1' AFTER `order`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.5') >=0 ){\n\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `color` `color` TEXT;\";\n\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` CHANGE `printings` `printings` TEXT;\";\n\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}fonts` LIKE 'upload_ttf';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}fonts` ADD `upload_ttf` TEXT NULL DEFAULT '' AFTER `upload`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7.1') >=0 ){\n\t\t\t\n\t\t\t$this->upgrade_1_7();\n\t\t\t\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'variations';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}products` ADD `variations` TEXT NULL DEFAULT '' AFTER `stages`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t\t\n\t\t\t// do the convert old data\n\t\t\t// 1. convert colors to attribute\n\t\t\t// 2. convert all old attribute structure to new structure\n\t\t\t// 3. convert stages\n\t\t\t\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}products` LIKE 'orientation';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) > 0){\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `orientation`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `min_qty`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `max_qty`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `size`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `change_color`;\");\n\t\t\t\t$this->main->db->rawQuery(\"ALTER TABLE `{$this->main->db->prefix}products` DROP `color`;\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif (version_compare(LUMISE, '1.7.3') >=0 ){\n\t\t\t$sql = \"SHOW COLUMNS FROM `{$this->main->db->prefix}order_products` LIKE 'print_files';\";\n\t\t\t$columns = $this->main->db->rawQuery($sql);\n\t\t\tif(count($columns) == 0){\n\t\t\t\t$sql_active = \"ALTER TABLE `{$this->main->db->prefix}order_products` ADD `print_files` TEXT NULL DEFAULT '' AFTER `screenshots`;\";\n\t\t\t\t$this->main->db->rawQuery($sql_active);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t*\tCreate subfolder upload\t\n\t\t*/\n\t\t\n\t\t$this->main->check_upload();\n\t\t\n\t}", "abstract public function mass_update();", "function m_updateHome()\n\t{\n\t\tif(isset($this->request['state']))\n\t\t{\n\t\t\t$state=$this->request['state'];\n\t\t}\n\t\tif(isset($this->request['sort']))\n\t\t{\n\t\t\t$sort=$this->request['sort'];\n\t\t}\n\t\t$this->obDb->query=\"UPDATE \".GIFTWRAPS.\" set `iState`='0'\";\n\t\t$this->obDb->updateQuery();\n\n\t\tif(isset($state))\n\t\t{\n\t\t\tforeach($state as $stateid=>$stateValue)\n\t\t\t{\n\t\t\t\t$this->obDb->query=\"UPDATE \".GIFTWRAPS.\" set\n\t\t\t\t `iState`='$stateValue' where iGiftwrapid_PK='$stateid'\";\n\t\t\t\t$this->obDb->updateQuery();\n\t\t\t}\n\t\t}\n\t\tif(isset($sort))\n\t\t{\n\t\t\tforeach($sort as $sortid=>$sortValue)\n\t\t\t{\n\t\t\t\t$this->obDb->query=\"UPDATE \".GIFTWRAPS.\" set\n\t\t\t\t `iSort`='$sortValue' where iGiftwrapid_PK='$sortid'\";\n\t\t\t\t$this->obDb->updateQuery();\n\t\t\t}\n\t\t}\n\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"sales/adminindex.php?action=promotions.giftwrap.home&msg=2\");\t\n\t}", "private function updateOperation() {\n sleep(1);\n }", "function update_tables($inst=null) {\n// create the nodes of all the tables\n\tglobal $conn,$DB,$DTB_PRE,$TB_PRE,$wise_table,$VWMLDBM;\n\tif($inst==1) {\n\t\tif($_SESSION['vwmldbm_inst']!=1) return; // inst=1 is super inst,so access should be protected\n\t}\n\telseif($inst>1 && $inst!=$_SESSION['vwmldbm_inst'] && $_SESSION['vwmldbm_inst']!=1) return; // inst=1 can access other inst\n\telseif(!$inst) $inst=$_SESSION['vwmldbm_inst']; \n\n// SJH_MOD \n\tif($TB_PRE==\"\" || $TB_PRE==null) $sql=\"select no from {$DTB_PRE}vwmldbm_tb where name like '%'\";\n\telse $sql=\"select no from {$DTB_PRE}vwmldbm_tb where name like '$TB_PRE\".\"\\_%'\";\n\n\t$res_tables=mysqli_query($conn,$sql);\n \n\tif($res_tables) {\n\t\twhile($rs_tables=mysqli_fetch_array($res_tables)) $wise_table[]=Table_node::get_new_node($rs_tables['no'],$inst);\n\t}\n\t$num_tables=0;\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$num_tables++;\n\t}\n\techo \"The number of tables: <b>$num_tables</b> <br>\";\n\t\n\tif($num_tables<1) return;\n\n// update upLinks and downlinks\n\t$res_f=mysqli_query($conn,\"select * from {$DTB_PRE}vwmldbm_rmd_fkey_info \");\n\t\n\tif($res_f) {\n\t\tif(mysqli_num_rows($res_f)<1) return; // there is no data in wise_rmd_feky_info\n\t\twhile($rs_f=mysqli_fetch_array($res_f)) {\n\t\t\t$from_tb_no=get_tree_no($rs_f['from_db'],$rs_f['from_tb'],$inst);\n\t\t\t$to_tb_no=get_tree_no($rs_f['to_db'],$rs_f['to_tb'],$inst);\n\t\t\t//echo $from_tb_no .\" => \".$to_tb_no.\"<br>\";\n\t\t\tupdate_node($from_tb_no,$to_tb_no);\n\t\t}\n\t}\n\n\t\n// root/terminal node unmarking\t\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif(count($wise_table[$i]->upLink))\n\t\t\t$wise_table[$i]->is_root=false;\n\t\tif(count($wise_table[$i]->downLink)){\n\t\t\t$wise_table[$i]->is_terminal=false;\n\t\t}\n\t}\n\t\n\t\n// Find each root node and do the df_traversal.\n\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\tif($wise_table[$i]->is_root) { // root node found\n\t\t\tif($wise_table[$i]->is_terminal) {\n\t\t\t\t//echo \"#\".$wise_table[$i]->tb_no.\" is an isolated node.<br>\";\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach($wise_table[$i]->downLink as $child) \n\t\t\t\t\tdf_traversal(find_node($child),$wise_table[$i]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\n// Update the orders of creation into wise2_vwmldbm_tb\n\t$how_many_in_each_level=array();\n\tfor($i=0;$i<count($wise_table);$i++){\n\t\t$how_many_in_each_level[$wise_table[$i]->level]++;\t\n\t}\n\t$cnt=0;\n\tfor($i=0;$i<count($wise_table);$i++){ // update the isolated nodes\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\tif(type_of_table($DB,$TB_PRE,get_tb_name($wise_table[$i]->tb_no),$inst)=='V') continue; // skip VIEW\n\t\tif($wise_table[$i]->is_root==true && $wise_table[$i]->is_terminal==true) $wise_table[$i]->order_of_creation=++$cnt;\n\t}\n\tfor($i=count($how_many_in_each_level)-1;$i>=0;$i--){ // update all other nodes\n\t\tfor($j=0;$j<count($wise_table);$j++){\n\t\t\tif($wise_table[$j]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t\tif(type_of_table($DB,$TB_PRE,get_tb_name($wise_table[$i]->tb_no,$inst))=='V') continue; // skip VIEW\n\t\t\tif($wise_table[$j]->is_root==true && $wise_table[$j]->is_terminal==true) continue; // these isolated nodes were counted already before.\n\t\t\tif($wise_table[$j]->level==$i){\n\t\t\t\t$wise_table[$j]->order_of_creation=++$cnt;\t\t\t\n\t\t\t}\n\t\t}\n\t}\n // update the order of creation info into wise2.wise2_system.wise_table\t\n\tfor($i=0;$i<count($wise_table);$i++){ // Tables (not views)\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$tb_name=get_tb_name($wise_table[$i]->tb_no,$inst);\n\t\tif(type_of_table($DB,$TB_PRE,$tb_name)=='V') continue; // skip VIEW\n\t\t\t\n\t\tmysqli_query($conn,\"update {$DTB_PRE}vwmldbm_tb set creating_order='\".$wise_table[$i]->order_of_creation.\"' where name='$tb_name'\");\n\t\t//echo $wise_table[$i]->tb_no.\": \".$wise_table[$i]->order_of_creation.\"<br>\";\t\n\t}\n\n// Determine the creating order of views from installation file\n\tif(file_exists($VWMLDBM['wise_rt'].\"/install/sql/view.php\")){\t\t\n\t\t$sql_view=array();\n\t\trequire_once($VWMLDBM['wise_rt'].\"/install/sql/view.php\");\t\n\t}\n\t\n// Remark: during the init_inst, view.php didn't become the part of the array.\n// But second time is okay. So for now let it go.\n//echo \"COUNT SQL_VIEW=\".count($sql_view);\n\n\tfor($i=0;$i<count($wise_table);$i++){ // Views (not tables)\n\t\tif($wise_table[$i]->tb_no==\"\") continue; // skip unnecessary tables\n\t\t$tb_name=get_tb_name($wise_table[$i]->tb_no,$inst);\n\t\tif(type_of_table($DB,$TB_PRE,$tb_name)!='V') continue; // skip Tables (Not views)\n\t\t$view_name=substr($tb_name,strlen($TB_PRE)+1);\n\t\tif($sql_view) $tb_c_order=array_search($view_name,array_keys($sql_view))+$cnt+1;\n\t\t\n\t\tmysqli_query($conn,\"update {$DTB_PRE}vwmldbm_tb set creating_order='$tb_c_order' where name='$tb_name'\");\t\n\t}\n}", "public function doUpdate() {\n\t\ttry {\n\t\t\tcall_user_func_array( $this->doUpdateFunction, $this->arguments );\n\t\t} catch ( Exception $ex ) {\n\t\t\t$this->exceptionHandler->handleException( $ex, 'data-update-failed',\n\t\t\t\t'A data update callback triggered an exception' );\n\t\t}\n\t}", "public function Do_update_Example1(){\n\n\t}", "public function update()\n {\n }", "function update_vvfidpersusers($vnom,$vprenom,$vid) {\n\t\t$updt = $this->query_AS400(\"SELECT CLIZK6,CLIL FROM CECILE/COPHYCLI WHERE STDOS='399' AND STGRP='1' AND CLIRS1 LIKE 'NOUVEAU%' AND CLIRS2 LIKE 'FICHE%' AND CLIZK6 LIKE '929998%' ORDER BY CLIZK6 ASC FETCH FIRST 1 ROWS ONLY\");\n\t\t//$updt = $this->query_AS400(\"select * from (select clirs1, clirs2,clizk6 from pgmcomet/cophycli where stgrp='1' and stdos='399')a inner join (select * from vvbase/vvrecusers )b on trim(a.clizk6)=trim(b.numfid)\");\n\n\t\t$connection_parameters = array(I5_OPTIONS_JOBNAME=>'I5JOB',I5_OPTIONS_INITLIBL=>'CECILE;VVBASE',I5_OPTIONS_LOCALCP=>'UTF-8;ISO8859-1'); //i5_OPTIONS_IDLE_TIMEOUT=>120,I5_OPTIONS_LOCALCP=>'CCSID'\n\t\tif ($conn_updt = @i5_connect ( '127.0.0.1', 'hdh', 'hdh', $connection_parameters )) {\n\n\n\n\n\n\t\t\ti5_transaction(I5_ISOLEVEL_NONE,$conn_updt);\n\n\t\t\t//$res = array();\n\t\t\t//for ($i=0;$i<count($updt);$i++) {\n\t\t\t@i5_query(\"UPDATE CECILE/COPHYCLI SET CLICNF='O' , CLIZK3='I' , CLIRS1='\".$vnom.\"' , CLIRS2='\".$vprenom.\"' WHERE STDOS='399' AND STGRP='1' AND CLIL='\".$updt[0][\"CLIL\"].\"'\");\n\t\t\t@i5_query(\"UPDATE VVBASE/VVCPBADGES SET NUMN='\".$updt[0][\"CLIZK6\"].\"' , ETAT='ATTN' WHERE ID='\".$vid.\"'\");\n\t\t\t\t//@i5_query(\"UPDATE VVBASE/VVRECUSERS SET NUMFID='\".$updt[$i][\"CLIZK6\"].\"' WHERE UPPER(NOM)='\".strtoupper($updt[$i][\"CLIRS1\"]).\"' AND UPPER(PRENOM)='\".strtoupper($updt[$i][\"CLIRS2\"]).\"'\");\n\t\t\t\t//array_push($res,\"UPDATE VVBASE/VVRECUSERS SET NUMFID='\".$updt[$i][\"CLIZK6\"].\"' WHERE UPPER(NOM)='\".strtoupper($updt[$i][\"CLIRS1\"]).\"' AND UPPER(PRENOM)='\".strtoupper($updt[$i][\"CLIRS2\"]).\"'\");\n\t\t\t//}\n\n\n\t\t\t$result = !(i5_commit($conn_updt));\n\n\t\t\tif (!i5_close($conn_updt)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\t}", "function Update()\n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$updateParam = \"\";\n\t\t$updateValue = \"\";\n\t\t$blobs = array();\n\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\tif( $fld[\"key\"] )\n\t\t\t\t$command.= '$this->Param[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\telse\n\t\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\n\t\t\t\n\t\t\tif( !$fld[\"key\"] && !array_key_exists( strtoupper($fieldname), array_change_key_case($this->Param, CASE_UPPER) ) )\n\t\t\t{\n\t\t\t\tforeach($this->Value as $field => $value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateValue.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \", \";\n\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\t\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($this->Param as $field=>$value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateParam.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\tconstruct SQL and do update\t\n\t\tif ($updateParam)\n\t\t\t$updateParam = substr($updateParam, 0, -5);\n\t\tif ($updateValue)\n\t\t\t$updateValue = substr($updateValue, 0, -2);\n\t\t\t\n\t\tif ($updateValue && $updateParam)\n\t\t{\n\t\t\t$dalSQL = \"update \".$this->_connection->addTableWrappers( $this->m_TableName ).\" set \".$updateValue.\" where \".$updateParam;\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\n\t\t//\tcleanup\n\t\t$this->Reset();\n\t}", "public function update()\n\t{\n\t\t$clientArray = array();\n\t\t$getData = array();\n\t\t$funcName = array();\n\t\t$clientArray = func_get_arg(0);\n\t\tfor($data=0;$data<count($clientArray);$data++)\n\t\t{\n\t\t\t$funcName[$data] = $clientArray[$data][0]->getName();\n\t\t\t$getData[$data] = $clientArray[$data][0]->$funcName[$data]();\n\t\t\t$keyName[$data] = $clientArray[$data][0]->getkey();\n\t\t}\n\t\t$clientId = $clientArray[0][0]->getClientId();\n\t\t// data pass to the model object for update\n\t\t$clientModel = new ClientModel();\n\t\t$status = $clientModel->updateData($getData,$keyName,$clientId);\n\t\treturn $status;\n\t}", "protected function _postUpdate()\n\t{\n\t\t$pinTable = new \\Pin\\Pin();\n\t\t$wishlistTable = new \\Wishlist\\Wishlist();\n\t\t$userTable = new \\User\\User();\n\t\t$pinLikeTable = new \\Pin\\PinLike();\n\n\t\tif(array_key_exists('status', $this->_modifiedFields)) {\n\t\t\t//wishlist status change\n\t\t\t$wishlistTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t//pin status change\n\t\t\t$pinTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t//pin like status change\n\t\t\t$pinLikeTable = new \\Pin\\PinLike();\n\t\t\t$pinLikeTable->update(array('status'=>$this->status), array('user_id = ?' => $this->id));\n\t\t\t$userTable->update(array(\n\t\t\t\t\t'likes' => new \\Core\\Db\\Expr('('.$pinLikeTable->select()->from($pinLikeTable,'count(1)')->where('pin_like.user_id = user.id AND pin_like.status = 1').')')\n\t\t\t), array('status = ?' => 1));\n\t\t\t//follow\n\t\t\t$followWishlistTable = new \\Wishlist\\WishlistFollow();\n\t\t\t$followIgnoreWishlistTable = new \\Wishlist\\WishlistFollowIgnore();\n\t\t\t$followUserTable = new \\User\\UserFollow();\n\t\t\t$followWishlistTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t\t$followIgnoreWishlistTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t\t$followUserTable->update(array('status' => $this->status), array('user_id = ? OR follow_id = ?' => $this->id));\n\t\t}\n\t\t\n\t\tif(array_key_exists('public', $this->_modifiedFields)) {\n\t\t\t$wishlistTable->update(array('public'=>$this->public), array('user_id = ?' => $this->id));\n\t\t\t$pinTable->update(array('public'=>$this->public), array('user_id = ?' => $this->id));\n\t\t\t$pinLikeTable = new \\Pin\\PinLike();\n\t\t\t$pinLikeTable->update(array('status'=>3), array('user_id = ?' => $this->id));\n\t\t\t$userTable->update(array(\n\t\t\t\t\t'likes' => new \\Core\\Db\\Expr('('.$pinLikeTable->select()->from($pinLikeTable,'count(1)')->where('pin_like.user_id = user.id AND pin_like.status = 1').')')\n\t\t\t), array('status = ?' => 1));\n\t\t}\n\n\t\t$userTable->updateInfo($this->id);\n\t\t\n\t\t\\Base\\Event::trigger('user.update',$this->id);\n\n\t}", "function updateRawcoins()\n{\n // debuglog(__FUNCTION__);\n\n exchange_set_default('alcurex', 'disabled', true);\n exchange_set_default('binance', 'disabled', true);\n exchange_set_default('empoex', 'disabled', true);\n exchange_set_default('coinbene', 'disabled', true);\n exchange_set_default('coinexchange', 'disabled', true);\n exchange_set_default('coinsmarkets', 'disabled', true);\n exchange_set_default('escodex', 'disabled', true);\n exchange_set_default('gateio', 'disabled', true);\n exchange_set_default('jubi', 'disabled', true);\n exchange_set_default('nova', 'disabled', true);\n exchange_set_default('stocksexchange', 'disabled', true);\n exchange_set_default('tradesatoshi', 'disabled', true);\n\n settings_prefetch_all();\n\n if (!exchange_get('bittrex', 'disabled')) {\n $list = bittrex_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bittrex'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bittrex', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bittrex', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('bitz', 'disabled')) {\n $list = bitz_api_query('tickerall');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bitz'\");\n foreach ($list as $c => $ticker) {\n $e = explode('_', $c);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('bitz', $symbol);\n }\n }\n }\n\n if (!exchange_get('bleutrade', 'disabled')) {\n $list = bleutrade_api_query('public/getcurrencies');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='bleutrade'\");\n foreach ($list->result as $currency) {\n if ($currency->Currency == 'BTC') {\n exchange_set('bleutrade', 'withdraw_fee_btc', $currency->TxFee);\n continue;\n }\n updateRawCoin('bleutrade', $currency->Currency, $currency->CurrencyLong);\n }\n }\n }\n\n if (!exchange_get('coinbene', 'disabled')) {\n $data = coinbene_api_query('market/symbol');\n $list = objSafeVal($data, 'symbol');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinbene'\");\n foreach ($list as $ticker) {\n if ($ticker->quoteAsset != 'BTC')\n continue;\n $symbol = $ticker->baseAsset;\n updateRawCoin('coinbene', $symbol);\n }\n }\n }\n\n if (!exchange_get('crex24', 'disabled')) {\n $list = crex24_api_query('currencies');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='crex24'\");\n foreach ($list as $currency) {\n $symbol = objSafeVal($currency, 'symbol');\n $name = objSafeVal($currency, 'name');\n if ($currency->isFiat || $currency->isDelisted)\n continue;\n updateRawCoin('crex24', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('poloniex', 'disabled')) {\n $poloniex = new poloniex;\n $tickers = $poloniex->get_currencies();\n if (!$tickers)\n $tickers = array();\n else\n dborun(\"UPDATE markets SET deleted=true WHERE name='poloniex'\");\n foreach ($tickers as $symbol => $ticker) {\n if (arraySafeVal($ticker, 'disabled'))\n continue;\n if (arraySafeVal($ticker, 'delisted'))\n continue;\n updateRawCoin('poloniex', $symbol);\n }\n }\n\n if (!exchange_get('c-cex', 'disabled')) {\n $ccex = new CcexAPI;\n $list = $ccex->getPairs();\n if ($list) {\n sleep(1);\n $names = $ccex->getCoinNames();\n\n dborun(\"UPDATE markets SET deleted=true WHERE name='c-cex'\");\n foreach ($list as $item) {\n $e = explode('-', $item);\n $symbol = strtoupper($e[0]);\n\n updateRawCoin('c-cex', $symbol, arraySafeVal($names, $e[0], 'unknown'));\n }\n }\n }\n\n if (!exchange_get('yobit', 'disabled')) {\n $res = yobit_api_query('info');\n if ($res) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='yobit'\");\n foreach ($res->pairs as $i => $item) {\n $e = explode('_', $i);\n $symbol = strtoupper($e[0]);\n updateRawCoin('yobit', $symbol);\n }\n }\n }\n\n if (!exchange_get('coinexchange', 'disabled')) {\n $list = coinexchange_api_query('getmarkets');\n if (isset($list->result) && !empty($list->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinexchange'\");\n foreach ($list->result as $item) {\n if ($item->BaseCurrencyCode != 'BTC')\n continue;\n $symbol = $item->MarketAssetCode;\n $label = objSafeVal($item, 'MarketAssetName');\n updateRawCoin('coinexchange', $symbol, $label);\n }\n }\n }\n\n if (!exchange_get('coinsmarkets', 'disabled')) {\n $list = coinsmarkets_api_query('apicoin');\n if (!empty($list) && is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='coinsmarkets'\");\n foreach ($list as $pair => $data) {\n $e = explode('_', $pair);\n if ($e[0] != 'BTC')\n continue;\n $symbol = strtoupper($e[1]);\n updateRawCoin('coinsmarkets', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptopia', 'disabled')) {\n $list = cryptopia_api_query('GetMarkets');\n if (isset($list->Data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptopia'\");\n foreach ($list->Data as $item) {\n $e = explode('/', $item->Label);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptopia', $symbol);\n }\n }\n }\n\n if (!exchange_get('cryptobridge', 'disabled')) {\n $list = cryptobridge_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='cryptobridge'\");\n foreach ($list as $ticker) {\n $e = explode('_', $ticker->id);\n if (strtoupper($e[1]) !== 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('cryptobridge', $symbol);\n }\n }\n }\n\n if (!exchange_get('escodex', 'disabled')) {\n $list = escodex_api_query('ticker');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='escodex'\");\n foreach ($list as $ticker) {\n #debuglog (json_encode($ticker));\n if (strtoupper($ticker->base) !== 'BTC')\n continue;\n $symbol = strtoupper($ticker->quote);\n updateRawCoin('escodex', $symbol);\n }\n }\n }\n\n if (!exchange_get('hitbtc', 'disabled')) {\n $list = hitbtc_api_query('symbols');\n if (is_object($list) && isset($list->symbols) && is_array($list->symbols)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='hitbtc'\");\n foreach ($list->symbols as $data) {\n $base = strtoupper($data->currency);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($data->commodity);\n updateRawCoin('hitbtc', $symbol);\n }\n }\n }\n\n if (!exchange_get('kraken', 'disabled')) {\n $list = kraken_api_query('AssetPairs');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kraken'\");\n foreach ($list as $pair => $item) {\n $pairs = explode('-', $pair);\n $base = reset($pairs);\n $symbol = end($pairs);\n if ($symbol == 'BTC' || $base != 'BTC')\n continue;\n if (in_array($symbol, array(\n 'GBP',\n 'CAD',\n 'EUR',\n 'USD',\n 'JPY'\n )))\n continue;\n if (strpos($symbol, '.d') !== false)\n continue;\n $symbol = strtoupper($symbol);\n updateRawCoin('kraken', $symbol);\n }\n }\n }\n\n if (!exchange_get('alcurex', 'disabled')) {\n $list = alcurex_api_query('market', '?info=on');\n if (is_object($list) && isset($list->MARKETS)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='alcurex'\");\n foreach ($list->MARKETS as $item) {\n $e = explode('_', $item->Pair);\n $symbol = strtoupper($e[0]);\n updateRawCoin('alcurex', $symbol);\n }\n }\n }\n\n if (!exchange_get('binance', 'disabled')) {\n $list = binance_api_query('ticker/allBookTickers');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='binance'\");\n foreach ($list as $ticker) {\n $base = substr($ticker->symbol, -3, 3);\n // XXXBTC XXXETH BTCUSDT (no separator!)\n if ($base != 'BTC')\n continue;\n $symbol = substr($ticker->symbol, 0, strlen($ticker->symbol) - 3);\n updateRawCoin('binance', $symbol);\n }\n }\n }\n\n if (!exchange_get('gateio', 'disabled')) {\n $json = gateio_api_query('marketlist');\n $list = arraySafeVal($json, 'data');\n if (!empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='gateio'\");\n foreach ($list as $item) {\n if ($item['curr_b'] != 'BTC')\n continue;\n $symbol = trim(strtoupper($item['symbol']));\n $name = trim($item['name']);\n updateRawCoin('gateio', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('nova', 'disabled')) {\n $list = nova_api_query('markets');\n if (is_object($list) && !empty($list->markets)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='nova'\");\n foreach ($list->markets as $item) {\n if ($item->basecurrency != 'BTC')\n continue;\n $symbol = strtoupper($item->currency);\n updateRawCoin('nova', $symbol);\n //debuglog(\"nova: $symbol\");\n }\n }\n }\n\n if (!exchange_get('stocksexchange', 'disabled')) {\n $list = stocksexchange_api_query('markets');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='stocksexchange'\");\n foreach ($list as $item) {\n if ($item->partner != 'BTC')\n continue;\n if ($item->active == false)\n continue;\n $symbol = strtoupper($item->currency);\n $name = trim($item->currency_long);\n updateRawCoin('stocksexchange', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('empoex', 'disabled')) {\n $list = empoex_api_query('marketinfo');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='empoex'\");\n foreach ($list as $item) {\n $e = explode('-', $item->pairname);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('empoex', $symbol);\n }\n }\n }\n\n if (!exchange_get('kucoin', 'disabled')) {\n $list = kucoin_api_query('currencies');\n if (kucoin_result_valid($list) && !empty($list->data)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='kucoin'\");\n foreach ($list->data as $item) {\n $symbol = $item->name;\n $name = $item->fullName;\n updateRawCoin('kucoin', $symbol, $name);\n }\n }\n }\n\n if (!exchange_get('livecoin', 'disabled')) {\n $list = livecoin_api_query('exchange/ticker');\n if (is_array($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='livecoin'\");\n foreach ($list as $item) {\n $e = explode('/', $item->symbol);\n $base = strtoupper($e[1]);\n if ($base != 'BTC')\n continue;\n $symbol = strtoupper($e[0]);\n updateRawCoin('livecoin', $symbol);\n }\n }\n }\n\n if (!exchange_get('shapeshift', 'disabled')) {\n $list = shapeshift_api_query('getcoins');\n if (is_array($list) && !empty($list)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='shapeshift'\");\n foreach ($list as $item) {\n $status = $item['status'];\n if ($status != 'available')\n continue;\n $symbol = strtoupper($item['symbol']);\n $name = trim($item['name']);\n updateRawCoin('shapeshift', $symbol, $name);\n //debuglog(\"shapeshift: $symbol $name\");\n }\n }\n }\n\n if (!exchange_get('tradesatoshi', 'disabled')) {\n $data = tradesatoshi_api_query('getcurrencies');\n if (is_object($data) && !empty($data->result)) {\n dborun(\"UPDATE markets SET deleted=true WHERE name='tradesatoshi'\");\n foreach ($data->result as $item) {\n $symbol = $item->currency;\n $name = trim($item->currencyLong);\n updateRawCoin('tradesatoshi', $symbol, $name);\n }\n }\n }\n\n //////////////////////////////////////////////////////////\n\n $markets = dbocolumn(\"SELECT DISTINCT name FROM markets\");\n foreach ($markets as $exchange) {\n if (exchange_get($exchange, 'disabled')) {\n $res = dborun(\"UPDATE markets SET disabled=8 WHERE name='$exchange'\");\n if (!$res)\n continue;\n $coins = getdbolist('db_coins', \"id IN (SELECT coinid FROM markets WHERE name='$exchange')\");\n foreach ($coins as $coin) {\n // allow to track a single market on a disabled exchange (dev test)\n if (market_get($exchange, $coin->getOfficialSymbol(), 'disabled', 1) == 0) {\n $res -= dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND coinid={$coin->id}\");\n }\n }\n debuglog(\"$exchange: $res markets disabled from db settings\");\n } else {\n $res = dborun(\"UPDATE markets SET disabled=0 WHERE name='$exchange' AND disabled=8\");\n if ($res)\n debuglog(\"$exchange: $res markets re-enabled from db settings\");\n }\n }\n\n dborun(\"DELETE FROM markets WHERE deleted\");\n\n $list = getdbolist('db_coins', \"not enable and not installed and id not in (select distinct coinid from markets)\");\n foreach ($list as $coin) {\n if ($coin->visible)\n debuglog(\"{$coin->symbol} is no longer active\");\n // todo: proper cleanup in all tables (like \"yiimp coin SYM delete\")\n // if ($coin->symbol != 'BTC')\n // $coin->delete();\n }\n}", "public function init() \n {\n foreach ($this->orders_to_update as $order_id) {\n $this->handle_main($order_id);\n }\n }", "function runAllUpgradeRequests()\r\n {\r\n $upgradeRequests = getAllUpgradeRequests();\r\n foreach /*thing in*/ ($upgradeRequests as $origTicketIDKey => $newTicketMerchIDValue)\r\n {\r\n upgradeTicket($origTicketIDKey, $newTicketMerchIDValue);\r\n }\r\n }", "function myPear_update21(){\n\n // Clean up\n $q=myPear_db()->qquery(\"SELECT * FROM zzz_units WHERE u_rank = 'RO'\",1);\n while($r=myPear_db()->next_record($q)) b_debug::print_r($r,'record');\n \n myPear_db()->qquery(\"DELETE FROM zzz_units WHERE u_rank = 'RO'\",1);\n myPear_db()->qquery(\"SELECT * FROM zzz_list_members WHERE lm_key='' AND lm_value=''\",1); \n myPear_db()->qquery(\"DELETE FROM zzz_list_members WHERE lm_key='' AND lm_value=''\",1); \n $q = myPear_db()->qquery(\"SELECT l_id FROM zzz_lists WHERE l_member_title='department'\",1);\n while($r = myPear_db()->next_record($q)){\n myPear_db()->qquery(\"DELETE FROM zzz_lists WHERE l_id=$r[l_id]\",1);\n myPear_db()->qquery(\"DELETE FROM zzz_list_members WHERE lm_lid=$r[l_id]\",1);\n }\n myPear_db()->qquery(\"UPDATE zzz_organizations SET org_name='SU/Fysikum' WHERE org_name='Stockholm U/Fysikum'\",1);\n\n\n // NO. Write module name to the database for the bLists\n foreach(array('zzz_units'=> 'u',\n\t\t'zzz_lists'=> 'l',\n\t\t) as $t=>$prefix){\n\n if (myPear_db()->columnExists(\"${prefix}_module\",$t)){\n myPear_db()->query(\"ALTER TABLE `$t` DROP `${prefix}_module`\");\n myPear_db()->reset_cache();\n }\n }\n \n // Upgrade Organozation\n if (!myPear_db()->columnExists('org_roles','zzz_organizations')){\n myPear_db()->qquery(\"ALTER TABLE `zzz_organizations` ADD `org_roles` VARCHAR(240) NOT NULL AFTER `org_theme`\",1); \n myPear_db()->reset_cache();\n }\n\n // Keep u_name\n $type = myPear_db()->getColumnType('zzz_units','u_rank');\n if (strToLower($type) != 'int'){\n myPear_db()->qquery(\"ALTER TABLE `zzz_units` CHANGE `u_rank` `u_rank` INT NOT NULL\"); \n }\n\n myPear_db()->qquery(\"UPDATE zzz_lists SET l_class = 'bList_eaEmpRecords' WHERE l_class = 'bList_ea'\",1);\n foreach(array('zzz_units'=>array(//'u_name',\n\t\t\t\t //'u_member_title',\n\t\t\t\t ),\n\t\t'zzz_lists'=>array('l_rank',\n\t\t\t\t //'l_name',\n\t\t\t\t //'l_member_title',\n\t\t\t\t )) as $t=>$ff){\n foreach($ff as $f)\n if (myPear_db()->columnExists($f,$t)) myPear_db()->query(\"ALTER TABLE `$t` DROP `$f`\");\n }\n myPear_db()->reset_cache();\n}", "protected function _loopPluginUpdate($arr)\n\t{\n\t\tglobal $varsPreference;\n\t\tglobal $classEscape;\n\n\t\t$array = $varsPreference['jsonModule'];\n\n\t\tforeach ($array as $key => $value) {\n\t\t\t$strDir = $key;\n\t\t\t$strFile = ucwords($key);\n\t\t\t$path = PATH_BACK_CLASS_ELSE_PLUGIN . $strDir . '/' . $strFile . '.php';\n\t\t\tif (!file_exists($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trequire_once($path);\n\t\t\t$strClass = 'Code_Else_Plugin_' . $strFile . '_' . $strFile;\n\t\t\t$classCall = new $strClass;\n\t\t\t$classCall->loop(array(\n\t\t\t\t'flagType' => 'accountStatus',\n\t\t\t\t'flagStatus' => 'updateModule',\n\t\t\t\t'varsModuleNew' => $arr['varsModuleNew'],\n\t\t\t\t'varsModulePast' => $arr['varsModulePast'],\n\t\t\t\t'arrId' => $arr['arrId'],\n\t\t\t));\n\t\t}\n\t}", "function process_one()\r\n{\r\n global $debug;\r\n $update_id = 0;\r\n echo \"-\";\r\n \r\n if (file_exists(\"last_update_id\")) \r\n $update_id = (int)file_get_contents(\"last_update_id\");\r\n \r\n $updates = get_updates($update_id);\r\n\r\n // jika debug=0 atau debug=false, pesan ini tidak akan dimunculkan\r\n if ((!empty($updates)) and ($debug) ) {\r\n echo \"\\r\\n===== isi diterima \\r\\n\";\r\n print_r($updates);\r\n }\r\n \r\n foreach ($updates as $message)\r\n {\r\n echo '+';\r\n $update_id = process_message($message);\r\n\t}\r\n \r\n\t// @TODO nanti ganti agar update_id disimpan ke database\r\n // update file id, biar pesan yang diterima tidak berulang\r\n file_put_contents(\"last_update_id\", $update_id + 1);\r\n}" ]
[ "0.62726885", "0.6203596", "0.6060833", "0.60435325", "0.60435325", "0.60222983", "0.59911776", "0.5937396", "0.58572555", "0.58572555", "0.58572555", "0.58572555", "0.5834429", "0.5817016", "0.57895195", "0.57885575", "0.5709447", "0.56913984", "0.5676525", "0.56166285", "0.55143136", "0.55143136", "0.55143136", "0.5483826", "0.5472744", "0.5466845", "0.5466845", "0.5376473", "0.5375689", "0.53694695", "0.53664017", "0.5355339", "0.53546125", "0.53455234", "0.5327303", "0.5316542", "0.53007364", "0.528238", "0.5271255", "0.52584314", "0.52484345", "0.52346617", "0.52340645", "0.5231635", "0.52290034", "0.5226772", "0.52111995", "0.52094084", "0.520129", "0.5196006", "0.5193902", "0.5192776", "0.5183452", "0.51800334", "0.5167455", "0.51670897", "0.5156231", "0.5153069", "0.515288", "0.5147138", "0.514268", "0.51374006", "0.51374006", "0.51301765", "0.511533", "0.5108551", "0.5098943", "0.50886774", "0.50850546", "0.50789636", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5066965", "0.5062129", "0.50562584", "0.5051262", "0.50463116", "0.50363845", "0.50347817", "0.5034601", "0.5012718", "0.50075376", "0.50053054", "0.5003827", "0.49995652", "0.49987757", "0.49926934", "0.49893162", "0.4983898", "0.4975432", "0.49714032" ]
0.61921734
2
/ Buy Potential Asset has already been checked that it's below threshold. This function chooses whether it buys all or buys a bit. $folioEntry example: ``` $DOTUSD = array ( 'pairSymbol'=>'DOTUSD', 'coinSymbol'=>'DOT', 'targetPercent' => 5, ); ```
function buyPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price) { $filename = $moduleName. '-'. $folioEntry['pairSymbol'].'-'; $filepath = 'indic/' . $filename . 'ohlcOld.json'; $ohlcOld = file_get_contents($filepath); $ohlcOld = json_decode($ohlcOld, true); $filepath = 'indic/' . $filename . 'emaSet.json'; $emaSet = file_get_contents($filepath); $emaSet = json_decode($emaSet, true); $filepath = '' . $moduleName . '-main.json'; $main = file_get_contents($filepath); $main = json_decode($main, true); end($ohlcOld); $lastKey = key($ohlcOld); $pairSymbol = $folioEntry['pairSymbol']; $haystack = array_column($main, 'pairSymbol'); $mainEntry = array_search($pairSymbol, $haystack, TRUE); $mainLast = count($main)-1; global $exchange; $price = getPrice ($api, $exchange, $pairSymbol); if (!isset($price)) { print ('no price'); } // Buy if lower than threshold if ($currentPercent>1 && $ohlcOld[$lastKey]['close']>$emaSet[$lastKey]['priceEMAMed'] && isset($price)) { $dev = $folioEntry['targetPercent']-$currentPercent; $dev = round($dev*$totalValue/100, 2, PHP_ROUND_HALF_DOWN); // check there is enough USD if ($main[$mainLast]['quantity']>$dev) { $toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN); } else { $toBuy = $main[$mainLast]['quantity']*0.92; $toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN); } $toBuy = $toBuy-$toBuy*0.004; // fee and drift $newAveragePrice = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toBuy * $price; $newAveragePrice = $newAveragePrice/($main[$mainEntry]['quantity'] + $toBuy); $newAveragePrice = round($newAveragePrice,5, PHP_ROUND_HALF_UP); $main[$mainEntry]['quantity'] +=$toBuy; $main[$mainEntry]['averageBuyPrice'] = $newAveragePrice; $main[$mainLast]['quantity'] -= $dev; print ($folioEntry['pairSymbol'].' bought'); } // Re-buy if preveiously sold all. Only dumpable ones apply. if ($currentPercent<=1 && $ohlcOld[$lastKey]['close']<$ohlcOld[$lastKey-1]['close'] && $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] && isset($price)) { $dev = $folioEntry['targetPercent']; $dev = $dev*$totalValue/100; // check there is enough USD if ($main[$mainLast]['quantity']>$dev) { $toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN); } else { $toBuy = $main[$mainLast]['quantity']*0.92; $toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN); } $toBuy = $toBuy- $toBuy*0.004; // fee and drift $main[$mainEntry]['quantity'] = $toBuy; $main[$mainEntry]['averageBuyPrice'] = $price; $main[$mainLast]['quantity'] -= $dev; print ($folioEntry['pairSymbol'].' bought from zero'); } $filepath = '' . $moduleName . '-main.json'; file_put_contents($filepath, json_encode($main)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sellPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price, $unixTime, $threshold) {\n\t$filename = $moduleName. '-';\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\t$history = file_get_contents($filepath);\n\t$history = json_decode($history, true);\n\n\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\tif (!isset($history)) {\n\t\tprint ('zero history');\n\t}\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n\t// Sell if higher than threshold\n\t// || $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow']\n\n\tif ($folioEntry['dumpable']==0 || $ohlcOld[$lastKey]['close']>=$emaSet[$lastKey]['priceEMASlow']) {\n\t\t$devPercent = $currentPercent - $folioEntry['targetPercent'];\n\t\t$dev = round($devPercent*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t$toSell = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\n\t\t$soldValue = $toSell*$price;\n\t\t$fee = 0.004*$soldValue;\n\t\t$soldValue = $soldValue- $fee; // fee and drift\n\n\t\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t// History Stuff\n\t\t$originalValue = $toSell*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$toSell,\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t// Main Stuff\n\n\t\t$newAveragePrice = round(($main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toSell * $price)/($main[$mainEntry]['quantity'] + $toSell),5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] -=$toSell;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold');\n\t}\n\n\t// Sell all aka dump. Only dumpable ones apply.\n\n\tif ($folioEntry['dumpable']==1 && $ohlcOld[$lastKey]['close']<$emaSet[$lastKey]['priceEMASlow'] && $devPercent>$threshold) {\n\n\t\t$soldValue = $main[$mainEntry]['quantity']*$price;\n\t\t$soldValue -= 0.004*$soldValue; // fee and drift\n\n\t\t$fee = 0.004*$soldValue;\n\n\t\t// History Stuff\n\t\t$originalValue = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$main[$mainEntry]['quantity'],\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t$main[$mainEntry]['quantity'] = 0;\n\t\t$main[$mainEntry]['averageBuyPrice'] = 0;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold (dump)');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\tfile_put_contents($filepath, json_encode($history));\n}", "function balanceCheck ($api, $moduleName, $folioArray, $threshold, $unixTime) {\n\n\n // get trade balance would go here\n\n\n\t// get current % of each coin and ema or other indicators\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$pairSymbols = array_column($folioArray, 'pairSymbol');\n\tarray_pop($pairSymbols);\n\n\t$pairCount = count($folioArray)-1; //last is USD\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('USD');\n\t\t}\n\t\t$currentPair = $folioArray[$i]['pairSymbol'];\n\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\n\t\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t $ohlcOld = file_get_contents($filepath);\n\t $ohlcOld = json_decode($ohlcOld, true);\n\n\t\tend($ohlcOld);\n\t\t$lastKey = key($ohlcOld);\n\n\t\t$price[$i] = $ohlcOld[$lastKey]['close'];\n\t\t$priceT[$i] = $ticker[$currentPair]['c'][0];\n\n\t\t$currentValue[$i] = $main[$i]['quantity']*$price[$i];\n\t\t$holdValue[$i] = $main[$i]['startQuantity']*$price[$i];\n\n\t}\n\t$totalValue = array_sum($currentValue);\n\t$totalValue += $main[$pairCount]['quantity']; // add USD\n\n // Hold value is the value if one only holds from the beginning\n\t$holdValue = array_sum($holdValue);\n\t$holdValue += $main[$pairCount]['startQuantity']; // add USD\n\n\t$operation = null;\n\n\t// based on deviation from planned % of folio, do stuff for each thing\n\tfor ($i=0; $i<$pairCount; $i++) { // count($folioArray)-1 since last is USD\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('squeak');\n\t\t}\n\n\t\tif ($folioArray[$i]['coinSymbol']!='ZUSD') {\n\t\t\t$currentPercent[$i] = round ($currentValue[$i]/$totalValue*100, 3, PHP_ROUND_HALF_UP);\n\t\t\t$deviation = $currentPercent[$i]-$main[$i]['targetPercent'];\n\n //Potential checks if it is worth buying or selling, depending on status of indicators\n\t\t\tif ($deviation>$threshold) {\n\t\t\t\tsellPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i], $unixTime, $threshold);\n\t\t\t}\n\t\t\tif ($deviation<-$threshold) {\n\t\t\t\tbuyPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i]);\n\t\t\t}\n\t\t\t$operation[] = $folioArray[$i]['pairSymbol'].' balance checked';\n\t\t}\n\t}\n\n\n\n\t$filepath = ''.$moduleName.'-'.'QuickExt.json';\n\t$quickExt = file_get_contents($filepath);\n\t$quickExt = json_decode($quickExt, true);\n\n\t$quickExt['tempTotalValue'] = $totalValue;\n\t$quickExt['holdValue'] = $holdValue;\n\n\tfor ($i=0; $i<=$pairCount; $i++) { // includes USD\n\t\t$quickExt['volChange'][$folioArray[$i]['coinSymbol']] = round($main[$i]['quantity']/$main[$i]['startQuantity']*100, 2, PHP_ROUND_HALF_UP);\n\t}\n\n\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\tprint_r ($operation);\n}", "private function unbalancedSupply() {\n $rapporto = $_POST['quantitaCercata'] / $_POST['quantitaOfferta'];\n if ($rapporto >= 0.5 && $rapporto <= 2)\n return false;\n return true;\n }", "function lotto_buyTickets() {\n\n\t// Set some needed variables.\n\tglobal $DB;\n\tglobal $MySelf;\n\n\t$ID = $MySelf->getID();\n\t$myMoney = getCredits($ID);\n\t$affordable = floor($myMoney / 1000000);\n\t\n\tif (!getConfig(\"lotto\")) {\n\t\tmakeNotice(\"Your CEO disabled the Lotto module, request denied.\", \"warning\", \"Lotto Module Offline\");\n\t}\n\n\t// Get my credits\n\t$MyStuff = $DB->getRow(\"SELECT lottoCredit, lottoCreditsSpent FROM users WHERE id='\" . $MySelf->getID() . \"'\");\n\t$Credits = $MyStuff[lottoCredit];\n\t$CreditsSpent = $MyStuff[lottoCreditsSpent];\n\n\t// User submited this form already!\n\tif ($_POST[check]) {\n\t\tnumericCheck($_POST[amount], 0, $affordable);\n\n\t\tif ($_POST[amount] == 0) {\n\t\t\tmakeNotice(\"You cannot buy zero tickets.\", \"warning\", \"Too few tickets.\", \"index.php?action=lotto\", \"[whoops]\");\n\t\t}\n\n\t\tconfirm(\"Please authorize the transaction of \" . number_format(($_POST[amount] * 1000000), 2) . \" ISK in order to buy $_POST[amount] lotto credits.\");\n\n\t\t// Get the old ticket count, and add the new tickets on top of those.\t\t\t\n\t\t$oldCount = $DB->getCol(\"SELECT lottoCredit FROM users WHERE id='$ID' LIMIT 1\");\n\t\t$newcount = $oldCount[0] + $_POST[amount];\n\n\t\t// Update the database to reflect the new ticket count.\n\t\t$check = $DB->query(\"UPDATE users SET lottoCredit='$newcount' WHERE id='$ID' LIMIT 1\");\n\n\t\t// Check that we were successful.\n\t\tif ($DB->affectedRows() != 1) {\n\t\t\tmakeNotice(\"I was unable to add $newcount tickets to $user stack of $count tickets! Danger will robonson, danger!\", \"error\", \"Unable to comply.\");\n\t\t}\n\n\t\t// Make him pay!\n\t\tglobal $TIMEMARK;\n\t\t$transaction = new transaction($ID, 1, ($_POST[amount] * 1000000));\n\t\t$transaction->setReason(\"lotto credits bought\");\n\t\tif ($transaction->commit()){\n\t\t\t// all worked out!\n\t\t\tmakeNotice(\"Your account has been charged the amount of \" . number_format(($_POST[amount] * 1000000), 2) . \" ISK.\", \"notice\", \"Credits bought\", \"index.php?action=lotto\", \"[OK]\");\n\t\t} else {\n\t\t\t// We were not successfull\n\t\t\tmakeNotice(\"I was unable to add $newcount tickets to $user stack of $count tickets! Danger will robonson, danger!\", \"error\", \"Unable to comply.\");\n\t\t}\n\t}\n\n\t// Prepare the drop-down menu.\n\tif ($affordable >= 1) {\n\t\t$ddm = \"<select name=\\\"amount\\\">\";\n\t\tfor ($i = 1; $i <= $affordable; $i++) {\n\t\t\tif ($i == 1) {\n\t\t\t\t$ddm .= \"<option value=\\\"$i\\\">Buy $i tickets</option>\";\n\t\t\t} else {\n\t\t\t\t$ddm .= \"<option value=\\\"$i\\\">Buy $i tickets</option>\";\n\t\t\t}\n\t\t}\n\t\t$ddm .= \"</select>\";\n\t} else {\n\t\t// Poor user.\n\t\t$ddm = \"You can not afford any credits.\";\n\t}\n\n\t// Create the table.\n\t$table = new table(2, true);\n\t$table->addHeader(\">> Buy lotto credits\");\n\t$table->addRow();\n\t$table->addCol(\"Here you can buy lotto tickets for 1.000.000,00 ISK each. \" .\n\t\"Your account currently holds \" . number_format($myMoney, 2) . \" ISK, so \" .\n\t\"you can afford $affordable tickets. Please choose the amount of credits you wish \" .\n\t\"to buy.\", array (\n\t\t\"colspan\" => 2\n\t));\n\n\t$table->addRow();\n\t$table->addCol(\"Your credits:\");\n\t$table->addCol($Credits);\n\t$table->addRow();\n\t$table->addCol(\"Total spent credits:\");\n\t$table->addCol($CreditsSpent);\n\t$table->addRow();\n\t$table->addCol(\"Purchase this many credits:\");\n\t$table->addCol($ddm);\n\t$table->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"Buy credits\\\">\");\n\t$table->addRow(\"#060622\");\n\t$table->addCol(\"[<a href=\\\"index.php?action=lotto\\\">Cancel request</a>]\", array (\n\t\t\"colspan\" => 2\n\t));\n\n\t// Add some more html form stuff.\n\t$html = \"<h2>Buy Lotto credits</h2>\";\n\t$html .= \"<form action=\\\"index.php\\\" method=\\\"POST\\\">\";\n\t$html .= $table->flush();\n\t$html .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"true\\\">\";\n\t$html .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"lottoBuyCredits\\\">\";\n\t$html .= \"</form>\";\n\n\t// Return the mess we made.\n\treturn ($html);\n}", "public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "public function issueFeeOverdue()\n {\n $timeToPay = new \\DateInterval('P10D');\n $cutoff = new \\DateTime();\n $cutoff->sub($timeToPay);\n\n $criteria = Criteria::create();\n $criteria->andWhere(Criteria::expr()->lte('invoicedDate', $cutoff->format(\\DateTime::ISO8601)));\n $criteria->orderBy(['invoicedDate' => Criteria::DESC]);\n\n $matchedFees = $this->getFees()->matching($criteria);\n\n /**\n * @var Fee $fee\n */\n foreach ($matchedFees as $fee) {\n if ($fee->isOutstanding() && $fee->getFeeType()->isEcmtIssue()) {\n return true;\n }\n }\n\n return false;\n }", "function buy(Time $processingTime, Trade $updateExistingTrade = null, $cancelOffer = false, $price)\n\t{\n\t\t$sellingAsset = $this->settings->getBaseAsset();\n\t\t$buyingAsset = $this->settings->getCounterAsset();\n\t\t\n\t\t$budget = $this->getCurrentBaseAssetBudget(true);\n\t\t$sellAmount = \\GalacticHorizon\\Amount::createFromFloat($budget);\n\n\t\tif (!$cancelOffer && $sellAmount->toFloat() <= 0) {\n\t\t\t$this->data->logError(\"Manage buy offer failed, buying amount is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$cancelOffer && (float)$price <= 0)\n\t\t{\n\t\t\t$this->data->logError(\"Manage buy offer failed, price is zero.\");\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/*\n\t\tvar_dump(\"budget = \" . $budget);\n\t\tvar_dump(\"price = \" . $price);\n\t\tvar_dump(\"sellingAsset = \" . $sellingAsset->getCode());\n\t\tvar_dump(\"sellAmount = \" . $sellAmount->toFloat());\n\t\tvar_dump(\"buyingAsset = \" . $buyingAsset->getCode());\n\t\texit();\n\t\t*/\n\n\t\t$manageOffer = new \\GalacticHorizon\\ManageSellOfferOperation();\n\t\t$manageOffer->setSellingAsset($sellingAsset);\n\t\t$manageOffer->setBuyingAsset($buyingAsset);\n\t\t$manageOffer->setSellAmount($cancelOffer ? \\GalacticHorizon\\Amount::createFromFloat(0) : $sellAmount);\n\t\t$manageOffer->setPrice(\\GalacticHorizon\\Price::createFromFloat($price));\n\t\t$manageOffer->setOfferID($updateExistingTrade ? $updateExistingTrade->getOfferID() : null);\n\n\t\ttry {\n\t\t\t$transaction = new \\GalacticHorizon\\Transaction($this->settings->getAccountKeypair());\n\t\t\t$transaction->addOperation($manageOffer);\n\t\t\t$transaction->sign([$this->settings->getAccountKeypair()]);\n\t\t\t\n\t\t\t$buffer = new \\GalacticHorizon\\XDRBuffer();\n\t\t\t$transaction->toXDRBuffer($buffer);\n\n\t\t\t$automaticlyFixTrustLineWithAmount = \\GalacticHorizon\\Amount::createFromFloat(2000000);\n\n\t\t\t$transactionResult = $transaction->submit($automaticlyFixTrustLineWithAmount);\n\n\t\t\tif ($transactionResult->getErrorCode() == \\GalacticHorizon\\TransactionResult::TX_SUCCESS) {\n\t\t\t\t// Return when an offer is cancelled\n\t\t\t\tif ($cancelOffer)\n\t\t\t\t\treturn true;\n\n\t\t\t\t$trade = Trade::fromGalacticHorizonOperationResponseAndResultForBot(\n\t\t\t\t\t$manageOffer,\n\t\t\t\t\tTrade::TYPE_BUY,\n\t\t\t\t\t$transactionResult,\n\t\t\t\t\t$transactionResult->getResult(0),\n\t\t\t\t\t$buffer->toBase64String(),\n\t\t\t\t\t$transactionResult->getFeeCharged()->toString(),\n\t\t\t\t\t$this\n\t\t\t\t);\n\n\t\t\t\t$lastTrade = $this->data->getLastTrade();\n\n\t\t\t\tif ($lastTrade)\n\t\t\t\t\t$trade->setPreviousBotTradeID($lastTrade->getID());\n\n\t\t\t\t$trade->setProcessedAt($processingTime->getDateTime());\n\n\t\t\t\t$this->data->addTrade($trade);\n\n\t\t\t\treturn $trade;\n\t\t\t} else {\n\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, error code = \" . $transactionResult->getErrorCode());\n\n\t\t\t\tif ($transactionResult->getResultCount() > 0) {\n\t\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer result, error code = \" . $transactionResult->getResult(0)->getErrorCode());\n\t\t\t\t}\n\n\t\t\t\t$this->getDataInterface()->logError(\"Transaction envelope = \" . $buffer->toBase64String());\n\t\t\t}\n\t\t} catch (\\GalacticHorizon\\Exception $e) {\n\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, exception = \" . (string)$e);\n\t\t\t$this->getDataInterface()->logError(\"Response = \" . $e->getHttpResponseBody());\n\t\t}\t\n\n\t\treturn false;\n\t}", "function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}", "function isPowerOverloaded($extra_consumption = 0)\n{\n global $game;\n\n // Calculate buildings energy consumption\n $buildings = $game->planet['building_1'] +\n $game->planet['building_2'] + \n $game->planet['building_3'] + \n $game->planet['building_4'] + \n $game->planet['building_10'] + \n $game->planet['building_6'] + \n $game->planet['building_7'] + \n $game->planet['building_8'] +\n $game->planet['building_9'] + \n $game->planet['building_11'] + \n $game->planet['building_12'] +\n $game->planet['building_13'];\n\n // Consider extra consumption from queued buildings\n $buildings += $extra_consumption;\n\n // Check if the active planet is the user's capital\n if ($game->player['user_capital']==$game->planet['planet_id'])\n $available_power = $game->planet['building_5']*11+14;\n else\n $available_power = $game->planet['building_5']*15+3;\n\n return ($buildings >= $available_power);\n}", "function buyStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qty = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n \n //Check Account Balance to see if the buy is possible\n $accountValue = getCurrentAccountBalance($username);\n \n //$purCost is to store a value in DB, ex: $purCost = API->currentCost;\n $purCost = $currentCost;\n \n //Calculate the total value of your purchase. Cost * Shares\n $totalValue = $purCost * $qty;\n \n if($accountValue >= $totalValue)\n {\n //add this entry into the DB.\n addToPortfolioDB($username,$purCost,$qty,$sym);\n //subtract cost of purchase from Bank Account Balance\n deleteFromAccountBalance($username,$totalValue,$accountValue);\n }\n else\n {\n echo \"NOT ENOUGH FUCKING MONEY\";\n }\n \n \n \n //make a new object to store data to return?\n $returnObj = array(\"TotalValue\"=>$totalValue);\n //example of how to single out a value is Below\n //var_dump($returnObj[\"TotalValue\"]);\n \n //returns an array\n return (json_encode($returnObj));\n //returns an json object\n //return (json_encode($returnObj));\n}", "public function hasBoothfee(){\n return $this->_has(6);\n }", "public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "function sellStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qtyRequested = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n\n //check how many of the stock you own\n $qtyYouOwn = getStockQuantity($username,$sym);\n \n //Make sure you have more or equal qty in portfolio compared to what you wanna sell\n if($qtyYouOwn >= $qtyRequested)\n {\n //Calculate the total value of your sell.\n $totalValue = $currentCost * $qtyRequested;\n }\n else //Placeholder for now, should probably not do this.\n {\n //Sell only the amount that you have in portfolio\n $totalValue = $currentCost * $qtyYouOwn;\n }\n \n \n //Call addtoAccountBalance and add $totalValue to the account balance\n $currentBalance = addtoAccountBalance($username,$totalValue,$sym);\n \n //Call deleteFromPortfolioDB and delete the previous entry\n deleteFromPortfolioDB($username, $qtyRequested, $sym);\n\n $returnString = \"Sell Order Confirmed!\";\n \n return($returnString);\n}", "function compute_withdrawing_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n if ($amount < 20000)\n {\n $fee = 1;\n }\n else if ($amount < 50000)\n {\n $fee = 3;\n }\n else\n {\n $fee = 5;\n }\n }\n return $fee;\n}", "function my_check_cost_of_bookings() {\n if ( is_cart() || is_checkout() ) {\n $bookable_total = $bookable_minimum = 0;\n foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n if ( isset( $cart_item['booking'] ) ) {//the cart contains a bookable product\n $quantity = $cart_item['quantity'];\n $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );\n $bookable_minimum = 20;\n $price = $_product->get_price();\n $taxable = $_product->is_taxable();\n if ( $taxable ) {\n if ( WC()->cart->tax_display_cart == 'excl' ) {\n $product_subtotal = $_product->get_price_excluding_tax( $quantity );\n } else {\n $product_subtotal = $_product->get_price_including_tax( $quantity );\n }\n // Non-taxable\n } else {\n $product_subtotal = $price * $quantity;\n }\n $bookable_total += $product_subtotal;\n if ( $bookable_total >= $bookable_minimum ) {\n return;\n }\n }\n }\n if ( $bookable_total > $bookable_minimum ) {\n wc_add_notice( sprintf( '<strong>A Minimum of %s %s is required before checking out.</strong>' . '<br />Current cart\\'s total: %s %s', $bookable_minimum, get_option( 'woocommerce_currency'), $bookable_total,get_option( 'woocommerce_currency') ), 'error' );\n }\n }\n}", "private function purchaseRestrictionsAwal($ins) {\n \n $dateNow = date('Y-m-d'); // date now\n \n // cek total volume pengisian selama hari ini, apakah >= 100 liter\n $totalVolumeFill = $this->db->query(\"SELECT SUM(liter) AS `total_volume` FROM {$this->transaction_kendaraan} WHERE no_pol = '{$ins['no_pol']}' AND tgl = '{$dateNow}' \")\n ->row_array()['total_volume'];\n \n $lastTotalVolume = floatval($ins['liter']) + floatval($totalVolumeFill);\n \n if($lastTotalVolume > 200) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam satu hari yang sama\"\t \n\t // \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam pembelian ke - {$ins['numOfBuy']}\", \n\t ];\n\t echo json_encode($response);\n\t \n } else if(floatval($ins['liter']) > 75) {\n\t \n\t $response = [\n\t \"status\" => \"approval\", \n\t \"message\" => \"Customer ingin mengisi lebih dari 75 liter ({$ins['liter']} liter) dalam pembelian {$ins['numOfBuy']}\", \n\t \"question\" => \"Apakah anda setuju melakukan pengisian lebih dari 75 liter ({$ins['liter']} liter) ?\"\n\t ];\n\t echo json_encode($response);\n\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "function processPaymentFieldsSpecialEvents($entry)\n{\n global $dbPriceSingleTicket;\n global $dbPricePartHigh;\n global $dbPricePartHighBtw;\n global $dbTicketPricePart;\n global $dbTicketPricePartBtw;\n global $dbTicketPricePartTotal;\n global $dbBtwHigh;\n\n global $dbFoodPrice;\n $price_ticket_ex_food = $dbPriceSingleTicket - $dbFoodPrice;\n\n // If there is a reduction price which is smaller than the food price the price part high will be below zero\n if ($price_ticket_ex_food < 0) {\n $price_ticket_ex_food = 0;\n }\n\n global $dbParticipants;\n $dbTicketPricePart = $price_ticket_ex_food * count($dbParticipants);\n\n $dbTicketPricePartBtw = $dbTicketPricePart * $dbBtwHigh;\n $dbTicketPricePartTotal = $dbTicketPricePart + $dbTicketPricePartBtw;\n\n $dbPricePartHigh = $dbTicketPricePart + $dbParkingPricePart;\n $dbPricePartHighBtw = $dbPricePartHigh * $dbBtwHigh;\n\n global $dbPricePartHighTotal;\n $dbPricePartHighTotal = $dbPricePartHigh + $dbPricePartHighBtw;\n \n // Calculate low btw\n // When the reduction price is smaller than the food price take the reduction price\n global $dbPricePartLow;\n $dbPricePartLow = $dbFoodPrice;\n if ($dbTicketPrice < $dbFoodPrice) {\n $dbPricePartLow = $dbTicketPrice;\n }\n\n global $dbPricePartLowBtw;\n global $dbPricePartLowTotal;\n global $dbFoodPartPriceLow;\n global $dbFoodPartPriceLowBtw;\n global $dbFoodPartPriceLowTotal;\n\n global $dbBtwLow;\n\n $dbPricePartLow = count($dbParticipants) * $dbPricePartLow;\n $dbFoodPartPriceLow = $dbPricePartLow;\n $dbPricePartLowBtw = $dbPricePartLow * $dbBtwLow;\n $dbFoodPartPriceLowBtw = $dbPricePartLowBtw;\n $dbPricePartLowTotal = $dbPricePartLow + $dbPricePartLowBtw;\n $dbFoodPartPriceLowTotal = $dbPricePartLowTotal;\n\n // Payment details\n global $dbTotalBtw;\n $dbTotalBtw = $dbPricePartLowBtw + $dbPricePartHighBtw;\n global $dbTotalPrice;\n $dbTotalPrice = ($dbPriceSingleTicket * count($dbParticipants)) + $dbParkingPricePart + $dbMembershipPricePart;\n\n $rounded_total_price = number_format($dbTotalPrice * 100, 0, ',', '');\n $rounded_btw_part_low = number_format(($dbPricePartLowBtw) * 100, 0, ',', '');\n $rounded_btw_part_high = number_format(($dbPricePartHighBtw) * 100, 0, ',', '');\n\n global $dbTotalPriceBtw;\n $dbTotalPriceBtw = ($rounded_total_price + $rounded_btw_part_low + $rounded_btw_part_high) / 100;\n}", "public function test_it_resolves_correct_free_item_qtys()\n {\n $adType = AdType::inRandomOrder()->first();\n\n //3 for the price of 2\n $rule = new XForThePriceOfYRule;\n $rule->setThresholdQty(3);\n $rule->setCalculatedQty(2);\n $rule->setAdType($adType);\n\n //3 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 3, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //4 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 4, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //5 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 5, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //6 eligible items in checkout, should return 2\n $checkoutItems = $this->generateCheckoutItems($adType, 6, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(2, $rule->totalBonusQty($checkoutItems->all()));\n\n //5 for the price of 4\n $rule = new XForThePriceOfYRule;\n $rule->setThresholdQty(5);\n $rule->setCalculatedQty(4);\n $rule->setAdType($adType);\n\n //3 eligible items in checkout, should return 0\n $checkoutItems = $this->generateCheckoutItems($adType, 3, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(0, $rule->totalBonusQty($checkoutItems->all()));\n\n //5 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 5, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //6 eligible items in checkout, should return 1\n $checkoutItems = $this->generateCheckoutItems($adType, 6, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(1, $rule->totalBonusQty($checkoutItems->all()));\n\n //10 eligible items in checkout, should return 2\n $checkoutItems = $this->generateCheckoutItems($adType, 10, $qtyOfDiffTypes = rand(6, 10));\n $this->assertEquals(2, $rule->totalBonusQty($checkoutItems->all()));\n }", "public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}", "private function calculateFOBPriceAction()\n {\n // than 99, then modify shippingPrice to 0.00 \n \t$price = $this->info['productPrice'];\n if($price <= 99){\n $shippingPrice = $this->info['shippingPrice'];\n }\n else{\n $this->info['shippingPrice'] = 0.0;\n }\n $this->info['fobPrice'] = ($price + $shippingPrice) * 1.07; // It also adds US TAXes\n }", "protected function setOfferApplicablePricing ()\n {\n $offerApplicableAccountHeads = $this->getOfferApplicableAccountHeads();\n\n foreach ( $this->request->pricing as $accountHead => $amount ) {\n if ( in_array($accountHead, $offerApplicableAccountHeads) ) {\n $this->offerApplicablePricing[ $accountHead ] = $amount;\n $this->offerApplicableAmount += $amount;\n }\n }\n }", "function checkPairing($user_id, $user_name, $pkg_id, $trans_datetime, $trans_date, $auto_flush)\n{\n\t//$max_daily_point = 100;\n \t$sql = \"SELECT max_daily_point\n FROM product_package\n WHERE pkg_id = $pkg_id\n\t\t limit 1\n \";\n \t$resultPkg=dbQuery($sql);\n\t$row=dbFetchAssoc($resultPkg);\t\n\t$max_daily_point = $row['max_daily_point'];\n\t\n\t$checkPoint = checkPoint($user_id);\n\t$balance_left_point = $checkPoint['balance_left_point'];\n\t$balance_right_point = $checkPoint['balance_right_point'];\n\t\n\tif($balance_left_point > 0 and $balance_right_point > 0)\n\t{\n\t\n\t\tif($balance_left_point > $balance_right_point)\n\t\t{\n\t\t\t$pair_point = $balance_right_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pair_point = $balance_left_point;\n\t\t}\n\t\t\n\t\t$actual_pair_point = $pair_point;\n\t\n\t\t$total_daily_pair_point = checkDailyPairPoint($user_id, $trans_date);\n\t\t$balance_max_daily_point = $max_daily_point - $total_daily_pair_point;\n\t\t\n\t\tif($balance_max_daily_point >= $pair_point)\n\t\t{\n\t\t\t$total_pair_point = $pair_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$total_pair_point = $balance_max_daily_point;\n\t\t}\n\t\t\n\t\tif($total_pair_point > 0 and $max_daily_point > $total_daily_pair_point and $auto_flush ==0)\n\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t$total_bonus = $total_pair_point * 15;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date,pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tcreated_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$total_pair_point', '$total_bonus', \n\t\t\t\t\t\t$_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$bonus_description = 'Pairing Bonus';\n\t\t\t\t$pair_bonus = $total_bonus;\n\t\t\t\t\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, $pair_bonus, 0, $user_name, $trans_datetime);\n\t\t\t\t\n\t\t\t\t$bonus_description = '10% into M-Wallet';\n\t\t\t\t$pair_bonus_deduct = 0.1 * $total_bonus;\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, 0, $pair_bonus_deduct, $user_name, $trans_datetime);\n\t\t\t\twallet('acct_mwallet', 4, $user_id, $bonus_description, $pair_bonus_deduct, 0, $user_name, $trans_datetime);\t\t\n\t\t\n\t\t}\n\t\telse // Flush\n\t\t{\n\t\t\t\t$total_bonus = 0;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date, pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tflush_sw, created_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$actual_pair_point', '$total_bonus', \n\t\t\t\t\t\t1, $_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t}\t\t\n\t}\n\t\n\n\t\n\n}", "public static function buy_bullish($pair, $risk, $stop, $leverage=50) {\n\n\t\t\t//Retrieve current price\n\t\t\tif (! self::valid($price = self::price($pair)))\n\t\t\t\treturn $price;\n\n\t\t\t//Find the correct size so that $risk is divided by $pips\n\t\t\tif (! self::valid($size = self::nav_size_percent_per_pip($pair, ($risk/$stop))))\n\t\t\t\treturn $size;\n\n\t\t\tif (! self::valid($newTrade = self::buy_market($size, $pair)) && isset($newTrade->tradeId))\n\t\t\t\treturn $newTrade;\n\n\t\t\t//Set the stoploss\n\t\t\treturn self::trade_set_stop($newTrade->tradeId, $price->ask + (self::instrument_pip($pair) * $stop));\n\t\t}", "public function test_amount_less_than_rate_cost()\n {\n\n\n\n $data=[\"amount\"=> 100,\n \"unpaid_appliance_rates\"=> 2,\n \"appliance_rate_cost\"=> 200,\n \"tariff_fixed_costs\"=> 160,\n \"price_per_kwh\"=> 700\n ];\n\n $response = $this->post('/api/transactions', $data);\n // $response->assertStatus(200);\n $response->assertJson( [\"data\"=> [\n \"type\"=> \"transaction\",\n \"attributes\"=> [\n \"paid_for_appliance_rates\"=> 0,\n \"fully_covered_appliance_rate\"=> 0,\n \"paid_for_fixed_tariff\"=> 100,\n \"paid_for_energy\"=> 0,\n \"topup_for_energy\"=> 0,\n \"sold_energy\"=> 0\n ]\n ]]);\n }", "public function tallyFee($row)\n\t{\n\t\treturn ($row['c_quantity'] * $row['og_s_value']) * ($this->settings['eco_stocks_buy_fee']/100);\n\t}", "public function canBuy()\n {\n //改成上半场内都能投注\n $match = $this->getMatch();\n if (!is_null($match) && ($match->isBeforeHalf())){\n return true;\n } else {\n return false;\n }\n }", "public static function sumTargetHealBonus(stdClass $data){\n\t\t//limit max earrings to 2\n\t\tself::limit($data, array('oldEarrings', 'newEarrings'), 2);\n\n\t\tif(!$data->includeTargetBonus){\n\t\t\treturn 0;\n\t\t}\n\n\t\t$bonus = 0;\n\t\t$isMw = ($data->chestEnchant==ENCHANT_MW_NINE OR $data->chestEnchant==ENCHANT_MW_TWELVE);\n\n\t\t//earrings\n\t\t$bonus += $data->oldEarrings * BONUS_EARRING_OLD;\n\t\t$bonus += $data->newEarrings * BONUS_EARRING_NEW;\n\n\t\t//earring bonus stats\n\t\tif($data->earringBonusLeft){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusLeft);\n\t\t}\n\t\tif($data->earringBonusRight){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusRight);\n\t\t}\n\n\t\t//heart potion\n\t\tif($data->heartPotion){\n\t\t\t$bonus += BONUS_HEART_POTION;\n\t\t}\n\n\t\t//if chest is disabled, stop here\n\t\tif($data->chestType==TYPE_NONE){\n\t\t\treturn $bonus;\n\t\t}\n\n\t\t//base (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//+0 (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusZero){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//plus\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\t\telseif($data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_NEW : BONUS_CHEST_NEW_PLAIN);\n\t\t}\n\n\t\treturn $bonus;\n\t}", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function item_quantities_none() {\r\n //if( isset($edd_options['coopshares_fair_checkout_info']) ) {\r\n // return true;\r\n //} else {\r\n return false;\r\n //}\r\n}", "public function isFree()\n {\n return ((float) $this->price <= 0.00);\n }", "public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}", "public static function chargeFees($price=1)\n {\n\n }", "function playerHit($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll){\n\t$newCard = drawACard($deck);\n\t$player[] = $newCard;\n\t$total = getTotal($player);\n\t//echo out each card and total\n\tforeach ($player as $card) {\n\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n\t//notify when player busts\n\tif (getTotal($player) > 21) {\n\t\tevaluateHands($name, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\t}\n\treturn $player;\n}", "public function calculateProfit(): bool\n {\n return true;\n }", "private function set_alcohol_use($arr) {\r\n\t\t$qno = $this->getFirstQuestionNo('alcohol_use');\r\n\t\t$err = null;\r\n try{//11.  How many alcoholic drinks do you consume on average?\r\n \t$v=$this->vc->exists('q39',$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t$this->data['alcohol_use']['q39']=($v==\"\")?0:$v;\r\n }catch(ValidationException $e){\r\n \t$eob=$e->createErrorObject();\r\n \t$eob->message = \"Please answer approximately how many alcholic drinks you consume on average\";\r\n \t$eob->name = \"Question \" . $qno;\r\n \t$err[] = $eob;\r\n }\r\n\r\n\t\t$qno += 1;\r\n try{//12. Have you ever had more than 5 drinks at one time in the past four (4) months?\r\n \t$v=$this->vc->exists('q40',$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t$this->data['alcohol_use']['q40']=($v==\"\")?0:$v;\r\n }catch(ValidationException $e){\r\n \t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please tell us if you have had more than 5 drinks at one time in the last 4 months\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n }\r\n\r\n\t\treturn ($err) ? $err : false;\r\n\t}", "function update_portfolio($connection, $id, $symbol, $amount){\n $result = get_portfolio($connection, $id, $symbol);\n $newAmount = $result['amount'] + $amount;\n if ($newAmount < 1){\n remove_portfolio($connection, $id, $symbol);\n }\n else{\n try {\n $sql = \"UPDATE portfolio Set amount = ? WHERE userId = ? AND symbol = ?\";\n $result = runQuery($connection, $sql, array($newAmount, $id, $symbol));\n return $result;\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n }\n }\n}", "function buy($amount,$symbol)\n {\n //balance should be greater than stock value to buy\n if($amount<=$this->totalamount)\n {\n //buy book stock\n if($symbol==\"Book\"){\n echo $this->new_account.\" owned Book Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->bookstock_buy++;\n $this->object_linkedlist->insertfirst(\"Book: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n //buy newspaper stock\n elseif($symbol==\"Newspaper\")\n {\n echo $this->new_account.\" owned Newspaper Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->newspaperstock_buy++;\n $this->object_linkedlist->insertfirst(\"Newspaper: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n }\n //if balance is less than stock value\n else{\n echo \"Your Balance is low than Stock price\\n\";\n }\n }", "public function is_fixed() {\n $deposit_type = get_option( 'woo_deposit_type' );\n \n if ( $deposit_type == 'fixed' ) {\n return true;\n } else {\n return false;\n }\n }", "public function askForFeeConfirmation()\n {\n }", "function sell(Time $processingTime, Trade $updateExistingTrade = null, $cancelOffer = false, $price)\n\t{\n\t\t$sellingAsset = $this->settings->getCounterAsset();\n\t\t$buyingAsset = $this->settings->getBaseAsset();\n\n\t\t$budget = $this->getCurrentCounterAssetBudget(true);\n\t\t$sellAmount = \\GalacticHorizon\\Amount::createFromFloat($budget);\n\n\t\tif (!$cancelOffer && $sellAmount->toFloat() <= 0) {\n\t\t\t$this->data->logError(\"Manage sell offer failed, selling amount is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$cancelOffer && (float)$price <= 0) {\n\t\t\t$this->data->logError(\"Manage sell offer failed, price is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($price > 0)\n\t\t\t$price = number_format(1/$price, 7, '.', '');\n\n\t\t/*\n\t\tvar_dump(\"budget = \", $budget);\n\t\t//var_dump(\"sellingAsset = \", $sellingAsset);\n\t\t//var_dump(\"buyingAsset = \", $buyingAsset);\n\t\tvar_dump(\"price = \", $price);\n\t\tvar_dump(\"sellAmount = \", $sellAmount->toFloat());\n\t\texit();\n\t\t*/\n\n\t\t$manageOffer = new \\GalacticHorizon\\ManageSellOfferOperation();\n\t\t$manageOffer->setSellingAsset($sellingAsset);\n\t\t$manageOffer->setBuyingAsset($buyingAsset);\n\t\t$manageOffer->setSellAmount($cancelOffer ? \\GalacticHorizon\\Amount::createFromFloat(0) : $sellAmount);\n\t\t$manageOffer->setPrice(\\GalacticHorizon\\Price::createFromFloat($price));\n\t\t$manageOffer->setOfferID($updateExistingTrade ? $updateExistingTrade->getOfferID() : null);\n\n\t\ttry {\n\t\t\t$transaction = new \\GalacticHorizon\\Transaction($this->settings->getAccountKeypair());\n\t\t\t$transaction->addOperation($manageOffer);\n\t\t\t$transaction->sign([$this->settings->getAccountKeypair()]);\n\t\t\t\n\t\t\t$buffer = new \\GalacticHorizon\\XDRBuffer();\n\t\t\t$transaction->toXDRBuffer($buffer);\n\n\t\t\t$automaticlyFixTrustLineWithAmount = \\GalacticHorizon\\Amount::createFromFloat(2000000);\n\n\t\t\t$transactionResult = $transaction->submit($automaticlyFixTrustLineWithAmount);\n\n\t\t\tif ($transactionResult->getErrorCode() == \\GalacticHorizon\\TransactionResult::TX_SUCCESS) {\n\t\t\t\t// Return when an offer is cancelled\n\t\t\t\tif ($cancelOffer)\n\t\t\t\t\treturn true;\n\n\t\t\t\t$trade = Trade::fromGalacticHorizonOperationResponseAndResultForBot(\n\t\t\t\t\t$manageOffer,\n\t\t\t\t\tTrade::TYPE_SELL,\n\t\t\t\t\t$transactionResult,\n\t\t\t\t\t$transactionResult->getResult(0),\n\t\t\t\t\t$buffer->toBase64String(),\n\t\t\t\t\t$transactionResult->getFeeCharged()->toString(),\n\t\t\t\t\t$this\n\t\t\t\t);\n\n\t\t\t\t$lastTrade = $this->data->getLastTrade();\n\n\t\t\t\tif ($lastTrade)\n\t\t\t\t\t$trade->setPreviousBotTradeID($lastTrade->getID());\n\n\t\t\t\t$trade->setProcessedAt($processingTime->getDateTime());\n\n\t\t\t\t$this->data->addTrade($trade);\n\n\t\t\t\treturn $trade;\n\t\t\t} else {\n\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, error code = \" . $transactionResult->getErrorCode());\n\n\t\t\t\tif ($transactionResult->getResultCount() > 0) {\n\t\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer result, error code = \" . $transactionResult->getResult(0)->getErrorCode());\n\t\t\t\t}\n\n\t\t\t\t$this->getDataInterface()->logError(\"Transaction envelope = \" . $buffer->toBase64String());\n\t\t\t}\n\t\t} catch (\\GalacticHorizon\\Exception $e) {\n\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, exception = \" . (string)$e);\n\t\t\t$this->getDataInterface()->logError(\"Response = \" . $e->getHttpResponseBody());\n\t\t}\t\n\n\t\treturn false;\n\t}", "public function hasNewPrice(){\n return $this->_has(16);\n }", "public function hasPrice(){\n return $this->_has(5);\n }", "function TaxInclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "public function testBuy()\n {\n VCR::insertCassette('pickups/buy.yml');\n\n $shipment = Shipment::create(Fixture::oneCallBuyShipment());\n\n $pickupData = Fixture::basicPickup();\n $pickupData['shipment'] = $shipment;\n\n $pickup = Pickup::create($pickupData);\n\n $boughtPickup = $pickup->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::pickupService(),\n ]);\n\n $this->assertInstanceOf('\\EasyPost\\Pickup', $boughtPickup);\n $this->assertStringMatchesFormat('pickup_%s', $boughtPickup->id);\n $this->assertNotNull($boughtPickup->confirmation);\n $this->assertEquals('scheduled', $boughtPickup->status);\n }", "public function testCorrectCanBuyWithEqualMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(100);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}", "function checkBuyBids()\n{\n $mysql_server = '192.168.1.101'; //reference global mysql_server\n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n //Retrieve all Values from BestBidOffer\n $indexQry = \"SELECT * FROM BuyBestBidOffer\";\n $indexResult = $mysqli->query($indexQry);\n \n //Create Info Stacks to store Information\n $stackUsername = array();\n $stackSymbol = array();\n $stackQty = array();\n $stackAsk = array();\n $stackIndexNo = array();\n $stackBidType = array();\n \n //Copy the info into arrays in exact same order\n if($indexResult->num_rows > 0)\n { //if there is something in the DB then...\n while ($row = $indexResult->fetch_assoc())\n {\n array_push($stackUsername, $row['username']);\n array_push($stackSymbol, $row['stockSymbol']);\n array_push($stackQty, $row['qty']);\n array_push($stackIndexNo, $row['indexNo']);\n array_push($stackAsk, $row['askPrice']);\n }\n }\n //Get the size of Arrays\n $arraySize = count($stackUsername);\n \n //Get the List of Unique tickers in BuyBids DB\n $BuyBidsTickers = getBuyBidStockTickers();\n \n //Array that contains Current Price for Stocks\n $currentPriceStack = array();\n \n //get information about DISTINCT tickers only\n foreach($BuyBidsTickers[\"Stocks\"] as $symbol)\n {\n \n $tempVar = getInfo($symbol);\n $tempObj = json_decode($tempVar);\n array_push($currentPriceStack, $tempObj->Close[0]); //get the current prices for Tickers\n }\n \n //var_dump($currentPriceStack);\n \n //Loop and compare each Ticker asking price with Current Prices. Ignore Username at this Level.\n foreach($stackSymbol as $key => $symbol)\n {\n //for each Ticker excluding duplicates in your buy bids DB\n foreach($BuyBidsTickers[\"Stocks\"] as $compareKey => $compareSymbol)\n {\n //if ticker in records matches a ticker in currentPrice data list\n if ($symbol == $compareSymbol)\n {\n if($stackAsk[$key] <= $currentPriceStack[$compareKey])\n {\n //Find the user linked to this current items.\n //var_dump($stackUsername[$key]);\n //Create Data Object and Run Buy function\n $tempArray = array(\"Username\" => $stackUsername[$key],\n \"Symbol\" => $stackSymbol[$key],\n \"Quantity\" => $stackQty[$key]);\n buyStock($tempArray);\n //delete the IndexNo of this record in BuyBestBidOffer Table\n deleteFromBuyBids($stackIndexNo[$key]);\n }\n }\n }\n }\n \n}", "public function buyDecimalAmount()\n\t{\n\t\treturn false;\n\t}", "public function hasPrecost(){\n return $this->_has(25);\n }", "function no_bankrupt($cash, $cost) {\n\tif ($cash - $cost < 0) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function testOppSearchByCostGreaterThan() {\n\t\t$this->setUrl('/search/advanced?r=opp&q[opp_cost][op]=GREATER+THAN&q[opp_cost][value]=500');\n\t\t$this->app->go();\n\t\t$this->assertPattern('/id=\"qb_opp_cost\"/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$this->assertIsA($collection, 'Tactile_OpportunityCollection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Build a website'));\n\t}", "public function testBuy()\n {\n VCR::insertCassette('orders/buy.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::uspsService(),\n ]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }", "function tradeFunc(){\n if(isset($_POST[\"mypokemon\"]) || isset($_POST[\"theirpokemon\"])){\n if (isset($_POST[\"mypokemon\"]) && isset($_POST[\"theirpokemon\"])) {\n $db = get_PDO();\n $mypokemon = $_POST[\"mypokemon\"];\n if(!does_name_exist($db, $mypokemon)){\n handle_request_error(\"{$mypokemon} not found in your Pokedex.\");\n }\n $theirpokemon = $_POST[\"theirpokemon\"];\n if(does_name_exist($db, $theirpokemon)){\n handle_request_error(\"You have already found {$theirpokemon}.\");\n }\n delete_from_queue_name($db, $mypokemon);\n $nickname = strtoupper($theirpokemon);\n insert_into_Pokedex($db, $theirpokemon, $nickname);\n output_success(\n \"You have traded your {$mypokemon} for {$theirpokemon}!\");\n } else if(isset($_POST[\"mypokemon\"])){\n handle_request_error(\"Missing theirpokemon parameter.\");\n } else {\n handle_request_error(\"Missing mypokemon parameter.\");\n }\n } else {\n handle_request_error(\"Missing mypokemon and theirpokemon parameter.\");\n }\n }", "private function checkHandoff($import, $handoff)\n {\n Percolate_Log::log('checkHandoff: ' . $import . \" -> \" . $handoff);\n if ($this->postStatuses[$handoff]['weight'] > $this->postStatuses[$import]['weight']){\n return true;\n } else {\n return false;\n }\n }", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "function getMaximumOutfits($outfits, $money) {\r\n // keep a queue of the currently selected outfits, track the longest queue\r\n $queue = [];\r\n $result = 0;\r\n $spent = 0;\r\n $length = 0;\r\n for ($i = 0; $i < count($outfits); $i++) {\r\n // add this outfit to the queue..\r\n $pick = $outfits[$i];\r\n $queue[] = $pick;\r\n $spent += $pick;\r\n $length++;\r\n\r\n // then leave stuff from the start of the queue until we're ok with $$$\r\n while ($spent > $money) {\r\n $leave = array_shift($queue);\r\n $spent -= $leave;\r\n $length--;\r\n }\r\n $result = max($result, $length);\r\n }\r\n\r\n return $result;\r\n}", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function PaypalSetExpressChekout($oPaypal){\n\n if (isset($_SESSION['tickets'])) unset($_SESSION['tickets']);\n $totalOrder = number_format($_SESSION['total_order'], 2, '.', '');\n $aProducts = array();\n $i=0;\n\n // \"return URL\" and \"cancel URL\" for paypal response\n $sHostUrl = $oPaypal->getHostUrl();\n $return_url = $sHostUrl . 'buy_ticket.php?c=checkout';\n $cancel_url = $sHostUrl . 'buy_ticket.php?c=cancel';\n\n $params = array(\n 'RETURNURL' => $return_url,\n 'CANCELURL' => $cancel_url,\n 'PAYMENTREQUEST_0_AMT' => $totalOrder,\n 'PAYMENTREQUEST_0_CURRENCYCODE' => $oPaypal->money_code,\n 'PAYMENTREQUEST_0_ITEMAMT' => $totalOrder,\n );\n\n $aTicket = array();\n\n //filtering $_POST and keep book with seat number > 0\n foreach($_POST as $key => $value){\n // \"name\" item\n if (strpos($key, 'name') === 0){\n $p = (int) substr($key, 4, 1);\n $nbseat = \"nbseats$p\";\n // if nb seat > 0, keep 'name' value\n if (intval($_POST[$nbseat]) > 0) { $aTickets[$i]['name'] = $value; }\n }\n // if 'nb seat' and > 0 then keep 'nbseat' value\n elseif(strpos($key, 'nbseats') === 0 && intval($_POST[$nbseat]) > 0) $aTickets[$i]['nbseat'] = intval($value); \n // if 'price' and seat> 0 then keep 'price' value\n elseif(strpos($key, 'price') === 0 && intval($_POST[$nbseat]) > 0) {\n $val = strtr($value, \",\" , \".\");\n $val_filter = floatval(filter_var($val, FILTER_VALIDATE_FLOAT));\n $aTickets[$i]['price'] = $val_filter;\n $i += 1;\n }\n }\n\n//var_dump($aTickets );\n\n //store values in session \n $_SESSION['tickets'] = $aTickets; \n\n foreach($aTickets as $k => $ticket){\n $params[\"L_PAYMENTREQUEST_0_NAME$k\"] = $ticket['name'];\n $params[\"L_PAYMENTREQUEST_0_DESC$k\"] = '';\n $params[\"L_PAYMENTREQUEST_0_AMT$k\"] = $ticket['price'];\n $params[\"L_PAYMENTREQUEST_0_QTY$k\"] = $ticket['nbseat'];\n }\n\n // SetExpressCheckout\n $response = $oPaypal->request('SetExpressCheckout', $params);\n\n if($response){\n $paypalUrl = 'https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token=' . $response['TOKEN'];\n }else{ \n $paypalUrl = $aSettingsProduct['cancel_url'];\n }\n\n //Re-direction to paypal (for get and do ExpressCheckOut)\n header('Location:'.$paypalUrl); \n\n}", "function AddBonus($section) {\n\tglobal $dbconn, $config;\n\n\t$err = array();\n\t\t\n\t$data[\"lc_bonus_percent\"] = trim($_REQUEST[\"lc_bonus_percent\"]);\n\t$data[\"lc_bonus_amount\"] = trim($_REQUEST[\"lc_bonus_amount\"]);\n\n\tif (!$data[\"lc_bonus_percent\"] || !IsPositiveInt($data[\"lc_bonus_percent\"]) || intval($data[\"lc_bonus_percent\"]) > 100) {\n\t\t$err[\"lc_bonus_percent\"] = \"invalid_lc_bonus_percent\";\n\t\t$data[\"lc_bonus_percent\"] = \"\";\n\t}\n\tif (!$data[\"lc_bonus_amount\"] || !IsPositiveFloat($data[\"lc_bonus_amount\"])) {\n\t\t$err[\"lc_bonus_amount\"] = \"invalid_lc_bonus_amount\";\n\t\t$data[\"lc_bonus_amount\"] = \"\";\n\t}\n\tif (count($err) > 0) {\n\t\tListServices($data, $err);\n\t\texit();\n\t}\n\n\t$strSQL = \"SELECT COUNT(id) AS cnt FROM \".BONUS_SETTINGS_TABLE.\" WHERE \".\n\t\t\t \"percent='\".intval($data[\"lc_bonus_percent\"]).\"'\";\n\t$rs = $dbconn->Execute($strSQL);\n\tif ($rs->fields[0] > 0) {\n\t\t$err[\"lc_bonus_percent_dublicate\"] = \"lc_bonus_percent_dublicate\";\n\t\tListServices($data, $err);\n\t}\n\n\t$strSQL = \"INSERT INTO \".BONUS_SETTINGS_TABLE.\" SET \".\n\t\t\t \"percent='\".intval($data[\"lc_bonus_percent\"]).\"', \".\n\t\t\t \"amount='\".floatval($data[\"lc_bonus_amount\"]).\"'\";\n\t$dbconn->Execute($strSQL);\n\n\theader(\"Location: \".$config[\"server\"].$config[\"site_root\"].\"/admin/admin_pay_services.php?sel=list_services&section=$section\");\n\texit();\n}", "function warquest_daily_bonus() {\r\n\r\n\t/* input */\r\n\tglobal $config;\r\n\t\r\n\t/* output */\r\n\tglobal $player;\r\n\tglobal $page;\r\n\t\t\r\n\tif ($player->holiday_date > date(\"Y-m-d H:i:s\", time())) {\r\n\t\r\n\t\t/* No bonus if holiday is activated! */\r\n\t\treturn;\r\n\t}\r\n\t\t\t\t\r\n\tif (date(\"Y-m-d\",strtotime( $player->bonus_date)) != date(\"Y-m-d\")) {\r\n\t\r\n\t\t/* Update last_login date for player with long session (>24h) */\r\n\t\t$member = warquest_db_member($player->pid);\r\n\t\t$member->last_login = date(\"Y-m-d H:i:s\");\t\t\t\t\r\n\t\twarquest_db_member_update($member);\r\n\t\t\t\t\r\n\t\t/* Add bonus */\r\n\t\t$money = $config[\"init_money\"] * $player->lid * rand(20,40);\r\n\r\n\t\t$player->bonus_date = date(\"Y-m-d H:i:s\");\r\n\t\t$player->money += $money;\r\n\t\t\r\n\t\t$log = 'Daily bonus '.number_format2($money);\t\t\r\n\t\twarquest_user_log($player, $log);\r\n\t\r\n\t\t/* Create message */\r\n \t\tif ($money>0) {\r\n\t\t\t$message = t('HOME_DAILY_BONUS', money_format1($money) );\t\t\r\n\t\t\t$page .= warquest_box_icon(\"info\", $message);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/* One year WarQuest bonus */\r\n\t\tif ( date(\"Y-m-d\", strtotime(\"08-02-2012\")) == date(\"Y-m-d\") ) {\r\n\t\t\t\r\n\t\t\t$skill = warquest_db_skill($player->pid);\r\n\t\t\t$skill->skill_points+= 10;\r\n\t\t\twarquest_db_skill_update($skill);\r\n\t\t\t\r\n\t\t\t$bonus = 10000000000;\r\n\t\t\t$player->bank1+=$bonus;\t\t\r\n\t\t\twarquest_db_bank_insert($player->pid, 0, 1, $bonus, $player->bank1, 6);\t\t\t\t\r\n\t\t}\t\r\n\t}\t\t\r\n}", "function get_shares_amount ($symbol) {\n $portfolio = load_portfolio_array();\n $shares_amount_available = 0;\n foreach ($portfolio as $record) {\n if ($record[\"symbol\"] == $symbol) {\n $shares_amount_available = $record[\"quantity\"];\n }\n }\n return $shares_amount_available;\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}", "function _buyquota()\n\t{\n\t\tif (get_option('is_on_pop3_buy')=='0') return new ocp_tempcode();\n\n\t\t$title=get_page_title('TITLE_QUOTA');\n\n\t\t$member_id=get_member();\n\t\t$pointsleft=available_points($member_id);\n\t\t$price=intval(get_option('quota'));\n\t\t$quota=post_param_integer('quota');\n\n\t\t$details=$GLOBALS['SITE_DB']->query_select('sales',array('details','details2'),array('memberid'=>$member_id,'purchasetype'=>'pop3'),'',1);\n\t\t$prefix=$details[0]['details'];\n\t\t$suffix=$details[0]['details2'];\n\n\t\t// If we don't own a POP3 account, stop right here.\n\t\tif (!array_key_exists(0,$details))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('NO_POP3'));\n\t\t}\n\n\t\t// Stop if we can't afford this much quota\n\t\tif ((($quota*$price)>$pointsleft) && (!has_specific_permission(get_member(),'give_points_self')))\n\t\t{\n\t\t\treturn warn_screen($title,do_lang_tempcode('CANT_AFFORD'));\n\t\t}\n\n\t\t// Mail off the order form\n\t\t$quota_url=get_option('quota_url');\n\t\t$_price=$quota*$price;\n\t\t$encoded_reason=do_lang('TITLE_QUOTA');\n\t\t$message_raw=do_template('POINTSTORE_QUOTA_MAIL',array('_GUID'=>'5a4e0bb5e53e6ccf8e57581c377557f4','ENCODED_REASON'=>$encoded_reason,'QUOTA'=>integer_format($quota),'EMAIL'=>$prefix.$suffix,'QUOTA_URL'=>$quota_url,'PRICE'=>integer_format($_price)));\n\t\trequire_code('notifications');\n\t\tdispatch_notification('pointstore_request_quota','quota_'.uniqid('',true),do_lang('MAIL_REQUEST_QUOTA',NULL,NULL,NULL,get_site_default_lang()),$message_raw->evaluate(get_site_default_lang(),false),NULL,NULL,3,true);\n\n\t\t$url=build_url(array('page'=>'_SELF','type'=>'misc'),'_SELF');\n\t\treturn redirect_screen($title,$url,do_lang_tempcode('ORDER_QUOTA_DONE'));\n\t}", "public function collectFreightRates(Mage_Shipping_Model_Rate_Request $request)\n {\n \t$freightRateConfig=Mage::getStoreConfig('carriers/freightrate'); \t\n\t\t$items = $request->getAllItems();\n \t\n \tif (!$freightRateConfig['active'] || sizeof($request->getAllItems())<1 || !Mage::helper('freightrate')->customerGroupApplies($items)\n \t\t|| !$request->getDropshipCollecting() ) { \n \t\treturn $this->collectDropshipRates($request);\n \t}\n \t\n \t$limitCarrier = $request->getLimitCarrier();\n \tif (is_array($limitCarrier) && !in_array('freightrate',$limitCarrier)) {\n \t\treturn $this->collectDropshipRates($request);\n \t}\n\n \t// else want to restrict what's sent to the carriers\n \t$newRequest = clone $request;\n \t$freightModel = Mage::getModel('freightrate/freightrate');\n \t$nonFreightItemPresent = false;\n \t$this->_freightFound=false;\n \t$exceedsMinOrder = false;\n \t$this->_debug = Mage::helper('wsalogger')->isDebug('Webshopapps_Freightrate');\n \t \t\n \tif (Mage::helper('freightrate')->cartExceedsMinOrder($request)) {\n \t\t$exceedsMinOrder = true;\n \t}\n \t\n \tif ($freightModel->getNonFreightItems($newRequest,$nonFreightItemPresent) ) {\n \t\t$this->_freightFound=true; \t\n \t}\n \t\n \tif (!$this->_freightFound && !$exceedsMinOrder) {\n \t\treturn $this->collectDropshipRates($request);\n \t}\n \tif (!Mage::helper('wsacommon')->checkItems('Y2FycmllcnMvZnJlaWdodHJhdGUvc2hpcF9vbmNl',\n \t'aG9yc2VzaG9l','Y2FycmllcnMvZnJlaWdodHJhdGUvc2VyaWFs')) { return $this->collectDropshipRates($request); }\n \n \tif (($nonFreightItemPresent && !Mage::getStoreConfig('carriers/freightrate/force_freight')) &&\n \t\tMage::helper('freightrate')->showOtherRates($exceedsMinOrder)) {\n\t $this->collectDropshipRates($request);\n \t} \t\n \t\n $myResults=$this->getResult();\n if ( (!$exceedsMinOrder || $this->_freightFound) && !empty($myResults) &&\n\t\t \t\t\tis_array($myResults->getAllRates()) && count($myResults->getAllRates())) {\n\n\t \t\t$rates=$myResults->getAllRates();\n\t \t\tforeach ($rates as $rate) {\n \t\t\t if ($rate instanceof Mage_Shipping_Model_Rate_Result_Method) {\n\t\t \t\t\treturn $this;\n\t\t \t\t}\n\t \t\t}\n \t }\n \t // otherwise not found rate, so use freightrate\n \t$carrier = $this->getCarrierByCode(\"freightrate\", $newRequest->getStoreId());\n \t$this->getResult()->append($carrier->collectFreightRates($newRequest));\n $error = Mage::getModel('shipping/rate_result_error');\n $error->setCarrier(\"freightrate\");\n $error->setCarrierTitle($carrier->getCarrierTitle());\n $error->setErrorMessage($freightModel->getDisclaimer());\n $this->getResult()->append($error);\n \n return $this;\n \t\n \t\n }", "public function hasDefense(){\r\n return $this->_has(6);\r\n }", "function sellBuy($name, $selling, $buying, $date, $dbh)\n{\n\tif (isIndividual($name, $dbh))\n\t{\n\t\t//First sell the stock requested.\n\t\t$previousCash = getIndCash($name,$dbh);\n\t\tsell($name, $selling, $date, $dbh);\n\t\t$currCash = getIndCash($name,$dbh);\n\t\n\t\t//Then buy the new stock with all proceeds\n\t\t$amount = $currCash - $previousCash ;\n\t\tindBuy($name, $buying, $amount, $date ,$dbh);\n\t\t\n\t}\n\telseif(isFund($name, $dbh))\n\t{\n\t\t//First ensure that fund is selling & buying a stock to continue.\n\t\tif (isStock($selling,$dbh) && isStock($buying,$dbh))\n\t\t{\n\t\t//Then sell the stock requested.\n\t\t$previousCash = getFundCash($name,$date,$dbh);\n\t\tsell($name, $selling, $date, $dbh);\n\t\t$currCash = getFundCash($name,$date,$dbh);\n\n\t\t//Then buy the new stock with all proceeds\n\t\t$amount = $currCash - $previousCash ;\n\t\tfundBuy($name, $buying, $amount, $date ,$dbh);\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\techo \"Transaction skipped: Fund trying to sellbuy non stock. Selling: \".$selling.\" Buying: \".$buying .\".<br>\";\n\t\t}\n\t}\n\telse \n\t{\n\t\techo \"Error sellBuy(): \".$name. \" trying to sell \".$selling.\" for \".$buying.\".<br>\";\n\t}\n\n}", "public function hasDefense(){\r\n return $this->_has(9);\r\n }", "public static function pay($opts)\n {\n $defaults = [\n 'cid' => 0,\n 'amount' => 0, // \n 'type' => '', # fixed | bonus | hourly | refund\n ];\n\n $opts = array_merge($defaults, $opts);\n extract($opts);\n\n $type = self::parseType($type);\n\n if ( !$type ) {\n error_log(\"[Transaction::pay()] Error: Invalid transaction type is given.\");\n return false; \n }\n\n if ( !$cid ) {\n error_log(\"[Transaction::pay()] Error: Contract ID is not given.\");\n return false;\n }\n\n if ($amount <= 0) {\n error_log(\"[Transaction::pay()] Error: Invalid amount to pay.\");\n return false;\n }\n\n if ( !isset($note) ) {\n $note = '';\n }\n\n $c = Contract::find($cid);\n if ( !$c ) {\n error_log(\"[Transaction::pay()] Error: Contract #{$cid} is not found.\");\n return false;\n }\n\n $fee_rate = FeeSettings::getFeeRate_Contract($cid);\n // Calculate amount to pay contractor and fee\n if ($type == self::TYPE_REFUND) {\n $contractor_amount = floor(-$amount * 100) / 100;\n $fee_amount = floor($contractor_amount * (1 - FEE_RATE) / FEE_RATE * 100) / 100;\n\n $amount = -($contractor_amount + $fee_amount); // buyer\n } else {\n $contractor_amount = floor($amount * FEE_RATE * 100) / 100;\n $fee_amount = $amount - $contractor_amount;\n \n $amount = -$amount;\n }\n\n // Create buyer transaction\n $bt = new Transaction;\n $bt->type = $type;\n $bt->for = self::FOR_BUYER;\n $bt->user_id = $c->buyer_id;\n $bt->contract_id = $cid;\n $bt->note = $note;\n $bt->amount = $amount;\n $bt->status = self::STATUS_PENDING;\n if ($type == self::TYPE_HOURLY) {\n if ( !isset($hourly_from) || !isset($hourly_to) ) {\n error_log(\"[Transaction::pay()] Error: Hourly log range is not given.\");\n return false;\n }\n\n if ( empty($hourly_mins) ) {\n error_log(\"[Transaction::pay()] Error: Invalid weekly minutes is given.\");\n return false;\n }\n\n $bt->hourly_from = $hourly_from;\n $bt->hourly_to = $hourly_to;\n $bt->hourly_mins = $hourly_mins;\n }\n\n $bt->save();\n\n // Create contractor transaction\n $ct = $bt->replicate();\n $ct->for = self::FOR_FREELANCER;\n $ct->user_id = $c->contractor_id;\n $ct->amount = $contractor_amount;\n $ct->ref_id = $bt->id; // buyer transaction id\n $ct->save();\n\n // Create fee transaction\n $ft = $bt->replicate();\n $ft->for = self::FOR_WAWJOB;\n $ft->user_id = SUPERADMIN_ID; // means Wawjob\n $ft->amount = $fee_amount;\n $ft->ref_id = $bt->id;\n $ft->save();\n\n // Save contractor transaction ID as ref ID of buyer transaction\n $bt->ref_id = $ct->id;\n $bt->save();\n\n // @todo: Send notification to buyer and freelancer\n $buyer_noti_types = [\n self::TYPE_BONUS => Notification::BUYER_PAY_BONUS,\n self::TYPE_FIXED => Notification::BUYER_PAY_FIXED,\n self::TYPE_REFUND => Notification::BUYER_REFUND\n ];\n\n $freelancer_noti_types = [\n self::TYPE_BONUS => Notification::PAY_BONUS,\n self::TYPE_FIXED => Notification::PAY_FIXED,\n self::TYPE_REFUND => Notification::REFUND\n ];\n\n // Send notification to buyer\n Notification::send($buyer_noti_types[$type], SUPERADMIN_ID, $c->buyer_id, [\n 'freelancer_name' => $c->contractor->fullname(),\n 'amount' => -$amount\n ]\n );\n\n // Send notification to freelancer\n Notification::send($freelancer_noti_types[$type], SUPERADMIN_ID, $c->contractor_id, [\n 'buyer_name' => $c->buyer->fullname(),\n 'amount' => -$amount\n ]\n );\n \n return true;\n }", "function filter_woocommerce_correios_shipping_args( $array, $this_id, $this_instance_id, $this_package ) { \n //$array['nVlPeso'] = 1000;\n if($array['nVlPeso'] >= 30){\n return array('nCdServico' => null);\n }\n return $array; \n}", "private function purchaseRestrictionsApproval($ins) {\n if($ins['liter'] > 100) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak diizinkan mengisi lebih dari 100 lt ({$ins['liter']} lt).\\n\\nSilakan ubah volume!\", \n\t ];\n\t echo json_encode($response);\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }", "public function buyStock($u) {\r\n\t\t\tinclude 'database.php';\r\n\t\t\t$query = 'INSERT INTO experimentalshares (ownerId, valueAtPurchase, company) VALUES (:ownerId, :valueAtPurchase, :company)';\r\n\t\t\t$statement = $db->prepare($query);\r\n\t\t\t$statement->bindValue(':ownerId', $u->getId());\r\n\t\t\t$statement->bindValue(':valueAtPurchase', $this->currentValue);\r\n\t\t\t$statement->bindValue(':company', $this->name);\r\n\t\t\t$statement->execute();\r\n\t\t}", "public function isUnderpaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_UNDERPAID;\n }", "function calculateBuyPriceOfAssetUnitFromOutboundTransactionUsingSpotPriceAndTransactedAmountAndFeePercentageExtendedCalculation($spotPrice, $transactedAmount, $feePercentage)\n\t{\t\n\t\t\n\t\t$calculatedBuyPriceOfAssetUnit\t\t= 0;\n\t\t\n\t\tif ($feePercentage >= 1)\n\t\t{\n\t\t\t$feePercentage \t\t\t\t\t= $feePercentage / 100;\n\t\t}\n\t\t\n\t\tif ($transactedAmount > 0)\n\t\t{\n\t\t\t$calculatedBuyPriceOfAssetUnit\t= (($spotPrice * $transactedAmount) + ($spotPrice * $transactedAmount * $feePercentage)) / $transactedAmount;\n\t\t}\n\n\t\treturn $calculatedBuyPriceOfAssetUnit;\t\n\t}", "public function testHasKidsFixedPrice()\n {\n $this->assertEquals(0, $this->getObject(0)->setIsFixedPrice(true)->getValue());\n }", "public function testActiveAccountPayoutWithHugeBalance()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '10000'\n ]);\n\n $activeAccounts = factory(ActiveAccount::class, 3)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE\n ]);\n\n $activeAccount = factory(ActiveAccount::class)->create([\n 'balance' => '10000000' * StellarAmount::STROOP_SCALE\n ]);\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $payoutAmount = $this->payoutService->calculateActiveAccountPayoutAmount($activeAccount);\n // problem with rounding up \n// $this->assertEquals(49985004398.650406, $payoutAmount);\n $this->assertEquals(49985004398.65040487853643906828, $payoutAmount);\n }", "public static function payLastHourlyContracts()\n {\n $cids = HourlyLogMap::getActiveHourlyContractIds('last');\n if (empty($cids)) {\n error_log(\"[Transaction::payHourlyContracts] No hourly contracts have logs for last week.\");\n return false;\n }\n\n $query = Contract::select(['id', 'price']);\n if (count($cids) > 1) {\n $query->whereIn('id', $cids);\n } else {\n $query->where('id', $cids[0]);\n }\n\n $contracts = $query->get()->keyBy('id');\n\n list($from, $to) = weekRange('-1 weeks');\n $from = date(\"Y-m-d\", strtotime($from));\n $to = date(\"Y-m-d\", strtotime($to));\n \n $map = HourlyLogMap::getWeekMinutes($cids, 'last');\n foreach($map as $cid => $mins) {\n $buyer_price = $contracts[$cid]->buyerPrice($mins);\n\n self::pay([\n 'cid' => $cid,\n 'amount' => $buyer_price,\n 'type' => 'hourly',\n 'hourly_from' => $from,\n 'hourly_to' => $to,\n 'hourly_mins' => $mins,\n ]);\n }\n \n return true;\n }", "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}", "public function hasPrice(){\n return $this->_has(12);\n }", "public function getOverspend()\n {\n if (abs($this->averageFortnightlySpend) > $this->averageFortnightlyPositive) {\n // If nothing is going in, then it's definitely an overspend.\n if ($this->averageFortnightlyPositive <= 0) {\n return true;\n }\n // Otherwise it's only an overspend if it's more than 2% over, to allow for funny fortnights\n if((abs($this->averageFortnightlySpend))/$this->averageFortnightlyPositive > 1.02) {\n return true;\n }\n }\n return false;\n }", "function binPrice($auction_id, $buy_now_price, $user_id = 0) {\n\tglobal $config;\n\t\n\t//see if buy it now is disabled for this item\n\tif ($buy_now_price==0) return 0;\n\t\n\t//calculate the adjusted buy-it-now price\n\trequire_once('../database.php');\n//\techo \"sql: \".\"SELECT COUNT(*) FROM `bids` WHERE `auction_id`=$auction_id AND `user_id`=$user_id\".\" <br/>\\n\";\n\t\n\t\n\tif (isset($config['App']['buyNow']['bid_discount']) && $config['App']['buyNow']['bid_discount']===true) {\n\t\t//see if this user has bought it before, if so no discount will be offered\n\t\tlist($prevBought)=mysql_fetch_array(mysql_query(\"SELECT COUNT(*) \n\t\t\t\t\t\t\t\t\tFROM `auctions`\n\t\t\t\t\t\t\t\t\tWHERE `deleted`=0\n\t\t\t\t\t\t\t\t\t AND `winner_id`='$user_id'\n\t\t\t\t\t\t\t\t\t AND `closed_status`=2\n\t\t\t\t\t\t\t\t\t AND `parent_id`='$auction_id'\"));\n\t\t\n\t\tif ($prevBought>0)\n\t\t{\n\t\t\t$discount=0;\n\t\t}\n\t\telseif($user_id>0)\n\t\t{\n\t\t\tlist($bid_count)=mysql_fetch_array(mysql_query(\"SELECT COUNT(*) FROM `bids` WHERE `auction_id`=$auction_id AND `user_id`=$user_id\"));\n\t\t\t$discount=($bid_count*$config['App']['buyNow']['bid_price']);\n\t\t}\n\t\t\n\t\tif ($discount>=$buy_now_price) {\n\t\t\t//don't know why this would ever happen, but good to have a handler for it\n\t\t\treturn 0.01;\n\t\t} else {\n\t\t\treturn $buy_now_price - $discount;\n\t\t}\n\t} else {\n\t\treturn $buy_now_price;\n\t}\n}", "public function checkMultipleCostAccounts()\n {\n $errors = collect();\n\n $invalid = collect();\n foreach ($this->rows as $hash => $row) {\n $activityCode = $this->activityCodes->get(trim(strtolower($row[0])));\n $resourceIds = $this->resourcesMap->get(trim(strtolower($row[7])));\n\n\n $shadows = BreakDownResourceShadow::where('code', $activityCode)->whereIn('resource_id', $resourceIds)\n ->whereRaw('coalesce(progress, 0) < 100')->whereRaw(\"coalesce(status, '') != 'closed'\")\n ->get();\n\n if ($shadows->count() > 1) {\n $row['hash'] = $hash;\n $row['resources'] = $shadows;\n $errors->push($row);\n } elseif ($shadows->count() < 1) {\n $invalid->push($row);\n }\n }\n\n if ($errors->count()) {\n return ['error' => 'cost_accounts', 'errors' => $errors, 'batch' => $this->batch];\n }\n\n $costIssues = new CostIssuesLog($this->batch);\n $costIssues->recordInvalid($invalid);\n\n return $this->save();\n }", "function test_leverage_tier($exchange, $method, $tier) {\n $format = array(\n 'tier' => 1,\n 'minNotional' => 0,\n 'maxNotional' => 5000,\n 'maintenanceMarginRate' => 0.01,\n 'maxLeverage' => 25,\n 'info' => array(),\n );\n $keys = is_array($format) ? array_keys($format) : array();\n for ($i = 0; $i < count($keys); $i++) {\n $key = $keys[$i];\n assert (is_array($tier, $exchange->id . ' ' . $method . ' ' . $key . ' missing from response') && array_key_exists($key, $tier, $exchange->id . ' ' . $method . ' ' . $key . ' missing from response'));\n }\n if ($tier['tier'] !== null) {\n assert ((is_float($tier['tier']) || is_int($tier['tier'])));\n assert ($tier['tier'] >= 0);\n }\n if ($tier['minNotional'] !== null) {\n assert ((is_float($tier['minNotional']) || is_int($tier['minNotional'])));\n assert ($tier['minNotional'] >= 0);\n }\n if ($tier['maxNotional'] !== null) {\n assert ((is_float($tier['maxNotional']) || is_int($tier['maxNotional'])));\n assert ($tier['maxNotional'] >= 0);\n }\n if ($tier['maxLeverage'] !== null) {\n assert ((is_float($tier['maxLeverage']) || is_int($tier['maxLeverage'])));\n assert ($tier['maxLeverage'] >= 1);\n }\n if ($tier['maintenanceMarginRate'] !== null) {\n assert ((is_float($tier['maintenanceMarginRate']) || is_int($tier['maintenanceMarginRate'])));\n assert ($tier['maintenanceMarginRate'] <= 1);\n }\n var_dump ($exchange->id, $method, $tier['tier'], $tier['minNotional'], $tier['maxNotional'], $tier['maintenanceMarginRate'], $tier['maxLeverage']);\n return $tier;\n}", "public function finalAdd2CartChecks($item, $number, $folioItem, $cartItem, $currentCartQuant, $typeType=false)\n\t{\n\t\t$error = \"\";\n\t\t\n\t\t#already have a previous unpaid loan with this bank\n\t\tif ( !$error && $folioItem )\n\t\t{\n\t\t\t$error = $this->lang->words['previous_loan_unpaid'];\n\t\t}\n\t\t\n\t\t#no new accounts in that type for this bank? error!\n\t\tif ( !$error && !$item['b_loans_on'] )\n\t\t{\n\t\t\t$error = $this->lang->words['bank_loans_disabled'];\n\t\t}\t\t\t\t\t\n\t\t\n\t\t#no positive deposit amount? error!\n\t\tif ( !$error && !$number > 0 )\n\t\t{\n\t\t\t$error = $this->lang->words['positive_loan_amount_needed'];\t\t\n\t\t}\n\t\t\n\t\t#deposit over group max?\n\t\tif ( !$error && $this->memberData['g_eco_max_loan_debt'] && $number + $currentCartQuant > $this->memberData['g_eco_max_loan_debt'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%YOUR_MAX%>\", $this->registry->getClass('class_localization')->formatNumber( $this->memberData['g_eco_max_loan_debt'] ) .' '. $this->numberLang(), $this->lang->words['cart_item_quantity_over_group_max'] );\t\t\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['loans'], $error );\n\t\t\t$error = str_replace( \"<%NUMBER_WORD%>\", $this->lang->words['loan_amount'], $error );\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t#deposit over bank loan max?\n\t\tif ( !$error && $item['b_loans_max'] && $number + $currentCartQuant > $item['b_loans_max'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%MAX%>\", $this->registry->getClass('class_localization')->formatNumber( $item['b_loans_max'] ) .' '. $this->numberLang(), $this->lang->words['over_bank_loan_max'] );\n\t\t}\n\n\t\treturn $error;\n\t}", "public static function buy_limit($units, $pair, $price, $expiry, $rest = FALSE) {\n\t\t\treturn self::limit('buy', $units, $pair, $price, $expiry, $rest);\n\t\t}", "public function fillFromDeposit($order = [])\n {\n $option = $this->rules()->getBottlingRule();\n $inventory = $this->inventory;\n $sodaDeposits = collect($inventory->tanks)->filter(function($value, $key) {\n return (($value->contains == 'freshSoda' || $value->contains == 'warmSoda') && $value->quantity >= 1);\n });\n if($sodaDeposits->isEmpty()) return 0;\n $deposit = 0;\n \n if ($option == 'optimized')\n {\n $warmDeposits = $sodaDeposits->filter(function ($value, $key) {\n return ($value->contains == 'warmSoda');\n });\n if ($warmDeposits->isNotEmpty())\n {\n $deposit = $warmDeposits->sortBy('quantity')->keys()->first();\n }\n else\n {\n $freshDeposits = $sodaDeposits->filter(function ($value, $key) {\n return ($value->contains == 'freshSoda');\n });\n if ($freshDeposits->isNotEmpty())\n {\n $deposit = $freshDeposits->sortBy('quantity')->keys()->first();\n }\n } \n }\n if ($option == 'strictPlayerOrder')\n {\n foreach ($order as $value)\n {\n if ($sodaDeposits->has($value))\n {\n $deposit = $value;\n break;\n }\n } \n }\n if ($option == 'relaxedPlayerOrder')\n {\n foreach ($order as $value)\n {\n if ($sodaDeposits->has($value))\n {\n $deposit = $value;\n break;\n }\n }\n if ($deposit == 0) $option = 'lazy';\n }\n if ($option == 'lazy')\n {\n if ($sodaDeposits->isNotEmpty()) $deposit = $sodaDeposits->keys()->first();\n }\n return $deposit;\n }", "function isEligibleForBuy($item_id, $user_id, $buy_max_quantity_per_user)\r\n {\r\n $items_count = $this->ItemUser->find('first', array(\r\n 'conditions' => array(\r\n 'ItemUser.item_id' => $item_id,\r\n 'ItemUser.user_id' => $user_id,\r\n ) ,\r\n 'fields' => array(\r\n 'SUM(ItemUser.quantity) as total_count'\r\n ) ,\r\n 'group' => array(\r\n 'ItemUser.user_id'\r\n ) ,\r\n 'recursive' => -1\r\n ));\r\n if (empty($buy_max_quantity_per_user) || $items_count[0]['total_count'] < $buy_max_quantity_per_user) {\r\n return true;\r\n }\r\n return false;\r\n }", "function spectra_money_top100 ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Re-Balancing\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t\t$accounts = mysqli_getset ($GLOBALS[\"tables\"][\"ledger\"], \"1 ORDER BY `balance` DESC LIMIT 90 OFFSET 10\");\n\n\t\tif ($accounts[\"success\"] < 1 || $accounts[\"data\"] == \"\")\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Unavailable\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t//\tInitialize Calculation Result\n\t\t$sum_balances = 0;\n\t\t\n\t\tforeach ($accounts[\"data\"] as $account)\n\t\t{\n\t\t\t$sum_balances = bcadd ($sum_balances, $account[\"balance\"], 8);\n\t\t}\n\t\t\n\t\t$calc_perc = bcdiv ($sum_balances, spectra_money_supply (), 8);\n\t\n\t\t$balance_calc[\"total\"] = $sum_balances;\n\t\t$balance_calc[\"percent\"] = ($calc_perc * 100);\n\t\t\n\t\treturn $balance_calc;\n\t}", "public function refactorBasedonItems()\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if ($cabinet->wood_xml)\n {\n $woods = self::returnWoodArray($cabinet);\n foreach ($woods AS $wood)\n {\n $this->cabItems += $wood['qty'];\n $this->instItems += $wood['qty'];\n }\n }\n }\n\n /*\n if ($this->cabItems < 30)\n {\n $this->cabItems = 30;\n }\n\n if ($this->instItems < 30 && $this->quote->type != 'Cabinet Small Job')\n {\n $this->instItems = 30;\n }\n\n\n if ($this->instItems > 35 && $this->instItems < 40)\n {\n $this->instItems = 40;\n }\n\n // Start Staging Price Blocks.\n if ($this->cabItems > 30 && $this->cabItems < 40)\n {\n $this->cabItems = 40;\n }\n */\n\n // For Designer\n if ($this->quote->type == 'Full Kitchen' || $this->quote->type == 'Cabinet and Install')\n {\n if ($this->cabItems <= 35)\n {\n $this->forDesigner = $this->getSetting('dL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forDesigner = $this->getSetting('dG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forDesigner = $this->getSetting('dG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forDesigner = $this->getSetting('dG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forDesigner = $this->getSetting('dG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forDesigner = $this->getSetting('dG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forDesigner = $this->getSetting('dG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forDesigner = $this->getSetting('dG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n }\n else\n {\n if ($this->quote->type == 'Cabinet Small Job' || $this->quote->type == 'Builder')\n {\n $this->forDesigner = 250;\n }\n }\n\n // ----------------------- Quote Type Specific values\n\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet Only')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if (!$cabinet->cabinet || !$cabinet->cabinet->vendor)\n {\n echo \\BS::alert(\"danger\", \"Unable To Determine Cabinets\",\n \"Cabinet type has not been selected! Unable to figure multiplier.\");\n return;\n }\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n $amt = ($cabinet->measure) ? 500 : 250;\n $this->forDesigner += $amt;\n $this->setDebug(\"Field Measure for Designer (Y=500/N=250)\", $amt);\n $this->forFrugal += 250; // for cabinet buildup.\n $this->setDebug(\"Frugal got $250 for Buildup\", 250);\n switch ($cabinet->location)\n {\n case 'North':\n $this->forFrugal += 300;\n $this->setDebug(\"Delivery North\", 300);\n break;\n case 'South':\n $this->forFrugal += 200;\n $this->setDebug(\"Delivery South\", 200);\n break;\n default:\n $this->forFrugal += 500;\n $this->setDebug(\"Further than 50m\", 500);\n break;\n }\n } // fe\n }\n else\n {\n if ($this->quote->type == 'Granite Only')\n {\n $this->forInstaller = 0;\n $this->forPlumber = 350;\n $this->forElectrician = 0;\n //$this->appElectrician = 0 ;\n //$this->forDesigner = 0;\n }\n else\n {\n if ($this->quote->type == \"Cabinet and Install\" || $this->quote->type == 'Builder')\n {\n if ($this->quote->type == 'Cabinet and Install')\n {\n foreach ($this->quote->cabinets AS $cabinet)\n {\n $add = ($cabinet->price * $cabinet->cabinet->vendor->multiplier) * .40;\n $this->forFrugal += $add; // Frugal gets 40% of the cabprice\n $this->setDebug(\"40% of {$cabinet->cabinet->frugal_name} to Frugal\", $add);\n }\n\n $this->forInstaller += $this->instItems * 20; // get 20 per installable item not attach\n $this->forFrugal += 250; // For delivery\n $this->forFrugal += 250; // for cabinet buildup.\n $this->forFrugal += $this->instItems * 10; // Cabinet + Install gets $10 for frugal.\n $this->forFrugal += $this->attCount * 30; // Attachment Count.\n } // If it's cabinet install\n else\n {\n if ($this->instItems < 40)\n {\n $this->forInstaller += 500;\n }\n else\n {\n $remainder = $this->instItems - 40;\n $this->forInstaller += 500;\n $this->forInstaller += $remainder * 10;\n } // more than 40\n } // If builder\n } // if cabinet and install or builder\n else\n {\n if ($this->cabItems <= 35)\n {\n $this->forFrugal += $this->getSetting('fL35');\n }\n else\n {\n if ($this->cabItems > 35 && $this->cabItems <= 55)\n {\n $this->forFrugal += $this->getSetting('fG35L55');\n }\n else\n {\n if ($this->cabItems > 55 && $this->cabItems <= 65)\n {\n $this->forFrugal += $this->getSetting('fG55L65');\n }\n else\n {\n if ($this->cabItems > 65 && $this->cabItems <= 75)\n {\n $this->forFrugal += $this->getSetting('fG65L75');\n }\n else\n {\n if ($this->cabItems > 75 && $this->cabItems <= 85)\n {\n $this->forFrugal += $this->getSetting('fG75L85');\n }\n else\n {\n if ($this->cabItems > 85 && $this->cabItems <= 94)\n {\n $this->forFrugal += $this->getSetting('fG85L94');\n }\n else\n {\n if ($this->cabItems > 94 && $this->cabItems <= 110)\n {\n $this->forFrugal += $this->getSetting('fG94L110');\n }\n else\n {\n if ($this->cabItems > 110)\n {\n $this->forFrugal += $this->getSetting('fG110');\n }\n }\n }\n }\n }\n }\n }\n }\n\n $this->forFrugal += ($this->attCount * 20);\n $this->setDebug(\"Frugal gets Attachment count * 20\", $this->attCount * 20);\n $this->forInstaller += ($this->instItems * 20);\n $this->setDebug(\"Installer gets Cabinet Installable ($this->instItems * 20)\",\n $this->instItems * 20);\n }\n }\n }\n\n $this->forElectrician += $this->appElectrician;\n $this->forPlumber += $this->appPlumber;\n $this->forInstaller += $this->accInstaller;\n $this->forFrugal += $this->accFrugal;\n // Additional - LED Lighting let's add this.\n $this->forDesigner += $this->designerLED;\n $this->forFrugal += $this->frugalLED;\n $this->forElectrician += $this->electricianLED;\n\n // No electrician or plumber if cabinet + install\n // For Frugal + on Quote and remove plumber and electrician rates.\n if ($this->quote->type == 'Cabinet and Install' || $this->quote->type == 'Cabinet Only')\n {\n $this->forPlumber = 0;\n $this->forElectrician = 0;\n }\n if ($this->quote->type == 'Cabinet Only')\n {\n $this->forInstaller = 0;\n }\n\n if ($this->quote->type == 'Granite Only')\n {\n $this->forElectrician = 0;\n }\n /*\n if ($this->quote->type == 'Cabinet Small Job')\n {\n if (!isset($this->gPrice))\n {\n $this->gPrice = 0;\n }\n\n $gMarkup = $this->gPrice * .2;\n $this->forFrugal += $gMarkup;\n\n $this->setDebug(\"Small Job Marks up Granite 20%\", $gMarkup);\n $sTotal = 0;\n if (isset($this->meta['sinks']))\n {\n foreach ($this->meta['sinks'] AS $sink)\n {\n if (!$sink)\n {\n continue;\n }\n $sink = Sink::find($sink);\n $sTotal += $sink->price;\n }\n $sMarkup = $sTotal * .2;\n $this->setDebug(\"Small Job Marks up Sink Costs 20%\", $sMarkup);\n $this->forFrugal += $sMarkup;\n }\n }\n */\n if ($this->quote->type == 'Cabinet Small Job')\n {\n $markup = $this->total * .4;\n $this->setDebug(\"Applying 40% Markup to Frugal for Cabinet Small Job\", $markup);\n $this->forFrugal = $markup;\n }\n\n // Add for installer to total\n $this->total += $this->forInstaller;\n $this->setDebug(\"Applying Installer Payouts to Quote\", $this->forInstaller);\n $this->total += $this->forElectrician;\n $this->setDebug(\"Applying Electrician Payouts to Quote\", $this->forElectrician);\n $this->total += $this->forPlumber;\n $this->setDebug(\"Applying Plumber Payouts to Quote\", $this->forPlumber);\n if ($this->quote->type != 'Builder')\n {\n $this->total += $this->forFrugal;\n $this->setDebug(\"Applying Frugal Payouts to Quote\", $this->forFrugal);\n }\n $this->total += $this->forDesigner;\n $this->setDebug(\"Applying Designer Payouts to Quote\", $this->forDesigner);\n if ($this->quote->type == 'Builder')\n {\n if ($this->quote->markup == 0)\n {\n $this->quote->markup = 30;\n $this->quote->save();\n }\n\n $perc = $this->quote->markup / 100;\n $markup = $this->total * $perc;\n $this->total += $markup;\n $this->setDebug(\"Applying {$this->quote->markup}% to Total For Builder Markup\", $markup);\n $this->forFrugal = $markup;\n }\n\n }", "public function shouldPay()\n {\n $paidMoney = $this -> countPaidMoney();\n $consumedMoney = $this -> countConsumedMoney();\n \n return $consumedMoney > $paidMoney;\n }", "public function tallyCost($row)\n\t{\n\t\treturn $row['b_loans_app_fee'];\n\t}", "function check_transfers() {\r\n\tglobal $option;\r\n\t$timestamp = mktime();\r\n\t/* Holt alle Auktionen, bei denen die Endzeit vorbei ist */\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => ($timestamp - 30), \"func\" => \"<\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => \"\", \"func\" => \"IS NOT NULL\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$cond[] = array(\"col\" => \"history\", \"value\" => 0);\r\n\t$result = uli_get_results('auctions', $cond);\r\n\tif ($result){\r\n\t\tforeach ($result as $auction){\r\n\t\t\t/* Transfer vorbereiten */\r\n\t\t\tif (trade_player($auction['playerID'], $auction['leagueID'], $auction)){\r\n\t\t\t\tarchive_auctions($auction['playerID'], $auction['leagueID']);\r\n\t\t\t}\r\n\t\t}}\r\n}", "function getCoinTrackingBuysForUser($accountID, $dataImportEventRecordID, $cryptoCurrencyTypesImported, $userEncryptionKey, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t$responseObject \t\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t\n\t\t$transactionTypeID\t\t\t\t\t\t\t\t\t\t\t\t\t= 1; // These are all buy records for now\n\t\t$transactionTypeLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Buy\";\n\t\t$displayTransactionTypeLabel\t\t\t\t\t\t\t\t\t\t= \"Bought\";\n\t\t$transactionSourceID\t\t\t\t\t\t\t\t\t\t\t\t= 20;\n\t\t$transactionSourceLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"CoinTracking\";\n\t\t$importTypeID\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 16;\n\t\t$authorID\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$isDebit\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$isDisabled\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$feeAmountInUSD\t\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$feeAmountInBaseCurrency\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$realizedReturnInUSD\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$sentCostBasisInUSD\t\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t$receivedCostBasisInUSD\t\t\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\n\t\t$transactionStatusID\t\t\t\t\t\t\t\t\t\t\t\t= 1;\n\t\t$transactionStatusLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Completed\";\n\t\t\n\t\t$providerNotes\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"\";\n\t\t\n\t\t$creationDate\t\t\t\t\t\t\t\t\t\t\t\t\t \t= $globalCurrentDate;\n\t\t\n\t\t$quoteCurrencyID\t\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$quoteCurrency\t\t\t\t\t\t\t\t\t\t\t\t\t\t= \"USD\";\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getCoinTrackingRecords\t\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT\n\ttransactions_FIFO_Universal.transactionRecordID,\n\ttransactions_FIFO_Universal.FK_ProviderAccountWalletID,\n\ttransactions_FIFO_Universal.transactionDate AS transactionTime,\n\tUNIX_TIMESTAMP(transactions_FIFO_Universal.transactionDate) AS transactionTimestamp,\n\ttransactions_FIFO_Universal.FK_LedgerEntryTypeID,\n\ttransactions_FIFO_Universal.FK_TransactionTypeID AS FK_EffectiveTypeID,\n\ttransactions_FIFO_Universal.FK_TransactionTypeID,\n\ttransactions_FIFO_Universal.FK_ReceivedCurrencyID AS FK_AssetTypeID,\n\ttransactions_FIFO_Universal.sentQuantity AS amount,\n\ttransactions_FIFO_Universal.isDebit,\n\t(transactions_FIFO_Universal.sentQuantity / transactions_FIFO_Universal.receivedQuantity) AS baseToQuoteCurrencySpotPrice,\n\t(transactions_FIFO_Universal.sentQuantity / transactions_FIFO_Universal.receivedQuantity) AS baseToUSDCurrencySpotPrice,\n\ttransactions_FIFO_Universal.FK_ReceivedWalletID AS FK_BaseCurrencyWalletID,\n\ttransactions_FIFO_Universal.FK_SentWalletID AS FK_QuoteCurrencyWalletID,\n\ttransactions_FIFO_Universal.receivedQuantity,\n\ttransactions_FIFO_Universal.sentQuantity,\n\ttransactions_FIFO_Universal.isDisabled,\n\ttransactions_FIFO_Universal.FK_TransactionSourceID,\n\t20 AS FK_ExchangeID,\n\ttransactions_FIFO_Universal.FK_ReceivedCurrencyID,\n\ttransactions_FIFO_Universal.receivedCurrency,\n\ttransactions_FIFO_Universal.FK_SentCurrencyID,\n\ttransactions_FIFO_Universal.sentCurrency,\n\ttransactions_FIFO_Universal.FK_ReceivedWalletID,\n\ttransactions_FIFO_Universal.FK_SentWalletID,\n\ttransactions_FIFO_Universal.realizedReturnInUSD,\n\ttransactions_FIFO_Universal.sentCostBasisInUSD,\n\ttransactions_FIFO_Universal.receivedCostBasisInUSD,\n\ttransactions_FIFO_Universal.receivedWalletType,\n\ttransactions_FIFO_Universal.receivedWallet,\n\ttransactions_FIFO_Universal.sentWalletType,\n\ttransactions_FIFO_Universal.sentWallet,\n\ttransactions_FIFO_Universal.FK_ReceivedTransactionSourceID,\t\n\ttransactions_FIFO_Universal.FK_SentTransactionSourceID\nFROM\n\ttransactions_FIFO_Universal\nWHERE\n\ttransactions_FIFO_Universal.FK_TransactionTypeID = 1\nORDER BY\n\tUNIX_TIMESTAMP(transactions_FIFO_Universal.transactionDate)\");\n\t\n\t\t\t$insertCoinTrackingRecords\t\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"INSERT INTO CoinTrackingLedgerTransaction\n(\n\ttransactionRecordID,\n\tFK_GlobalTransactionRecordID,\n\tFK_AccountID,\n\tFK_ProviderAccountWalletID,\n\ttransactionTime,\n\ttransactionTimestamp,\n\tFK_EffectiveTypeID,\n\tFK_TransactionTypeID,\n\tFK_AssetTypeID,\n\tamount,\n\tisDebit,\n\tbaseToQuoteCurrencySpotPrice,\n\tbaseToUSDCurrencySpotPrice,\n\tbtcSpotPriceAtTimeOfTransaction,\n\tFK_BaseCurrencyWalletID,\n\tFK_QuoteCurrencyWalletID,\n\treceivedQuantity,\n\tsentQuantity,\n\tFK_TransactionSourceID,\n\tFK_ExchangeID,\n\tFK_ReceivedCurrencyID,\n\treceivedCurrencyAbbreviation,\n\tFK_SentCurrencyID,\n\tsentCurrencyAbbreviation,\n\tFK_ReceivedWalletID,\n\tFK_SentWalletID,\n\treceivedWalletType,\n\treceivedWallet,\n\tsentWalletType,\n\tsentWallet\n)\nVALUES\n(\n\t:transactionRecordID,\n\t:FK_GlobalTransactionRecordID,\n\t:FK_AccountID,\n\t:FK_ProviderAccountWalletID,\n\t:transactionTime,\n\t:transactionTimestamp,\n\t:FK_EffectiveTypeID,\n\t:FK_TransactionTypeID,\n\t:FK_AssetTypeID,\n\t:amount,\n\t:isDebit,\n\t:baseToQuoteCurrencySpotPrice,\n\t:baseToUSDCurrencySpotPrice,\n\t:btcSpotPriceAtTimeOfTransaction,\n\t:FK_BaseCurrencyWalletID,\n\t:FK_QuoteCurrencyWalletID,\n\t:receivedQuantity,\n\t:sentQuantity,\n\t:FK_TransactionSourceID,\n\t:FK_ExchangeID,\n\t:FK_ReceivedCurrencyID,\n\t:receivedCurrencyAbbreviation,\n\t:FK_SentCurrencyID,\n\t:sentCurrencyAbbreviation,\n\t:FK_ReceivedWalletID,\n\t:FK_SentWalletID,\n\t:receivedWalletType,\n\t:receivedWallet,\n\t:sentWalletType,\n\t:sentWallet\n)\");\n\t\n\t\t\tif ($getCoinTrackingRecords -> execute() && $getCoinTrackingRecords -> rowCount() > 0)\n\t\t\t{\n\t\t\t\terrorLog(\"began get cointracking buy transaction records \".$getCoinTrackingRecords -> rowCount() > 0);\n\t\t\t\t\n\t\t\t\twhile ($row = $getCoinTrackingRecords -> fetchObject())\n\t\t\t\t{\n\t\t\t\t\t$transactionRecordID\t\t\t\t\t\t\t\t\t= $row -> transactionRecordID;\n\t\t\t\t\t$FK_ProviderAccountWalletID\t\t\t\t\t\t\t\t= $row -> FK_ProviderAccountWalletID;\n\t\t\t\t\t$transactionTime\t\t\t\t\t\t\t\t\t\t= $row -> transactionTime;\n\t\t\t\t\t$transactionTimestamp\t\t\t\t\t\t\t\t\t= $row -> transactionTimestamp;\n\t\t\t\t\t$FK_LedgerEntryTypeID\t\t\t\t\t\t\t\t\t= $row -> FK_LedgerEntryTypeID;\n\t\t\t\t\t$FK_EffectiveTypeID\t\t\t\t\t\t\t\t\t\t= $row -> FK_EffectiveTypeID;\n\t\t\t\t\t$FK_TransactionTypeID\t\t\t\t\t\t\t\t\t= $row -> FK_TransactionTypeID;\n\t\t\t\t\t$FK_AssetTypeID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_AssetTypeID;\n\t\t\t\t\t$amount\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> amount;\n\t\t\t\t\t$baseToQuoteCurrencySpotPrice\t\t\t\t\t\t\t= $row -> baseToQuoteCurrencySpotPrice;\t\t\t\t\t\t\t\n\t\t\t\t\t$baseToUSDCurrencySpotPrice\t\t\t\t\t\t\t\t= $row -> baseToUSDCurrencySpotPrice;\n\t\t\t\t\t\n\t\t\t\t\t$FK_BaseCurrencyWalletID\t\t\t\t\t\t\t\t= $row -> FK_BaseCurrencyWalletID;\n\t\t\t\t\t$FK_QuoteCurrencyWalletID\t\t\t\t\t\t\t\t= $row -> FK_QuoteCurrencyWalletID;\n\t\t\t\t\t$receivedQuantity\t\t\t\t\t\t\t\t\t\t= $row -> receivedQuantity;\n\t\t\t\t\t$sentQuantity\t\t\t\t\t\t\t\t\t\t\t= $row -> sentQuantity;\n\t\t\t\t\t$FK_TransactionSourceID\t\t\t\t\t\t\t\t\t= $row -> FK_TransactionSourceID;\n\t\t\t\t\t$FK_ExchangeID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_ExchangeID;\n\t\t\t\t\t$FK_ReceivedCurrencyID\t\t\t\t\t\t\t\t\t= $row -> FK_ReceivedCurrencyID;\n\t\t\t\t\t$receivedCurrency\t\t\t\t\t\t\t\t\t\t= $row -> receivedCurrency;\n\t\t\t\t\t$FK_SentCurrencyID\t\t\t\t\t\t\t\t\t\t= $row -> FK_SentCurrencyID;\n\t\t\t\t\t$sentCurrency\t\t\t\t\t\t\t\t\t\t\t= $row -> sentCurrency;\n\t\t\t\t\t$FK_ReceivedWalletID\t\t\t\t\t\t\t\t\t= $row -> FK_ReceivedWalletID;\n\t\t\t\t\t$FK_SentWalletID\t\t\t\t\t\t\t\t\t\t= $row -> FK_SentWalletID;\n\t\t\t\t\t$receivedWalletType\t\t\t\t\t\t\t\t\t\t= $row -> receivedWalletType;\n\t\t\t\t\t$receivedWallet\t\t\t\t\t\t\t\t\t\t\t= $row -> receivedWallet;\n\t\t\t\t\t$sentWalletType\t\t\t\t\t\t\t\t\t\t\t= $row -> sentWalletType;\n\t\t\t\t\t$sentWallet \t\t\t\t\t\t\t\t\t\t\t= $row -> sentWallet;\n\t\t\t\t\t$FK_ReceivedTransactionSourceID\t\t\t\t\t\t\t= $row -> FK_ReceivedTransactionSourceID;\n\t\t\t\t\t$FK_SentTransactionSourceID\t\t\t\t\t\t\t\t= $row -> FK_SentTransactionSourceID;\n\n\t\t\t\t\tif (isset($cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$currentCount\t\t\t\t\t\t\t\t\t\t= $cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID];\n\t\t\t\t\t\t$currentCount++;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]\t= $currentCount;\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$cryptoCurrencyTypesImported[$FK_AssetTypeID][$quoteCurrencyID]\t= 1;\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// create asset type status record for this data import event record ID\n\t\t\t\t\tcreateDataImportAssetStatusRecord($accountID, $userEncryptionKey, $dataImportEventRecordID, $FK_AssetTypeID, $quoteCurrencyID, $globalCurrentDate, $sid, $dbh);\n\n\t\t\t\t\t$transactionAmountInUSD\t\t\t\t\t\t\t\t\t= $amount;\n\t\t\t\t\t$transactionAmountMinusFeeInUSD\t\t\t\t\t\t\t= $amount;\n\n\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t\t= 0;\n\n\t\t\t\t\t$nativeTransactionIDValue\t\t\t\t\t\t\t\t= md5(\"$transactionSourceID $transactionTimestamp $FK_TransactionTypeID $FK_ReceivedCurrencyID $FK_SentCurrencyID $receivedWalletType $sentWalletType $amount $sentQuantity $receivedCurrency\".md5(\"$sentQuantity.$transactionTime.$accountID\"));\n\n\t\t\t\t\t$profitStanceTransactionIDValue\t\t\t\t\t\t\t= createProfitStanceTransactionIDValue($accountID, $FK_AssetTypeID, $transactionSourceID, $nativeTransactionIDValue, $globalCurrentDate, $sid);\n\n\t\t\t\t\t$globalTransactionCreationResults\t\t\t\t\t\t= createGlobalTransactionIdentificationRecordWithProfitStanceTransactionIDValue($accountID, $FK_AssetTypeID, $dataImportEventRecordID, $nativeTransactionIDValue, $profitStanceTransactionIDValue, $transactionSourceID, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\t\n\t\t\t\t\tif ($globalTransactionCreationResults['createdGlobalTransactionIdentificationRecord'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t= $globalTransactionCreationResults['globalTransactionIdentificationRecordID'];\n\t\t\t\t\t}\t\n\t\t\t\t\t\n\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t\t= 0;\n\t\t\t\t\t\n\t\t\t\t\tif ($FK_ReceivedCurrencyID == 1 && $FK_SentCurrencyID == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t= $baseToUSDCurrencySpotPrice;\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$cascadeRetrieveSpotPriceResponseObject\t\t\t\t= getSpotPriceForAssetPairUsingSourceCascade(1, 2, $transactionTime, 14, \"CoinGecko price by date\", $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($cascadeRetrieveSpotPriceResponseObject['foundSpotPrice'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t= $cascadeRetrieveSpotPriceResponseObject['spotPrice'];\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$unspentTransactionTotal\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t\n\t\t\t\t\tif ($isDebit == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$unspentTransactionTotal \t\t\t\t\t\t\t= $amount;\n\t\t\t\t\t}\n\t\t\t\t\telse if ($isDebit == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t= $amount;\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$sourceWallet\t\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t$destinationWallet\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t\n\t\t\t\t\t$sourceWalletResponseObject\t\t\t\t\t\t\t\t= $sourceWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $FK_SentWalletID, $userEncryptionKey, $dbh);\n\t\t\t\n\t\t\t\t\tif ($sourceWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"could not instantiate crypto wallet $accountID, $FK_SentWalletID, $userEncryptionKey\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$destinationWalletResponseObject\t\t\t\t\t\t= $destinationWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $FK_ReceivedWalletID, $userEncryptionKey, $dbh);\n\t\t\t\n\t\t\t\t\tif ($destinationWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"could not instantiate crypto wallet $accountID, $FK_ReceivedWalletID, $userEncryptionKey\");\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\terrorLog(\"INSERT INTO CoinTrackingLedgerTransaction\n(\n\ttransactionRecordID,\n\tFK_GlobalTransactionRecordID,\n\tFK_AccountID,\n\tFK_ProviderAccountWalletID,\n\ttransactionTime,\n\ttransactionTimestamp,\n\tFK_EffectiveTypeID,\n\tFK_TransactionTypeID,\n\tFK_AssetTypeID,\n\tamount,\n\tisDebit,\n\tbaseToQuoteCurrencySpotPrice,\n\tbaseToUSDCurrencySpotPrice,\n\tbtcSpotPriceAtTimeOfTransaction,\n\tFK_BaseCurrencyWalletID,\n\tFK_QuoteCurrencyWalletID,\n\treceivedQuantity,\n\tsentQuantity,\n\tFK_TransactionSourceID,\n\tFK_ExchangeID,\n\tFK_ReceivedCurrencyID,\n\treceivedCurrencyAbbreviation,\n\tFK_SentCurrencyID,\n\tsentCurrencyAbbreviation,\n\tFK_ReceivedWalletID,\n\tFK_SentWalletID,\n\treceivedWalletType,\n\treceivedWallet,\n\tsentWalletType,\n\tsentWallet\n)\nVALUES\n(\n\t$transactionRecordID,\n\t$globalTransactionIdentificationRecordID,\n\t$accountID,\n\t$FK_ProviderAccountWalletID,\n\t'$transactionTime',\n\t$transactionTimestamp,\n\t$FK_EffectiveTypeID,\n\t$FK_TransactionTypeID,\n\t$FK_AssetTypeID,\n\t$amount,\n\t$isDebit,\n\t$baseToQuoteCurrencySpotPrice,\n\t$baseToUSDCurrencySpotPrice,\n\t$btcSpotPriceAtTimeOfTransaction,\n\t$FK_BaseCurrencyWalletID,\n\t$FK_QuoteCurrencyWalletID,\n\t$receivedQuantity,\n\t$sentQuantity,\n\t$transactionSourceID,\n\t$FK_ExchangeID,\n\t$FK_ReceivedCurrencyID,\n\t'$receivedCurrency',\n\t$FK_SentCurrencyID,\n\t'$sentCurrency',\n\t$FK_ReceivedWalletID,\n\t$FK_SentWalletID,\n\t'$receivedWalletType',\n\t'$receivedWallet',\n\t'$sentWalletType',\n\t'$sentWallet'\n)\");\n\t\t\t\t\t\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionRecordID', $transactionRecordID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_GlobalTransactionRecordID', $globalTransactionIdentificationRecordID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_AccountID', $accountID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ProviderAccountWalletID', $FK_ProviderAccountWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionTime', $transactionTime);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':transactionTimestamp', $transactionTimestamp);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_EffectiveTypeID', $FK_EffectiveTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_TransactionTypeID', $FK_TransactionTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_AssetTypeID', $FK_AssetTypeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':amount', $amount);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':isDebit', $isDebit);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':baseToQuoteCurrencySpotPrice', $baseToQuoteCurrencySpotPrice);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':baseToUSDCurrencySpotPrice', $baseToUSDCurrencySpotPrice);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':btcSpotPriceAtTimeOfTransaction', $btcSpotPriceAtTimeOfTransaction);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_BaseCurrencyWalletID', $FK_BaseCurrencyWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_QuoteCurrencyWalletID', $FK_QuoteCurrencyWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedQuantity', $receivedQuantity);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentQuantity', $sentQuantity);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_TransactionSourceID', $transactionSourceID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ExchangeID', $FK_ExchangeID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ReceivedCurrencyID', $FK_ReceivedCurrencyID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedCurrencyAbbreviation', $receivedCurrency);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_SentCurrencyID', $FK_SentCurrencyID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentCurrencyAbbreviation', $sentCurrency);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_ReceivedWalletID', $FK_ReceivedWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':FK_SentWalletID', $FK_SentWalletID);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedWalletType', $receivedWalletType);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':receivedWallet', $receivedWallet);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentWalletType', $sentWalletType);\n\t\t\t\t\t$insertCoinTrackingRecords -> bindValue(':sentWallet', $sentWallet);\n\n\t\t\t\t\t\n\n\t\t\t\t\t$nativeRecordID\t\t\t\t\t\t\t\t\t\t\t= 0;\n\n\t\t\t\t\tif ($insertCoinTrackingRecords -> execute())\n\t\t\t\t\t{\n\t\t\t\t\t\terrorLog(\"insert coin tracking record worked\", $GLOBALS['debugCoreFunctionality']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$nativeRecordID \t\t\t\t\t\t\t\t\t= $dbh -> lastInsertId();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$cryptoTransaction\t\t\t\t\t\t\t\t\t\t= new CryptoTransaction();\n\t\t\t\t\t\n\t\t\t\t\t$cryptoTransaction -> setData(0, $accountID, $authorID, $globalTransactionIdentificationRecordID, $FK_TransactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $FK_AssetTypeID, $receivedCurrency, $quoteCurrencyID, $quoteCurrency, $FK_SentWalletID, $FK_ReceivedWalletID, $transactionTime, $transactionTime, $transactionTimestamp, $nativeRecordID, $nativeRecordID, $receivedQuantity, $amount, $baseToQuoteCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountInUSD, $feeAmountInBaseCurrency, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid);\n\t\t\t\t\t\n\t\t\t\t\t$writeToDatabaseResponse\t\t\t\t\t\t\t\t= $cryptoTransaction -> writeToDatabase($userEncryptionKey, $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\tif ($writeToDatabaseResponse['wroteToDatabase'] == true)\n\t\t\t\t\t{\n\t\t\t\t\t\t$transactionID\t\t\t\t\t\t\t\t\t\t= $cryptoTransaction -> getTransactionID();\n\t\t\t\t\t\n\t\t\t\t\t\terrorLog(\"transaction $transactionID created\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$profitStanceLedgerEntry\t\t\t\t\t\t\t= new ProfitStanceLedgerEntry();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$profitStanceLedgerEntry -> setData($accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $exchangeTileID, $globalTransactionIdentificationRecordID, $transactionTime, $receivedQuantity, $dbh);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$writeProfitStanceLedgerEntryRecordResponseObject\t= $profitStanceLedgerEntry -> writeToDatabase($dbh);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif ($writeProfitStanceLedgerEntryRecordResponseObject['wroteToDatabase'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"wrote profitStance ledger entry $accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $globalTransactionIdentificationRecordID, $receivedQuantity to the database.\", $GLOBALS['debugCoreFunctionality']);\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\terrorLog(\"could not write profitStance ledger entry $accountID, $FK_AssetTypeID, $receivedCurrency, $transactionSourceID, $transactionSourceLabel, $globalTransactionIdentificationRecordID, $receivedQuantity to the database.\", $GLOBALS['criticalErrors']);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= true;\n\t\t}\n\t\tcatch (PDOException $e) \n\t\t{\n\t\t\t$cryptoTransaction \t\t\t\t\t\t\t\t\t\t\t\t= null;\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= false;\n\t\t\t\n\t\t\terrorLog($e -> getMessage());\n\t\t\n\t\t\tdie();\n\t\t}\n\n return $cryptoCurrencyTypesImported;\n }", "public function testIsTierPriceFixed()\n {\n $this->assertTrue($this->_model->isTierPriceFixed());\n }", "function buyFeature($feature_type, $world_id) {\n\twriteLog(\"buyFeature()\");\n\n\t$cost = calculateFeatureCost($feature_type, $world_id);\n\t\n\t# Determine if enough funds exist\n\t$current_funds = getCurrentFunds($world_id);\n\t\n\tif ($current_funds >= $cost) {\n\t\t# Update funds\n\t\t$dml = \"UPDATE oddworld.grid SET grid_money = grid_money - \" . $cost . \" WHERE grid_id = \" . $world_id . \";\";\n\t\twriteLog(\"buyFeature(): DML: \" . $dml);\n\t\t$status = doInsert($dml);\t\n\t}\n\t\n}", "public function existingPackageHandler(&$plan_info)\n {\n if ($this->planType == 'account') {\n return;\n }\n\n if ((!$plan_info['Package_ID'] && $plan_info['Price'] <= 0)\n || ($plan_info['Package_ID']\n && ($plan_info['Listings_remains'] > 0\n || $plan_info['Listing_number'] == 0)\n )\n ) {\n $this->skipCheckout = true;\n unset($this->steps['checkout']);\n } else {\n $this->skipCheckout = false;\n }\n }", "function updateAssetPrice( $asset=null ){\n global $mysqli;\n // Lookup asset id \n $asset = $mysqli->real_escape_string($asset);\n $results = $mysqli->query(\"SELECT id, divisible FROM assets WHERE asset='{$asset}'\");\n if($results && $results->num_rows){\n $row = $results->fetch_assoc();\n $asset_id = $row['id'];\n $divisible = ($row['divisible']==1) ? true : false;\n } else {\n byeLog('Error looking up asset id');\n }\n // Bail out on BTC or XCP\n if($asset_id<=2)\n return;\n // Lookup last order match for XCP\n $sql = \"SELECT\n m.forward_asset_id,\n m.forward_quantity,\n m.backward_asset_id,\n m.backward_quantity\n FROM\n order_matches m\n WHERE\n ((m.forward_asset_id=2 AND m.backward_asset_id='{$asset_id}') OR\n ( m.forward_asset_id='{$asset_id}' AND m.backward_asset_id=2)) AND\n m.status='completed'\n ORDER BY \n m.tx1_index DESC \n LIMIT 1\";\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n $data = $results->fetch_assoc();\n $xcp_amt = ($data['forward_asset_id']==2) ? $data['forward_quantity'] : $data['backward_quantity'];\n $xxx_amt = ($data['forward_asset_id']==2) ? $data['backward_quantity'] : $data['forward_quantity'];\n $xcp_qty = number_format($xcp_amt * 0.00000001,8,'.','');\n $xxx_qty = ($divisible) ? number_format($xxx_amt * 0.00000001,8,'.','') : number_format($xxx_amt,0,'.','');\n $price = number_format($xcp_qty / $xxx_qty,8,'.','');\n $price_int = number_format($price * 100000000,0,'.','');\n $results = $mysqli->query(\"UPDATE assets SET xcp_price='{$price_int}' WHERE id='{$asset_id}'\");\n if(!$results)\n byeLog('Error updating XCP price for asset ' . $asset);\n }\n } else {\n byeLog('Error while trying to lookup asset price');\n }\n}", "function get_amount($date) {\n global $debug;\n $val = null;\n $money = 0;\n //if ($debug) { echo \"comparing value range for this object: \"; print_r($item); }\n foreach ($this->list as $item) {\n if ($item->includes($date)) {\n $val = $item;\n }\n }\n if (!$val) {\n return $money;\n }\n $period = $val->period;\n switch ($period) {\n case 'weekly':\n // this is only debited once every week.\n // make sure it is a multiple of 1 week offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 7 == 0) {\n $money = $val->amount;\n }\n break;\n case 'biweekly':\n // this is only debited once every 2 weeks.\n // make sure it is a multiple of 2 weeks offset from $val->extra\n $offset_seconds = strtotime($date) - strtotime($val->extra);\n $offset_days = floor($offset_seconds / 86400);\n if ($offset_days % 14 == 0) {\n $money = $val->amount;\n }\n break;\n case 'monthly': \n // this is debited once per month\n // make sure the day of month matches the day from $val->extra\n $day_amount = date('d', strtotime($val->extra));\n $day_this = date('d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'semiannual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_amount_semi = date('m-d', strtotime(\"+6 months\", strtotime($val->extra)));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount || $day_this == $day_amount_semi) {\n $money = $val->amount;\n }\n break;\n case 'annual': \n // this is debited once per year\n // make sure the day matches the day from $val->extra\n $day_amount = date('m-d', strtotime($val->extra));\n $day_this = date('m-d', strtotime($date));\n if ($day_this == $day_amount) {\n $money = $val->amount;\n }\n break;\n case 'once':\n // make sure date matches exactly with $val->extra\n if ($date == $val->extra) {\n $money = $val->amount;\n }\n break;\n case 'daily':\n // always return the same value\n $money = $val->amount;\n break;\n default:\n throw new Exception(\"unkown period '$period'\");\n }\n if ($debug) {\n printf(\"get_amount($date) $val->period, $val->amount, $val->extra -> $money\\n\");\n }\n return $money;\n }", "function apply_condition_bonus(){\r\n\t$Bonus_Rand = mt_rand(75,150) * 1000;\r\n\r\n\tif($this->Eq['A']['exp'] < 0){\r\n\t\t$i = (10000+$this->Eq['A']['exp'])/10000;\r\n\t\t$this->Eq['A']['atk'] = floor($this->Eq['A']['atk'] * $i);\r\n\t\t$i = 1 + abs($this->Eq['A']['exp'])/10000;\r\n\t}else\t$i = 1 - $this->Eq['A']['exp']/$Bonus_Rand;\r\n\t$this->Eq['A']['enc'] = floor($this->Eq['A']['enc'] * $i);\r\n\r\n\tif($this->Eq['D']['exp'] < 0)\t$i = ($this->Eq['D']['exp'])/-5000;\r\n\telse\t\t\t\t$i = 1 - $this->Eq['D']['exp']/$Bonus_Rand;\r\n\t$this->Eq['D']['enc'] = floor($this->Eq['D']['enc'] * $i);\r\n\r\n\tif($this->Eq['E']['exp'] < 0)\t$i = ($this->Eq['E']['exp'])/-5000;\r\n\telse\t\t\t\t$i = 1 - $this->Eq['E']['exp']/$Bonus_Rand;\r\n\t$this->Eq['E']['enc'] = floor($this->Eq['E']['enc'] * $i);\r\n\r\n}", "function calculate_insertion_fee($cid = 0, $cattype = 'service', $amount = 0, $pid = 0, $userid = 0, $isbudgetrange = 0, $filtered_budgetid = 0, $applytax = true)\n\t{\n\t\tglobal $ilance, $phrase;\n\t\t$fee = 0;\n\t\t// #### PRODUCT INSERTION FEE ##################################\n\t\tif ($cattype == 'product')\n\t\t{\n\t\t\t$ifgroupname = $ilance->categories->insertiongroup($cid);\n\t\t\tif ($userid > 0)\n\t\t\t{\n\t\t\t\t$forceifgroupid = $ilance->permissions->check_access($userid, \"{$cattype}insgroup\");\n\t\t\t\tif ($forceifgroupid > 0)\n\t\t\t\t{\n\t\t\t\t\t$ifgroupname = $ilance->db->fetch_field(DB_PREFIX . \"insertion_groups\", \"groupid = '\" . intval($forceifgroupid) . \"'\", \"groupname\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql = $ilance->db->query(\"\n\t\t\t\tSELECT insertion_to, insertion_from, amount\n\t\t\t\tFROM \" . DB_PREFIX . \"insertion_fees\n\t\t\t\tWHERE groupname = '\" . $ilance->db->escape_string($ifgroupname) . \"'\n\t\t\t\t\tAND state = '\" . $ilance->db->escape_string($cattype) . \"'\n\t\t\t\tORDER BY sort ASC\n\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t\t{\n\t\t\t\t$found = 0;\n\t\t\t\twhile ($rows = $ilance->db->fetch_array($sql, DB_ASSOC))\n\t\t\t\t{\n\t\t\t\t\tif ($rows['insertion_to'] == '-1')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($amount >= $rows['insertion_from'] AND $rows['insertion_to'] == '-1')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$found = 1;\n\t\t\t\t\t\t\t$fee += $rows['amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($amount >= $rows['insertion_from'] AND $amount <= $rows['insertion_to'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$found = 1;\n\t\t\t\t\t\t\t$fee += $rows['amount'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($found == 0)\n\t\t\t\t{\n\t\t\t\t\t$fee = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$fee = 0;\n\t\t\t}\n\t\t}\n\t\t// #### SERVICE INSERTION FEE ##################################\n\t\telse if ($cattype == 'service')\n\t\t{\n\t\t\t// #### BUDGET RANGE INSERTION FEES ####################\n\t\t\tif ($isbudgetrange AND $filtered_budgetid > 0)\n\t\t\t{\n\t\t\t\t$insertiongroup = $ilance->db->fetch_field(DB_PREFIX . \"budget\", \"budgetid = '\" . intval($filtered_budgetid) . \"'\", \"insertiongroup\");\n\t\t\t\t$ifgroupname = $insertiongroup;\n\t\t\t\tif ($userid > 0)\n\t\t\t\t{\n\t\t\t\t\t$forceifgroupid = $ilance->permissions->check_access($userid, \"{$cattype}insgroup\");\n\t\t\t\t\tif ($forceifgroupid > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$ifgroupname = $ilance->db->fetch_field(DB_PREFIX . \"insertion_groups\", \"groupid = '\" . intval($forceifgroupid) . \"'\", \"groupname\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$sql = $ilance->db->query(\"\n\t\t\t\t\tSELECT amount\n\t\t\t\t\tFROM \" . DB_PREFIX . \"insertion_fees\n\t\t\t\t\tWHERE groupname = '\" . $ilance->db->escape_string($ifgroupname) . \"'\n\t\t\t\t\t\tAND state = '\" . $ilance->db->escape_string($cattype) . \"'\n\t\t\t\t\tORDER BY sort ASC\n\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t\t\t{\n\t\t\t\t\t// our budget range has some insertion group defined ..\n\t\t\t\t\twhile ($rows = $ilance->db->fetch_array($sql, DB_ASSOC))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fee += $rows['amount'];\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// buyer decides to set project as budget non-disclosed (does not select a pre-defined budget range)\n\t\t\t\t// is admin charging fees in this category for non-disclosed auctions?\n\t\t\t\t$ndfee = $ilance->db->fetch_field(DB_PREFIX . \"categories\", \"cid = '\" . intval($cid) . \"'\", \"nondisclosefeeamount\");\n\t\t\t\tif ($ndfee > 0)\n\t\t\t\t{\n\t\t\t\t\t$fee = $ndfee;\n\t\t\t\t}\n\t\t\t\tunset($ndfee);\n\t\t\t}\n\t\t\t// #### CATEGORY BASE INSERTION FEES ###################\n\t\t\t$insertiongr = $ilance->categories->insertiongroup($cid);\n\t\t\tif (!empty($insertiongr))\n\t\t\t{\n\t\t\t\t$sql = $ilance->db->query(\"\n\t\t\t\t\tSELECT amount\n\t\t\t\t\tFROM \" . DB_PREFIX . \"insertion_fees\n\t\t\t\t\tWHERE groupname = '\" . $ilance->db->escape_string($insertiongr) . \"'\n\t\t\t\t\t\tAND state = '\" . $ilance->db->escape_string($cattype) . \"'\n\t\t\t\t\tORDER BY sort ASC\n\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t\t\t{\n\t\t\t\t\twhile ($rows = $ilance->db->fetch_array($sql, DB_ASSOC))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fee += $rows['amount'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($insertiongr);\n\t\t}\n\t\t// check if we're exempt from insertion fees\n\t\tif ($userid > 0 AND $ilance->permissions->check_access($userid, 'insexempt') == 'yes')\n\t\t{\n\t\t\t$fee = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// #### taxes on insertion fees ################\n\t\t\t$feenotax = $fee;\n\t\t\tif ($userid > 0 AND $ilance->tax->is_taxable($userid, 'insertionfee') AND $applytax)\n\t\t\t{\n\t\t\t\t// #### fetch tax amount to charge for this invoice type\n\t\t\t\t$taxamount = $ilance->tax->fetch_amount($userid, $fee, 'insertionfee', 0);\n\t\t\t\t// #### fetch total amount to hold within the \"totalamount\" field\n\t\t\t\t$totalamount = ($fee + $taxamount);\n\t\t\t\t// ensure the fee we use below contains the taxes added also\n\t\t\t\t$fee = $totalamount;\n\t\t\t}\n\t\t}\n\t\treturn $fee;\n\t}" ]
[ "0.6538791", "0.5978094", "0.5084909", "0.50661504", "0.4991182", "0.49791357", "0.49686983", "0.49271303", "0.49065572", "0.49030474", "0.48959696", "0.48240322", "0.4812633", "0.4795141", "0.4790744", "0.47311062", "0.46994248", "0.4686266", "0.46818075", "0.46815133", "0.46658453", "0.4645906", "0.4632221", "0.46300325", "0.46277696", "0.46166906", "0.4588078", "0.45802665", "0.4576475", "0.45722464", "0.45646214", "0.45453453", "0.45326325", "0.45214158", "0.45210284", "0.4517955", "0.4516993", "0.45098564", "0.45060837", "0.44982564", "0.44848603", "0.4482266", "0.4463476", "0.44614", "0.4456088", "0.44535455", "0.4452456", "0.44451538", "0.44325912", "0.4431258", "0.43972453", "0.43942443", "0.43929583", "0.43896103", "0.43876433", "0.43865234", "0.4383833", "0.4383435", "0.43783438", "0.43697754", "0.43694842", "0.4367131", "0.43572634", "0.43400678", "0.43386924", "0.4338629", "0.43344167", "0.43167377", "0.4309656", "0.4307958", "0.43047363", "0.43035832", "0.4297242", "0.429342", "0.4284575", "0.42827782", "0.4280734", "0.42792544", "0.42788115", "0.42710748", "0.42672983", "0.4266136", "0.42660215", "0.4265219", "0.42576173", "0.42570192", "0.4254485", "0.4251283", "0.42496252", "0.42478657", "0.42477787", "0.42454717", "0.4245052", "0.4242149", "0.42397997", "0.4237742", "0.42363948", "0.42285675", "0.42251602", "0.42241752" ]
0.7070034
0
/ Sell Potential Asset has already been checked that it's above threshold. This function chooses whether it sells all or sells a bit. $folioEntry example: ``` $DOTUSD = array ( 'pairSymbol'=>'DOTUSD', 'coinSymbol'=>'DOT', 'targetPercent' => 5, ); ```
function sellPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price, $unixTime, $threshold) { $filename = $moduleName. '-'; $filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-ohlcOld.json'; $ohlcOld = file_get_contents($filepath); $ohlcOld = json_decode($ohlcOld, true); $filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-emaSet.json'; $emaSet = file_get_contents($filepath); $emaSet = json_decode($emaSet, true); $filepath = '' . $moduleName . '-main.json'; $main = file_get_contents($filepath); $main = json_decode($main, true); $filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json'; $history = file_get_contents($filepath); $history = json_decode($history, true); //$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0); //$history = array ('ledger'=>null, 'totals'=>$historyTotals); if (!isset($history)) { print ('zero history'); } end($ohlcOld); $lastKey = key($ohlcOld); $pairSymbol = $folioEntry['pairSymbol']; $haystack = array_column($main, 'pairSymbol'); $mainEntry = array_search($pairSymbol, $haystack, TRUE); $mainLast = count($main)-1; // Sell if higher than threshold // || $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] if ($folioEntry['dumpable']==0 || $ohlcOld[$lastKey]['close']>=$emaSet[$lastKey]['priceEMASlow']) { $devPercent = $currentPercent - $folioEntry['targetPercent']; $dev = round($devPercent*$totalValue/100, 2, PHP_ROUND_HALF_DOWN); $toSell = round($dev/$price, 5, PHP_ROUND_HALF_DOWN); $soldValue = $toSell*$price; $fee = 0.004*$soldValue; $soldValue = $soldValue- $fee; // fee and drift //$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0); //$history = array ('ledger'=>null, 'totals'=>$historyTotals); // History Stuff $originalValue = $toSell*$main[$mainEntry]['averageBuyPrice']; $profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP); $profitValue = $soldValue-$originalValue; $history['ledger'][] = array ( 'time'=>$unixTime, 'volume'=>$toSell, 'value'=>$soldValue, 'fee'=>$fee, 'profitPercent'=>$profitPercent, 'profitValue'=>$profitValue, ); $history['totals']['profit'] += $profitPercent; $history['totals']['quoteProfit'] += $profitValue; $history['totals']['totalDiff'] += $fee; $history['totals']['count'] += 1; if ($profitValue>0) { $history['totals']['positive'] += 1; $history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP); } // Main Stuff $newAveragePrice = round(($main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toSell * $price)/($main[$mainEntry]['quantity'] + $toSell),5, PHP_ROUND_HALF_UP); $main[$mainEntry]['quantity'] -=$toSell; $main[$mainEntry]['averageBuyPrice'] = $newAveragePrice; $main[$mainLast]['quantity'] += $soldValue; print ($folioEntry['pairSymbol'].' sold'); } // Sell all aka dump. Only dumpable ones apply. if ($folioEntry['dumpable']==1 && $ohlcOld[$lastKey]['close']<$emaSet[$lastKey]['priceEMASlow'] && $devPercent>$threshold) { $soldValue = $main[$mainEntry]['quantity']*$price; $soldValue -= 0.004*$soldValue; // fee and drift $fee = 0.004*$soldValue; // History Stuff $originalValue = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice']; $profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP); $profitValue = $soldValue-$originalValue; $history['ledger'][] = array ( 'time'=>$unixTime, 'volume'=>$main[$mainEntry]['quantity'], 'value'=>$soldValue, 'fee'=>$fee, 'profitPercent'=>$profitPercent, 'profitValue'=>$profitValue, ); $history['totals']['profit'] += $profitPercent; $history['totals']['quoteProfit'] += $profitValue; $history['totals']['totalDiff'] += $fee; $history['totals']['count'] += 1; if ($profitValue>0) { $history['totals']['positive'] += 1; $history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP); } $main[$mainEntry]['quantity'] = 0; $main[$mainEntry]['averageBuyPrice'] = 0; $main[$mainLast]['quantity'] += $soldValue; print ($folioEntry['pairSymbol'].' sold (dump)'); } $filepath = '' . $moduleName . '-main.json'; file_put_contents($filepath, json_encode($main)); $filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json'; file_put_contents($filepath, json_encode($history)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buyPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price) {\n\t$filename = $moduleName. '-'. $folioEntry['pairSymbol'].'-';\n\n\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n global $exchange;\n $price = getPrice ($api, $exchange, $pairSymbol);\n\n\tif (!isset($price)) {\n\t\tprint ('no price');\n\t}\n\n\n\t// Buy if lower than threshold\n\tif ($currentPercent>1 && $ohlcOld[$lastKey]['close']>$emaSet[$lastKey]['priceEMAMed'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent']-$currentPercent;\n\t\t$dev = round($dev*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy-$toBuy*0.004; // fee and drift\n\t\t$newAveragePrice = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toBuy * $price;\n\t\t$newAveragePrice = $newAveragePrice/($main[$mainEntry]['quantity'] + $toBuy);\n\t\t$newAveragePrice = round($newAveragePrice,5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] +=$toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought');\n\t}\n\n\t// Re-buy if preveiously sold all. Only dumpable ones apply.\n\n\tif ($currentPercent<=1 && $ohlcOld[$lastKey]['close']<$ohlcOld[$lastKey-1]['close'] && $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent'];\n\t\t$dev = $dev*$totalValue/100;\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy- $toBuy*0.004; // fee and drift\n\n\t\t$main[$mainEntry]['quantity'] = $toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $price;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought from zero');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n}", "function balanceCheck ($api, $moduleName, $folioArray, $threshold, $unixTime) {\n\n\n // get trade balance would go here\n\n\n\t// get current % of each coin and ema or other indicators\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$pairSymbols = array_column($folioArray, 'pairSymbol');\n\tarray_pop($pairSymbols);\n\n\t$pairCount = count($folioArray)-1; //last is USD\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('USD');\n\t\t}\n\t\t$currentPair = $folioArray[$i]['pairSymbol'];\n\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\n\t\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t $ohlcOld = file_get_contents($filepath);\n\t $ohlcOld = json_decode($ohlcOld, true);\n\n\t\tend($ohlcOld);\n\t\t$lastKey = key($ohlcOld);\n\n\t\t$price[$i] = $ohlcOld[$lastKey]['close'];\n\t\t$priceT[$i] = $ticker[$currentPair]['c'][0];\n\n\t\t$currentValue[$i] = $main[$i]['quantity']*$price[$i];\n\t\t$holdValue[$i] = $main[$i]['startQuantity']*$price[$i];\n\n\t}\n\t$totalValue = array_sum($currentValue);\n\t$totalValue += $main[$pairCount]['quantity']; // add USD\n\n // Hold value is the value if one only holds from the beginning\n\t$holdValue = array_sum($holdValue);\n\t$holdValue += $main[$pairCount]['startQuantity']; // add USD\n\n\t$operation = null;\n\n\t// based on deviation from planned % of folio, do stuff for each thing\n\tfor ($i=0; $i<$pairCount; $i++) { // count($folioArray)-1 since last is USD\n\t\t$filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-';\n\t\tif ($folioArray[$i]['coinSymbol']=='ZUSD') {\n\t\t\tprint ('squeak');\n\t\t}\n\n\t\tif ($folioArray[$i]['coinSymbol']!='ZUSD') {\n\t\t\t$currentPercent[$i] = round ($currentValue[$i]/$totalValue*100, 3, PHP_ROUND_HALF_UP);\n\t\t\t$deviation = $currentPercent[$i]-$main[$i]['targetPercent'];\n\n //Potential checks if it is worth buying or selling, depending on status of indicators\n\t\t\tif ($deviation>$threshold) {\n\t\t\t\tsellPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i], $unixTime, $threshold);\n\t\t\t}\n\t\t\tif ($deviation<-$threshold) {\n\t\t\t\tbuyPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i]);\n\t\t\t}\n\t\t\t$operation[] = $folioArray[$i]['pairSymbol'].' balance checked';\n\t\t}\n\t}\n\n\n\n\t$filepath = ''.$moduleName.'-'.'QuickExt.json';\n\t$quickExt = file_get_contents($filepath);\n\t$quickExt = json_decode($quickExt, true);\n\n\t$quickExt['tempTotalValue'] = $totalValue;\n\t$quickExt['holdValue'] = $holdValue;\n\n\tfor ($i=0; $i<=$pairCount; $i++) { // includes USD\n\t\t$quickExt['volChange'][$folioArray[$i]['coinSymbol']] = round($main[$i]['quantity']/$main[$i]['startQuantity']*100, 2, PHP_ROUND_HALF_UP);\n\t}\n\n\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\tprint_r ($operation);\n}", "function sellStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qtyRequested = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n\n //check how many of the stock you own\n $qtyYouOwn = getStockQuantity($username,$sym);\n \n //Make sure you have more or equal qty in portfolio compared to what you wanna sell\n if($qtyYouOwn >= $qtyRequested)\n {\n //Calculate the total value of your sell.\n $totalValue = $currentCost * $qtyRequested;\n }\n else //Placeholder for now, should probably not do this.\n {\n //Sell only the amount that you have in portfolio\n $totalValue = $currentCost * $qtyYouOwn;\n }\n \n \n //Call addtoAccountBalance and add $totalValue to the account balance\n $currentBalance = addtoAccountBalance($username,$totalValue,$sym);\n \n //Call deleteFromPortfolioDB and delete the previous entry\n deleteFromPortfolioDB($username, $qtyRequested, $sym);\n\n $returnString = \"Sell Order Confirmed!\";\n \n return($returnString);\n}", "function sell(Time $processingTime, Trade $updateExistingTrade = null, $cancelOffer = false, $price)\n\t{\n\t\t$sellingAsset = $this->settings->getCounterAsset();\n\t\t$buyingAsset = $this->settings->getBaseAsset();\n\n\t\t$budget = $this->getCurrentCounterAssetBudget(true);\n\t\t$sellAmount = \\GalacticHorizon\\Amount::createFromFloat($budget);\n\n\t\tif (!$cancelOffer && $sellAmount->toFloat() <= 0) {\n\t\t\t$this->data->logError(\"Manage sell offer failed, selling amount is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$cancelOffer && (float)$price <= 0) {\n\t\t\t$this->data->logError(\"Manage sell offer failed, price is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($price > 0)\n\t\t\t$price = number_format(1/$price, 7, '.', '');\n\n\t\t/*\n\t\tvar_dump(\"budget = \", $budget);\n\t\t//var_dump(\"sellingAsset = \", $sellingAsset);\n\t\t//var_dump(\"buyingAsset = \", $buyingAsset);\n\t\tvar_dump(\"price = \", $price);\n\t\tvar_dump(\"sellAmount = \", $sellAmount->toFloat());\n\t\texit();\n\t\t*/\n\n\t\t$manageOffer = new \\GalacticHorizon\\ManageSellOfferOperation();\n\t\t$manageOffer->setSellingAsset($sellingAsset);\n\t\t$manageOffer->setBuyingAsset($buyingAsset);\n\t\t$manageOffer->setSellAmount($cancelOffer ? \\GalacticHorizon\\Amount::createFromFloat(0) : $sellAmount);\n\t\t$manageOffer->setPrice(\\GalacticHorizon\\Price::createFromFloat($price));\n\t\t$manageOffer->setOfferID($updateExistingTrade ? $updateExistingTrade->getOfferID() : null);\n\n\t\ttry {\n\t\t\t$transaction = new \\GalacticHorizon\\Transaction($this->settings->getAccountKeypair());\n\t\t\t$transaction->addOperation($manageOffer);\n\t\t\t$transaction->sign([$this->settings->getAccountKeypair()]);\n\t\t\t\n\t\t\t$buffer = new \\GalacticHorizon\\XDRBuffer();\n\t\t\t$transaction->toXDRBuffer($buffer);\n\n\t\t\t$automaticlyFixTrustLineWithAmount = \\GalacticHorizon\\Amount::createFromFloat(2000000);\n\n\t\t\t$transactionResult = $transaction->submit($automaticlyFixTrustLineWithAmount);\n\n\t\t\tif ($transactionResult->getErrorCode() == \\GalacticHorizon\\TransactionResult::TX_SUCCESS) {\n\t\t\t\t// Return when an offer is cancelled\n\t\t\t\tif ($cancelOffer)\n\t\t\t\t\treturn true;\n\n\t\t\t\t$trade = Trade::fromGalacticHorizonOperationResponseAndResultForBot(\n\t\t\t\t\t$manageOffer,\n\t\t\t\t\tTrade::TYPE_SELL,\n\t\t\t\t\t$transactionResult,\n\t\t\t\t\t$transactionResult->getResult(0),\n\t\t\t\t\t$buffer->toBase64String(),\n\t\t\t\t\t$transactionResult->getFeeCharged()->toString(),\n\t\t\t\t\t$this\n\t\t\t\t);\n\n\t\t\t\t$lastTrade = $this->data->getLastTrade();\n\n\t\t\t\tif ($lastTrade)\n\t\t\t\t\t$trade->setPreviousBotTradeID($lastTrade->getID());\n\n\t\t\t\t$trade->setProcessedAt($processingTime->getDateTime());\n\n\t\t\t\t$this->data->addTrade($trade);\n\n\t\t\t\treturn $trade;\n\t\t\t} else {\n\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, error code = \" . $transactionResult->getErrorCode());\n\n\t\t\t\tif ($transactionResult->getResultCount() > 0) {\n\t\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer result, error code = \" . $transactionResult->getResult(0)->getErrorCode());\n\t\t\t\t}\n\n\t\t\t\t$this->getDataInterface()->logError(\"Transaction envelope = \" . $buffer->toBase64String());\n\t\t\t}\n\t\t} catch (\\GalacticHorizon\\Exception $e) {\n\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, exception = \" . (string)$e);\n\t\t\t$this->getDataInterface()->logError(\"Response = \" . $e->getHttpResponseBody());\n\t\t}\t\n\n\t\treturn false;\n\t}", "function buy(Time $processingTime, Trade $updateExistingTrade = null, $cancelOffer = false, $price)\n\t{\n\t\t$sellingAsset = $this->settings->getBaseAsset();\n\t\t$buyingAsset = $this->settings->getCounterAsset();\n\t\t\n\t\t$budget = $this->getCurrentBaseAssetBudget(true);\n\t\t$sellAmount = \\GalacticHorizon\\Amount::createFromFloat($budget);\n\n\t\tif (!$cancelOffer && $sellAmount->toFloat() <= 0) {\n\t\t\t$this->data->logError(\"Manage buy offer failed, buying amount is zero.\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$cancelOffer && (float)$price <= 0)\n\t\t{\n\t\t\t$this->data->logError(\"Manage buy offer failed, price is zero.\");\n\t\t\treturn false;\n\t\t}\n\t\n\t\t/*\n\t\tvar_dump(\"budget = \" . $budget);\n\t\tvar_dump(\"price = \" . $price);\n\t\tvar_dump(\"sellingAsset = \" . $sellingAsset->getCode());\n\t\tvar_dump(\"sellAmount = \" . $sellAmount->toFloat());\n\t\tvar_dump(\"buyingAsset = \" . $buyingAsset->getCode());\n\t\texit();\n\t\t*/\n\n\t\t$manageOffer = new \\GalacticHorizon\\ManageSellOfferOperation();\n\t\t$manageOffer->setSellingAsset($sellingAsset);\n\t\t$manageOffer->setBuyingAsset($buyingAsset);\n\t\t$manageOffer->setSellAmount($cancelOffer ? \\GalacticHorizon\\Amount::createFromFloat(0) : $sellAmount);\n\t\t$manageOffer->setPrice(\\GalacticHorizon\\Price::createFromFloat($price));\n\t\t$manageOffer->setOfferID($updateExistingTrade ? $updateExistingTrade->getOfferID() : null);\n\n\t\ttry {\n\t\t\t$transaction = new \\GalacticHorizon\\Transaction($this->settings->getAccountKeypair());\n\t\t\t$transaction->addOperation($manageOffer);\n\t\t\t$transaction->sign([$this->settings->getAccountKeypair()]);\n\t\t\t\n\t\t\t$buffer = new \\GalacticHorizon\\XDRBuffer();\n\t\t\t$transaction->toXDRBuffer($buffer);\n\n\t\t\t$automaticlyFixTrustLineWithAmount = \\GalacticHorizon\\Amount::createFromFloat(2000000);\n\n\t\t\t$transactionResult = $transaction->submit($automaticlyFixTrustLineWithAmount);\n\n\t\t\tif ($transactionResult->getErrorCode() == \\GalacticHorizon\\TransactionResult::TX_SUCCESS) {\n\t\t\t\t// Return when an offer is cancelled\n\t\t\t\tif ($cancelOffer)\n\t\t\t\t\treturn true;\n\n\t\t\t\t$trade = Trade::fromGalacticHorizonOperationResponseAndResultForBot(\n\t\t\t\t\t$manageOffer,\n\t\t\t\t\tTrade::TYPE_BUY,\n\t\t\t\t\t$transactionResult,\n\t\t\t\t\t$transactionResult->getResult(0),\n\t\t\t\t\t$buffer->toBase64String(),\n\t\t\t\t\t$transactionResult->getFeeCharged()->toString(),\n\t\t\t\t\t$this\n\t\t\t\t);\n\n\t\t\t\t$lastTrade = $this->data->getLastTrade();\n\n\t\t\t\tif ($lastTrade)\n\t\t\t\t\t$trade->setPreviousBotTradeID($lastTrade->getID());\n\n\t\t\t\t$trade->setProcessedAt($processingTime->getDateTime());\n\n\t\t\t\t$this->data->addTrade($trade);\n\n\t\t\t\treturn $trade;\n\t\t\t} else {\n\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, error code = \" . $transactionResult->getErrorCode());\n\n\t\t\t\tif ($transactionResult->getResultCount() > 0) {\n\t\t\t\t\t$this->getDataInterface()->logError(\"Manage buy offer result, error code = \" . $transactionResult->getResult(0)->getErrorCode());\n\t\t\t\t}\n\n\t\t\t\t$this->getDataInterface()->logError(\"Transaction envelope = \" . $buffer->toBase64String());\n\t\t\t}\n\t\t} catch (\\GalacticHorizon\\Exception $e) {\n\t\t\t$this->getDataInterface()->logError(\"Manage buy offer operation failed, exception = \" . (string)$e);\n\t\t\t$this->getDataInterface()->logError(\"Response = \" . $e->getHttpResponseBody());\n\t\t}\t\n\n\t\treturn false;\n\t}", "public function issueFeeOverdue()\n {\n $timeToPay = new \\DateInterval('P10D');\n $cutoff = new \\DateTime();\n $cutoff->sub($timeToPay);\n\n $criteria = Criteria::create();\n $criteria->andWhere(Criteria::expr()->lte('invoicedDate', $cutoff->format(\\DateTime::ISO8601)));\n $criteria->orderBy(['invoicedDate' => Criteria::DESC]);\n\n $matchedFees = $this->getFees()->matching($criteria);\n\n /**\n * @var Fee $fee\n */\n foreach ($matchedFees as $fee) {\n if ($fee->isOutstanding() && $fee->getFeeType()->isEcmtIssue()) {\n return true;\n }\n }\n\n return false;\n }", "protected function sold()\n\t{\n\t\tforeach ($this->config->data()['sold'] as $key => $value) {\n\t\t\tif ($this->store['sold'] >= $key) {\n\t\t\t\t$this->score += $value;\n\t\t\t}\n\t\t}\n\t}", "function TaxExclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "private function unbalancedSupply() {\n $rapporto = $_POST['quantitaCercata'] / $_POST['quantitaOfferta'];\n if ($rapporto >= 0.5 && $rapporto <= 2)\n return false;\n return true;\n }", "protected function setOfferApplicablePricing ()\n {\n $offerApplicableAccountHeads = $this->getOfferApplicableAccountHeads();\n\n foreach ( $this->request->pricing as $accountHead => $amount ) {\n if ( in_array($accountHead, $offerApplicableAccountHeads) ) {\n $this->offerApplicablePricing[ $accountHead ] = $amount;\n $this->offerApplicableAmount += $amount;\n }\n }\n }", "function update_portfolio($connection, $id, $symbol, $amount){\n $result = get_portfolio($connection, $id, $symbol);\n $newAmount = $result['amount'] + $amount;\n if ($newAmount < 1){\n remove_portfolio($connection, $id, $symbol);\n }\n else{\n try {\n $sql = \"UPDATE portfolio Set amount = ? WHERE userId = ? AND symbol = ?\";\n $result = runQuery($connection, $sql, array($newAmount, $id, $symbol));\n return $result;\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n }\n }\n}", "public function testHasKidsFixedPrice()\n {\n $this->assertEquals(0, $this->getObject(0)->setIsFixedPrice(true)->getValue());\n }", "function get_shares_amount ($symbol) {\n $portfolio = load_portfolio_array();\n $shares_amount_available = 0;\n foreach ($portfolio as $record) {\n if ($record[\"symbol\"] == $symbol) {\n $shares_amount_available = $record[\"quantity\"];\n }\n }\n return $shares_amount_available;\n}", "public function tallyFee($row)\n\t{\n\t\treturn ($row['c_quantity'] * $row['og_s_value']) * ($this->settings['eco_stocks_buy_fee']/100);\n\t}", "function buyStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qty = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n \n //Check Account Balance to see if the buy is possible\n $accountValue = getCurrentAccountBalance($username);\n \n //$purCost is to store a value in DB, ex: $purCost = API->currentCost;\n $purCost = $currentCost;\n \n //Calculate the total value of your purchase. Cost * Shares\n $totalValue = $purCost * $qty;\n \n if($accountValue >= $totalValue)\n {\n //add this entry into the DB.\n addToPortfolioDB($username,$purCost,$qty,$sym);\n //subtract cost of purchase from Bank Account Balance\n deleteFromAccountBalance($username,$totalValue,$accountValue);\n }\n else\n {\n echo \"NOT ENOUGH FUCKING MONEY\";\n }\n \n \n \n //make a new object to store data to return?\n $returnObj = array(\"TotalValue\"=>$totalValue);\n //example of how to single out a value is Below\n //var_dump($returnObj[\"TotalValue\"]);\n \n //returns an array\n return (json_encode($returnObj));\n //returns an json object\n //return (json_encode($returnObj));\n}", "function SetAmountSoldOutside ($amount = 0) {\n\t\n}", "function sell($amount,$symbol){\n //user should be the owner of the stock if he wants to sell\n if($symbol==\"Book\" && $this->bookstock_buy>0){\n echo $this->new_account.\" sold Book Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->bookstock_buy--;\n $this->object_linkedlist->remove_last();\n }\n elseif($symbol==\"Newspaper\" && $this->newspaperstock_buy>0){\n echo $this->new_account.\" sold Newspaper Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->newspaperstock_buy--;\n $this->object_linkedlist->remove_last();\n }\n }", "public function hasPrice(){\n return $this->_has(5);\n }", "public function getOverspend()\n {\n if (abs($this->averageFortnightlySpend) > $this->averageFortnightlyPositive) {\n // If nothing is going in, then it's definitely an overspend.\n if ($this->averageFortnightlyPositive <= 0) {\n return true;\n }\n // Otherwise it's only an overspend if it's more than 2% over, to allow for funny fortnights\n if((abs($this->averageFortnightlySpend))/$this->averageFortnightlyPositive > 1.02) {\n return true;\n }\n }\n return false;\n }", "function processPaymentFieldsSpecialEvents($entry)\n{\n global $dbPriceSingleTicket;\n global $dbPricePartHigh;\n global $dbPricePartHighBtw;\n global $dbTicketPricePart;\n global $dbTicketPricePartBtw;\n global $dbTicketPricePartTotal;\n global $dbBtwHigh;\n\n global $dbFoodPrice;\n $price_ticket_ex_food = $dbPriceSingleTicket - $dbFoodPrice;\n\n // If there is a reduction price which is smaller than the food price the price part high will be below zero\n if ($price_ticket_ex_food < 0) {\n $price_ticket_ex_food = 0;\n }\n\n global $dbParticipants;\n $dbTicketPricePart = $price_ticket_ex_food * count($dbParticipants);\n\n $dbTicketPricePartBtw = $dbTicketPricePart * $dbBtwHigh;\n $dbTicketPricePartTotal = $dbTicketPricePart + $dbTicketPricePartBtw;\n\n $dbPricePartHigh = $dbTicketPricePart + $dbParkingPricePart;\n $dbPricePartHighBtw = $dbPricePartHigh * $dbBtwHigh;\n\n global $dbPricePartHighTotal;\n $dbPricePartHighTotal = $dbPricePartHigh + $dbPricePartHighBtw;\n \n // Calculate low btw\n // When the reduction price is smaller than the food price take the reduction price\n global $dbPricePartLow;\n $dbPricePartLow = $dbFoodPrice;\n if ($dbTicketPrice < $dbFoodPrice) {\n $dbPricePartLow = $dbTicketPrice;\n }\n\n global $dbPricePartLowBtw;\n global $dbPricePartLowTotal;\n global $dbFoodPartPriceLow;\n global $dbFoodPartPriceLowBtw;\n global $dbFoodPartPriceLowTotal;\n\n global $dbBtwLow;\n\n $dbPricePartLow = count($dbParticipants) * $dbPricePartLow;\n $dbFoodPartPriceLow = $dbPricePartLow;\n $dbPricePartLowBtw = $dbPricePartLow * $dbBtwLow;\n $dbFoodPartPriceLowBtw = $dbPricePartLowBtw;\n $dbPricePartLowTotal = $dbPricePartLow + $dbPricePartLowBtw;\n $dbFoodPartPriceLowTotal = $dbPricePartLowTotal;\n\n // Payment details\n global $dbTotalBtw;\n $dbTotalBtw = $dbPricePartLowBtw + $dbPricePartHighBtw;\n global $dbTotalPrice;\n $dbTotalPrice = ($dbPriceSingleTicket * count($dbParticipants)) + $dbParkingPricePart + $dbMembershipPricePart;\n\n $rounded_total_price = number_format($dbTotalPrice * 100, 0, ',', '');\n $rounded_btw_part_low = number_format(($dbPricePartLowBtw) * 100, 0, ',', '');\n $rounded_btw_part_high = number_format(($dbPricePartHighBtw) * 100, 0, ',', '');\n\n global $dbTotalPriceBtw;\n $dbTotalPriceBtw = ($rounded_total_price + $rounded_btw_part_low + $rounded_btw_part_high) / 100;\n}", "public function modify_stock( $by ) {\n\t\tglobal $wpdb;\n\t\t\n\t\t// Only do this if we're updating\n\t\tif ( ! $this->managing_stock() )\n\t\t\treturn false;\n\n\t\t// +- = minus\n\t\t$this->stock = $this->stock + $by;\n\t\t$amount_sold = ( ! empty( $this->stock_sold ) ? $this->stock_sold : 0 ) + $by;\n\n\t\t// Update & return the new value\n\t\tupdate_post_meta( $this->variation_id, 'stock', $this->stock );\n\t\tupdate_post_meta( $this->variation_id, 'stock_sold', $amount_sold );\n\t\t\n\t\tif ( self::get_options()->get_option('jigoshop_notify_no_stock_amount') >= 0\n\t\t\t&& self::get_options()->get_option('jigoshop_notify_no_stock_amount') >= $this->stock\n\t\t\t&& self::get_options()->get_option( 'jigoshop_hide_no_stock_product' ) == 'yes' ) {\n\t\t\t\n\t\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'draft' ), array( 'ID' => $this->variation_id ) );\n\t\t\t\n\t\t} else if ( $this->stock > self::get_options()->get_option('jigoshop_notify_no_stock_amount')\n\t\t\t&& get_post_status( $this->variation_id ) == 'draft'\n\t\t\t&& self::get_options()->get_option( 'jigoshop_hide_no_stock_product' ) == 'yes' ) {\n\t\t\t\n\t\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $this->variation_id ) );\n\t\t}\n\t\t\n\t\treturn $this->stock;\n\t}", "public static function buy_bullish($pair, $risk, $stop, $leverage=50) {\n\n\t\t\t//Retrieve current price\n\t\t\tif (! self::valid($price = self::price($pair)))\n\t\t\t\treturn $price;\n\n\t\t\t//Find the correct size so that $risk is divided by $pips\n\t\t\tif (! self::valid($size = self::nav_size_percent_per_pip($pair, ($risk/$stop))))\n\t\t\t\treturn $size;\n\n\t\t\tif (! self::valid($newTrade = self::buy_market($size, $pair)) && isset($newTrade->tradeId))\n\t\t\t\treturn $newTrade;\n\n\t\t\t//Set the stoploss\n\t\t\treturn self::trade_set_stop($newTrade->tradeId, $price->ask + (self::instrument_pip($pair) * $stop));\n\t\t}", "function playerHit($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll){\n\t$newCard = drawACard($deck);\n\t$player[] = $newCard;\n\t$total = getTotal($player);\n\t//echo out each card and total\n\tforeach ($player as $card) {\n\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n\t//notify when player busts\n\tif (getTotal($player) > 21) {\n\t\tevaluateHands($name, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\t}\n\treturn $player;\n}", "function buy($amount,$symbol)\n {\n //balance should be greater than stock value to buy\n if($amount<=$this->totalamount)\n {\n //buy book stock\n if($symbol==\"Book\"){\n echo $this->new_account.\" owned Book Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->bookstock_buy++;\n $this->object_linkedlist->insertfirst(\"Book: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n //buy newspaper stock\n elseif($symbol==\"Newspaper\")\n {\n echo $this->new_account.\" owned Newspaper Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->newspaperstock_buy++;\n $this->object_linkedlist->insertfirst(\"Newspaper: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n }\n //if balance is less than stock value\n else{\n echo \"Your Balance is low than Stock price\\n\";\n }\n }", "private function calculateFOBPriceAction()\n {\n // than 99, then modify shippingPrice to 0.00 \n \t$price = $this->info['productPrice'];\n if($price <= 99){\n $shippingPrice = $this->info['shippingPrice'];\n }\n else{\n $this->info['shippingPrice'] = 0.0;\n }\n $this->info['fobPrice'] = ($price + $shippingPrice) * 1.07; // It also adds US TAXes\n }", "function TaxInclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}", "function isPowerOverloaded($extra_consumption = 0)\n{\n global $game;\n\n // Calculate buildings energy consumption\n $buildings = $game->planet['building_1'] +\n $game->planet['building_2'] + \n $game->planet['building_3'] + \n $game->planet['building_4'] + \n $game->planet['building_10'] + \n $game->planet['building_6'] + \n $game->planet['building_7'] + \n $game->planet['building_8'] +\n $game->planet['building_9'] + \n $game->planet['building_11'] + \n $game->planet['building_12'] +\n $game->planet['building_13'];\n\n // Consider extra consumption from queued buildings\n $buildings += $extra_consumption;\n\n // Check if the active planet is the user's capital\n if ($game->player['user_capital']==$game->planet['planet_id'])\n $available_power = $game->planet['building_5']*11+14;\n else\n $available_power = $game->planet['building_5']*15+3;\n\n return ($buildings >= $available_power);\n}", "public function is_fixed() {\n $deposit_type = get_option( 'woo_deposit_type' );\n \n if ( $deposit_type == 'fixed' ) {\n return true;\n } else {\n return false;\n }\n }", "function checkPairing($user_id, $user_name, $pkg_id, $trans_datetime, $trans_date, $auto_flush)\n{\n\t//$max_daily_point = 100;\n \t$sql = \"SELECT max_daily_point\n FROM product_package\n WHERE pkg_id = $pkg_id\n\t\t limit 1\n \";\n \t$resultPkg=dbQuery($sql);\n\t$row=dbFetchAssoc($resultPkg);\t\n\t$max_daily_point = $row['max_daily_point'];\n\t\n\t$checkPoint = checkPoint($user_id);\n\t$balance_left_point = $checkPoint['balance_left_point'];\n\t$balance_right_point = $checkPoint['balance_right_point'];\n\t\n\tif($balance_left_point > 0 and $balance_right_point > 0)\n\t{\n\t\n\t\tif($balance_left_point > $balance_right_point)\n\t\t{\n\t\t\t$pair_point = $balance_right_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pair_point = $balance_left_point;\n\t\t}\n\t\t\n\t\t$actual_pair_point = $pair_point;\n\t\n\t\t$total_daily_pair_point = checkDailyPairPoint($user_id, $trans_date);\n\t\t$balance_max_daily_point = $max_daily_point - $total_daily_pair_point;\n\t\t\n\t\tif($balance_max_daily_point >= $pair_point)\n\t\t{\n\t\t\t$total_pair_point = $pair_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$total_pair_point = $balance_max_daily_point;\n\t\t}\n\t\t\n\t\tif($total_pair_point > 0 and $max_daily_point > $total_daily_pair_point and $auto_flush ==0)\n\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t$total_bonus = $total_pair_point * 15;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date,pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tcreated_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$total_pair_point', '$total_bonus', \n\t\t\t\t\t\t$_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$bonus_description = 'Pairing Bonus';\n\t\t\t\t$pair_bonus = $total_bonus;\n\t\t\t\t\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, $pair_bonus, 0, $user_name, $trans_datetime);\n\t\t\t\t\n\t\t\t\t$bonus_description = '10% into M-Wallet';\n\t\t\t\t$pair_bonus_deduct = 0.1 * $total_bonus;\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, 0, $pair_bonus_deduct, $user_name, $trans_datetime);\n\t\t\t\twallet('acct_mwallet', 4, $user_id, $bonus_description, $pair_bonus_deduct, 0, $user_name, $trans_datetime);\t\t\n\t\t\n\t\t}\n\t\telse // Flush\n\t\t{\n\t\t\t\t$total_bonus = 0;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date, pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tflush_sw, created_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$actual_pair_point', '$total_bonus', \n\t\t\t\t\t\t1, $_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t}\t\t\n\t}\n\t\n\n\t\n\n}", "function item_quantities_none() {\r\n //if( isset($edd_options['coopshares_fair_checkout_info']) ) {\r\n // return true;\r\n //} else {\r\n return false;\r\n //}\r\n}", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\tif ($_deals->managing_stock()) :\n\t\t\t\t\tif ($_deals->is_in_stock() && $_deals->has_enough_stock( $values['quantity'] )) :\n\t\t\t\t\t\t// :)\n\t\t\t\t\telse :\n\t\t\t\t\t\t$error->add( 'out-of-stock', sprintf(__('Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'cmdeals'), $_deals->get_title(), $_deals->_stock ) );\n\t\t\t\t\t\treturn $error;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn true;\n\t\t}", "public function hasNewPrice(){\n return $this->_has(16);\n }", "public function hasPrice(){\n return $this->_has(12);\n }", "function lotto_buyTickets() {\n\n\t// Set some needed variables.\n\tglobal $DB;\n\tglobal $MySelf;\n\n\t$ID = $MySelf->getID();\n\t$myMoney = getCredits($ID);\n\t$affordable = floor($myMoney / 1000000);\n\t\n\tif (!getConfig(\"lotto\")) {\n\t\tmakeNotice(\"Your CEO disabled the Lotto module, request denied.\", \"warning\", \"Lotto Module Offline\");\n\t}\n\n\t// Get my credits\n\t$MyStuff = $DB->getRow(\"SELECT lottoCredit, lottoCreditsSpent FROM users WHERE id='\" . $MySelf->getID() . \"'\");\n\t$Credits = $MyStuff[lottoCredit];\n\t$CreditsSpent = $MyStuff[lottoCreditsSpent];\n\n\t// User submited this form already!\n\tif ($_POST[check]) {\n\t\tnumericCheck($_POST[amount], 0, $affordable);\n\n\t\tif ($_POST[amount] == 0) {\n\t\t\tmakeNotice(\"You cannot buy zero tickets.\", \"warning\", \"Too few tickets.\", \"index.php?action=lotto\", \"[whoops]\");\n\t\t}\n\n\t\tconfirm(\"Please authorize the transaction of \" . number_format(($_POST[amount] * 1000000), 2) . \" ISK in order to buy $_POST[amount] lotto credits.\");\n\n\t\t// Get the old ticket count, and add the new tickets on top of those.\t\t\t\n\t\t$oldCount = $DB->getCol(\"SELECT lottoCredit FROM users WHERE id='$ID' LIMIT 1\");\n\t\t$newcount = $oldCount[0] + $_POST[amount];\n\n\t\t// Update the database to reflect the new ticket count.\n\t\t$check = $DB->query(\"UPDATE users SET lottoCredit='$newcount' WHERE id='$ID' LIMIT 1\");\n\n\t\t// Check that we were successful.\n\t\tif ($DB->affectedRows() != 1) {\n\t\t\tmakeNotice(\"I was unable to add $newcount tickets to $user stack of $count tickets! Danger will robonson, danger!\", \"error\", \"Unable to comply.\");\n\t\t}\n\n\t\t// Make him pay!\n\t\tglobal $TIMEMARK;\n\t\t$transaction = new transaction($ID, 1, ($_POST[amount] * 1000000));\n\t\t$transaction->setReason(\"lotto credits bought\");\n\t\tif ($transaction->commit()){\n\t\t\t// all worked out!\n\t\t\tmakeNotice(\"Your account has been charged the amount of \" . number_format(($_POST[amount] * 1000000), 2) . \" ISK.\", \"notice\", \"Credits bought\", \"index.php?action=lotto\", \"[OK]\");\n\t\t} else {\n\t\t\t// We were not successfull\n\t\t\tmakeNotice(\"I was unable to add $newcount tickets to $user stack of $count tickets! Danger will robonson, danger!\", \"error\", \"Unable to comply.\");\n\t\t}\n\t}\n\n\t// Prepare the drop-down menu.\n\tif ($affordable >= 1) {\n\t\t$ddm = \"<select name=\\\"amount\\\">\";\n\t\tfor ($i = 1; $i <= $affordable; $i++) {\n\t\t\tif ($i == 1) {\n\t\t\t\t$ddm .= \"<option value=\\\"$i\\\">Buy $i tickets</option>\";\n\t\t\t} else {\n\t\t\t\t$ddm .= \"<option value=\\\"$i\\\">Buy $i tickets</option>\";\n\t\t\t}\n\t\t}\n\t\t$ddm .= \"</select>\";\n\t} else {\n\t\t// Poor user.\n\t\t$ddm = \"You can not afford any credits.\";\n\t}\n\n\t// Create the table.\n\t$table = new table(2, true);\n\t$table->addHeader(\">> Buy lotto credits\");\n\t$table->addRow();\n\t$table->addCol(\"Here you can buy lotto tickets for 1.000.000,00 ISK each. \" .\n\t\"Your account currently holds \" . number_format($myMoney, 2) . \" ISK, so \" .\n\t\"you can afford $affordable tickets. Please choose the amount of credits you wish \" .\n\t\"to buy.\", array (\n\t\t\"colspan\" => 2\n\t));\n\n\t$table->addRow();\n\t$table->addCol(\"Your credits:\");\n\t$table->addCol($Credits);\n\t$table->addRow();\n\t$table->addCol(\"Total spent credits:\");\n\t$table->addCol($CreditsSpent);\n\t$table->addRow();\n\t$table->addCol(\"Purchase this many credits:\");\n\t$table->addCol($ddm);\n\t$table->addHeaderCentered(\"<input type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"Buy credits\\\">\");\n\t$table->addRow(\"#060622\");\n\t$table->addCol(\"[<a href=\\\"index.php?action=lotto\\\">Cancel request</a>]\", array (\n\t\t\"colspan\" => 2\n\t));\n\n\t// Add some more html form stuff.\n\t$html = \"<h2>Buy Lotto credits</h2>\";\n\t$html .= \"<form action=\\\"index.php\\\" method=\\\"POST\\\">\";\n\t$html .= $table->flush();\n\t$html .= \"<input type=\\\"hidden\\\" name=\\\"check\\\" value=\\\"true\\\">\";\n\t$html .= \"<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"lottoBuyCredits\\\">\";\n\t$html .= \"</form>\";\n\n\t// Return the mess we made.\n\treturn ($html);\n}", "public function hasOldPrice(){\n return $this->_has(17);\n }", "private function set_alcohol_use($arr) {\r\n\t\t$qno = $this->getFirstQuestionNo('alcohol_use');\r\n\t\t$err = null;\r\n try{//11.  How many alcoholic drinks do you consume on average?\r\n \t$v=$this->vc->exists('q39',$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t$this->data['alcohol_use']['q39']=($v==\"\")?0:$v;\r\n }catch(ValidationException $e){\r\n \t$eob=$e->createErrorObject();\r\n \t$eob->message = \"Please answer approximately how many alcholic drinks you consume on average\";\r\n \t$eob->name = \"Question \" . $qno;\r\n \t$err[] = $eob;\r\n }\r\n\r\n\t\t$qno += 1;\r\n try{//12. Have you ever had more than 5 drinks at one time in the past four (4) months?\r\n \t$v=$this->vc->exists('q40',$arr,\"enum\",array(\"values\"=>array(1,2,3,4,5)),false,false);\r\n \t$this->data['alcohol_use']['q40']=($v==\"\")?0:$v;\r\n }catch(ValidationException $e){\r\n \t$eob=$e->createErrorObject();\r\n \t\t$eob->message = \"Please tell us if you have had more than 5 drinks at one time in the last 4 months\";\r\n \t\t$eob->name = \"Question \" . $qno;\r\n \t\t$err[] = $eob;\r\n }\r\n\r\n\t\treturn ($err) ? $err : false;\r\n\t}", "function my_check_cost_of_bookings() {\n if ( is_cart() || is_checkout() ) {\n $bookable_total = $bookable_minimum = 0;\n foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {\n if ( isset( $cart_item['booking'] ) ) {//the cart contains a bookable product\n $quantity = $cart_item['quantity'];\n $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );\n $bookable_minimum = 20;\n $price = $_product->get_price();\n $taxable = $_product->is_taxable();\n if ( $taxable ) {\n if ( WC()->cart->tax_display_cart == 'excl' ) {\n $product_subtotal = $_product->get_price_excluding_tax( $quantity );\n } else {\n $product_subtotal = $_product->get_price_including_tax( $quantity );\n }\n // Non-taxable\n } else {\n $product_subtotal = $price * $quantity;\n }\n $bookable_total += $product_subtotal;\n if ( $bookable_total >= $bookable_minimum ) {\n return;\n }\n }\n }\n if ( $bookable_total > $bookable_minimum ) {\n wc_add_notice( sprintf( '<strong>A Minimum of %s %s is required before checking out.</strong>' . '<br />Current cart\\'s total: %s %s', $bookable_minimum, get_option( 'woocommerce_currency'), $bookable_total,get_option( 'woocommerce_currency') ), 'error' );\n }\n }\n}", "function sellBuy($name, $selling, $buying, $date, $dbh)\n{\n\tif (isIndividual($name, $dbh))\n\t{\n\t\t//First sell the stock requested.\n\t\t$previousCash = getIndCash($name,$dbh);\n\t\tsell($name, $selling, $date, $dbh);\n\t\t$currCash = getIndCash($name,$dbh);\n\t\n\t\t//Then buy the new stock with all proceeds\n\t\t$amount = $currCash - $previousCash ;\n\t\tindBuy($name, $buying, $amount, $date ,$dbh);\n\t\t\n\t}\n\telseif(isFund($name, $dbh))\n\t{\n\t\t//First ensure that fund is selling & buying a stock to continue.\n\t\tif (isStock($selling,$dbh) && isStock($buying,$dbh))\n\t\t{\n\t\t//Then sell the stock requested.\n\t\t$previousCash = getFundCash($name,$date,$dbh);\n\t\tsell($name, $selling, $date, $dbh);\n\t\t$currCash = getFundCash($name,$date,$dbh);\n\n\t\t//Then buy the new stock with all proceeds\n\t\t$amount = $currCash - $previousCash ;\n\t\tfundBuy($name, $buying, $amount, $date ,$dbh);\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\techo \"Transaction skipped: Fund trying to sellbuy non stock. Selling: \".$selling.\" Buying: \".$buying .\".<br>\";\n\t\t}\n\t}\n\telse \n\t{\n\t\techo \"Error sellBuy(): \".$name. \" trying to sell \".$selling.\" for \".$buying.\".<br>\";\n\t}\n\n}", "protected function _fcpoCheckReduceBefore() \n {\n $oConfig = $this->_oFcpoHelper->fcpoGetConfig();\n $sPaymentId = $this->oxorder__oxpaymenttype->value;\n $blReduceStockBefore = !(bool) $oConfig->getConfigParam('blFCPOReduceStock');\n $blIsRedirectPayment = fcPayOnePayment::fcIsPayOneRedirectType($sPaymentId);\n\n if ($blReduceStockBefore && $blIsRedirectPayment) {\n $aOrderArticles = $this->getOrderArticles();\n foreach ($aOrderArticles as $oOrderArticle) {\n $oOrderArticle->updateArticleStock($oOrderArticle->oxorderarticles__oxamount->value * (-1), $oConfig->getConfigParam('blAllowNegativeStock'));\n }\n }\n }", "public function buyDecimalAmount()\n\t{\n\t\treturn false;\n\t}", "public function PaypalSetExpressChekout($oPaypal){\n\n if (isset($_SESSION['tickets'])) unset($_SESSION['tickets']);\n $totalOrder = number_format($_SESSION['total_order'], 2, '.', '');\n $aProducts = array();\n $i=0;\n\n // \"return URL\" and \"cancel URL\" for paypal response\n $sHostUrl = $oPaypal->getHostUrl();\n $return_url = $sHostUrl . 'buy_ticket.php?c=checkout';\n $cancel_url = $sHostUrl . 'buy_ticket.php?c=cancel';\n\n $params = array(\n 'RETURNURL' => $return_url,\n 'CANCELURL' => $cancel_url,\n 'PAYMENTREQUEST_0_AMT' => $totalOrder,\n 'PAYMENTREQUEST_0_CURRENCYCODE' => $oPaypal->money_code,\n 'PAYMENTREQUEST_0_ITEMAMT' => $totalOrder,\n );\n\n $aTicket = array();\n\n //filtering $_POST and keep book with seat number > 0\n foreach($_POST as $key => $value){\n // \"name\" item\n if (strpos($key, 'name') === 0){\n $p = (int) substr($key, 4, 1);\n $nbseat = \"nbseats$p\";\n // if nb seat > 0, keep 'name' value\n if (intval($_POST[$nbseat]) > 0) { $aTickets[$i]['name'] = $value; }\n }\n // if 'nb seat' and > 0 then keep 'nbseat' value\n elseif(strpos($key, 'nbseats') === 0 && intval($_POST[$nbseat]) > 0) $aTickets[$i]['nbseat'] = intval($value); \n // if 'price' and seat> 0 then keep 'price' value\n elseif(strpos($key, 'price') === 0 && intval($_POST[$nbseat]) > 0) {\n $val = strtr($value, \",\" , \".\");\n $val_filter = floatval(filter_var($val, FILTER_VALIDATE_FLOAT));\n $aTickets[$i]['price'] = $val_filter;\n $i += 1;\n }\n }\n\n//var_dump($aTickets );\n\n //store values in session \n $_SESSION['tickets'] = $aTickets; \n\n foreach($aTickets as $k => $ticket){\n $params[\"L_PAYMENTREQUEST_0_NAME$k\"] = $ticket['name'];\n $params[\"L_PAYMENTREQUEST_0_DESC$k\"] = '';\n $params[\"L_PAYMENTREQUEST_0_AMT$k\"] = $ticket['price'];\n $params[\"L_PAYMENTREQUEST_0_QTY$k\"] = $ticket['nbseat'];\n }\n\n // SetExpressCheckout\n $response = $oPaypal->request('SetExpressCheckout', $params);\n\n if($response){\n $paypalUrl = 'https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token=' . $response['TOKEN'];\n }else{ \n $paypalUrl = $aSettingsProduct['cancel_url'];\n }\n\n //Re-direction to paypal (for get and do ExpressCheckOut)\n header('Location:'.$paypalUrl); \n\n}", "function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}", "static public function adjustLowestPriceForProducts( $items = false, $verbose = false ) {\n\n $items = $items ? $items : WPLA_ListingQueryHelper::getItemsWithMinMaxAndLowestPrice();\n $changed_product_ids = array();\n $repricing_margin = floatval( get_option('wpla_repricing_margin') );\n $lowest_offer_mode = get_option('wpla_repricing_use_lowest_offer',0);\n $repricing_snh_fee = floatval( get_option('wpla_repricing_shipping') ); // shipping and handling\n\n // loop found listings\n foreach ( $items as $item ) {\n\n // make sure there is a product - and min/max prices are set (0 != NULL)\n if ( ! $item->post_id ) continue;\n if ( ! $item->min_price ) continue;\n if ( ! $item->max_price ) continue;\n if ( ! $item->buybox_price && ! $item->compet_price ) continue;\n \n WPLA()->logger->debug( 'adjustLowestPrice for '. $item->sku );\n\n // build target price from BuyBox and/or competitor price\n if ( $item->buybox_price && ! $item->has_buybox ) {\n \n // decide based on uppricing mode\n if ( $lowest_offer_mode && ( $item->buybox_price != $item->compet_price ) ) {\n\n // apply undercut to competitor price - if competitor price is different from BuyBox price\n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.', lowest offer at '.$item->compet_price.' - your target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.', lowest offer at '.$item->compet_price.' - your target price: '.$target_price );\n\n } else {\n\n // apply undercut to BuyBox price - if there is a BuyBox price and it's not the seller's\n $target_price = $item->buybox_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.' - your target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': Other seller has BuyBox at '.$item->buybox_price.' - your target price: '.$target_price );\n\n }\n \n } elseif ( $item->buybox_price && $item->has_buybox && $item->compet_price ) {\n\n // decide based on uppricing mode\n if ( $lowest_offer_mode && ( $item->buybox_price != $item->compet_price ) ) {\n\n // seller has BuyBox and there is competition - apply undercut to competitor price (beta)\n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox, but there is a competitor at '.$item->compet_price.' - new target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox, but there is a competitor at '.$item->compet_price.' - new target price: '.$target_price );\n\n } else {\n\n // seller has BuyBox and there is competition - keep price for now\n $target_price = $item->buybox_price;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox - keeping current price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox - keeping current price: '.$target_price );\n\n }\n\n } elseif ( $item->buybox_price && $item->has_buybox && ! $item->compet_price ) {\n \n // seller has BuyBox and NO competition - fall back to max_price\n $target_price = $item->max_price;\n if ( $verbose ) wpla_show_message( $item->sku.': You have the BuyBox but there is no competitor - falling back to Max Price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': You have the BuyBox but there is no competitor - falling back to Max Price: '.$target_price );\n\n } elseif ( $item->compet_price ) {\n \n $target_price = $item->compet_price - $repricing_margin;\n if ( $verbose ) wpla_show_message( $item->sku.': No BuyBox price - falling back to next competitor at '.$item->compet_price.' - new target price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': No BuyBox price - falling back to next competitor at '.$item->compet_price.' - new target price: '.$target_price );\n\n } else {\n\n $target_price = $item->max_price;\n if ( $verbose ) wpla_show_message( $item->sku.': No BuyBox price, no competitor - falling back to Max Price: '.$target_price );\n WPLA()->logger->debug( $item->sku.': No BuyBox price, no competitor - falling back to Max Price: '.$target_price );\n\n }\n\n $target_price = apply_filters( 'wpla_before_reprice_item', $target_price, $item );\n\n $target_price = round( $target_price, 2 );\n\n\n // update price\n $price_was_changed = self::updateAmazonPrice( $item, $target_price, $verbose );\n if ( $price_was_changed ) {\n $changed_product_ids[] = $item->post_id;\n WPLA()->logger->info('adjustLowestPriceForProducts() - new price for #'.$item->sku.': '.$target_price);\n }\n\n } // foreach item\n\n // echo \"<pre>\";print_r($changed_product_ids);echo\"</pre>\";#die();\n // echo \"<pre>\";print_r($items);echo\"</pre>\";die();\n\n return $changed_product_ids;\n }", "public function testIsTierPriceFixed()\n {\n $this->assertTrue($this->_model->isTierPriceFixed());\n }", "private function purchaseRestrictionsAwal($ins) {\n \n $dateNow = date('Y-m-d'); // date now\n \n // cek total volume pengisian selama hari ini, apakah >= 100 liter\n $totalVolumeFill = $this->db->query(\"SELECT SUM(liter) AS `total_volume` FROM {$this->transaction_kendaraan} WHERE no_pol = '{$ins['no_pol']}' AND tgl = '{$dateNow}' \")\n ->row_array()['total_volume'];\n \n $lastTotalVolume = floatval($ins['liter']) + floatval($totalVolumeFill);\n \n if($lastTotalVolume > 200) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam satu hari yang sama\"\t \n\t // \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam pembelian ke - {$ins['numOfBuy']}\", \n\t ];\n\t echo json_encode($response);\n\t \n } else if(floatval($ins['liter']) > 75) {\n\t \n\t $response = [\n\t \"status\" => \"approval\", \n\t \"message\" => \"Customer ingin mengisi lebih dari 75 liter ({$ins['liter']} liter) dalam pembelian {$ins['numOfBuy']}\", \n\t \"question\" => \"Apakah anda setuju melakukan pengisian lebih dari 75 liter ({$ins['liter']} liter) ?\"\n\t ];\n\t echo json_encode($response);\n\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }", "public function isFree()\n {\n return ((float) $this->price <= 0.00);\n }", "public function hasBoothfee(){\n return $this->_has(6);\n }", "public function firstAssetPrice($value_of_whole_market, $value_of_shop)\n {\n \t//$value_of_shop is revenue the shop generates;\n\n \t$price_of_one_share = $value_of_shop/$value_of_whole_market; //Price of one share, we issue 1000 shares.\n\n \treturn $value_of_shop_in_market;\n\n }", "private function sellTrasactionPendingAddsMoney(){\n\n }", "public function hasRealPrice(){\n return $this->_has(21);\n }", "private function sellTrasactionAddsMoney(){\n\n }", "function compute_withdrawing_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n if ($amount < 20000)\n {\n $fee = 1;\n }\n else if ($amount < 50000)\n {\n $fee = 3;\n }\n else\n {\n $fee = 5;\n }\n }\n return $fee;\n}", "function fp_add_fee_from_cart()\r\n {\r\n if(isset($_POST['fp_apply_points'])) \t{\r\n add_action( 'woocommerce_cart_calculate_fees', array( $this , 'fp_woo_add_cart_fee' ), 10, 1);\r\n $_SESSION['fp_action']=\"apply\";\r\n }\r\n }", "function update_portfolio_event_handler($values, $action) {\n $portfolio = load_portfolio_array();\n $existing_record = portfolio_record_lookup($portfolio, $values[\"lookupSymbol\"]);\n \n switch ($action){\n case \"buy\":\n if(isset($existing_record)) {\n // Update existing record in portfolio\n $existing_record[\"quantity\"] = $existing_record[\"quantity\"] + $values[\"quantity\"];\n $existing_record[\"price_paid\"] = $values[\"lookupAsk\"];\n save_portfolio($portfolio, $existing_record, $values[\"lookupSymbol\"]);\n } else {\n // Set new record to portfolio\n $portfolio_record = array('symbol' => $values[\"lookupSymbol\"],\n 'name' => $values[\"lookupName\"],\n 'quantity' => $values[\"quantity\"],\n 'price_paid' => $values[\"lookupAsk\"]);\n save_portfolio($portfolio, $portfolio_record);\n }\n\t set_message(AlertType::Success, \"You successfuly bought \" . $values[\"quantity\"] . \" \" . $values[\"lookupName\"] .\" shares.\");\n break;\n case \"sell\":\n // Update existing record in portfolio\n $existing_record[\"quantity\"] = $existing_record[\"quantity\"] - $values[\"quantity\"];\n save_portfolio($portfolio, $existing_record, $values[\"lookupSymbol\"]);\n\t set_message(AlertType::Success, \"You successfuly sold \" . $values[\"quantity\"] . \" \" . $values[\"lookupName\"] .\" shares.\");\n break;\n }\n}", "public function sellProfit(){\n\t\t$campaigns = $this->campaigns()->get();\n\t\t\n\t\t$profit = 0;\n\t\t\n\t\tforeach($campaigns as $campaign){\n\t\t\t$profit += $campaign->sellProfit($this->id);\n\t\t}\n\t\t\n\t\treturn $profit;\n\t}", "public function sellSoda($deposit, $price)\n {\n $inventory = $this->inventory;\n $inventory->bottles -= 1;\n $inventory->tanks->$deposit->quantity -= 1;\n $inventory->cash += $price;\n $recyclingCost = $this->rules()->getRecyclingCost();\n $inventory->cash -= $recyclingCost;\n $this->inventory = $inventory;\n return $recyclingCost;\n }", "public function testIncorrectCanBuyWithOneALotShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(9);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock, 10);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "public function calculateProfit(): bool\n {\n return true;\n }", "public static function sumTargetHealBonus(stdClass $data){\n\t\t//limit max earrings to 2\n\t\tself::limit($data, array('oldEarrings', 'newEarrings'), 2);\n\n\t\tif(!$data->includeTargetBonus){\n\t\t\treturn 0;\n\t\t}\n\n\t\t$bonus = 0;\n\t\t$isMw = ($data->chestEnchant==ENCHANT_MW_NINE OR $data->chestEnchant==ENCHANT_MW_TWELVE);\n\n\t\t//earrings\n\t\t$bonus += $data->oldEarrings * BONUS_EARRING_OLD;\n\t\t$bonus += $data->newEarrings * BONUS_EARRING_NEW;\n\n\t\t//earring bonus stats\n\t\tif($data->earringBonusLeft){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusLeft);\n\t\t}\n\t\tif($data->earringBonusRight){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusRight);\n\t\t}\n\n\t\t//heart potion\n\t\tif($data->heartPotion){\n\t\t\t$bonus += BONUS_HEART_POTION;\n\t\t}\n\n\t\t//if chest is disabled, stop here\n\t\tif($data->chestType==TYPE_NONE){\n\t\t\treturn $bonus;\n\t\t}\n\n\t\t//base (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//+0 (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusZero){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//plus\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\t\telseif($data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_NEW : BONUS_CHEST_NEW_PLAIN);\n\t\t}\n\n\t\treturn $bonus;\n\t}", "public function sharpen($amount);", "public function setPrice()\n {\n $price = $this->price;\n $outFix = $this->outFix;\n $outPer = $this->outPer;\n $inPer = $this->inPer;\n $inFix = $this->inFix;\n $flag = $this->flagInOut;\n if ($price < 1) {\n $sumIn = $outFix > 0 ? 1 + $outFix : 1; //outFix\n $sumIn = $outPer > 0 ? $sumIn + ($sumIn * $outPer / 100) : $sumIn; //outPer\n $sumIn = $sumIn / $price; // price\n $sumIn = $inFix > 0 ? $sumIn + $inFix : $sumIn;// inFix\n $ss = $sumIn * $inPer / 100;\n $sumIn = $inPer > 0 ? $sumIn + $ss : $sumIn;\n $this->in = $this->format_amount($sumIn);\n $this->out = $flag ? 1 : 0;\n } else {\n $val = $inFix > 0 ? 1 - $inFix : 1;\n $val = $inPer > 0 ? $val - $val * ($inPer / 100) : $val;\n $sumOut = $price * $val;\n $sumOut = $outFix > 0 ? $sumOut - $outFix : $sumOut;\n $sumOut = $outPer > 0 ? $sumOut - $outPer / 100 * $sumOut : $sumOut;\n $this->out = $this->format_amount($sumOut);\n $this->in = $flag ? 1 : 0;\n }\n $this->price = (float)$price;\n }", "public function hasDefense(){\r\n return $this->_has(6);\r\n }", "private function CheckStockLevels()\n\t{\n\t\t$quote = getCustomerQuote();\n\t\t$items = $quote->getItems();\n\n\t\tforeach($items as $item) {\n\t\t\tif($item->getProductId() && !$item->checkStockLevel()) {\n\t\t\t\t$outOfStock = $item->getName();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($outOfStock)) {\n\t\t\tFlashMessage(sprintf(getLang('CheckoutInvLevelBelowOrderQty'), $outOfStock), MSG_ERROR, 'cart.php');\n\t\t}\n\t}", "public function hasSilencedf(){\r\n return $this->_has(30);\r\n }", "public function hasPoisonDefense(){\r\n return $this->_has(16);\r\n }", "public function isPriceAlarm()\n {\n // #419 disabling price alarm if article has fixed price\n $oProduct = $this->getProduct();\n $sFixedPriceField = 'oxarticles__oxblfixedprice';\n if (isset($oProduct->$sFixedPriceField->value) && $oProduct->$sFixedPriceField->value) {\n return 0;\n }\n\n return 1;\n }", "public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}", "public function isIncludedInPrice();", "function calculateSellPriceOfAssetUnitUsingSpotPriceAndTransactedAmountAndFeePercentageExtendedCalculation($spotPrice, $transactedAmount, $feePercentage)\n\t{\t\n\t\t\n\t\t$calculatedSellPriceOfAssetUnit\t\t= 0;\n\t\t\n\t\tif ($feePercentage >= 1)\n\t\t{\n\t\t\t$feePercentage \t\t\t\t\t= $feePercentage / 100;\n\t\t}\n\t\t\n\t\tif ($transactedAmount > 0)\n\t\t{\n\t\t\t$calculatedSellPriceOfAssetUnit\t= (($spotPrice * $transactedAmount) - ($spotPrice * $transactedAmount * $feePercentage)) / $transactedAmount;\n\t\t}\n\n\t\treturn $calculatedSellPriceOfAssetUnit;\t\n\t}", "public function finalAdd2CartChecks($item, $number, $folioItem, $cartItem, $currentCartQuant, $typeType=false)\n\t{\n\t\t$error = \"\";\n\t\t\n\t\t#can't purchase a fraction of a share\n\t\t$number = intval($number);\n\t\t\n\t\t#no number of shares? error!\n\t\tif ( $number < 1 )\n\t\t{\n\t\t\t$error = $this->lang->words['no_shares_to_add'];\n\t\t}\n\t\t\n\t\t#number of shares over group max? error!\n\t\tif ( !$error && $this->memberData['g_eco_stock_max'] && $number + $folioItem['p_amount'] + $currentCartQuant > $this->memberData['g_eco_stock_max'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%YOUR_MAX%>\", $this->registry->getClass('class_localization')->formatNumber( $this->memberData['g_eco_stock_max'] ) .' '. $this->numberLang(), $this->lang->words['cart_item_quantity_over_group_max'] );\t\t\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['stock'], $error );\n\t\t\t$error = str_replace( \"<%NUMBER_WORD%>\", $this->lang->words['quantity'], $error );\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t#number of shares over stock max? error!\n\t\tif ( !$error && $item['s_limit'] && $number + $folioItem['p_amount'] + $currentCartQuant > $item['s_limit'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%MAX%>\", $this->registry->getClass('class_localization')->formatNumber( $item['s_limit'] ) .' '. $this->numberLang(), $this->lang->words['cart_item_quantity_over_item_max_with_vars'] );\t\t\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['stock'], $error );\n\t\t\t$error = str_replace( \"<%NUMBER_WORD%>\", $this->lang->words['quantity'], $error );\t\t\t\t\t\t\n\t\t}\t\t\n\n\t\treturn $error;\n\t}", "public static function chargeFees($price=1)\n {\n\n }", "public function deliveryPriceOutDhaka()\n {\n }", "public function hasPoisonDefense(){\r\n return $this->_has(19);\r\n }", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function existingPackageHandler(&$plan_info)\n {\n if ($this->planType == 'account') {\n return;\n }\n\n if ((!$plan_info['Package_ID'] && $plan_info['Price'] <= 0)\n || ($plan_info['Package_ID']\n && ($plan_info['Listings_remains'] > 0\n || $plan_info['Listing_number'] == 0)\n )\n ) {\n $this->skipCheckout = true;\n unset($this->steps['checkout']);\n } else {\n $this->skipCheckout = false;\n }\n }", "public function profit() : void {\n\t\techo ($this->price - $this->cost);\n\t}", "public function hasDefense(){\r\n return $this->_has(9);\r\n }", "public function pro_savings_stats() {\r\n\t\t$core = WP_Smush::get_instance()->core();\r\n\r\n\t\tif ( ! WP_Smush::is_pro() ) {\r\n\t\t\tif ( empty( $core->stats ) || empty( $core->stats['pro_savings'] ) ) {\r\n\t\t\t\t$core->set_pro_savings();\r\n\t\t\t}\r\n\t\t\t$pro_savings = $core->stats['pro_savings'];\r\n\t\t\t$show_pro_savings = $pro_savings['savings'] > 0;\r\n\t\t\tif ( $show_pro_savings ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<li class=\"smush-avg-pro-savings\" id=\"smush-avg-pro-savings\">\r\n\t\t\t\t\t<span class=\"sui-list-label\"><?php esc_html_e( 'Pro Savings', 'wp-smushit' ); ?>\r\n\t\t\t\t\t\t<span class=\"sui-tag sui-tag-pro sui-tooltip sui-tooltip-constrained\" data-tooltip=\"<?php esc_html_e( 'Join WPMU DEV to unlock multi-pass lossy compression', 'wp-smushit' ); ?>\">\r\n\t\t\t\t\t\t\t<?php esc_html_e( 'PRO', 'wp-smushit' ); ?>\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<span class=\"sui-list-detail wp-smush-stats\">\r\n\t\t\t\t\t\t<span class=\"wp-smush-stats-human\"><?php echo esc_html( $pro_savings['savings'] ); ?></span>\r\n\t\t\t\t\t\t<span class=\"wp-smush-stats-sep\">/</span>\r\n\t\t\t\t\t\t<span class=\"wp-smush-stats-percent\"><?php echo esc_html( $pro_savings['percent'] ); ?></span>%\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</li>\r\n\t\t\t\t<?php\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$compression_savings = 0;\r\n\t\t\tif ( ! empty( $core->stats ) && ! empty( $core->stats['bytes'] ) ) {\r\n\t\t\t\t$compression_savings = $core->stats['bytes'] - $core->stats['resize_savings'];\r\n\t\t\t}\r\n\t\t\t?>\r\n\t\t\t<li class=\"super-smush-attachments\">\r\n\t\t\t\t<span class=\"sui-list-label\">\r\n\t\t\t\t\t<?php esc_html_e( 'Super-Smush Savings', 'wp-smushit' ); ?>\r\n\t\t\t\t\t<?php if ( ! $this->settings->get( 'lossy' ) ) { ?>\r\n\t\t\t\t\t\t<p class=\"wp-smush-stats-label-message sui-hidden-sm sui-hidden-md sui-hidden-lg\">\r\n\t\t\t\t\t\t\t<?php\r\n\t\t\t\t\t\t\t$link_class = 'wp-smush-lossy-enable-link';\r\n\t\t\t\t\t\t\tif ( ( is_multisite() && Settings::can_access( 'bulk' ) ) || 'bulk' !== $this->get_current_tab() ) {\r\n\t\t\t\t\t\t\t\t$settings_link = $this->get_page_url() . '#enable-lossy';\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$settings_link = '#';\r\n\t\t\t\t\t\t\t\t$link_class = 'wp-smush-lossy-enable';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tprintf(\r\n\t\t\t\t\t\t\t\t/* translators: %1$s; starting a tag, %2$s: ending a tag */\r\n\t\t\t\t\t\t\t\tesc_html__( 'Compress images up to 2x more than regular smush with almost no visible drop in quality. %1$sEnable Super-Smush%2$s', 'wp-smushit' ),\r\n\t\t\t\t\t\t\t\t'<a role=\"button\" class=\"' . esc_attr( $link_class ) . '\" href=\"' . esc_url( $settings_link ) . '\">',\r\n\t\t\t\t\t\t\t\t'</a>'\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t?>\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t<?php } ?>\r\n\t\t\t\t</span>\r\n\t\t\t\t<?php if ( WP_Smush::is_pro() ) : ?>\r\n\t\t\t\t\t<span class=\"sui-list-detail wp-smush-stats\">\r\n\t\t\t\t\t\t<?php if ( ! $this->settings->get( 'lossy' ) ) : ?>\r\n\t\t\t\t\t\t\t<a role=\"button\" class=\"sui-hidden-xs <?php echo esc_attr( $link_class ); ?>\" href=\"<?php echo esc_url( $settings_link ); ?>\">\r\n\t\t\t\t\t\t\t\t<?php esc_html_e( 'Enable Super-Smush', 'wp-smushit' ); ?>\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t<?php else : ?>\r\n\t\t\t\t\t\t\t<span class=\"smushed-savings\">\r\n\t\t\t\t\t\t\t\t<?php echo esc_html( size_format( $compression_savings, 1 ) ); ?>\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\t</span>\r\n\t\t\t\t<?php endif; ?>\r\n\t\t\t</li>\r\n\t\t\t<?php\r\n\t\t}\r\n\t}", "function filter_woocommerce_correios_shipping_args( $array, $this_id, $this_instance_id, $this_package ) { \n //$array['nVlPeso'] = 1000;\n if($array['nVlPeso'] >= 30){\n return array('nCdServico' => null);\n }\n return $array; \n}", "function longtermrise(){ //riserate in decimal eg. 1.2\n global $names, $rows, $lastRow, $tax;\n for ($col=1; $col<14; $col++) {\n $new = $rows[$lastRow][$col];\n $old = $rows[0][$col];\n if (($new*$tax > 10*$old) && ($rows[$lastRow-1][$col]*$tax < 10*$old) ) {\n $msg=\"\\\"$names[$col]\\\" rose since the beginning (Org x\".round(($new*$tax/$old),2).\" at a price of \".round($new*$tax,2).\")!\";\n pushbullet(\"CSGO Skin Notification! :)\", $msg);\n }else if (($new*$tax > 5*$old) && ($rows[$lastRow-1][$col]*$tax < 5*$old) ) {\n $msg=\"\\\"$names[$col]\\\" rose since the beginning (Org x\".round(($new*$tax/$old),2).\" at a price of \".round($new*$tax,2).\")!\";\n pushbullet(\"CSGO Skin Notification! :)\", $msg);\n }else if (($new*$tax > 2*$old) && ($rows[$lastRow-1][$col]*$tax < 2*$old) ) {\n $msg=\"\\\"$names[$col]\\\" rose since the beginning (Org x\".round(($new*$tax/$old),2).\" at a price of \".round($new*$tax,2).\")!\";\n pushbullet(\"CSGO Skin Notification! :)\", $msg);\n }\n }\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}", "function indSell($seller, $selling, $date, $dbh)\n{\n\t// When selling, also calculate and add to ind_fund_return\n\tif (isFund($selling,$dbh))\n\t{\t\t\n\t\ttry{\n\t\t\t//Calculate the individuals return from the fund and add it to individual_cash.\n\t\t\t$individualsInvestment = getIndividualsInvestment($seller,$selling, $dbh);\n\t\t\t$investmentDate = getFundInvestmentDate($seller,$selling,$dbh);\n\t\t\t$fundsStartValue = getFundTotalCash($selling, $investmentDate,$dbh);\n\t\t\t$fundCurrentTotalCapital = getFundTotalCash($selling, $date, $dbh);\n\t\t\t$individualsReturn = ($individualsInvestment/$fundsStartValue)*($fundCurrentTotalCapital);\t\t\n\t \n\t\t\t// Now add the cash to the $seller and remove it from the fund_cash.\n\t\t\t$prevCashVal = getIndCash($seller, $dbh); \n\t\t\t\n\t\t\t// Calculate total return and add to ind_fund_return table\n\t\t\t$totalReturn = $individualsReturn/$prevCashVal;\n\t\t\t$dateSold = strtotime($date);\n\t\t\t$dateBought = strtotime($investmentDate);\n\t\t\t$numDaysHeld = ceil(abs($dateSold - $dateBought) / 86400);\n\t\t\tif ($numDaysHeld > 0)\n\t\t\t{\n\t\t\t\t$annualizedReturn = pow($totalReturn, (1/($numDaysHeld/365)));\n\t\t\t\tinsertIntoIndFundReturn($seller, $selling, $annualizedReturn, $dbh);\n\t\t\t\taddCashToIndividualSelling($seller, $individualsReturn, $dbh);\n\t\t\t}\n\n\t\t\t// Fund sells all shares held by individual\n\t\t\t// Get the stocks currently owned by the $fund\n\t\t\t$sqlind = \"SELECT symbol, shares, percentage, purchase_date FROM fund_stock where name = :name\";\t\n\t\t\t$query_ind = $dbh->prepare($sqlind);\n\t\t\t$query_ind->bindValue(':name', $selling);\n\t\t\t$query_ind->execute();\t\t\n\t\t\n\t\t\twhile ($rs = $query_ind->fetch(PDO::FETCH_OBJ))\n\t\t\t{\t\t\t\t\n\t\t\t\t// Get this individual_fund Start date to use for currStockPrice^\n\t\t\t\t$fundInvestmentDate = getFundInvestmentDate($seller,$selling,$dbh);\n\t\t\t\t$investmentDateStockPrice = getInitialStockPrice($rs->symbol, $fundInvestmentDate, $dbh);\n\n\t\t\t\t//Calculate the number of shares to sell and update fund_stock \n\t\t\t\t$sharesToDivest = ($individualsInvestment*$rs->percentage)/$investmentDateStockPrice;\n\t\t\t\n\t\t\t\t//Remove these shares from the fund_stock table\n\t\t\t\tremoveSharesFromFund($selling, $rs->symbol, $sharesToDivest, $dbh);\n\t\t\t}\n\n\n\t\t\t// Now just remove the percentage of cash from fund_cash, and remove initial investment\n\t\t\tremoveCashFromFund($selling, $individualsReturn,$individualsInvestment, $dbh);\n\t\t\t// remove entry from individual_fund table\n\t\t\t//removeIndividualFund($seller, $selling, $dbh);\n\t\t\t//Remove the stock from the individuals_fund table\n\t\t\t$sql = \"DELETE FROM individual_fund WHERE fund = :symbol AND person = :person\";\n\t\t\t$query = $dbh->prepare($sql);\n\t\t\t$query->bindValue(':symbol', $selling);\n\t\t\t$query->bindValue(':person', $seller);\n\t\t\t$query->execute();\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\techo \"Error individual selling fund.<br>\";\n\t\t}\n\t}\n\telseif(isStock($selling,$dbh))\n\t//Individual, sell the shares and update individuals cash. \n\t{\n\t\ttry{\n\t\t\t$sqlind = \"SELECT * FROM individual_fund where person=:seller AND fund=:fund\";\t\n\t\t\t$query_ind = $dbh->prepare($sqlind);\n\t\t\t$query_ind->bindValue(':seller', $seller);\n\t\t\t$query_ind->bindValue(':fund', $selling);\n\t\t\t$query_ind->execute();\n\t\t\t$ind_result = $query_ind->fetch(PDO::FETCH_ASSOC);\n\n\t\t\t// get the close value of the stock we are selling on the nearest date.\n\t\t\t$value = (float) getStockPrice($selling, $date, $dbh) * (float) $ind_result['shares'];\n\t\t\t$currCash = getIndCash($seller ,$dbh);\n\t\t\t$newCashValue = (float) $value + (float) $currCash;\n\n\t\t\t// Calculate total return and add to ind_fund_return\n\t\t\t$dateSold = strtotime($date);\n\t\t\t$dateBought = strtotime(getFundInvestmentDate($seller,$selling,$dbh));\n\t\t\t$numDaysHeld = ceil(abs($dateSold - $dateBought) / 86400);\n\t\t\tif ( $numDaysHeld > 0)\n\t\t\t{\n\t\t\t\t$annualizedReturn = pow($value, (1/($numDaysHeld/365)));\n\t\t\t\tinsertIntoIndFundReturn($seller, $selling, $annualizedReturn, $dbh);\n\t\t\t\t//Add cash to the individual_cash\n\t\t\t\taddCashToIndividualSelling($seller, $value, $dbh);\n\t\t\t}\n\n\t\t\t//Remove the stock from the individuals_fund table\n\t\t\t$sql = \"DELETE FROM individual_fund WHERE fund = :symbol AND person = :person\";\n\t\t\t$query = $dbh->prepare($sql);\n\t\t\t$query->bindValue(':symbol', $selling);\n\t\t\t$query->bindValue(':person', $seller);\n\t\t\t$query->execute();\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\techo \"Error Individual selling Stock<br>\";\n\t\t}\n\t}\n\telse\n\t{\t\n\t\techo \"Error indSell(): Not selling a stock or a fund.<br>\";\n\t}\t\n}", "function fp_remove_fee_from_cart()\r\n {\r\n if(isset($_POST['fp_remove_points'])) {\r\n remove_action( 'woocommerce_cart_calculate_fees', array( $this , 'fp_woo_add_cart_fee' ),10,1);\r\n $_SESSION['fp_action']=\"remove\";\r\n }\r\n }", "function fundSellStock($seller, $selling, $date, $dbh)\n{\n\t\t\n\t$sql = \"SELECT shares, percentage FROM fund_stock WHERE name = :fund AND symbol = :symbol\";\n\t$query = $dbh->prepare($sql);\n\t$query->bindValue(':fund', $seller);\n\t$query->bindValue(':symbol', $selling);\n\t$query->execute();\n\t\n\ttry{\n\t\tif ($query->rowCount() > 0)\n\t\t{\n\t\t\t$rs = $query->fetch(PDO::FETCH_OBJ);\n\t\t\t$percentage = $rs->percentage;\n\t\t\t$shares = $rs->shares;\n\n\t\t\t$currStockPrice = getStockPrice($selling,$date,$dbh);\n\t\t\t$returnToCash = $currStockPrice * $shares;\n\n\t\t\t//Update the funds cash and percentage with returns from the stock sold.\t\n\t\t\t$sql = \"UPDATE fund_cash SET cash=cash+:cash, percentage = percentage+:perc WHERE name = :name\";\n\t\t\t$query = $dbh->prepare($sql);\n\t\t\t$query->bindValue(':name', $seller);\n\t\t\t$query->bindValue(':cash', $returnToCash);\n\t\t\t$query->bindValue(':perc', $percentage);\n\t\t\t$query->execute();\n\n\t\t\t// remove from fund_stock\n\t\t\t$sql = \"DELETE FROM fund_stock WHERE name = :name AND symbol=:selling\";\n\t\t\t$query = $dbh->prepare($sql);\n\t\t\t$query->bindValue(':name', $seller);\n\t\t\t$query->bindValue(':selling', $selling);\n\t\t\t$query->execute();\n\t\t\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\"Error fundSellStock(): Fund \".$seller.\" doesn't own \".$selling.\"<br>\";\n\t\t}\n\t}\n\tcatch (PDOException $e)\n\t{\n\t\techo \"Error fund selling stock<br>\";\n\t}\n\t\n}", "public function finalAdd2CartChecks($item, $number, $folioItem, $cartItem, $currentCartQuant, $typeType=false)\n\t{\n\t\t$error = \"\";\n\t\t\n\t\t#already have a previous unpaid loan with this bank\n\t\tif ( !$error && $folioItem )\n\t\t{\n\t\t\t$error = $this->lang->words['previous_loan_unpaid'];\n\t\t}\n\t\t\n\t\t#no new accounts in that type for this bank? error!\n\t\tif ( !$error && !$item['b_loans_on'] )\n\t\t{\n\t\t\t$error = $this->lang->words['bank_loans_disabled'];\n\t\t}\t\t\t\t\t\n\t\t\n\t\t#no positive deposit amount? error!\n\t\tif ( !$error && !$number > 0 )\n\t\t{\n\t\t\t$error = $this->lang->words['positive_loan_amount_needed'];\t\t\n\t\t}\n\t\t\n\t\t#deposit over group max?\n\t\tif ( !$error && $this->memberData['g_eco_max_loan_debt'] && $number + $currentCartQuant > $this->memberData['g_eco_max_loan_debt'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%YOUR_MAX%>\", $this->registry->getClass('class_localization')->formatNumber( $this->memberData['g_eco_max_loan_debt'] ) .' '. $this->numberLang(), $this->lang->words['cart_item_quantity_over_group_max'] );\t\t\n\t\t\t$error = str_replace( \"<%TYPE%>\", $this->lang->words['loans'], $error );\n\t\t\t$error = str_replace( \"<%NUMBER_WORD%>\", $this->lang->words['loan_amount'], $error );\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t#deposit over bank loan max?\n\t\tif ( !$error && $item['b_loans_max'] && $number + $currentCartQuant > $item['b_loans_max'] )\n\t\t{\n\t\t\t$error = str_replace( \"<%MAX%>\", $this->registry->getClass('class_localization')->formatNumber( $item['b_loans_max'] ) .' '. $this->numberLang(), $this->lang->words['over_bank_loan_max'] );\n\t\t}\n\n\t\treturn $error;\n\t}", "public function testIncorrectCanBuyWithOneShortMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(99);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$c->buyStock(NULL, 0);\n\t\t\t$c->sellStock(NULL, 0);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(false,$result);\n\t\t}", "public static function sell_bearish($pair, $risk, $stop, $leverage=50) {\n\n\t\t\t//Retrieve current price\n\t\t\tif (! self::valid($price = self::price($pair)))\n\t\t\t\treturn $price;\n\n\t\t\t//Find the correct size so that $risk is divided by $pips\n\t\t\tif (! self::valid($size = self::nav_size_percent_per_pip($pair, ($risk/$stop))))\n\t\t\t\treturn $size;\n\n\t\t\tif (! self::valid($newTrade = self::sell_market($size, $pair)) && isset($newTrade->tradeId))\n\t\t\t\treturn $newTrade;\n\n\t\t\t//Set the stoploss\n\t\t\treturn self::trade_set_stop($newTrade->tradeId, $price->bid - (self::instrument_pip($pair) * $stop));\n\t\t}", "public function hasPrecost(){\n return $this->_has(25);\n }", "function calculateBuyPriceOfAssetUnitFromOutboundTransactionUsingSpotPriceAndTransactedAmountAndFeePercentageExtendedCalculation($spotPrice, $transactedAmount, $feePercentage)\n\t{\t\n\t\t\n\t\t$calculatedBuyPriceOfAssetUnit\t\t= 0;\n\t\t\n\t\tif ($feePercentage >= 1)\n\t\t{\n\t\t\t$feePercentage \t\t\t\t\t= $feePercentage / 100;\n\t\t}\n\t\t\n\t\tif ($transactedAmount > 0)\n\t\t{\n\t\t\t$calculatedBuyPriceOfAssetUnit\t= (($spotPrice * $transactedAmount) + ($spotPrice * $transactedAmount * $feePercentage)) / $transactedAmount;\n\t\t}\n\n\t\treturn $calculatedBuyPriceOfAssetUnit;\t\n\t}", "public function isOutOfStock(){\n\t\treturn FALSE;\n\t}", "function inv_tss(){\n\trequire(\"../includes/resource/db.php\");\n\tset_time_limit(720);\n\t/*\n\techo substr(sprintf('%o', fileperms('shoebuy/')), -4);\n\techo substr(sprintf('%o', fileperms('shoebuy/peppergate-ip.csv')), -4).\"<br>\";\n\t*/\n\t\n\t/* ************************************************************************ */\n\t/* ***************** Variables to change for each vendor ****************** */\n\t/* ************************************************************************ */\n\t\n\t$name = \"theshoestore/tssinv.csv\";\n\t//header\n\t$line = \"ProductId,AO_Code,AO_Sufix,AO_Name,AO_Cost,AO_stock,AO_Weight\\r\\n\";\n\t$company = \"ALG\";\n\t$replenishmentdate = \"\";\n\t$season = \"ALG5\";\n\t\n\t$ao_code = \"2272\";\n\t/* ************************************************************************ */\n\t/* ************** EOF Variables to change for each vendor ***************** */\n\t/* ************************************************************************ */\n\t\n\t\n\t\n\t$file = fopen( $name, \"w\" );\n\t\n\t$time = date(\"H_i_s\");\n\n\t\n\t$linkID = mysql_connect($inhost, $inuser, $inpass) or die ('Error connecting to mysql');\n\tmysql_select_db($indatabase, $linkID);\n\t\n\t$query = \"SELECT * FROM $intable WHERE class = '\".$season.\"' ORDER BY itemNo ASC\";\n\t//$query = \"SHOW COLUMNS FROM $intable WHERE class = '\".$season.\"' ORDER BY itemNo ASC\";\n\n\n\t$result = mysql_query($query, $linkID) or die(\"Data not found. 1st\"); \n\t\n\t\n\t\n\tfputs($file, $line);\n\t\n\twhile($row = mysql_fetch_assoc($result)){\n\t\t\n\t\t\n\t\t\n\t\t//loop through size 35 to 42\n\t\tif(strpos($row['color'], 'Exclusive') === false){ \n\t\t\tif(strpos($row['color'], 'Scrubwear') === false){\t\n\t\t\t\n\t\t\tinclude(\"resource/variables_mysql.php\");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$tmpUPC\t\t=trim($row1['UPC_CD'],\" \");\n\t\t\t\n\t/* ************************************************************************ */\n\t/* ***************** Variables to change for each vendor ****************** */\n\t/* ************************************************************************ */\t\n\t\t\tif ($tmpStock <= 10){ $tmpStock = 0;} else { $tmpStock = $tmpStock;}\n\t\t\t\n\t\t\tif ($tmpSize == 35){ $sizeChart = \"35 (US 5 - 5.5)\";}\n\t\t\tif ($tmpSize == 36){ $sizeChart = \"36 (US 6 - 6.5)\";}\n\t\t\tif ($tmpSize == 37){ $sizeChart = \"37 (US 7 - 7.5)\";}\n\t\t\tif ($tmpSize == 38){ $sizeChart = \"38 (US 8 - 8.5)\";}\n\t\t\tif ($tmpSize == 39){ $sizeChart = \"39 (US 9 - 9.5)\";}\n\t\t\tif ($tmpSize == 40){ $sizeChart = \"40 (US 10)\";}\n\t\t\tif ($tmpSize == 41){ $sizeChart = \"41 (US 10.5)\";}\n\t\t\tif ($tmpSize == 42){ $sizeChart = \"42 (US 11)\";}\n\t\t\t\n\t\t/*\tif ($tmpItemNo == \"ALG-101\"){$pID = \"1\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-112\"){$pID = \"2\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-117\"){$pID = \"3\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-123\"){$pID = \"4\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-124\"){$pID = \"5\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-126\"){$pID = \"6\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-205\"){$pID = \"7\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-206\"){$pID = \"8\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-211\"){$pID = \"9\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-311\"){$pID = \"10\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-316\"){$pID = \"11\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-ASP-6146\"){$pID = \"49\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-ASP-6156\"){$pID = \"50\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-101\"){$pID = \"51\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-123\"){$pID = \"52\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-126\"){$pID = \"53\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-419\"){$pID = \"54\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-423\"){$pID = \"55\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-601\"){$pID = \"56\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-602\"){$pID = \"57\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-604\"){$pID = \"58\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-611\"){$pID = \"59\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DEB-600\"){$pID = \"60\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DEB-601\"){$pID = \"61\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-114\"){$pID = \"62\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-314\"){$pID = \"63\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-315\"){$pID = \"64\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-339\"){$pID = \"65\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-515\"){$pID = \"66\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-516\"){$pID = \"67\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-517\"){$pID = \"68\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-519\"){$pID = \"69\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-600\"){$pID = \"70\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-601\"){$pID = \"71\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-101\"){$pID = \"72\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-102\"){$pID = \"73\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-205\"){$pID = \"74\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-206\"){$pID = \"75\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-211\"){$pID = \"76\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-326\"){$pID = \"77\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-327\"){$pID = \"78\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-345\"){$pID = \"79\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-346\"){$pID = \"80\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-347\"){$pID = \"81\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-412\"){$pID = \"82\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-416\"){$pID = \"83\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-420\"){$pID = \"84\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-507\"){$pID = \"85\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-509\"){$pID = \"86\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-601\"){$pID = \"87\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-205\"){$pID = \"96\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-206\"){$pID = \"97\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-211\"){$pID = \"98\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-305\"){$pID = \"99\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-604\"){$pID = \"100\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-611\"){$pID = \"101\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-101\"){$pID = \"102\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-112\"){$pID = \"103\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-123\"){$pID = \"104\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-124\"){$pID = \"105\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-205\"){$pID = \"106\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-206\"){$pID = \"107\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-208\"){$pID = \"108\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-209\"){$pID = \"109\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-211\"){$pID = \"110\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-311\"){$pID = \"111\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-323\"){$pID = \"112\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-324\"){$pID = \"113\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-325\"){$pID = \"114\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-333\"){$pID = \"115\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-334\"){$pID = \"116\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-402\"){$pID = \"117\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-406\"){$pID = \"118\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-407\"){$pID = \"119\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-410\"){$pID = \"120\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-421\"){$pID = \"121\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-424\"){$pID = \"122\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-504\"){$pID = \"123\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-514\"){$pID = \"124\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-600\"){$pID = \"125\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-601\"){$pID = \"126\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-602\"){$pID = \"127\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-604\"){$pID = \"128\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-701\"){$pID = \"129\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-702\"){$pID = \"130\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-802\"){$pID = \"131\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-804\"){$pID = \"132\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-101\"){$pID = \"133\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-123\"){$pID = \"134\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-126\"){$pID = \"135\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-604\"){$pID = \"136\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-611\"){$pID = \"137\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-615\"){$pID = \"138\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-618\"){$pID = \"139\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-420\"){$pID = \"168\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-422\"){$pID = \"169\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-604\"){$pID = \"170\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-611\"){$pID = \"171\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-614\"){$pID = \"172\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-999\"){$pID = \"224\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-999W\"){$pID = \"225\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-205\"){$pID = \"226\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-206\"){$pID = \"227\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-211\"){$pID = \"228\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-412\"){$pID = \"229\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-416\"){$pID = \"230\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-508\"){$pID = \"231\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-521\"){$pID = \"232\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-601\"){$pID = \"233\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-602\"){$pID = \"234\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-101\"){$pID = \"235\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-1121\"){$pID = \"236\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-122\"){$pID = \"237\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-1231\"){$pID = \"238\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-126\"){$pID = \"239\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-3211\"){$pID = \"240\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-3221\"){$pID = \"241\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-339\"){$pID = \"242\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-5211\"){$pID = \"243\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-5221\"){$pID = \"244\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-5231\"){$pID = \"245\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-525\"){$pID = \"246\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-600\"){$pID = \"247\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-601\"){$pID = \"248\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-602\"){$pID = \"249\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-701\"){$pID = \"250\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-702\"){$pID = \"251\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-711\"){$pID = \"252\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-712\"){$pID = \"253\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-101\"){$pID = \"254\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-123\"){$pID = \"255\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-126\"){$pID = \"256\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-305\"){$pID = \"257\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-422\"){$pID = \"258\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-423\"){$pID = \"259\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-604\"){$pID = \"260\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-611\"){$pID = \"261\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAD-101\"){$pID = \"262\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAD-126\"){$pID = \"263\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAD-420\"){$pID = \"264\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-709\"){$pID = \"265\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-320\"){$pID = \"266\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-321\"){$pID = \"267\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-322\"){$pID = \"268\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-323\"){$pID = \"269\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-330\"){$pID = \"270\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-336\"){$pID = \"271\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-337\"){$pID = \"272\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-407\"){$pID = \"273\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-410\"){$pID = \"274\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-412\"){$pID = \"275\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-416\"){$pID = \"276\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-421\"){$pID = \"277\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-424\"){$pID = \"278\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-504\"){$pID = \"279\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-505\"){$pID = \"280\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-509\"){$pID = \"281\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-511\"){$pID = \"282\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-512\"){$pID = \"283\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-513\"){$pID = \"284\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-601\"){$pID = \"285\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-602\"){$pID = \"286\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-604\"){$pID = \"287\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-701\"){$pID = \"288\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-702\"){$pID = \"289\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-709\"){$pID = \"290\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-714\"){$pID = \"291\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-715\"){$pID = \"292\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-716\"){$pID = \"293\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-802\"){$pID = \"294\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-804\"){$pID = \"295\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-814\"){$pID = \"296\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-925\"){$pID = \"297\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-710\"){$pID = \"298\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-713\"){$pID = \"299\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-714\"){$pID = \"300\";}\t\n\t\t\t*/\n\t\t\tif ($tmpItemNo == \"ALG-128\"){$pID = \"375\";}\n\t\t\tif ($tmpItemNo == \"ALG-381\"){$pID = \"376\";}\n\t\t\tif ($tmpItemNo == \"ALG-382\"){$pID = \"377\";}\n\t\t\tif ($tmpItemNo == \"ALG-383\"){$pID = \"378\";}\n\t\t\tif ($tmpItemNo == \"ALG-535\"){$pID = \"379\";}\n\t\t\tif ($tmpItemNo == \"ALG-536\"){$pID = \"380\";}\n\t\t\tif ($tmpItemNo == \"ALG-537\"){$pID = \"381\";}\n\t\t\tif ($tmpItemNo == \"ALG-631\"){$pID = \"382\";}\n\t\t\tif ($tmpItemNo == \"ALG-633\"){$pID = \"383\";}\n\t\t\tif ($tmpItemNo == \"ALG-635\"){$pID = \"384\";}\n\t\t\tif ($tmpItemNo == \"ALG-637\"){$pID = \"385\";}\n\t\t\tif ($tmpItemNo == \"ALG-723\"){$pID = \"386\";}\n\t\t\tif ($tmpItemNo == \"ALG-ABB-362\"){$pID = \"387\";}\n\t\t\tif ($tmpItemNo == \"ALG-ABB-363\"){$pID = \"388\";}\n\t\t\tif ($tmpItemNo == \"ALG-ABB-526\"){$pID = \"389\";}\n\t\t\tif ($tmpItemNo == \"ALG-BAL-101\"){$pID = \"390\";}\n\t\t\tif ($tmpItemNo == \"ALG-BAL-201\"){$pID = \"391\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-201\"){$pID = \"392\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-204\"){$pID = \"393\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-241\"){$pID = \"394\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-242\"){$pID = \"395\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-246\"){$pID = \"396\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-247\"){$pID = \"397\";}\n\t\t\tif ($tmpItemNo == \"ALG-CHA-101\"){$pID = \"398\";}\n\t\t\tif ($tmpItemNo == \"ALG-CHA-702\"){$pID = \"399\";}\n\t\t\tif ($tmpItemNo == \"ALG-CHA-703\"){$pID = \"400\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-103\"){$pID = \"401\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-353\"){$pID = \"402\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-354\"){$pID = \"403\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-624\"){$pID = \"404\";}\n\t\t\tif ($tmpItemNo == \"ALG-DEB-731\"){$pID = \"405\";}\n\t\t\tif ($tmpItemNo == \"ALG-DEB-732\"){$pID = \"406\";}\n\t\t\tif ($tmpItemNo == \"ALG-DON-129\"){$pID = \"407\";}\n\t\t\tif ($tmpItemNo == \"ALG-DON-354\"){$pID = \"408\";}\n\t\t\tif ($tmpItemNo == \"ALG-DON-550\"){$pID = \"409\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-181\"){$pID = \"410\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-551\"){$pID = \"411\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-552\"){$pID = \"412\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-555\"){$pID = \"413\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-556\"){$pID = \"414\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-557\"){$pID = \"415\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-600\"){$pID = \"416\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-601\"){$pID = \"417\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-347\"){$pID = \"418\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-349\"){$pID = \"419\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-522\"){$pID = \"420\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-537\"){$pID = \"421\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-701\"){$pID = \"422\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-705\"){$pID = \"423\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-951\"){$pID = \"424\";}\n\t\t\tif ($tmpItemNo == \"ALG-KLE-101\"){$pID = \"425\";}\n\t\t\tif ($tmpItemNo == \"ALG-KLE-137\"){$pID = \"426\";}\n\t\t\tif ($tmpItemNo == \"ALG-KLE-723\"){$pID = \"427\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-133\"){$pID = \"428\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-210\"){$pID = \"429\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-411\"){$pID = \"430\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-522\"){$pID = \"431\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-642\"){$pID = \"432\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-645\"){$pID = \"433\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-624\"){$pID = \"434\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-641\"){$pID = \"435\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-643\"){$pID = \"436\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-647\"){$pID = \"437\";}\n\t\t\tif ($tmpItemNo == \"ALG-SEV-581\"){$pID = \"438\";}\n\t\t\tif ($tmpItemNo == \"ALG-SEV-583\"){$pID = \"439\";}\n\t\t\tif ($tmpItemNo == \"ALG-TUS-553\"){$pID = \"440\";}\n\t\t\tif ($tmpItemNo == \"ALG-TUS-723\"){$pID = \"441\";}\n\t\t\tif ($tmpItemNo == \"ALG-TUS-951\"){$pID = \"442\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-601\"){$pID = \"443\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-703\"){$pID = \"444\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-705\"){$pID = \"445\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-706\"){$pID = \"446\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-710\"){$pID = \"447\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-210\"){$pID = \"448\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-553\"){$pID = \"449\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-601\"){$pID = \"450\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-720\"){$pID = \"451\";}\n\n\t\n\n\t\t\t//content/data\n\t\t\t//$line = $pID.\",\".$row['DESCRIP'].\",,\".$tmpItemNo.\"-\".$tmpSize.\",\".$sizeChart.\",0,\".$tmpStock.\",0\\r\\n\";\n\t\t\t$line = $pID.\",\".$ao_code.\",\".$tmpItemNo.\"-\".$tmpSize.\",\".$sizeChart.\",0,\".$tmpStock.\",0\\r\\n\";\n\t\t\t\n\t\t\t$ao_code++;\n\t\t\t\n\t/* ************************************************************************ */\n\t/* ************** EOF Variables to change for each vendor ***************** */\n\t/* ************************************************************************ */\n\t\t\t\t//echo $line.\"<br>\";\n\t\t\t\tfputs($file, $line);\n\t\t\t}\n\t\t}\n\t\t\t\n\t}\n\tfclose($file);\n\techo \"TSS created<br>\";\n}", "public function test_it_should_decrease_sell_in_of_ordinary_item()\r\n {\r\n $initialSellIn = 5;\r\n $this->itemBuilder->ordinaryItem()->toSellIn($initialSellIn);\r\n\r\n $this->updateQuality();\r\n\r\n $this->assertThatSellInIs(lessThan($initialSellIn)); // variant (1a), general\r\n $this->assertThatSellInIs(equalTo($initialSellIn - 1)); // variant (1b), specific\r\n }", "function fn_warehouses_check_amount_in_stock_before_check($product_id, $amount, $product_options, $cart_id, $is_edp, $original_amount, $cart, $update_id, $product, &$current_amount)\n{\n /** @var Tygh\\Addons\\Warehouses\\Manager $manager */\n $manager = Tygh::$app['addons.warehouses.manager'];\n /** @var Tygh\\Addons\\Warehouses\\ProductStock $product_stock */\n $product_stock = $manager->getProductWarehousesStock($product_id);\n\n if (!$product_stock->hasStockSplitByWarehouses()) {\n return;\n }\n\n $location = fn_warehouses_get_location_from_cart($cart);\n $pickup_point_id = fn_warehouses_get_pickup_point_id_from_cart($cart, $cart_id);\n $destination_id = fn_warehouses_get_destination_id($location);\n\n $product_amount = $product_stock->getAmount();\n if ($pickup_point_id && $product_stock->getWarehousesById($pickup_point_id)) {\n $store = $product_stock->getWarehousesById($pickup_point_id);\n $store = reset($store);\n $product_amount = $product_stock->getAmountForDestination($store->getMainDestinationId());\n } elseif ($destination_id && $product_stock->getAmountForDestination($destination_id)) {\n $product_amount = $product_stock->getAmountForDestination($destination_id);\n }\n\n $current_amount = $product_amount;\n\n if (!empty($cart['products'][$cart_id]['amount']) && !$current_amount) {\n Tygh::$app['session']['warehouses']['out_of_stock_products'][$product_id] = $product_id;\n }\n}", "public function chargeFee($amount = false) {\n $this->checkFee($amount);\n\n if(!$amount) {\n $fee = config('games.under_over.entry_fee');\n } else {\n $fee = $amount;\n }\n \n // deduct from the gold of current user\n $this->gold = $this->gold - $fee;\n try {\n $this->saveOrFail();\n } catch(QueryException $ex) {\n throw new PersonalRuntimeException(__('common.errors.invalid_query'));\n }\n }", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "public function canBuy()\n {\n //改成上半场内都能投注\n $match = $this->getMatch();\n if (!is_null($match) && ($match->isBeforeHalf())){\n return true;\n } else {\n return false;\n }\n }", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "function updateAssetPrice( $asset=null ){\n global $mysqli;\n // Lookup asset id \n $asset = $mysqli->real_escape_string($asset);\n $results = $mysqli->query(\"SELECT id, divisible FROM assets WHERE asset='{$asset}'\");\n if($results && $results->num_rows){\n $row = $results->fetch_assoc();\n $asset_id = $row['id'];\n $divisible = ($row['divisible']==1) ? true : false;\n } else {\n byeLog('Error looking up asset id');\n }\n // Bail out on BTC or XCP\n if($asset_id<=2)\n return;\n // Lookup last order match for XCP\n $sql = \"SELECT\n m.forward_asset_id,\n m.forward_quantity,\n m.backward_asset_id,\n m.backward_quantity\n FROM\n order_matches m\n WHERE\n ((m.forward_asset_id=2 AND m.backward_asset_id='{$asset_id}') OR\n ( m.forward_asset_id='{$asset_id}' AND m.backward_asset_id=2)) AND\n m.status='completed'\n ORDER BY \n m.tx1_index DESC \n LIMIT 1\";\n $results = $mysqli->query($sql);\n if($results){\n if($results->num_rows){\n $data = $results->fetch_assoc();\n $xcp_amt = ($data['forward_asset_id']==2) ? $data['forward_quantity'] : $data['backward_quantity'];\n $xxx_amt = ($data['forward_asset_id']==2) ? $data['backward_quantity'] : $data['forward_quantity'];\n $xcp_qty = number_format($xcp_amt * 0.00000001,8,'.','');\n $xxx_qty = ($divisible) ? number_format($xxx_amt * 0.00000001,8,'.','') : number_format($xxx_amt,0,'.','');\n $price = number_format($xcp_qty / $xxx_qty,8,'.','');\n $price_int = number_format($price * 100000000,0,'.','');\n $results = $mysqli->query(\"UPDATE assets SET xcp_price='{$price_int}' WHERE id='{$asset_id}'\");\n if(!$results)\n byeLog('Error updating XCP price for asset ' . $asset);\n }\n } else {\n byeLog('Error while trying to lookup asset price');\n }\n}", "public function checkStock()\n {\n if ($this->qty > ($this->beer->stock - $this->beer->requested_stock)){\n return false;\n }\n\n return true;\n }", "public function sethiddenObjLow(array $value)\n {\n $this->hiddenbuildingsLow = self::mutateToPgArray($value);\n }" ]
[ "0.6861287", "0.56940365", "0.5029836", "0.49890214", "0.4963406", "0.48867038", "0.48828098", "0.484458", "0.47552383", "0.472395", "0.47031915", "0.4697599", "0.46971878", "0.4695357", "0.46872982", "0.46714625", "0.46508902", "0.4649354", "0.4631042", "0.4615618", "0.459406", "0.45864096", "0.45826766", "0.45756885", "0.45698813", "0.45645043", "0.45455506", "0.4538302", "0.45222938", "0.45182252", "0.45127758", "0.44997236", "0.44989014", "0.44950154", "0.44931602", "0.44903624", "0.44878614", "0.4477965", "0.44757858", "0.4475488", "0.44520438", "0.4446746", "0.44238335", "0.4406634", "0.4379171", "0.43769568", "0.43687743", "0.4368516", "0.43669844", "0.43586352", "0.43512365", "0.43419376", "0.4340841", "0.4334789", "0.433449", "0.43332765", "0.43282673", "0.43275586", "0.43257412", "0.4316409", "0.43017578", "0.4282973", "0.42697826", "0.42697132", "0.4268622", "0.42665327", "0.42636636", "0.42594406", "0.42570403", "0.42546797", "0.4251034", "0.42439473", "0.42437315", "0.42410314", "0.4229274", "0.4228071", "0.42256925", "0.42254627", "0.421333", "0.42097571", "0.42065433", "0.42022085", "0.4201173", "0.41966972", "0.4185715", "0.41831642", "0.4182241", "0.4171735", "0.41657168", "0.4162711", "0.41561818", "0.4149811", "0.4133512", "0.41316944", "0.41308045", "0.4129339", "0.41264543", "0.41134658", "0.41104835", "0.41019" ]
0.69471425
0
/ Balance Check Main checker function Path: Check account balance, decide if there is an opportunity to sell Everytime there is a buy, it recalculates the average price of the buy and when it sells it records profit Store average price at point of buy So there are two files: Average buy price for each item (main.json), and a file for the record of each sell written as one transaction
function balanceCheck ($api, $moduleName, $folioArray, $threshold, $unixTime) { // get trade balance would go here // get current % of each coin and ema or other indicators $filepath = '' . $moduleName . '-main.json'; $main = file_get_contents($filepath); $main = json_decode($main, true); $pairSymbols = array_column($folioArray, 'pairSymbol'); array_pop($pairSymbols); $pairCount = count($folioArray)-1; //last is USD for ($i=0; $i<$pairCount; $i++) { if ($folioArray[$i]['coinSymbol']=='ZUSD') { print ('USD'); } $currentPair = $folioArray[$i]['pairSymbol']; $filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-'; $filepath = 'indic/' . $filename . 'ohlcOld.json'; $ohlcOld = file_get_contents($filepath); $ohlcOld = json_decode($ohlcOld, true); end($ohlcOld); $lastKey = key($ohlcOld); $price[$i] = $ohlcOld[$lastKey]['close']; $priceT[$i] = $ticker[$currentPair]['c'][0]; $currentValue[$i] = $main[$i]['quantity']*$price[$i]; $holdValue[$i] = $main[$i]['startQuantity']*$price[$i]; } $totalValue = array_sum($currentValue); $totalValue += $main[$pairCount]['quantity']; // add USD // Hold value is the value if one only holds from the beginning $holdValue = array_sum($holdValue); $holdValue += $main[$pairCount]['startQuantity']; // add USD $operation = null; // based on deviation from planned % of folio, do stuff for each thing for ($i=0; $i<$pairCount; $i++) { // count($folioArray)-1 since last is USD $filename = $moduleName.'-'.$folioArray[$i]['pairSymbol']. '-'; if ($folioArray[$i]['coinSymbol']=='ZUSD') { print ('squeak'); } if ($folioArray[$i]['coinSymbol']!='ZUSD') { $currentPercent[$i] = round ($currentValue[$i]/$totalValue*100, 3, PHP_ROUND_HALF_UP); $deviation = $currentPercent[$i]-$main[$i]['targetPercent']; //Potential checks if it is worth buying or selling, depending on status of indicators if ($deviation>$threshold) { sellPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i], $unixTime, $threshold); } if ($deviation<-$threshold) { buyPotential ($api, $moduleName, $currentPercent[$i], $folioArray[$i], $totalValue, $priceT[$i]); } $operation[] = $folioArray[$i]['pairSymbol'].' balance checked'; } } $filepath = ''.$moduleName.'-'.'QuickExt.json'; $quickExt = file_get_contents($filepath); $quickExt = json_decode($quickExt, true); $quickExt['tempTotalValue'] = $totalValue; $quickExt['holdValue'] = $holdValue; for ($i=0; $i<=$pairCount; $i++) { // includes USD $quickExt['volChange'][$folioArray[$i]['coinSymbol']] = round($main[$i]['quantity']/$main[$i]['startQuantity']*100, 2, PHP_ROUND_HALF_UP); } file_put_contents($filepath, json_encode($quickExt)); print_r ($operation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function checkBalance();", "function applyWallet($Adv,$amount,$lastrate,$transferAmount){ \r\n\t$wallet = Wallet::get(array(\"id_user\" => $_SESSION[\"gak_id\"]));\r\n\t$totalToman = $amount*$lastrate + $lastrate*$transferAmount;\r\n\tif ($wallet->amount < $totalToman){\r\n\t\t$_SESSION['result']=\" موجودی کیف پول شما از مبلغ درخواست کمتر است. \";\r\n\t\t$_SESSION['alert']=\"warning\";\r\n\t\theader(\"location: /dinero/deal?amount=\".$_GET['amount'].\"&id=\".$_GET['id'].\"&balance=low\");\r\n\t}else{\r\n\t\t//update wallet and add transaction\r\n\t\t//insert\r\n\t\t$insert_wallettransaction=array(\r\n\t\t\t\t\"id_wallet\" => $wallet->id,\r\n\t\t\t\t\"type\" => \"withdraw\",\r\n\t\t\t\t\"amount\" => $totalToman,\r\n\t\t\t\t\"status\" => \"confirm\",\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\")\r\n\t\t);\r\n\t\t$walletTransaction = Wallettransactions::insert($insert_wallettransaction);\r\n\t\t//update\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $wallet->id,\r\n\t\t\t\t\"amount\" => $wallet->amount - $totalToman\r\n\t\t);\r\n\t\tWallet::update($arr_update);\r\n\t\t//log\r\n\t\tAccountkitlog::insert(array(\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"), \"title\" => \"walletWithdraw\"));\r\n\t\t//trade\r\n\t\t\r\n\t\t$arr_insert=array(\r\n\t\t\t\t\"id_buyer\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"id_seller\" => $Adv->id_user,\r\n\t\t\t\t\"id_adv\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $amount,\r\n\t\t\t\t\"exchange_rate\" => $lastrate,\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"trade_status\" => \"buyerpaid\",\r\n\t\t\t\t\"buyerpay_status\" => \"confirm\",\r\n\t\t\t\t\"sellerpay_status\" => \"pending\",\r\n\t\t\t\t\"buyerpay_details\" => \"id:\".$walletTransaction.\"|Payment:Wallet|refID:\".date(\"YmdHis\"),\r\n\t\t\t\t\"sellerpay_details\" => \"\"\r\n\t\t);\r\n\t\t$Trade = Dinerotrade::insert($arr_insert);\r\n\t\t\r\n\t\t//update text transaction wallet\r\n\t\tWallettransactions::update(array(\"id\"=>$walletTransaction, \"text\"=>\"Withdraw from wallet, Trade #\".$Trade*951753 ));\r\n\t\t\r\n\t\t//update adv\r\n\t\t$updateAmount = $Adv->amount - $amount;\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $updateAmount\r\n\t\t);\r\n\t\tDineroadv::update($arr_update);\r\n\t\t\r\n\t\t//user logs\r\n\t\tAccountkitlog::insert(array(\r\n\t\t\t\t\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"title\" => \"tradePaid\"));\r\n\t\t\t\r\n\t\t//send emails and sms\r\n\t\t$checkTrade=Dinerotrade::get(array(\"id\" => $Trade,\"id_buyer\" => $_SESSION[\"gak_id\"]));\r\n\t\t$seller = AccountKit::get(array(\"id\" => $checkTrade->id_seller));\r\n\t\t$buyer = AccountKit::get(array(\"id\" => $checkTrade->id_buyer));\r\n\t\t$sellerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_seller, \"type\" => \"fullname\"));\r\n\t\t$buyerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"fullname\"));\r\n\t\t$buyerBankname= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"bankname\"));\r\n\t\t$buyerIban= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"iban\"));\r\n\t\t$transferAmount = findTransferAmount($checkTrade->amount);\r\n\t\t$token = $GLOBALS['GCMS_SETTING']['dinero']['smstoken'];\r\n\t\t$params = array(\r\n\t\t\t\t'to' => $seller->number,\r\n\t\t\t\t'from' => 'Info',\r\n\t\t\t\t'message' => \"Trade for \".$checkTrade->amount .\"€ \"\r\n\t\t\t\t.\"https://24dinero.com/\"\r\n\t\t\t\t,\r\n\t\t);\r\n\t\t//sms_send($params,$token);\r\n\t\t\r\n\t\t//start send email\r\n\t\t$bodyStatusDineroSeller= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#D84A38;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو، لطفا سریعا اقدام کنید\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoSeller= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your advertisements on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can confirm or cancel the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionSeller= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format(floor($checkTrade->amount*2.5/100)).' <br>\r\n ٪2.5 Commission\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format((floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ (floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t$bodyStatusDineroBuyer= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#016910;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoBuyer= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your trade on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can follow the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionBuyer= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format($transferAmount).' <br>\r\n Transfer Amount\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($transferAmount* $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ $transferAmount* $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t//sendingblue email\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/libs/Mailin.php\");\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/controller/emailTemplate.php\");\r\n\t\t$mailin = new Mailin('https://api.sendinblue.com/v2.0',$GLOBALS['GCMS_SETTING']['dinero']['sendinblueAPIKey']);\r\n\t\t//seller\r\n\t\t$maildata = array( \"to\" => array($seller->email=> $sellerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroSeller,$bodyInfoSeller,$bodyTransactionSeller),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//buyer\r\n\t\t$maildata = array( \"to\" => array($buyer->email=> $buyerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroBuyer,$bodyInfoBuyer,$bodyTransactionBuyer),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//\\\\\\\\\\end send email\r\n\t\t\r\n\t\t$_SESSION['result']=\"پرداخت شما با موفقیت انجام شد\";\r\n\t\t$_SESSION['alert']=\"success\";\r\n\t\theader(\"location: /dinero/trade/\".$Trade);\r\n\t\t\r\n\t}\r\n\t\r\n}", "function usdt_bal()\n{\n try {\n require_once app_path('jsonRPCClient.php');\n $bitcoin_username = owndecrypt(get_wallet_keydetail('USDT', 'XDC_username'));\n $bitcoin_password = owndecrypt(get_wallet_keydetail('USDT', 'XDC_password'));\n $bitcoin_portnumber = owndecrypt(get_wallet_keydetail('USDT', 'portnumber'));\n $bitcoin_host = owndecrypt(get_wallet_keydetail('USDT', 'host'));\n $bitcoin = new jsonRPCClient(\"http://$bitcoin_username:$bitcoin_password@$bitcoin_host:$bitcoin_portnumber/\");\n\n if ($bitcoin) {\n $address_list = $bitcoin->omni_getwalletbalances();\n $bal = 0;\n if ($address_list) {\n foreach ($address_list as $list) {\n if ($list['propertyid'] == 31) {\n $bal = $list['balance'];\n }\n }\n }\n\n return $bal;\n }\n\n } catch (\\Exception $exception) {\n return 0;\n }\n}", "function buyPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price) {\n\t$filename = $moduleName. '-'. $folioEntry['pairSymbol'].'-';\n\n\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n global $exchange;\n $price = getPrice ($api, $exchange, $pairSymbol);\n\n\tif (!isset($price)) {\n\t\tprint ('no price');\n\t}\n\n\n\t// Buy if lower than threshold\n\tif ($currentPercent>1 && $ohlcOld[$lastKey]['close']>$emaSet[$lastKey]['priceEMAMed'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent']-$currentPercent;\n\t\t$dev = round($dev*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy-$toBuy*0.004; // fee and drift\n\t\t$newAveragePrice = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toBuy * $price;\n\t\t$newAveragePrice = $newAveragePrice/($main[$mainEntry]['quantity'] + $toBuy);\n\t\t$newAveragePrice = round($newAveragePrice,5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] +=$toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought');\n\t}\n\n\t// Re-buy if preveiously sold all. Only dumpable ones apply.\n\n\tif ($currentPercent<=1 && $ohlcOld[$lastKey]['close']<$ohlcOld[$lastKey-1]['close'] && $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent'];\n\t\t$dev = $dev*$totalValue/100;\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy- $toBuy*0.004; // fee and drift\n\n\t\t$main[$mainEntry]['quantity'] = $toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $price;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought from zero');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n}", "public function UpdateAccountBalances () \r\n {\r\n $table = \"BALANCE\";\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove old ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"CREATE TEMPORARY TABLE ${table} SELECT ReceiptID AS AccountID, SUM(Total) As Receipts, (0) AS Payments FROM Transaction GROUP BY ReceiptID ORDER BY ReceiptID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"INSERT INTO ${table} SELECT PaymentID AS AccountID, (0) AS Receipts, SUM(Total) AS Payments FROM Transaction GROUP BY PaymentID ORDER BY PaymentID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account SET Receipts=(0.00), Payments=(0.00), Balance=(0.00)\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't clear Account table balances\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Receipts=${table}.Receipts\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Payments=${table}.Payments\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove new ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n return (true);\r\n }", "function validTransferAmount($account,$amount){\r\n\tif($account[0]=='1'){\r\n\t\t$db = new mysqli(\"localhost\",\"root\",\"***\",\"onlinebanking\");\r\n\t\t$amount = $db -> real_escape_string($amount);\r\n\t\t$rChequing = $db -> query(\"SELECT balance FROM chequingaccounts WHERE account_num='$account'\");\r\n\t\t$db -> close();\r\n\r\n\t\t$chequingBalance = $rChequing -> fetch_all(MYSQLI_ASSOC);\r\n\t\tif(empty($chequingBalance)){\r\n\t\t\treturn False;\r\n\t\t}else{\r\n\t\t\tif($chequingBalance[0]['balance']>=$amount){\r\n\t\t\t\treturn True;\r\n\t\t\t}else{\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}elseif($account[0]='2'){\r\n\t\t$db = new mysqli(\"localhost\",\"root\",\"***\",\"onlinebanking\");\r\n\t\t$amount = $db -> real_escape_string($amount);\r\n\t\t$rSavings = $db -> query(\"SELECT balance FROM savingsaccounts WHERE account_num='$account'\");\r\n\t\t$db -> close();\r\n\r\n\t\t$savingsBalance = $rSavings -> fetch_all(MYSQLI_ASSOC);\r\n\t\tif(empty($savingsBalance)){\r\n\t\t\treturn False;\r\n\t\t}else{\r\n\t\t\tif($savingsBalance[0]['balance']>=$amount){\r\n\t\t\t\treturn True;\r\n\t\t\t}else{\r\n\t\t\t\treturn False;\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\treturn False;\r\n\t}\r\n}", "function buyStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qty = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n \n //Check Account Balance to see if the buy is possible\n $accountValue = getCurrentAccountBalance($username);\n \n //$purCost is to store a value in DB, ex: $purCost = API->currentCost;\n $purCost = $currentCost;\n \n //Calculate the total value of your purchase. Cost * Shares\n $totalValue = $purCost * $qty;\n \n if($accountValue >= $totalValue)\n {\n //add this entry into the DB.\n addToPortfolioDB($username,$purCost,$qty,$sym);\n //subtract cost of purchase from Bank Account Balance\n deleteFromAccountBalance($username,$totalValue,$accountValue);\n }\n else\n {\n echo \"NOT ENOUGH FUCKING MONEY\";\n }\n \n \n \n //make a new object to store data to return?\n $returnObj = array(\"TotalValue\"=>$totalValue);\n //example of how to single out a value is Below\n //var_dump($returnObj[\"TotalValue\"]);\n \n //returns an array\n return (json_encode($returnObj));\n //returns an json object\n //return (json_encode($returnObj));\n}", "function sellPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price, $unixTime, $threshold) {\n\t$filename = $moduleName. '-';\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\t$history = file_get_contents($filepath);\n\t$history = json_decode($history, true);\n\n\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\tif (!isset($history)) {\n\t\tprint ('zero history');\n\t}\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n\t// Sell if higher than threshold\n\t// || $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow']\n\n\tif ($folioEntry['dumpable']==0 || $ohlcOld[$lastKey]['close']>=$emaSet[$lastKey]['priceEMASlow']) {\n\t\t$devPercent = $currentPercent - $folioEntry['targetPercent'];\n\t\t$dev = round($devPercent*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t$toSell = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\n\t\t$soldValue = $toSell*$price;\n\t\t$fee = 0.004*$soldValue;\n\t\t$soldValue = $soldValue- $fee; // fee and drift\n\n\t\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t// History Stuff\n\t\t$originalValue = $toSell*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$toSell,\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t// Main Stuff\n\n\t\t$newAveragePrice = round(($main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toSell * $price)/($main[$mainEntry]['quantity'] + $toSell),5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] -=$toSell;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold');\n\t}\n\n\t// Sell all aka dump. Only dumpable ones apply.\n\n\tif ($folioEntry['dumpable']==1 && $ohlcOld[$lastKey]['close']<$emaSet[$lastKey]['priceEMASlow'] && $devPercent>$threshold) {\n\n\t\t$soldValue = $main[$mainEntry]['quantity']*$price;\n\t\t$soldValue -= 0.004*$soldValue; // fee and drift\n\n\t\t$fee = 0.004*$soldValue;\n\n\t\t// History Stuff\n\t\t$originalValue = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$main[$mainEntry]['quantity'],\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t$main[$mainEntry]['quantity'] = 0;\n\t\t$main[$mainEntry]['averageBuyPrice'] = 0;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold (dump)');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\tfile_put_contents($filepath, json_encode($history));\n}", "function balance_the_books($p, $val,$code) {\r\n\t\t\r\n\t\t$p_a = myQuery(\"select account_id from accounts where account_type = 'project' and account_owner_id = $p\");\r\n\t\t$p_a = $p_a['account_id'];\r\n\t\t\r\n\t\t// Project has debts?\r\n\t\t\r\n\t $debits = mysql_query($queros=\"select *,sum(transaction_value) as t from transactions,accounts as ac_d, accounts as ac_c where ac_d.account_owner_id = $p and ac_d.account_type = 'project' and ac_d.account_id = transaction_debtor and ac_c.account_id = transaction_creditor and ac_c.account_type = 'pocket' group by ac_c.account_owner_id\");\r\n\t\t //echo $queros.\"<br />\";\r\n\t\t$credits = mysql_query($queros=\"select *,sum(transaction_value) as t from transactions,accounts as ac_d, accounts as ac_c where ac_c.account_owner_id = $p and ac_c.account_type = 'project' and ac_d.account_id = transaction_debtor and ac_c.account_id = transaction_creditor and ac_d.account_type = 'pocket' group by ac_d.account_owner_id\");\r\n\t\t //echo $queros;\r\n\t\t \r\n\t\t \r\n\t\t while($d = mysql_fetch_assoc($debits)) $book[''.$d['transaction_creditor']] = $d['t'];\t\r\n\t\t while($c = mysql_fetch_assoc($credits)) {\r\n\t\t \tif(isset($book[''.$c['transaction_debtor']]))\t$book[''.$c['transaction_debtor']] -= $c['t'];\r\n\t\t\telse $book[''.$c['transaction_debtor']] = -$c['t'];\r\n\t\t }\r\n\t\t \r\n\t\t print_r($book);\r\n\t\t //return;\r\n\t\t \t\t \r\n\t\t $debt_sum = 0;\r\n\t\t foreach($book as $e) $debt_sum += $e;\r\n\t\t $kickback = 0;\r\n\t\t if($val > $debt_sum) { // If we can actually pay back all our debts, do it\r\n\t\t \t$kickback = $val - $debt_sum;\r\n\t\t \t$val = $debt_sum;\r\n\t\t } \r\n\t\t \r\n\t\t\r\n\t\t \t\t \r\n\t\t foreach($book as $k => $e) {\r\n\t\t \t\t// Pay back the individual players\r\n\t\t \t\t\r\n\t\t \t\t$payback = ($e / $debt_sum)*$val; // pay back the correct fraction of the income\r\n\t\t \t\tif(round($payback,2) == 0) continue; // if that fraction is zero, done\r\n\t\t \t\t\r\n\t\t \t\t$code = md5($code);\r\n\t\t\t\t$note = \"project paying off debts owed to members\";\t\t \t\t\r\n\t\t \t\t//\tSend money from the project account into the user account\r\n\t\t \t\tmysql_query (\"insert into transactions (transaction_debtor,transaction_creditor,transaction_note,transaction_value,transaction_code) \r\n\t\t \t\t\t\t\t\t\tvalues ($k,$p_a,'$note',$payback,'$code')\") or die(mysql_error());\r\n\t\t \t\t\r\n\t\t }\r\n\r\n\t\tif($kickback != 0) {\r\n\t\t\t\t\r\n\t\t\t$shareholders = mysql_query(\"select * from accounts where account_type = 'shareholder'\");\r\n\t\t\t\r\n\t\t\t$kickback = $kickback / mysql_num_rows($shareholders);\r\n\t\t\t\r\n\t\t\twhile($s = mysql_fetch_assoc($shareholders)) {\r\n\t\t\t\t$u_a = $s['account_id'];\r\n\t\t\t \t$code = md5($code);\r\n\t\t\t\r\n\t\t\t \t$note = 'project generated extra money, have some kickback';\r\n\t\t\t\tmysql_query (\"insert into transactions (transaction_debtor, transaction_creditor, transaction_note, transaction_value, transaction_code) \r\n\t\t\t\t\t\tvalues ($u_a, $p_a, '$note',$kickback,'$code')\") or die(mysql_error());\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}", "function balance($wallet_id = null) {\n\t\tif(empty($wallet_id)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/balance';\n\t\t\t$json = file_get_contents($url);\n\t\t\t$data = json_decode($json);\n\t\t\tif(!$data->successful) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn $data->balance;\n\t\t\t}\n\t\t}\n\t}", "function checkPairing($user_id, $user_name, $pkg_id, $trans_datetime, $trans_date, $auto_flush)\n{\n\t//$max_daily_point = 100;\n \t$sql = \"SELECT max_daily_point\n FROM product_package\n WHERE pkg_id = $pkg_id\n\t\t limit 1\n \";\n \t$resultPkg=dbQuery($sql);\n\t$row=dbFetchAssoc($resultPkg);\t\n\t$max_daily_point = $row['max_daily_point'];\n\t\n\t$checkPoint = checkPoint($user_id);\n\t$balance_left_point = $checkPoint['balance_left_point'];\n\t$balance_right_point = $checkPoint['balance_right_point'];\n\t\n\tif($balance_left_point > 0 and $balance_right_point > 0)\n\t{\n\t\n\t\tif($balance_left_point > $balance_right_point)\n\t\t{\n\t\t\t$pair_point = $balance_right_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pair_point = $balance_left_point;\n\t\t}\n\t\t\n\t\t$actual_pair_point = $pair_point;\n\t\n\t\t$total_daily_pair_point = checkDailyPairPoint($user_id, $trans_date);\n\t\t$balance_max_daily_point = $max_daily_point - $total_daily_pair_point;\n\t\t\n\t\tif($balance_max_daily_point >= $pair_point)\n\t\t{\n\t\t\t$total_pair_point = $pair_point;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$total_pair_point = $balance_max_daily_point;\n\t\t}\n\t\t\n\t\tif($total_pair_point > 0 and $max_daily_point > $total_daily_pair_point and $auto_flush ==0)\n\t\t{\n\t\t\t\t\t\t\t\t\n\t\t\t\t$total_bonus = $total_pair_point * 15;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date,pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tcreated_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$total_pair_point', '$total_bonus', \n\t\t\t\t\t\t$_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$bonus_description = 'Pairing Bonus';\n\t\t\t\t$pair_bonus = $total_bonus;\n\t\t\t\t\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, $pair_bonus, 0, $user_name, $trans_datetime);\n\t\t\t\t\n\t\t\t\t$bonus_description = '10% into M-Wallet';\n\t\t\t\t$pair_bonus_deduct = 0.1 * $total_bonus;\n\t\t\t\twallet('acct_ewallet', 3, $user_id, $bonus_description, 0, $pair_bonus_deduct, $user_name, $trans_datetime);\n\t\t\t\twallet('acct_mwallet', 4, $user_id, $bonus_description, $pair_bonus_deduct, 0, $user_name, $trans_datetime);\t\t\n\t\t\n\t\t}\n\t\telse // Flush\n\t\t{\n\t\t\t\t$total_bonus = 0;\n\t\t\t\t\n\t\t\t\t$sql = \"INSERT INTO acct_point_pairing(pairing_date, pairing_datetime, user_id,user_name, pair_point, total_bonus,\n\t\t\t\t\t\tflush_sw, created_by, created_date)\n\t\t\t\t\t\tVALUES('$trans_date', '$trans_datetime', '$user_id','$user_name','$actual_pair_point', '$total_bonus', \n\t\t\t\t\t\t1, $_SESSION[user_id], NOW())\n\t\t\t\t\t\t\";\n\t\t\t\tdbQuery($sql);\n\t\t\t\t$pairing_id = mysql_insert_id();\n\t\t}\t\t\n\t}\n\t\n\n\t\n\n}", "public function balance () {\n\t\t\t// get the response from the api server in json format\n\t\t\t$response = $this->request();\n\t\t\tif ($response->status == 1 || $response->remarks == 'success') {\n\t\t\t\treturn $response->balance;\n\t\t\t}\n\t\t\t$this->error = $response->remarks;\n\t\t\t\n\t\t\treturn 0;\n\t\t}", "function saveTransaction($fname, $lname, $email, $address1, $address2, $city, \n $state, $postalcode, $tendertype, $cart)\n{\n // test\n //echo \"saving transaction...\";\n \n $valid = true;\n \n // calculate totals\n global $taxRate;\n global $shippingFlatRate;\n \n $totalBase = 0;\n $totalSale = 0;\n $calcTax = 0;\n $calcShipping = 0;\n $calcTotal = 0;\n \n // loop through the cart and create the totals\n foreach ($cart as $item)\n {\n // grab the data from the array\n //$id = $item['id'];\n $totalBase += ($item['basePrice'] * $item['quantity']);\n $totalSale += ($item['salePrice'] * $item['quantity']);\n }\n \n //$totalSale = number_format($totalSale,2);\n //$totalBase = number_format($totalBase,2);\n \n $calcTax = number_format($totalSale * $taxRate, 2);\n \n $calcShipping = number_format($totalSale * $shippingFlatRate, 2);\n \n // total - sale + tax + shipping\n $calcTotal = ($totalSale + $calcTax + $calcShipping);\n\n // testing\n //echo 'Starting customer data .. \\n';\n\n // save the customer info \n $customerId = saveCustomer($fname, $lname, $email, $address1, $address2, $city, $state, $postalcode);\n \n //echo 'Customer ID = ' . $customerId . '\\n';\n \n // save the transaction (req's customer id)\n $transId = createTransaction($customerId, $tendertype, $totalSale, \n $totalBase, $calcTax, $calcShipping, $calcTotal);\n \n //echo 'Transaction ID = ' . $transId . '\\n';\n \n // save the lineitems (req's txn id)\n createLineItems($customerId, $transId, $cart);\n \n //echo 'LineItems created...\\n';\n \n return $valid;\n}", "public function index()\n {\n $user = Auth::user();\n $depositPoint = DB::table('deposits')->where('user_id', $user->id)->sum('deposit_club_point');\n\n if($depositPoint >= 10000){\n\n if(!$user->is_merchant == 1){\n\n //for normal customer\n $user->balance = $user->balance + ($depositPoint * (1/10000));\n $user->update();\n\n $wallet = new Wallet;\n $wallet->user_id = $user->id;\n $wallet->amount = $depositPoint * (1/10000);\n $wallet->payment_method = 'Club Point Convert';\n $wallet->payment_details = 'Club Point Convert';\n $wallet->approval = 1;\n $wallet->save();\n\n $convertpoint = new Deposit;\n $convertpoint->user_id = $user->id;\n $convertpoint->deposit_club_point = $depositPoint * (-1);\n if( $convertpoint->save() ){\n flash('Your points successfully Converted into BDH')->success();\n return redirect()->back();\n }\n } else {\n\n //for Merchent\n $convertpoint = new Deposit;\n $convertpoint->user_id = $user->id;\n $convertpoint->deposit_amount = $depositPoint * (1/10000);\n $convertpoint->deposit_club_point = $depositPoint * (-1);\n if( $convertpoint->save() ){\n flash('Your points successfully Converted into BDH')->success();\n return redirect()->back();\n }\n }\n }\n flash('You can Convert your point after earn 10,000 points')->error();\n return redirect()->back();\n }", "public function handle()\n {\n $deposits = Deposit::where(['active' => 1])->get();\n\n foreach ($deposits as $deposit) {\n\n $percent = ($deposit['invested'] * $deposit['percent']) / 100;\n $total = $deposit['invested'] + $percent;\n $accrueTimes = $deposit['accrue_times'];\n $accrueTimes++;\n $transaction = new Transaction;\n\n if($deposit['accrue_times'] + 1 < $deposit['duration']) {\n\n DB::transaction(function () use ($percent, $accrueTimes, $deposit, $total, $transaction) {\n\n try {\n $deposit->update([\n 'invested' => $total,\n 'accrue_times' => $accrueTimes\n ]);\n\n $transaction::create([\n 'user_id' => $deposit['user_id'],\n 'wallet_id' => $deposit['wallet_id'],\n 'deposit_id' => $deposit['id'],\n 'type' => 'accrue',\n 'amount' => $percent,\n ]);\n\n $this->info('Successfully accrued interest on the deposit id: ' . $deposit['id']);\n\n } catch (\\Exception $e) {\n return $e;\n }\n\n });\n\n } else {\n\n DB::transaction(function () use ($percent, $accrueTimes, $deposit, $total, $transaction) {\n\n try {\n $deposit->update([\n 'invested' => $total,\n 'accrue_times' => $accrueTimes,\n 'active' => 0\n ]);\n\n $transaction::create([\n 'user_id' => $deposit['user_id'],\n 'wallet_id' => $deposit['wallet_id'],\n 'deposit_id' => $deposit['id'],\n 'type' => 'accrue',\n 'amount' => $percent,\n ]);\n\n $transaction::create([\n 'user_id' => $deposit['user_id'],\n 'wallet_id' => $deposit['wallet_id'],\n 'deposit_id' => $deposit['id'],\n 'type' => 'close_deposit',\n 'amount' => $total,\n ]);\n\n $this->info('Successfully accrued interest on the deposit id: ' . $deposit['id'] . ' Deposit close.');\n\n } catch (\\Exception $e) {\n return $e;\n }\n\n });\n }\n }\n $this->info('Cron ended a job.');\n }", "public function withdrawImpl($db, $amount){\n $stmt = $db->query(\"SELECT balance FROM account where id = \".$this->id);\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $balance = $row['balance'];\n $need = $amount - $balance;\n if($need > 0){\n // Get all the other accounts that are owned by the owners of this\n // account\n $sql = \"SELECT DISTINCT(account_id) FROM account JOIN account_owner ON account_id = account_owner.account_id WHERE id <> $id AND (\";\n $first = true;\n foreach($this->getOwners() as $owner){\n if(!$first){\n $ccl.=\" OR \";\n }\n $first = false;\n $ccl .= \"owner = \".$owner->getId();\n }\n $ccl .= \")\";\n $stmt = $db->query($sql);\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach($results as $row){\n if($need <= 0){\n break;\n }\n $toTransfer = $otherBalance > $need ? $need : $otherBalance;\n if($toTransfer > 0 ){\n $other = $row['account_id'];\n $stmt = $db->query(\"SELECT balance FROM account WHERE id = $other\");\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $otherBalance = $row['balance'];\n $otherBalance -= $toTransfer;\n $balance += $toTransfer;\n $db->exec(\"UPDATE account SET balance = $otherBalance WHERE id = $other\");\n $db->exec(\"UPDATE account SET balance = $balance WHERE id = \".$this->id);\n $db->exec(\"INSERT INTO account_charge (account_id, charge) VALUES ($other, \\\"transfer $toTransfer to account \".$this->id.\"\\\")\");\n $need -= $toTransfer;\n }\n }\n if($need > 0){\n return false;\n }\n }\n $db->exec(\"UPDATE account set balance = \".$balance - $amount.\" WHERE id = \".$this->id);\n return true;\n }", "public function testActiveAccountPayoutWithHugeBalance()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '10000'\n ]);\n\n $activeAccounts = factory(ActiveAccount::class, 3)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE\n ]);\n\n $activeAccount = factory(ActiveAccount::class)->create([\n 'balance' => '10000000' * StellarAmount::STROOP_SCALE\n ]);\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $payoutAmount = $this->payoutService->calculateActiveAccountPayoutAmount($activeAccount);\n // problem with rounding up \n// $this->assertEquals(49985004398.650406, $payoutAmount);\n $this->assertEquals(49985004398.65040487853643906828, $payoutAmount);\n }", "public function userConsolidatedBalances($userid){\n\n //recalculate loan Balances\n $consolidatedLoanDeductions = Userconsolidatedloan::\n where('user_id',$userid)\n ->orderBy('date_entry', 'asc')\n ->orderBy('entry_time', 'asc')\n ->get();\n\n //loop to update balances to zero\n foreach($consolidatedLoanDeductions as $item){\n $deductItem = Userconsolidatedloan::find($item->id);\n $deductItem->balance = 0.0;\n $deductItem->save();\n }\n\n //loop to update actual Balances\n foreach($consolidatedLoanDeductions as $item){\n\n //1. select all records based on that date\n $loanDeductionsByDate = $consolidatedLoanDeductions\n ->where('date_entry','=',$item->date_entry)\n ->sortBy('id');\n\n //2. check if there is more than 1 records\n if($loanDeductionsByDate->count() > 1){\n //find all deductions less than this date\n $loanDeductionsLessDate = $consolidatedLoanDeductions\n ->where('date_entry','<',$item->date_entry)\n ->sortBy('date_entry');\n //find the total balance\n $credit = $loanDeductionsLessDate->sum('credit');\n $debit = $loanDeductionsLessDate->sum('debit');\n $lessDateBalance = $debit - $credit;\n\n //enter foreach loop\n foreach($loanDeductionsByDate as $deduction){\n $loanDeductionsByDateFilter = $loanDeductionsByDate->where('id','<',$deduction->id);\n\n $credit = $loanDeductionsByDateFilter->sum('credit');\n $debit = $loanDeductionsByDateFilter->sum('debit');\n $filterDateBalance = $debit - $credit;\n //add filter date balance with less balance and update new balance for that row\n\n //find individual row\n $deductItem = Userconsolidatedloan::find($deduction->id);\n $credit = $deductItem->credit;\n $debit = $deductItem->debit;\n $diffBal = $debit - $credit;\n $deductItem->balance = $lessDateBalance + $filterDateBalance + $diffBal;\n $deductItem->save();\n }\n\n }\n else\n {\n\n //total loan Balances\n $loanBalances = $this->initialConsolidatedLoanBalances($item->user_id,$item->date_entry);\n\n //find individual row\n $deductItem = Userconsolidatedloan::find($item->id);\n $credit = $deductItem->credit;\n $debit = $deductItem->debit;\n $myBal = $debit-$credit;\n $deductItem->balance = $loanBalances + $myBal;\n $deductItem->save();\n }\n\n }\n\n }", "public function bookCreditBalance($relatedDocNo, $gsaUid, $amount) {\n trace('[METHOD] '.__METHOD__);\n \n $gsaAccTransAccessorObj = tx_ptgsaaccounting_gsaTransactionAccessor::getInstance();\n $gsaShopTransAccessorObj = tx_ptgsashop_gsaTransactionAccessor::getInstance();\n $freeCreditArr = $gsaAccTransAccessorObj->selectFreeCredits($gsaUid);\n $amountResidual = $amount;\n foreach ($freeCreditArr as $key=>$creditDocNo) {\n \n \n $freeCredit = $gsaShopTransAccessorObj->selectTransactionDocumentData($creditDocNo);\n $freeCreditUpdate = array();\n $credit = bcsub($freeCredit['ENDPRB'],$freeCredit['GUTSCHRIFTZAHLUNG'],$this->precision);\n if (bcsub($credit,$amountResidual,$this->precision) > 0) {\n $freeCreditUpdate['GUTSCHRIFTZAHLUNG'] = bcadd($amountResidual,$freeCredit['GUTSCHRIFTZAHLUNG'] ,$this->precision);\n $amountResidual = 0; \n } else {\n $amountResidual = bcsub($amountResidual,$credit,$this->precision); \n $freeCreditUpdate['GUTSCHRIFTZAHLUNG'] = bcadd($credit,$freeCredit['GUTSCHRIFTZAHLUNG'] ,$this->precision);\n }\n $freeCreditUpdate['LETZTERUSER'] = 'Online-Shop selected by Customer'; // data type: varchar(30)\n $freeCreditUpdate['LETZTERUSERDATE'] = date('Y-m-d H:i:s');\n \n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $gsaShopTransAccessorObj->updateTransactionDocument($freeCredit['AUFNR'], $freeCreditUpdate);\n } \n if ($amountResidual <= 0) {\n break;\n }\n \n } \n\n if ($amountResidual > 0) {\n $this->bookPayment($relatedDocNo, bcsub($amount, $amountResidual,$this->precision), 0, false, date('Y-m-d'), $additionalNote='Online-Shop '.$gsaUid, $amount);\n //throw new tx_pttools_exception('There is not enough free credit for this customer', 3);\n } else {\n $this->bookPayment($relatedDocNo, $amount, 0, false, date('Y-m-d'), $additionalNote='Online-Shop Customer:'.$gsaUid, $amount);\n }\n // get related customer object, set booking data\n $customerObj = new tx_ptgsauserreg_customer($gsaUid);\n $bookingDate = date('Y-m-d');\n \n // update the related customer's transaction volume (\"Umsatz\"): ADRESSE.KUMSATZ, KUNDE.UMSATZ, KUNDE.SALDO, KUNDE.LETZTERUMSATZ\n if (self::TEST_MODE == false) {\n // write record if not TEST_MODE\n $customerObj->registerTransactionVolume(0); // saldo and umsatz doesn't change\n }\n }", "public function testCorrectCanBuyWithEqualMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(100);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function redeemAction(){\n $txtRedeemPoints = $_POST['txtRedeemPoints'];\n $quoteData = Mage::getSingleton('checkout/session')->getQuote();\n \n $CartContentsTotal = $quoteData['subtotal'];\n $CartTotal = $quoteData['grand_total'];\n \n if(!empty($txtRedeemPoints)){\n $LB_Session = $_SESSION['LB_Session'];\n if (!empty($LB_Session)) {\n // confirm loyalty points available or not and update to session if available.\n $CardOrPhoneNumber = $LB_Session['Phone Number'];\n $CardPoints = Lb_Points_Helper_Data::getCardPoints($CardOrPhoneNumber);\n $InquiryResult = $CardPoints->InquiryResult;\n $balances = $InquiryResult->balances;\n $Balance = $balances->balance;\n foreach ($Balance as $balValue) {\n if ($balValue->valueCode == 'Discount') {\n $_SESSION['LB_Session']['lb_discount'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_discount_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_discount_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'Points') {\n $_SESSION['LB_Session']['lb_points'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_points_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_points_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'ZAR') {\n $_SESSION['LB_Session']['lb_zar'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_zar_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_zar_exchangeRate'] = $balValue->exchangeRate;\n }\n }\n Lb_Points_Helper_Data::debug_log(\"LB API called : Inquiry to check Points Balance\", true);\n \n $totalRedeemPoints = 0;\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $totalRedeemPoints = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n }\n \n if($totalRedeemPoints == 0){\n $totalRedeemPoints = $txtRedeemPoints;\n }\n \n if ($txtRedeemPoints > 0 && $totalRedeemPoints <= $CartTotal && is_numeric($txtRedeemPoints)) {\n \n if ($_SESSION['LB_Session']['lb_points'] >= $totalRedeemPoints) {\n //self::generate_discount_coupon($txtRedeemPoints, 'fixed_cart', 'REDEEM');\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $_SESSION['LB_Session']['totalRedeemPoints'] = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n else\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n else\n {\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n $message = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and applied discount to your cart.\";\n $messageJson = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and discount is being applied to your cart.\";\n Mage::getSingleton('core/session')->addSuccess($message);\n echo json_encode(array('status' => 1, 'message' => $messageJson));\n }else {\n echo json_encode(array('status' => 0, 'message' => \"You don't have sufficient Loyalty Points to redeem.\"));\n }\n } else {\n echo json_encode(array('status' => 0, 'message' => \"Please enter valid Loyalty Points.\"));\n }\n }\n else\n echo json_encode(array('status' => 0, 'message' => Lb_Points_Helper_Data::$rewardProgrammeName.\" session expired.\"));\n }\n else\n echo json_encode(array('status' => 0, 'message' => \"Please enter loyalty points.\"));\n die;\n }", "public function perform()\n {\n $typeIDs = $this->args[\"typeIDs\"];\n\n // Get all the data from EVE Central\n $pricingData = $this->app->EveCentral->getPrices($typeIDs);\n\n // Loop through all the typeID\n foreach ($pricingData as $typeID => $data) {\n $avgSell = 0;\n $lowSell = 0;\n $highSell = 0;\n $avgBuy = 0;\n $lowBuy = 0;\n $highBuy = 0;\n\n switch ($typeID) {\n // Customs Office\n case 2233:\n // Fetch the price for gantry, nodes, modules, mainframes, cores and sum it up, that's the price for a customs office\n $gantry = $this->app->EveCentral->getPrice(3962)[\"sell\"][\"min\"];\n $nodes = $this->app->EveCentral->getPrice(2867)[\"sell\"][\"min\"];\n $modules = $this->app->EveCentral->getPrice(2871)[\"sell\"][\"min\"];\n $mainframes = $this->app->EveCentral->getPrice(2876)[\"sell\"][\"min\"];\n $cores = $this->app->EveCentral->getPrice(2872)[\"sell\"][\"min\"];\n $avgSell = $gantry + (($nodes + $modules + $mainframes + $cores) * 8);\n break;\n\n // Motherships\n case 3628:\n case 22852:\n case 23913:\n case 23917:\n case 23919:\n $avgSell = 20000000000; // 20b\n break;\n\n // Revenant\n case 3514:\n $avgSell = 100000000000; // 100b\n break;\n\n // Titans\n case 671:\n case 3764:\n case 11567:\n case 23773:\n $avgSell = 100000000000; // 100b\n break;\n\n // Turney frigs\n case 2834:\n case 3516:\n case 11375:\n $avgSell = 80000000000; // 80b\n break;\n\n // Chremoas\n case 33397:\n $avgSell = 120000000000; // 120b\n break;\n // Cambion\n case 32788:\n $avgSell = 100000000000; // 100b\n break;\n\n // Adrestia\n case 2836:\n $avgSell = 150000000000; // 150b\n break;\n // Vangel\n case 3518:\n $avgSell = 90000000000; // 90b\n break;\n // Etana\n case 32790:\n $avgSell = 100000000000; // 100b\n break;\n // Moracha\n case 33395:\n $avgSell = 125000000000; // 125b\n break;\n // Mimir\n case 32209:\n $avgSell = 100000000000; // 100b\n break;\n\n // Chameleon\n case 33675:\n $avgSell = 120000000000; // 120b\n break;\n // Whiptail\n case 33673:\n $avgSell = 100000000000; // 100b\n break;\n\n // Polaris\n case 9860:\n $avgSell = 1000000000000; // 1t\n break;\n // Cockroach\n case 11019:\n $avgSell = 1000000000000; // 1t\n break;\n\n // Gold Magnate\n case 11940:\n // Silver Magnate\n case 11942:\n // Opux Luxury Yacht\n case 635:\n // Guardian-Vexor\n case 11011:\n // Opux Dragoon Yacht\n $avgSell = 500000000000; // 500b\n break;\n\n // Megathron Federate Issue\n case 13202:\n // Raven State Issue\n case 26840:\n // Apocalypse Imperial Issue\n case 11936:\n // Armageddon Imperial Issue\n case 11938:\n // Tempest Imperial Issue\n case 26842:\n $avgSell = 750000000000; // 750b\n break;\n\n // Fallthrough\n default:\n $avgSell = $data[\"sell\"][\"avg\"];\n $lowSell = $data[\"sell\"][\"min\"];\n $highSell = $data[\"sell\"][\"max\"];\n $avgBuy = $data[\"buy\"][\"avg\"];\n $lowBuy = $data[\"buy\"][\"min\"];\n $highBuy = $data[\"buy\"][\"max\"];\n\n // If the selling price is under 0.05% different from the buying price then we swap them..\n if ($highBuy > 0 && $lowSell > 0) {\n if ((($highBuy / $lowSell) * 100) < 0.05) {\n // Make sure it has no chance of being duplicated\n $duplicationChance = $this->app->Db->queryField(\"SELECT chanceOfDuplicating FROM invTypes WHERE typeID = :typeID\", \"chanceOfDuplicating\", array(\":typeID\" => $typeID));\n if ($duplicationChance == 0) {\n $avgSell = $data[\"buy\"][\"avg\"];\n $lowSell = $data[\"buy\"][\"min\"];\n $highSell = $data[\"buy\"][\"max\"];\n $avgBuy = $data[\"buy\"][\"avg\"];\n $lowBuy = $data[\"buy\"][\"min\"];\n $highBuy = $data[\"buy\"][\"max\"];\n }\n }\n }\n break;\n }\n\n $date = $data[\"date\"];\n\n // a fallthrough for pre-defined prices\n if ($lowSell == 0) $lowSell = $avgSell;\n\n if ($highSell == 0) $highSell = $avgSell;\n\n // Now we just insert it all and call it a day\n $this->app->Db->execute(\"INSERT INTO invPrices (typeID, avgSell, lowSell, highSell, avgBuy, lowBuy, highBuy) VALUES (:typeID, :avgSell, :lowSell, :highSell, :avgBuy, :lowBuy, :highBuy) ON DUPLICATE KEY UPDATE avgSell = :avgSell, lowSell = :lowSell, highSell = :highSell, avgBuy = :avgBuy, lowBuy = :lowBuy, highBuy = :highBuy\", array(\n \":typeID\" => $typeID,\n \":avgSell\" => $avgSell,\n \":lowSell\" => $lowSell,\n \":highSell\" => $highSell,\n \":avgBuy\" => $avgBuy,\n \":lowBuy\" => $lowBuy,\n \":highBuy\" => $highBuy,\n ));\n\n $this->app->StatsD->increment(\"ecPriceUpdates\");\n }\n }", "function calculate1($mode,$itemcode,$adate,$warehouse)\n{\n include \"config.php\";\n\t\t if($_SESSION['db'] == \"golden\")\n\t\t {\n\t\t $query9 = \"SELECT iac FROM ims_itemcodes WHERE code = '$code'\";\n $result9 = mysql_query($query9,$conn);\n while($row = mysql_fetch_assoc($result9))\n\t\t\t$iac = $row['iac'];\n\n\t\t\t$query = \"SELECT round((amount/quantity),2) AS price FROM ac_financialpostings WHERE date <= '$adate' AND itemcode = '$itemcode' AND coacode = '$iac' AND crdr = 'Dr' ORDER BY date DESC,id DESC LIMIT 1\";\n\t\t\t$result = mysql_query($query,$conn) or die(mysql_error());\n\t\t\t$rows = mysql_fetch_assoc($result);\n\t\t\t$amount = $rows['price'];\n\t\t\t//echo \"$code/$amount<br>\";\n\t\t\treturn $amount;\n\t\t }\n \n if ( $mode == \"Weighted Average\")\n { $wtqty = 0; \n $wtval = 0;\n\t $rtqty = 0;\n\t $rtval = 0;\n\t $cnt = 0;\n\t // Goods Receipt\n $query2 = \"SELECT * FROM pp_goodsreceipt WHERE code = '$itemcode' and aflag = '1' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn1);\n\t$cnt1 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['receivedquantity']; \n\t $wtval = $wtval + $row2['totalamount']; \n }\n\t //Initial Stock\n\t$query2 = \"SELECT * FROM ims_initialstock WHERE itemcode = '$itemcode' AND warehouse = '$warehouse'\";\n $result2 = mysql_query($query2,$conn1);\n\t$cnt2 = mysql_num_rows($result2); \n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['quantity']; \n\t $wtval = $wtval + $row2['amount']; \n } \n\t //Direct Purchase\n\t $query2 = \"SELECT * FROM pp_sobi WHERE code = '$itemcode' and dflag = 0 and flag = 1 and warehouse = '$warehouse' and adate <= '$adate' \";\n $result2 = mysql_query($query2,$conn1);\n\t $cnt3 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['receivedquantity']; \n\t $wtval = $wtval + ($row2['receivedquantity'] * $row2['rateperunit']); \n }\n\t \n\t //Production\n\t \n\t $query2 = \"SELECT * FROM breeder_production WHERE itemcode = '$itemcode' and date1 <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt4 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $wtqty = $wtqty + $row2['quantity'];\n\t $query21 = \"select * from ac_financialpostings where itemcode = '$itemcode' and trnum = '$row2[flock]' and type = 'Production' and date = '$row2[date1]'\";\n $result21 = mysql_query($query21,$conn);\n\t while($row21 = mysql_fetch_assoc($result21))\n { \n\t\t $wtval = $wtval + $row21['amount']; \n\t\t }\n\t\t\n }\n\t //PackSlip\n\t /* $query2 = \"SELECT * FROM oc_packslip WHERE itemcode = '$itemcode' and flag = '1' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt5 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rtqty = $rtqty + $row2['quantity'];\n\t\t $rtval = $rtval + round(($row2['prodprice'] * $row2['quantity']),2); \n } */\n\t //Direct Sales\n\t //Direct Purchase\n\t $query2 = \"SELECT * FROM oc_cobi WHERE code = '$itemcode' and dflag = 0 and warehosue = '$warehouse' and flag = 1 and adate <= '$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt6 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['quantity']; \n\t $wtval = $wtval + ($row2['quantity'] * $row2['price']); \n }\n\t \n\t //Consumption\n\t /* $query2 = \"SELECT * FROM breeder_consumption WHERE itemcode = '$itemcode' and date2 <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt7 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rtqty = $rtqty + $row2['quantity'];\n\t\t $query21 = \"select * from ac_financialpostings where itemcode = '$itemcode' and trnum = '$row2[flock]' and type = 'Consumption' and date = '$row2[date2]' group by trnum \";\n $result21 = mysql_query($query21,$conn);\n\t while($row21 = mysql_fetch_assoc($result21))\n { \n\t\t $rtval = $rtval + $row21['amount']; \n\t\t }\n\t\t\n } */\n\t \n\t if ( $cnt == 0 AND $cnt1 == 0 AND $cnt2 == 0 AND $cnt3 == 0 AND $cnt4 == 0 AND $cnt5 == 0 AND $cnt6 == 0 AND $cnt7 == 0)\n\t {\n\t $val = $row1['stdcost'];\n\t }\n\t else\n\t { \n\t $wtqty = $wtqty;\n\t $wtval = $wtval;\n\t $val = round(($wtval/$wtqty),4);\n\t }\t \n }\n\n\n\n\n if ( $mode == \"Fifo\" )\n {\n $totqty = 0;\n $query2 = \"SELECT sum(quantity) as totqty FROM oc_packslip WHERE itemcode = '$itemcode' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t while($row2 = mysql_fetch_assoc($result2))\n {\n\t $totqty = $row2['totqty'];\n\t }\n\t \n\t $purqty = 0;\n\t $bal = 0;\n\t $fifoval = 0;\n\t $pkqty = $row1['quantity'];\n $dumqty = $pkqty;\n\t $query2 = \"SELECT * FROM pp_goodsreceipt WHERE code = '$itemcode' and adate <='$adate' order by adate \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t if ( $dumqty > 0)\n\t\t{\n\t\t if ( $totqty > $purqty )\n\t\t {\n\t\t $purqty = $purqty + $row2['receivedquantity'];\n\t\t\t if ( $purqty > $totqty )\n\t\t\t {\n\t\t\t $bal = $purqty - $totqty;\n\t\t\t\t if ( bal > $pkqty )\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t\t\t$dumqty = 0;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t\t $dumqty = $pkqty - $bal;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t if ($row2['receivedquantity'] > $dumqty )\n\t\t\t{\n\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t $dumqty = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t $dumqty = $dumqty - $row2['receivedquantity'];\n\t\t\t}\t\t \n\t\t }\n\t\t}\n\t \n\t }\n\t if ( $cnt == 0)\n\t {\n\t $val = $row1['stdcost'];\n\t }\n\t else\n\t {\n\t $val = round(($fifoval/$pkqty),4);\n\t }\n\t \n }\n if ( $mode == \"Lifo\")\n {\n $totqty = 0;\n $query2 = \"SELECT sum(quantity) as totqty FROM oc_packslip WHERE itemcode = '$itemcode' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t while($row2 = mysql_fetch_assoc($result2))\n {\n\t $totqty = $row2['totqty'];\n\t }\n\t \n\t $purqty = 0;\n\t $bal = 0;\n\t $fifoval = 0;\n\t $pkqty = $row1['quantity'];\n $dumqty = $pkqty;\n\t $query2 = \"SELECT * FROM pp_goodsreceipt WHERE code = '$itemcode' and adate <='$adate' order by adate DESC \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t if ( $dumqty > 0)\n\t\t{\n\t\t if ( $totqty > $purqty )\n\t\t {\n\t\t $purqty = $purqty + $row2['receivedquantity'];\n\t\t\t if ( $purqty > $totqty )\n\t\t\t {\n\t\t\t $bal = $purqty - $totqty;\n\t\t\t\t if ( bal > $pkqty )\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t\t\t$dumqty = 0;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t\t $dumqty = $pkqty - $bal;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t if ($row2['receivedquantity'] > $dumqty )\n\t\t\t{\n\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t $dumqty = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t $dumqty = $dumqty - $row2['receivedquantity'];\n\t\t\t}\t\t \n\t\t }\n\t\t}\n\t \n\t }\n\t if ( $cnt == 0)\n\t {\n\t $val = $row1['stdcost'];\n\t }\n\t else\n\t {\n\t $val = round(($fifoval/$pkqty),4);\n\t }\n \n }\nreturn $val;\n}", "public function run(): BigDecimal\n {\n $taxRates = TaxRates::readFromFile(__DIR__ . '/../accounts.tsv');\n\n $reader = new BookEntryReader($this->filename);\n $revenueParser = new RevenueParser($reader, $taxRates);\n\n $generator = new Generator($taxRates);\n if ($this->quarter !== null)\n $generator->setRevenueFilter(new QuarterRevenueFilter($this->quarter));\n $taxLines = $generator->generate($revenueParser);\n\n $this->write($taxLines);\n\n return array_reduce($taxLines, function (BigDecimal $sum, TaxLine $taxLine) {\n return $sum->plus($taxLine->getTaxAmount());\n }, BigDecimal::zero());\n }", "public function checkBalance()\n {\n if ($this->_client) {\n $balance = $this->_client->checkBalance();\n\n if ($balance['balance'] <= env('SMS_CREDIT_THRESHOLD')) {\n // Send warning email\n $subject = 'SMS service balance running low';\n $vars = ['balance'=>$balance];\n \\Mail::send(['text'=>'errors.sms_balance'], $vars, function($message) use ($subject)\n {\n $message->to(env('DEVELOPER_EMAIL'))->subject($subject);\n });\n }\n }\n }", "public function withdrawRequestProcess($balanceType, $requestAmount, $account)\n{\n\t// return $balanceType;\n\t$availableBalance = Account::where('user_id', Auth::id())->first();\n\t$wbBalance = $availableBalance->balance - ( $requestAmount * .05 ); // Balance after deduct charge 5% of withdrawal request amount\n\t$roiBalance = $availableBalance->roi_balance - ( $requestAmount * .05 );\n\t$deductBalance = ( $requestAmount + $requestAmount * .05 );\n\n\t\t\n\n\n\t\tif( $balanceType == 1 )\n\t\t{\n\t\t\tif( $requestAmount > $wbBalance )\n\t\t\t\t{\n\t\t\t\t\treturn redirect()->back()->with('message', 'Insufficient Balance');\n\t\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$tnx_id = 'wwr_'.rand(1,99999999);\n\t\t\t\tWithdrawal::insert([\n\t\t\t\t\t'amount' \t\t=> $requestAmount,\n\t\t\t\t\t'wdrl_chrg'\t\t=> ($requestAmount * .05),\n\t\t\t\t\t'amount_type' \t=> $balanceType,\n\t\t\t\t\t'request_date'\t=> Carbon::now(),\n\t\t\t\t\t'user_id'\t\t=> Auth::id(),\n\t\t\t\t\t'withdraw_to' => $account,\n\t\t\t\t\t'tnx_id'\t\t=> $tnx_id\n\t\t\t\t\t]);\n\n\t\t\t\t Account::where('user_id', Auth::id())\n\t\t\t\t ->decrement('balance', $deductBalance);\n\n\t\t\t\t Transaction::insert(\n\t\t\t\t\t[\n\t\t\t\t\t'tnx_id' => $tnx_id,\n\t\t\t\t\t'amount' => $requestAmount+($requestAmount*.05),\n\t\t\t\t\t'sign' => '-',\n\t\t\t\t\t'purpose' => 2,\n\t\t\t\t\t// 'proce_fee'=> ($requestAmount*.05),\n\t\t\t\t\t'date' => Carbon::now(), \n\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t// 'related_id' =>22\n\t\t\t\t\t]);\t\n\n\t\t\t\t\treturn redirect()->back()->with('smessage', 'Your withdrawal request submitted. Please allow us 24 hours to process your request.');\t\t\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\t\n\n\t\t\tif( $requestAmount > $roiBalance )\n\t\t\t\t{\n\t\t\t\t\treturn redirect()->back()->with('message', 'Insufficient balance.');\n\n\t\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$tnx_id = 'rwr_'.rand(1,99999999);\n\n\t\t\t\tWithdrawal::insert([\n\t\t\t\t\t'amount' \t\t=> $requestAmount,\n\t\t\t\t\t'wdrl_chrg'\t\t=> ($requestAmount * .05),\n\t\t\t\t\t'amount_type' \t=> $balanceType,\n\t\t\t\t\t'request_date'\t=> Carbon::now(),\n\t\t\t\t\t// 'response_date' => 0\n\t\t\t\t\t'user_id'\t\t=> Auth::id(),\n\t\t\t\t\t// 'status'\t\t=> 0\n\t\t\t\t\t'withdraw_to' => $account,\n\t\t\t\t\t'tnx_id'\t\t=> $tnx_id\n\t\t\t\t\t]);\n\n\t\t\t\t Account::where('user_id', Auth::id())\n\t\t\t\t ->decrement('roi_balance', $deductBalance);\n\n\t\t\t\t Transaction::insert(\n\t\t\t\t\t[\n\t\t\t\t\t'tnx_id' => $tnx_id,\n\t\t\t\t\t'amount' => $requestAmount+($requestAmount * .05),\n\t\t\t\t\t'sign' => '-',\n\t\t\t\t\t'purpose' => 15,\n\t\t\t\t\t// 'proce_fee'=> ($requestAmount*.05),\n\t\t\t\t\t'date' => Carbon::now(), \n\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t// 'related_id' =>22\n\t\t\t\t\t]);\n\n\t\t\t\t\treturn redirect()->back()->with('smessage', 'Your withdrawal request submitted. Please allow us 24 hours to process your request.');\t\t\t\t \n\t\t\t\t\t\n\t\t\t};\n\n\t\t}\n\n\n\n}", "public function test_validate_withdraw_balance()\n {\n $amount = 5000;\n $balance = $this->obj->get_balance();\n $withdraw = $this->obj->validate_withdraw_balance($amount);\n if($amount < $balance){\n $this->assertTrue($withdraw);\n }else{\n $this->assertFalse($withdraw);\n }\n \n }", "function ciniki_poma_orderUpdateStatusBalance(&$ciniki, $tnid, $order_id) {\n \n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Load the order\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderLoad');\n $rc = ciniki_poma_orderLoad($ciniki, $tnid, $order_id);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $order = $rc['order'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n\n //\n // Recalculate the totals\n //\n $new_order = array(\n 'date'=>$order['order_date'],\n 'subtotal_amount'=>0,\n 'discount_amount'=>0,\n 'total_amount'=>0,\n 'total_savings'=>0,\n 'paid_amount'=>0,\n 'balance_amount'=>0,\n 'items'=>array(),\n );\n $max_line_number = 0;\n if( isset($order['items']) && count($order['items']) > 0 ) {\n $subitemcount = 0; // The basket items that have substitutions on them, not the individual count of subd items\n $subfeeitem = null;\n foreach($order['items'] as $iid => $item) {\n if( $item['unit_amount'] > 1 ) {\n $item['unit_amount'] = round($item['unit_amount'], 2);\n }\n $unit_amount = $item['unit_amount'];\n if( isset($item['unit_discount_amount']) && $item['unit_discount_amount'] > 0 ) {\n $unit_amount = bcsub($unit_amount, $item['unit_discount_amount'], 6);\n if( $unit_amount < 0 ) {\n $unit_amount = 0;\n }\n }\n if( isset($item['unit_discount_percentage']) && $item['unit_discount_percentage'] > 0 ) {\n $percentage = bcdiv($item['unit_discount_percentage'], 100, 4);\n $unit_amount = bcsub($unit_amount, bcmul($unit_amount, $percentage, 4), 4);\n if( $unit_amount < 0 ) {\n $unit_amount = 0;\n }\n }\n if( $item['itype'] == 10 || $item['itype'] == 20 ) {\n $quantity = $item['weight_quantity'];\n } else {\n $quantity = $item['unit_quantity'];\n }\n $new_item = array();\n\n //\n // Use different rounding depending on the price\n //\n $new_item['subtotal_amount'] = round(bcmul($quantity, $item['unit_amount'], 6), 2);\n $new_item['total_amount'] = round(bcmul($quantity, $unit_amount, 6), 2);\n $new_item['discount_amount'] = bcsub(bcmul($quantity, $item['unit_amount'], 6), $new_item['total_amount'], 2);\n if( isset($item['deposited_amount']) && $item['deposited_amount'] != 0 ) {\n $new_item['total_amount'] = bcsub($new_item['total_amount'], $item['deposited_amount'], 6);\n }\n\n //\n // Check if there is a container deposit for this item\n //\n if( ($item['flags']&0x80) == 0x80 && $item['cdeposit_amount'] > 0 ) {\n $deposit = bcmul($quantity, $item['cdeposit_amount'], 2);\n $new_item['total_amount'] = bcadd($new_item['total_amount'], $deposit, 2);\n }\n\n //\n // Only add to the order totals if the item is not prepaid.\n //\n if( ($item['flags']&0x0200) == 0 ) {\n $new_order['subtotal_amount'] = bcadd($new_order['subtotal_amount'], $new_item['total_amount'], 2);\n if( $new_item['discount_amount'] > 0 ) {\n $new_order['total_savings'] = bcadd($new_order['total_savings'], $new_item['discount_amount'], 2);\n }\n }\n \n $update_args = array();\n foreach(['subtotal_amount', 'discount_amount', 'total_amount'] as $field) {\n if( $item[$field] != $new_item[$field] ) {\n $update_args[$field] = $new_item[$field];\n $order['items'][$iid][$field] = $new_item[$field];\n }\n }\n if( count($update_args) > 0 ) {\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.poma.orderitem', $item['id'], $update_args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n if( $max_line_number < $item['line_number'] ) {\n $max_line_number = $item['line_number'];\n }\n\n // \n // Check for item to keep track of sub fees\n //\n if( ($item['flags']&0x08) == 0x08 ) {\n $subfeeitem = $item;\n }\n\n //\n // Check for substitutions\n //\n if( ($item['flags']&0x02) == 0x02 ) {\n if( isset($item['subitems']) ) {\n $sub_found = 0;\n foreach($item['subitems'] as $subitem) {\n //\n // Check if the subitem was alter quantity 0x10 or was a substituted item 0x04\n //\n if( ($subitem['flags']&0x14) > 0 ) {\n $sub_found++;\n }\n }\n if( $sub_found > 0 ) {\n $subitemcount += 1;\n }\n }\n }\n }\n if( $subitemcount > 0 ) {\n if( $subfeeitem == null ) {\n //\n // Check if fees are to be applied\n //\n if( ($item['flags']&0x0100) == 0x0100 ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderitem', array(\n 'line_number'=>$max_line_number+1,\n 'order_id'=>$order_id,\n 'parent_id'=>0,\n 'flags'=>0x28,\n 'itype'=>30,\n 'description'=>'Modification Fee',\n 'unit_quantity'=>$subitemcount,\n 'unit_amount'=>2,\n 'total_amount'=>bcmul($subitemcount, 2, 2),\n 'taxtype_id'=>0,\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n //\n // Update order total\n //\n $new_order['subtotal_amount'] = bcadd($new_order['subtotal_amount'], 2, 2);\n }\n } elseif( $subfeeitem['unit_quantity'] != $subitemcount ) {\n $update_args = array(\n 'unit_quantity'=>$subitemcount,\n 'total_amount'=>bcmul($subfeeitem['unit_amount'], $subitemcount, 2),\n );\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.poma.orderitem', $subfeeitem['id'], $update_args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n //\n // Update order total\n //\n $new_order['subtotal_amount'] = bcsub($new_order['subtotal_amount'], $subfeeitem['total_amount'], 2);\n $new_order['subtotal_amount'] = bcadd($new_order['subtotal_amount'], bcmul($subfeeitem['unit_amount'], $subitemcount, 2), 2);\n }\n } elseif( $subfeeitem != null ) {\n //\n // No sub fees, remove the sub fee item\n //\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.poma.orderitem', $subfeeitem['id'], null, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n //\n // Update order total\n //\n $new_order['subtotal_amount'] = bcsub($new_order['subtotal_amount'], $subfeeitem['total_amount'], 2);\n }\n }\n\n //\n // Build the hash of invoice details and items to pass to ciniki.taxes for tax calculations\n //\n if( count($order['items']) > 0 ) {\n foreach($order['items'] as $iid => $item) {\n if( $item['taxtype_id'] > 0 ) {\n if( $item['itype'] == 10 || $item['itype'] == 20 ) {\n $quantity = $item['weight_quantity'];\n } else {\n $quantity = $item['unit_quantity'];\n }\n $new_order['items'][] = array(\n 'id'=>$item['id'],\n 'amount'=>$item['total_amount'],\n 'quantity'=>$quantity,\n 'taxtype_id'=>$item['taxtype_id'],\n );\n }\n }\n }\n \n //\n // Pass to the taxes module to calculate the taxes\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'taxes', 'private', 'calcInvoiceTaxes');\n $rc = ciniki_taxes_calcInvoiceTaxes($ciniki, $tnid, $new_order);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $new_taxes = $rc['taxes'];\n\n //\n // Get the existing taxes for the order\n //\n $strsql = \"SELECT id, uuid, taxrate_id, description, amount \"\n . \"FROM ciniki_poma_order_taxes \"\n . \"WHERE ciniki_poma_order_taxes.order_id = '\" . ciniki_core_dbQuote($ciniki, $order_id) . \"' \"\n . \"AND ciniki_poma_order_taxes.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashIDQuery');\n $rc = ciniki_core_dbHashIDQuery($ciniki, $strsql, 'ciniki.poma', 'taxes', 'taxrate_id');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['taxes']) ) {\n $old_taxes = $rc['taxes'];\n } else {\n $old_taxes = array();\n }\n \n //\n // Check if order taxes need to be updated or added \n //\n $order_tax_amount = 0;\n $included_tax_amount = 0;\n foreach($new_taxes as $tid => $tax) {\n $tax_amount = round(bcadd($tax['calculated_items_amount'], $tax['calculated_invoice_amount'], 4), 2);\n if( isset($old_taxes[$tid]) ) {\n $args = array();\n if( $tax_amount != $old_taxes[$tid]['amount'] ) {\n $args['amount'] = $tax_amount;\n }\n // Check if the name is different, perhaps it was updated\n if( $tax['name'] != $old_taxes[$tid]['description'] ) {\n $args['description'] = $tax['name'];\n }\n if( count($args) > 0 ) {\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.poma.ordertax', $old_taxes[$tid]['id'], $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n } else {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.ordertax', \n array(\n 'order_id'=>$order_id,\n 'taxrate_id'=>$tid,\n 'flags'=>$tax['flags'],\n 'line_number'=>1,\n 'description'=>$tax['name'],\n 'amount'=>$tax_amount,\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n //\n // Keep track of the total taxes for the order\n //\n if( ($tax['flags']&0x01) == 0x01 ) {\n $included_tax_amount = bcadd($included_tax_amount, $tax_amount, 4);\n } else {\n $order_tax_amount = bcadd($order_tax_amount, $tax_amount, 4);\n }\n }\n\n //\n // Check if any taxes are no longer applicable\n //\n foreach($old_taxes as $tid => $tax) {\n if( !isset($new_taxes[$tid]) ) {\n // Remove the tax\n $rc = ciniki_core_objectDelete($ciniki, $tnid, 'ciniki.poma.ordertax', $tax['id'], $tax['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n\n $new_order['total_amount'] = bcadd($new_order['subtotal_amount'], $order_tax_amount, 6);\n if( isset($order['subtotal_discount_amount']) && $order['subtotal_discount_amount'] > 0 ) {\n $new_order['total_amount'] = bcsub($new_order['total_amount'], $order['subtotal_discount_amount'], 2);\n if( $new_order['total_amount'] < 0 ) {\n $new_order['total_amount'] = 0;\n }\n $new_order['discount_amount'] = bcadd($new_order['discount_amount'], $order['subtotal_discount_amount'], 2);\n }\n if( isset($order['subtotal_discount_percentage']) && $order['subtotal_discount_percentage'] > 0 ) {\n $percentage = bcdiv($order['subtotal_discount_percentage'], 100, 4);\n $discount_amount = bcmul($new_order['subtotal_amount'], $percentage, 2);\n $new_order['total_amount'] = bcsub($new_order['total_amount'], $discount_amount, 2);\n if( $new_order['total_amount'] < 0 ) {\n $new_order['total_amount'] = 0;\n }\n $new_order['discount_amount'] = bcadd($new_order['discount_amount'], $discount_amount, 2);\n }\n\n if( $new_order['discount_amount'] > 0 ) {\n $new_order['total_savings'] = bcadd($new_order['total_savings'], $new_order['discount_amount'], 2);\n }\n\n //\n // FIXME: Calculate payments for this order\n //\n $strsql = \"SELECT id, ledger_id, payment_type, amount \"\n . \"FROM ciniki_poma_order_payments \"\n . \"WHERE order_id = '\" . ciniki_core_dbQuote($ciniki, $order_id) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'payment');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['rows']) ) {\n $payments = $rc['rows'];\n } else {\n $payments = array();\n }\n\n $new_order['paid_amount'] = 0;\n foreach($payments as $payment) {\n $new_order['paid_amount'] = bcadd($new_order['paid_amount'], $payment['amount'], 6);\n }\n $new_order['balance_amount'] = bcsub($new_order['total_amount'], $new_order['paid_amount'], 6);\n //\n // Check if fully paid\n //\n if( $new_order['total_amount'] > 0 && $new_order['balance_amount'] <= 0 && $order['payment_status'] != 50 ) {\n $new_order['payment_status'] = 50;\n } \n\n //\n // Check if partial paid\n //\n elseif( $new_order['total_amount'] > 0 && $new_order['balance_amount'] > 0 && $new_order['balance_amount'] < $new_order['total_amount'] \n && $order['payment_status'] > 0 // Order has been invoiced\n && $order['payment_status'] != 40 // Order is not already in partial payment status\n ) {\n $new_order['payment_status'] = 40;\n }\n\n //\n // Update the order\n //\n $update_args = array();\n foreach(['payment_status', 'subtotal_amount', 'discount_amount', 'total_amount', 'total_savings', 'paid_amount', 'balance_amount'] as $field) {\n if( isset($new_order[$field]) && $order[$field] != $new_order[$field] ) {\n $update_args[$field] = $new_order[$field];\n $order[$field] = $new_order[$field];\n }\n }\n if( count($update_args) > 0 ) {\n $rc = ciniki_core_objectUpdate($ciniki, $tnid, 'ciniki.poma.order', $order['id'], $update_args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Update accounting\n //\n if( isset($update_args['total_amount']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'accountUpdate');\n $rc = ciniki_poma_accountUpdate($ciniki, $tnid, array('order_id'=>$order['id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n return array('stat'=>'ok', 'order'=>$order);\n}", "function deposit($connection,$amount,$accno){\r\n try {\r\n $connection->beginTransaction();\r\n\r\n $accno = $_SESSION['accno'];\r\n $sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n\r\n\r\n $final_bal = $amount + Services::getforAccountsBalance($connection,$accno);\r\n //do not deposit to self\r\n if($accno ==$_SESSION['accno']){\r\n return false;\r\n };\r\n //update balance\r\n $statement->execute(array(':balance' => $final_bal,':account'=>$accno));\r\n\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n //update transaction history\r\n $insert_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,\r\n balance) VALUES(:accno,:date,:debit,:credit,:balance)\";\r\n $stmt = $connection->prepare($insert_sql);\r\n $stmt->execute(array(':accno'=>$accno,':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$amount,':balance'=>$final_bal));\r\n //$stmt = $connection->prepare($insert_sql);\r\n // if($stmt->rowCount()<1){\r\n // echo \"Insert failed\";\r\n // }else{\r\n // echo \"string\";\r\n // }\r\n $connection->commit();\r\n return true;\r\n } catch (Exception $e) {\r\n\r\n $connection->rollBack();\r\n return false;\r\n }\r\n\r\n }", "public function pay_wallet(){\n\t\t\n\t\t\t\n\t\t$data['wal_debit'] \t= $this->ledger_model->total_wallet_debit();\n\t\t$data['wal_credit'] \t= $this->ledger_model->total_wallet_credit();\n\t\t\n\t\t//Get Decision who in online?\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\n\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['users'] = $this->db->order_by('id', 'desc')->get_where('users', ['active' => '1']);\n\t\t}\n\t\telseif ($user['role'] == 'user')\n\t\t{\n\t\t\t$data['users'] = $this->db->order_by('id', 'desc')->get_where('users', ['role' => 'user']);\n\t\t}\n\t\t\n\t\telseif ($user['role'] == 'agent')\n\t\t{\n\t\t\t$data['users'] = $this->db->where('created_by', $userID)->order_by('id', 'desc')->get_where('users', ['role' => 'agent']);\n\t\t}\n\t\t\n\t\t$data['client'] = $this->db->order_by('id', 'desc')->get_where('users', ['active' => '1']);\n\t\t\n\t\t\n\t\t\t$data['category'] = $this->db->where('parentid', '0')->order_by('id', 'asc')->get_where('acct_categories', ['visible' => '0']);\n\t\n\t\t\t$data['main_account'] = $this->db->get_where('acct_categories', ['category_type' => 'main']);\n\t\t\t\n\t\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['sub_account'] = $this->db->get_where('acct_categories', ['category_type' => 'sub']);\n\t\t}\n\t\telseif ($user['role'] == 'agent')\n\t\t{\n\t\t\t$data['sub_account'] = $this->db->get_where('acct_categories', ['category_type' => 'sub']);\n\t\t}\n\t\t\n\t\telseif ($user['role'] == 'user')\n\t\t{\n\t\t\t$data['sub_account'] = $this->db->get_where('acct_categories', ['visible' => '2']); \n\t\t}\n\t\t\t\t\t//Wallet********Points///\t\t\n\n\n\t\tif($this->input->post()) {\n\t\t\tif ($this->input->post('submit') != 'pay_wallet') die('Error! sorry');\n\t\t\t\n\t\t\t$this->form_validation->set_rules('price', 'Cost', 'required|trim'); \t\n\t\t\t\n\n\t\t\t$sellProduct = $this->product_model->pay_wallet();\n\t\t\tif($sellProduct){\n\t\t\t\tredirect(base_url('product/invoice/'.$sellProduct));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsetFlashGoBack('errorMsg', 'Something went wrong! please try again later.');\n\t\t\t}\n\n\t\t\t//print_r($this->input->post());\n\t\t}\n\n\t\t\ttheme('pay_wallet', $data);\n\t}", "public function createExtern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => ['required', 'regex:/^[A-Z]{3}[0-9]{6}(DZD|EUR|USD)$/'],\n 'receiver.name' => 'required|max:255',\n 'receiver.bank' => 'required|regex:/^[A-Z]{3}$/|exists:banks,code',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n\n //create the transfer\n $commission = config('commission.SENDEXTBANK') * $amount;\n $now = \\Carbon\\Carbon::now();\n $virement_code = $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi');\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //generate the XML file that will be treated later equivalent to send money\n $xmlBody = View::make('xml_transfer_template', [\n \"code\" => $virement_code,\n \"date\" => $now->format('YmdHis'),\n \"senderName\" => $this->client()->firstname . ' ' . $this->client()->lastname,\n \"senderAccount\" => $senderAccount->number,\n \"receiverName\" => $request->input('receiver.name'),\n \"receiverBank\" => $request->input('receiver.bank'),\n \"receiverAccount\" => $request->input('receiver.account'),\n \"amount\" => $amount,\n \"reason\" => $request->input('reason'),\n ])->render();\n $xmlBody = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . $xmlBody;\n\n Storage::disk('xml_out')->put($virement_code . '.xml', $xmlBody);\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n ExternTransfer::create([\n 'code' => $virement_code,\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'commission' => $commission,\n 'intern_account_id' => $senderAccount->number,\n 'direction' => 'out',\n 'extern_account_name' => $request->input('receiver.name'),\n 'extern_account_number' => $request->input('receiver.account'),\n 'extern_bank' => $request->input('receiver.bank'),\n ]);\n\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,\n 'transaction_type' => 'transf',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "public function appr_paid($paid_id) {\n\n\t\t$sql = $this->query(\"SELECT * FROM `app_order` WHERE `id` = '$paid_id'\");\n\n\twhile($fetch = mysql_fetch_array($sql)) {\n\n\n\t\t\t\t$pro_id \t\t\t= $fetch['pro_id'];\n\t\t\t \t$pro_count \t\t\t= $fetch['count'];\n\t\t\t\t$pro_name \t\t\t= $fetch['name'];\n\t\t\t\t$pro_email \t\t\t= $fetch['email'];\n\t\t\t\t$pro_address \t\t= $fetch['address'];\n\t\t\t\t$pro_mobile \t\t= $fetch['mobile'];\n\t\t\t\t$pro_total \t\t\t= $fetch['total'];\n}\n\t\t\t$transfer_data_part_2_array = array($pro_id,$pro_count,$pro_name,$pro_email,$pro_address,$pro_mobile,$pro_total);\n\t\t\t\n\t\t\t\n\t\t\t$this->transfer_data_part_2($transfer_data_part_2_array);\n\n\t\t\t//After Sending them in a function via array........... The next programme delete the Item by using `id`\n\n\t\t\t$this->query(\"DELETE FROM `my_cart`.`app_order` WHERE `app_order`.`id` = '$paid_id'\");\n\n// Add into Main Balance............STARTS\n\t\t\t$balance_sql = $this->query(\"SELECT `total` FROM `balance`\");\n\t\t\t\n\t\t\t$balance_sql_fetch = mysql_fetch_array($balance_sql);\n\t\t\t$main_balance = $balance_sql_fetch['total'];\n\t\t\t$add_total = $main_balance + (int)$pro_total;\n\n\t\t\t$this->query(\"UPDATE `my_cart`.`balance` SET `total` = '$add_total' WHERE `id` = '1'\");\n\n// Add into Main Balance............ENDS\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. STARTS\n\n\n\n//Add into sub balance (This balance is for Search term (it'll help Admin to Find out the Sold Date...)) ............. ENDS\n\t}", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "public function checkBalance()\n {\n echo \"Check Balance of Dhanmondi Branch<br>\";\n }", "function financialBalance($userId, $business_id, $conn) {\n $key_balance_info = getKeyFromCatalogue('Financial Summary', 'Balance Sheet', '', 'tbl_business_answer', $conn);\n insertNewTab($key_balance_info, getAnswerByQuery($key_balance_info, $conn), 'key', $userId, $business_id, $conn);\n }", "public function transferBalance($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n \n $currentDate = $this->getAppService()->getDate();\n //Check Request\n if ($post['type'] == 'debit') {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n \n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if (($localUserData['avaiPurchaseBal'] - $this->signupBal) >= $post['balance']) {\n //generate bal request code\n $transferCodeMatch = true;\n while ($transferCodeMatch == true) {\n \n $transferCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($transferCode);\n if (count($getUserInfo) == 0) {\n $transferCodeMatch = false;\n }\n }\n try {\n //set transfer code\n $updateUserData = array (\n 'balReqCode' => $transferCode,\n 'balReq' => $post['balance']\n );\n $this->getUserModel()->updateUser($localUserData['Id'], $updateUserData);\n \n //set notification message\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$post['balance'].'.Code :'.$transferCode,\n 'date' => $this->getAppService()->getDateTime()\n );\n $this->getNotificationModel()->createNotification($notificationData);\n \n $response['status'] = 'success';\n $response['message'] = 'Transfer code send successfully.';\n $response['bal'] = $userData['avaiTransBal'];\n \n } catch (\\Exception $e) {\n $response['status'] = 'error';\n $response['message'] = 'Something went wrong : Please try agaign.';\n }\n \n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient balance.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getUserByPhoneNo($post['phoneNo']);\n //Transfer credit Balance\n if ($userData['avaiTransBal'] >= $post['balance']) {\n if (count($localUserData) > 0) {\n if ($localUserData['accountStatus'] == 'Active') {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n if ($localUserData['userRoll'] == 'local') {\n $localUser = array (\n 'avaiPurchaseBal' => $post['balance'],\n 'totalWinBal' => 0,\n );\n //Update Local user balance.\n $this->getUserModel()->updateUserBal($localUserData['Id'],$localUser);\n \n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Receive chips : '.$post['balance'],\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n } else {\n //check date records exist if not then create new if Yes then use Id\n $getLocalTicketDate = $this->getTicketDateModel()->getTicketDate($localUserData['Id'],$currentDate);\n \n if (count($getLocalTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $localUserData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $localUserData['avaiTransBal'],\n );\n\n $getLocalDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $localDateId = $getLocalDateEntity->Id;\n } else {\n $localDateId = $getLocalTicketDate['Id'];\n }\n $localUser = array (\n 'avaiTransBal' => $localUserData['avaiTransBal'] + $post['balance'],\n );\n //Update Local user balance.\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n \n $transactionData = array (\n 'dateId' => $localDateId,\n 'userId' => $userData['Id'],\n 'agentId' => $localUserData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n }\n \n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] - $post['balance'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n \n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Credit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n \n $response['status'] = 'success';\n $response['message'] = 'Chips transfer successfully.';\n $response['bal'] = $userData['avaiTransBal'] - $post['balance'];\n\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = $e->getMessage();//'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'you do have not efficient balance.';\n }\n }\n return $response;\n }", "function confirm($id=\"\"){\r\n \t\t\t//$bitcoin_isvalid = $bitcoin->listtransactions();\r\n\r\n \t\t\t/*$bal=$bitcoin->getbalance();*/\r\n\r\n \r\n\r\n\t\t$id=insep_decode($id);\r\n\t\t$condition=array(\"transactionId\"=>$id,\"status\"=>\"Pending\");\r\n\t\t$transdata=$this->CommonModel->getTableData(\"tansation\",$condition);\r\n\t\tif($transdata->num_rows() >0){\t\t\r\n\r\n\r\n if($this->input->post(\"witdraw_submit\")){ \r\n\r\n\r\n \t\t$currecncy=$transdata->row()->currency;\r\n \t \t$currency=$transdata->row()->currency;\r\n \r\n\r\n \tif($currency==\"BTC\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTC\",$transdata);\r\n\r\n\r\n \t}else if($currency==\"LTC\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"LTC\",$transdata);\r\n\r\n \t}else if($currency==\"DGB\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DGB\",$transdata);\r\n\r\n \t}else if($currency==\"DASH\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DASH\",$transdata);\r\n\r\n \t}else if($currency==\"ETH\"){\r\n \t\t$txn_id=$this->transfer_eth(\"ETH\",$transdata);\r\n\r\n \t}else if($currency==\"XRP\"){\r\n\r\n \t\t$txn_id=$this->transfer_xrp($transdata);\r\n\r\n \t} else if($currency==\"BTG\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTG\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"BCH\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BCH\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"ETC\"){\r\n\r\n \t\t$txn_id=$this->transfer_etc(\"ETC\",$transdata);\r\n\r\n \t}else if($currency==\"XMR\"){\r\n\r\n \t \t$txn_id=$this->transfer_xmr($transdata);\r\n\r\n \t}\r\n\t\t \t\r\n \t\t$status=\"Success\";\r\n\r\n \t\tif($status==\"Success\"){\r\n\r\n\t\t\t\t$transdata=$transdata->row();\r\n\t\t\t\t$currecncy=$transdata->currency;\r\n\t\t\t\t$amount=$transdata->total_amount;\r\n\t\t\t\t$update[\"status\"]=\"Completed\";\r\n\t\t\t\t$update[\"transation_hash\"]=$txn_id;\r\n\t\t\t\t$this->CommonModel->updateTableData(\"tansation\",$update,$condition);\r\n\t\t\t\t$email_data=getEmailTeamplete(10);\r\n\t\t\t\t$subject=$email_data->subject;\r\n\t\t\t\t$template=$email_data->template;\r\n\t\t\t\t$site_data=site_settings();\r\n\t\t\t\t$sitename=$site_data->site_name;\r\n\t\t\t\t$trans_data=$transdata;\r\n\t\t \t $trans_data->total_amount;\t\t\t\t\t\r\n\t\t\t\t\t$data=array(\r\n\t\t\t\t\t\t\"###TRANSID###\"=>$trans_data->transactionId,\t\t\t\r\n\t\t\t\t\t\t\"###AMOUNT###\"=>$trans_data->total_amount.$trans_data->currency,\r\n\t\t\t\t\t\t\"###LOGOIMG###\"=> base_url().\"assets/frontend/images/mail_logo.png\",\r\n\t\t\t\t\t\t\"###FBIMG###\"=> base_url().\"assets/frontend/images/facebook.png\",\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\"###STATUS###\"=> \"Completed\",\t\t\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$data[\"###LOGOIMG###\"]=getSiteLogo();\r\n\t\t\t\t\t$data[\"###EMAILIMG###\"]= base_url().\"assets/frontend/images/email_send.png\";\r\n\t\t\t\t\t$data[\"###FBIMG###\"]= base_url().\"assets/frontend/images/facebook.png\";\t\t\t\r\n\t\t\t\t\t$data[\"###TWIMG###\"]= base_url().\"assets/frontend/images/twitter.png\";\r\n\t\t\t\t\t$data[\"###GPIMG###\"]= base_url().\"assets/frontend/images/gplus.png\";\r\n\t\t\t\t\t$data[\"###LEIMG###\"]= base_url().\"assets/frontend/images/linkedin.png\";\t\r\n\t\t\t\t\t$data[\"###HDIMG###\"]= base_url().\"assets/frontend/images/email.png\";\r\n\t\t\t\t\t$data[\"###FBLINK###\"]= $site_data->facebooklink;\t\t\t\t\r\n\t\t\t\t\t$data[\"###TWLINK###\"]= $site_data->twitterlink;\t\r\n\t\t\t\t\t$data[\"###GPLINK###\"]= $site_data->googlelink;\r\n\t\t\t\t\t$data[\"###LELINK###\"]= $site_data->linkedinlink;\r\n\t\t\t\t$email=get_user_email($trans_data->user_id);\r\n\t\t\t\t $message=strtr($template,$data);\t\t\r\n\t\t\t\tsend_mail($email,$subject,$message);\r\n\t\t\t\t$this->session->set_flashdata(\"success\",\"Withdraw request Completed successfully\");\t\t\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}else{\r\n\r\n\r\n\t\t\t\t$this->session->set_flashdata(\"error\",\"Withdraw request error, Tray again after some time\");\t\t\r\n\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$transdata=$transdata->row();\r\n\t\t\t$user_id=$transdata->user_id;\r\n\t\t\t$condition=array(\"user_id\"=>$user_id);\r\n\t\t\t$userdata=$this->CommonModel->getTableData(\"userdetails\",$condition)->row();\t\r\n\t\t\t$data['withdraw']=$transdata;\t\r\n\r\n\t\t\t $data['user_name']=$userdata->username;\t\t\r\n\t\t\t\r\n\t\t\t$this->load->view(\"admin/transation/withdaw_request_details\",$data);\t\r\n\r\n\t\t}\r\n\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->session->set_flashdata(\"error\",\"Invalid link or already used link\");\t\t\r\n\t\r\n\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t}", "public function actionWithdraw(){\n $my_var = \\Yii::$app->request->post();\n\n //playing safe\n $session = \\Yii::$app->session;\n try{\n //begin transaction\n $connection = \\Yii::$app->inventorydb;\n $transaction = $connection->beginTransaction();\n\n if($my_var){//condition to check if there are items to be withdraw\n\n $model = new InventoryWithdrawal;\n $model->created_by=$this->getuserid();\n $model->withdrawal_datetime=date('Y-m-d');\n $model->lab_id=1; //check if the user has lab_id\n $model->total_qty=0;\n $model->total_cost=0;\n $model->remarks=\"Transaction made from mobile\";\n if(!$model->save()){ //if the header failed to save\n $transaction->rollBack();\n throw new \\Exception(\"Cannot save header of Withdrawal Items!\", 1);\n }\n\n // the format is objects inside an array\n foreach($my_var as $key) {\n $entry = InventoryEntries::findOne($key['id']); //get the entries record\n \n if($key['quantity']>$entry->quantity_onhand){ // cart qty > withdrawable ~> throw ERR\n $transaction->rollBack();\n throw new \\Exception(\"Withdrawable Quantity is less than the desired Quantity!\", 1);\n }\n\n //subtract qty in Entries tbl\n $entry->quantity_onhand = (int)$entry->quantity_onhand - (int)$key['quantity']; \n if($entry->save()){\n $func = new Functions();\n $func->checkreorderpoint($entry->product_id);\n //create record of withdrawaldetails item\n $item = new InventoryWithdrawaldetails();\n $item->inventory_withdrawal_id =$model->inventory_withdrawal_id;\n $item->inventory_transactions_id=$key['id'];\n $item->quantity=$key['quantity'];\n $item->price=$entry->amount*(int)$key['quantity'];\n $item->withdarawal_status_id=2;\n $item->save();\n }\n }\n\n $transaction->commit();\n return $this->asJson([\n 'success' => true,\n 'message' => 'Processed Successfully!',\n ]);\n }else{\n return $this->asJson([\n 'success' => false,\n 'message' => 'Cart Empty',\n ]); \n }\n\n }catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n\n }", "public function store(Request $request)\n {\n $actonaddnew = 'fish';\n $soccer = 'soccer';\n $virtual = 'virtual';\n\n\n $userid = auth('api')->user()->id;\n $userbranch = auth('api')->user()->branch;\n $userrole = auth('api')->user()->type;\n///\n$inpbranch = $request['branchnametobalance'];\n\n$doesthebranchhavefish = \\DB::table('branchandproducts')->where('branch', '=', $inpbranch)->where('sysname', '=', $actonaddnew)->count();\n$doesthebranchhavesoccer = \\DB::table('branchandproducts')->where('branch', '=', $inpbranch)->where('sysname', '=', $soccer)->count();\n$doesthebranchhavevirtual = \\DB::table('branchandproducts')->where('branch', '=', $inpbranch)->where('sysname', '=', $virtual)->count();\n /// branch no fish, but has virtual and soccer\n if ($doesthebranchhavefish < 1 && $doesthebranchhavesoccer > 0 && $doesthebranchhavevirtual > 0 )\n {\n \n $this->validate($request,[\n 'datedone' => 'required |max:191',\n 'branchnametobalance' => 'required',\n 'sctkts' => 'required',\n 'vsales' => 'required',\n\n 'vcan' => 'required',\n 'vpay' => 'required',\n 'vtkts' => 'required',\n 'reportedcash' => 'required',\n 'bio' => 'required',\n 'scsales' => 'required'\n ]);\n $userid = auth('api')->user()->id;\n\n $datepaid = date('Y-m-d');\n $inpbranch = $request['branchnametobalance'];\n\n$dateinq = $request['datedone'];\n/// getting the expenses\n$totalexpense = \\DB::table('madeexpenses')\n ->where('datemade', '=', $dateinq)\n ->where('branch', '=', $inpbranch)\n ->where('explevel', '=', 1)\n ->where('approvalstate', '=', 1)\n ->sum('amount');\n\n /// getting the cashin\n$totalcashin = \\DB::table('couttransfers')\n->where('transferdate', '=', $dateinq)\n->where('branchto', '=', $inpbranch)\n->where('status', '=', 1)\n->sum('amount');\n /// getting the cashout\n $totalcashout = \\DB::table('cintransfers')\n ->where('transferdate', '=', $dateinq)\n ->where('branchto', '=', $inpbranch)\n ->where('status', '=', 1)\n ->sum('amount');\n\n /// getting the payout\n $totalpayout = \\DB::table('branchpayouts')\n ->where('datepaid', '=', $dateinq)\n ->where('branch', '=', $inpbranch)\n// ->where('status', '=', 1)\n ->sum('amount');\n\n\n /// checking if a record exists for balancing\n $branchinbalanced = \\DB::table('shopbalancingrecords')->where('branch', '=', $inpbranch) ->count();\n\n///getting the openning balance\nif($branchinbalanced > 0)\n{\n$openningbalance = Shopbalancingrecord::where('branch', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('clcash');\n}\nif($branchinbalanced < 1)\n{\n$openningbalance = Branch::where('branchno', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('openningbalance');\n}\n//$openningbalance = \\DB::table('shopbalancingrecords')\n \n//->where('branch', '=', $inpbranch)\n//->orderBy('id', 'Desc')\n//->take(1)\n//->sum('clcash');\n\n\n\n\n$soccersales = $request['scsales'];\n//$soccerpayout =;\n//$casin =;\n//$cashout =;\n//$expenses =;\n\n\n\n\n\n\n $virp = ($request['vsales']-$request['vpay']-$request['vcan']);\n\n\n$closingbalance = $openningbalance + $soccersales+ $virp + $totalcashin - $totalcashout -$totalexpense -$totalpayout;\n\n\n return Shopbalancingrecord::Create([\n 'fishincome' => 0,\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n'scpayout' => $totalpayout,\n 'scsales' => $request['scsales'],\n 'sctkts' => $request['sctkts'],\n 'vsales' => $request['vsales'],\n 'vcan' => $request['vcan'],\n 'vprof' => $virp,\n 'vpay' => $request['vpay'],\n 'vtkts' => $request['vtkts'],\n 'comment' => $request['comment'],\n 'expenses' => $totalexpense,\n 'cashin' => $totalcashin,\n 'cashout' => $totalcashout,\n 'opbalance' => $openningbalance,\n 'clcash' => $closingbalance,\n 'reportedcash' => $request['reportedcash'],\n 'comment' => $request['bio'],\n\n 'ucret' => $userid,\n \n ]);\n } //// closing working without fish\n /// branch with fish, has virtual and soccer\n if ($doesthebranchhavefish > 0 && $doesthebranchhavesoccer > 0 && $doesthebranchhavevirtual > 0 )\n {\n \n\n ///// checking for the Number of fish Machines \n $totalfishmacinesinthebranch = \\DB::table('branchesandmachines')->where('branchname', '=', $userbranch)->count();\n \n /// for one fishmachine with Soccer and virtual \n \n if($totalfishmacinesinthebranch == 1)\n {\n $userid = auth('api')->user()->id;\n $userbranch = auth('api')->user()->branch;\n $userrole = auth('api')->user()->type;\n\n $this->validate($request,[\n 'datedone' => 'required |max:191',\n 'branchnametobalance' => 'required',\n 'sctkts' => 'required',\n 'vsales' => 'required',\n \n 'vcan' => 'required',\n 'vpay' => 'required',\n 'vtkts' => 'required',\n 'reportedcash' => 'required',\n 'bio' => 'required',\n 'scsales' => 'required',\n ///////////////////////////////////// fish\n // 'machineoneopenningcode' => 'required',\n 'machineonecurrentcode' => 'required',\n 'machineonesales' => 'required',\n 'machineonepayout' => 'required',\n 'machineonefloat' => 'required'\n\n ]);\n $userid = auth('api')->user()->id;\n $datepaid = date('Y-m-d');\n $inpbranch = $request['branchnametobalance'];\n $dateinq = $request['datedone'];\n /// getting the expenses\n $totalexpense = \\DB::table('madeexpenses')->where('datemade', '=', $dateinq)->where('branch', '=', $inpbranch)->where('explevel', '=', 1)\n ->where('approvalstate', '=', 1)\n ->sum('amount');\n \n /// getting the cashin\n $totalcashin = \\DB::table('couttransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)\n ->sum('amount');\n /// getting the cashout\n $totalcashout = \\DB::table('cintransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)->sum('amount');\n \n /// getting the payout\n $totalpayout = \\DB::table('branchpayouts')->where('datepaid', '=', $dateinq)->where('branch', '=', $inpbranch)->sum('amount');\n \n \n /// checking if a record exists for balancing\n $branchinbalanced = \\DB::table('shopbalancingrecords')->where('branch', '=', $inpbranch) ->count();\n \n ///getting the openning balance\n if($branchinbalanced > 0)\n {\n $openningbalance = Shopbalancingrecord::where('branch', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('clcash');\n }\n if($branchinbalanced < 1)\n {\n $openningbalance = Branch::where('branchno', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('openningbalance');\n }\n //$openningbalance = \\DB::table('shopbalancingrecords')\n \n //->where('branch', '=', $inpbranch)\n //->orderBy('id', 'Desc')\n //->take(1)\n //->sum('clcash');\n \n \n \n \n $soccersales = $request['scsales'];\n //$soccerpayout =;\n //$casin =;\n //$cashout =;\n //$expenses =;\n \n \n \n \n \n \n $virp = ($request['vsales']-$request['vpay']-$request['vcan']);\n \n \n\n /// working on fish sales and codes\n //gitting the days code from sles and payout\n$machineoneopenningcode = \\DB::table('currentmachinecodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('machinecode');\n \n$machineonecurrentcode = $request['machineonecurrentcode'];\n$machineonesales = $request['machineonesales'];\n$machineonepayout = $request['machineonepayout'];\n$machineonefloat = $request['machineonefloat'];\n\n\n $machineoneclosingcode = $machineonecurrentcode;\n $fishincome = ($machineoneclosingcode - $machineoneopenningcode)*500;\n $closingbalance = $openningbalance + $soccersales+ $virp + $fishincome + $totalcashin - $totalcashout -$totalexpense -$totalpayout;\nShopbalancingrecord::Create([\n 'fishincome' => $fishincome,\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'scpayout' => $totalpayout,\n 'scsales' => $request['scsales'],\n 'sctkts' => $request['sctkts'],\n 'vsales' => $request['vsales'],\n 'vcan' => $request['vcan'],\n 'vprof' => $virp,\n 'vpay' => $request['vpay'],\n 'vtkts' => $request['vtkts'],\n 'comment' => $request['comment'],\n 'expenses' => $totalexpense,\n 'cashin' => $totalcashin,\n 'cashout' => $totalcashout,\n 'opbalance' => $openningbalance,\n 'clcash' => $closingbalance,\n 'reportedcash' => $request['reportedcash'],\n 'comment' => $request['bio'],\n \n 'ucret' => $userid,\n \n ]);\n //// Saving the current machinecodes\n Currentmachinecode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'machinecode' => $machineoneclosingcode,\n 'ucret' => $userid,\n \n]);\n/// working and Updating the daily Codes\nDailyreportcode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'closingcode' => $machineoneclosingcode,\n\n 'openningcode' => $machineoneopenningcode,\n 'salescode' => $machineonesales,\n 'payoutcode' => $machineonepayout,\n 'profitcode' => $machineonesales-$machineonepayout,\n 'ucret' => $userid,\n\n]);\n\n/// working and Updating the daily Codes\n/////////////////////////////////////////// checking if there is a sale or payout\n$existpreviouswork = \\DB::table('dailyreportcodes')->where('branch', '=', $userbranch)\n ->where('machineno', '=', 101)\n // ->where('rolein', '=', $udefinedrole)\n ->count();\n//latest sales\nif($existpreviouswork > 0)\n{\n /// checking the reset code status\n $resetcodestatus = \\DB::table('dailyreportcodes')->where('branch', '=', $userbranch)\n ->where('machineno', '=', 101)\n ->where('resetstatus', '=', 1)\n ->count();\n /////\n if($resetcodestatus < 1)\n {\n $previoussalesfigure = \\DB::table('dailyreportcodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('salescode');\n $previouspayoutfigure = \\DB::table('dailyreportcodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('payoutcode');\n }/////\n if($resetcodestatus > 0)\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n }////\n\nif($existpreviouswork < 0)\n{\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n\n}\n\nSalesdetail::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n \n 'previoussalesfigure' => $previoussalesfigure,\n 'previouspayoutfigure' => $previouspayoutfigure,\n\n 'currentsalesfigure' => $machineonesales,\n 'currentpayoutfigure' => $machineonepayout,\n\n 'salesamount' => ($machineonesales - $machineonepayout)*500,\n 'salesfigure' => $machineonesales - $machineonepayout,\n\n\n \n \n 'ucret' => $userid,\n\n]);\n\n } /// closing for one machine\n\n\n\n\n } //// closing working with fish\n\n// lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll\n/// branch with fish,soccer but no Virtual \nif ($doesthebranchhavefish > 0 && $doesthebranchhavesoccer > 0 && $doesthebranchhavevirtual < 1)\n{\n \n\n ///// checking for the Number of fish Machines \n $totalfishmacinesinthebranch = \\DB::table('branchesandmachines')->where('branchname', '=', $userbranch)->count();\n \n /// for one fishmachine with Soccer and virtual \n \n if($totalfishmacinesinthebranch == 1)\n {\n $userid = auth('api')->user()->id;\n $userbranch = auth('api')->user()->branch;\n $userrole = auth('api')->user()->type;\n\n $this->validate($request,[\n 'datedone' => 'required |max:191',\n 'branchnametobalance' => 'required',\n 'sctkts' => 'required',\n // 'vsales' => 'required',\n\n // 'vcan' => 'required',\n //'vpay' => 'required',\n // 'vtkts' => 'required',\n 'reportedcash' => 'required',\n 'bio' => 'required',\n 'scsales' => 'required',\n ///////////////////////////////////// fish\n // 'machineoneopenningcode' => 'required',\n 'machineonecurrentcode' => 'required',\n 'machineonesales' => 'required',\n 'machineonepayout' => 'required',\n 'machineonefloat' => 'required'\n\n ]);\n $userid = auth('api')->user()->id;\n $datepaid = date('Y-m-d');\n $inpbranch = $request['branchnametobalance'];\n $dateinq = $request['datedone'];\n/// getting the expenses\n $totalexpense = \\DB::table('madeexpenses')->where('datemade', '=', $dateinq)->where('branch', '=', $inpbranch)->where('explevel', '=', 1)\n ->where('approvalstate', '=', 1)\n ->sum('amount');\n\n /// getting the cashin\n $totalcashin = \\DB::table('couttransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)\n->sum('amount');\n /// getting the cashout\n $totalcashout = \\DB::table('cintransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)->sum('amount');\n\n /// getting the payout\n $totalpayout = \\DB::table('branchpayouts')->where('datepaid', '=', $dateinq)->where('branch', '=', $inpbranch)->sum('amount');\n\n\n /// checking if a record exists for balancing\n $branchinbalanced = \\DB::table('shopbalancingrecords')->where('branch', '=', $inpbranch) ->count();\n\n///getting the openning balance\nif($branchinbalanced > 0)\n{\n$openningbalance = Shopbalancingrecord::where('branch', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('clcash');\n}\nif($branchinbalanced < 1)\n{\n$openningbalance = Branch::where('branchno', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('openningbalance');\n}\n//$openningbalance = \\DB::table('shopbalancingrecords')\n \n//->where('branch', '=', $inpbranch)\n//->orderBy('id', 'Desc')\n//->take(1)\n//->sum('clcash');\n\n\n\n\n$soccersales = $request['scsales'];\n//$soccerpayout =;\n//$casin =;\n//$cashout =;\n//$expenses =;\n\n\n\n\n\n\n // $virp = ($request['vsales']-$request['vpay']-$request['vcan']);\n\n\n\n/// working on fish sales and codes\n//gitting the days code from sles and payout\n$machineoneopenningcode = \\DB::table('currentmachinecodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('machinecode');\n \n$machineonecurrentcode = $request['machineonecurrentcode'];\n$machineonesales = $request['machineonesales'];\n$machineonepayout = $request['machineonepayout'];\n$machineonefloat = $request['machineonefloat'];\n\n\n$machineoneclosingcode = $machineonecurrentcode;\n$fishincome = ($machineoneclosingcode - $machineoneopenningcode) *500;\n$closingbalance = $openningbalance + $soccersales + $fishincome + $totalcashin - $totalcashout -$totalexpense -$totalpayout;\nShopbalancingrecord::Create([\n 'fishincome' => $fishincome,\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'scpayout' => $totalpayout,\n 'scsales' => $request['scsales'],\n 'sctkts' => $request['sctkts'],\n 'vsales' => 0,\n 'vcan' => 0,\n 'vprof' => 0,\n 'vpay' => 0,\n 'vtkts' => 0,\n 'comment' => $request['comment'],\n 'expenses' => $totalexpense,\n 'cashin' => $totalcashin,\n 'cashout' => $totalcashout,\n 'opbalance' => $openningbalance,\n 'clcash' => $closingbalance,\n 'reportedcash' => $request['reportedcash'],\n 'comment' => $request['bio'],\n\n 'ucret' => $userid,\n \n ]);\n //// Saving the current machinecodes\n Currentmachinecode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'machinecode' => $machineoneclosingcode,\n 'ucret' => $userid,\n \n]);\n/// working and Updating the daily Codes\nDailyreportcode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'closingcode' => $machineoneclosingcode,\n\n 'openningcode' => $machineoneopenningcode,\n 'salescode' => $machineonesales,\n 'payoutcode' => $machineonepayout,\n 'profitcode' => $machineonesales-$machineonepayout,\n 'ucret' => $userid,\n\n]);\n\n/// working and Updating the daily Codes\n/////////////////////////////////////////// checking if there is a sale or payout\n$existpreviouswork = \\DB::table('dailyreportcodes')->where('branch', '=', $userbranch)\n ->where('machineno', '=', 101)\n// ->where('rolein', '=', $udefinedrole)\n ->count();\n//latest sales\nif($existpreviouswork > 0)\n{\n /// checking the reset code status\n $resetcodestatus = \\DB::table('dailyreportcodes')->where('branch', '=', $userbranch)\n ->where('machineno', '=', 101)\n ->where('resetstatus', '=', 1)\n ->count();\n /////\n if($resetcodestatus < 1)\n {\n $previoussalesfigure = \\DB::table('dailyreportcodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('salescode');\n $previouspayoutfigure = \\DB::table('dailyreportcodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('payoutcode');\n }/////\n if($resetcodestatus > 0)\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n }////\n\nif($existpreviouswork < 0)\n{\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n\n}\n\nSalesdetail::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n \n 'previoussalesfigure' => $previoussalesfigure,\n 'previouspayoutfigure' => $previouspayoutfigure,\n\n 'currentsalesfigure' => $machineonesales,\n 'currentpayoutfigure' => $machineonepayout,\n\n 'salesamount' => ($machineonesales - $machineonepayout)*500,\n 'salesfigure' => $machineonesales - $machineonepayout,\n\n\n \n \n 'ucret' => $userid,\n\n]);\n\n } /// closing for one machine\n\n\n\n\n }\n // llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll\n\n \n \n if ($doesthebranchhavefish > 0 && $doesthebranchhavesoccer < 1 && $doesthebranchhavevirtual > 0 )\n {\n \n \n ///// checking for the Number of fish Machines \n $totalfishmacinesinthebranch = \\DB::table('branchesandmachines')->where('branchname', '=', $userbranch)->count();\n \n /// for one fishmachine with Soccer and virtual \n \n if($totalfishmacinesinthebranch == 1)\n {\n $userid = auth('api')->user()->id;\n $userbranch = auth('api')->user()->branch;\n $userrole = auth('api')->user()->type;\n \n $this->validate($request,[\n 'datedone' => 'required |max:191',\n 'branchnametobalance' => 'required',\n // 'sctkts' => 'required',\n 'vsales' => 'required',\n \n 'vcan' => 'required',\n 'vpay' => 'required',\n 'vtkts' => 'required',\n 'reportedcash' => 'required',\n 'bio' => 'required',\n // 'scsales' => 'required',\n ///////////////////////////////////// fish\n // 'machineoneopenningcode' => 'required',\n 'machineonecurrentcode' => 'required',\n 'machineonesales' => 'required',\n 'machineonepayout' => 'required',\n 'machineonefloat' => 'required'\n \n ]);\n $userid = auth('api')->user()->id;\n $datepaid = date('Y-m-d');\n $inpbranch = $request['branchnametobalance'];\n $dateinq = $request['datedone'];\n /// getting the expenses\n $totalexpense = \\DB::table('madeexpenses')->where('datemade', '=', $dateinq)->where('branch', '=', $inpbranch)->where('explevel', '=', 1)\n ->where('approvalstate', '=', 1)\n ->sum('amount');\n \n /// getting the cashin\n $totalcashin = \\DB::table('couttransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)\n ->sum('amount');\n /// getting the cashout\n $totalcashout = \\DB::table('cintransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)->sum('amount');\n \n /// getting the payout\n $totalpayout = \\DB::table('branchpayouts')->where('datepaid', '=', $dateinq)->where('branch', '=', $inpbranch)->sum('amount');\n \n \n /// checking if a record exists for balancing\n $branchinbalanced = \\DB::table('shopbalancingrecords')->where('branch', '=', $inpbranch) ->count();\n \n ///getting the openning balance\n if($branchinbalanced > 0)\n {\n $openningbalance = Shopbalancingrecord::where('branch', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('clcash');\n }\n if($branchinbalanced < 1)\n {\n $openningbalance = Branch::where('branchno', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('openningbalance');\n }\n //$openningbalance = \\DB::table('shopbalancingrecords')\n \n //->where('branch', '=', $inpbranch)\n //->orderBy('id', 'Desc')\n //->take(1)\n //->sum('clcash');\n \n \n \n \n // $soccersales = $request['scsales'];\n //$soccerpayout =;\n //$casin =;\n //$cashout =;\n //$expenses =;\n \n \n \n \n \n \n $virp = ($request['vsales']-$request['vpay']-$request['vcan']);\n \n \n \n /// working on fish sales and codes\n //gitting the days code from sles and payout\n $machineoneopenningcode = \\DB::table('currentmachinecodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('machinecode');\n \n $machineonecurrentcode = $request['machineonecurrentcode'];\n $machineonesales = $request['machineonesales'];\n $machineonepayout = $request['machineonepayout'];\n $machineonefloat = $request['machineonefloat'];\n \n \n $machineoneclosingcode = $machineonecurrentcode;\n $fishincome = ($machineoneclosingcode - $machineoneopenningcode)*500;\n $closingbalance = $openningbalance + $soccersales+ $virp + $fishincome + $totalcashin - $totalcashout -$totalexpense -$totalpayout;\n Shopbalancingrecord::Create([\n 'fishincome' => $fishincome,\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'scpayout' => $totalpayout,\n 'scsales' =>0,\n 'sctkts' => 0,\n 'vsales' => $request['vsales'],\n 'vcan' => $request['vcan'],\n 'vprof' => $virp,\n 'vpay' => $request['vpay'],\n 'vtkts' => $request['vtkts'],\n 'comment' => $request['comment'],\n 'expenses' => $totalexpense,\n 'cashin' => $totalcashin,\n 'cashout' => $totalcashout,\n 'opbalance' => $openningbalance,\n 'clcash' => $closingbalance,\n 'reportedcash' => $request['reportedcash'],\n 'comment' => $request['bio'],\n \n 'ucret' => $userid,\n \n ]);\n //// Saving the current machinecodes\n Currentmachinecode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'machinecode' => $machineoneclosingcode,\n 'ucret' => $userid,\n \n ]);\n /// working and Updating the daily Codes\n Dailyreportcode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'closingcode' => $machineoneclosingcode,\n \n 'openningcode' => $machineoneopenningcode,\n 'salescode' => $machineonesales,\n 'payoutcode' => $machineonepayout,\n 'profitcode' => $machineonesales-$machineonepayout,\n 'ucret' => $userid,\n \n ]);\n \n /// working and Updating the daily Codes\n /////////////////////////////////////////// checking if there is a sale or payout\n $existpreviouswork = \\DB::table('dailyreportcodes')->where('branch', '=', $userbranch)\n ->where('machineno', '=', 101)\n // ->where('rolein', '=', $udefinedrole)\n ->count();\n //latest sales\n if($existpreviouswork > 0)\n {\n /// checking the reset code status\n $resetcodestatus = \\DB::table('dailyreportcodes')->where('branch', '=', $userbranch)\n ->where('machineno', '=', 101)\n ->where('resetstatus', '=', 1)\n ->count();\n /////\n if($resetcodestatus < 1)\n {\n $previoussalesfigure = \\DB::table('dailyreportcodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('salescode');\n $previouspayoutfigure = \\DB::table('dailyreportcodes')->where('branch', $userbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('payoutcode');\n }/////\n if($resetcodestatus > 0)\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n }////\n \n if($existpreviouswork < 0)\n {\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n \n }\n \n Salesdetail::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n \n 'previoussalesfigure' => $previoussalesfigure,\n 'previouspayoutfigure' => $previouspayoutfigure,\n \n 'currentsalesfigure' => $machineonesales,\n 'currentpayoutfigure' => $machineonepayout,\n \n 'salesamount' => ($machineonesales - $machineonepayout)*500,\n 'salesfigure' => $machineonesales - $machineonepayout,\n \n \n \n \n 'ucret' => $userid,\n \n ]);\n \n } /// closing for one machine\n \n \n \n \n } //// closing working with fish\n\n // lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll\n if ($doesthebranchhavefish > 0 && $doesthebranchhavesoccer < 1 && $doesthebranchhavevirtual < 1 )\n {\n \n \n ///// checking for the Number of fish Machines \n $totalfishmacinesinthebranch = \\DB::table('branchesandmachines')->where('branchname', '=', $userbranch)->count();\n \n /// for one fishmachine with Soccer and virtual \n \n if($totalfishmacinesinthebranch == 1)\n {\n $userid = auth('api')->user()->id;\n $userbranch = auth('api')->user()->branch;\n $userrole = auth('api')->user()->type;\n \n $this->validate($request,[\n 'datedone' => 'required |max:191',\n 'branchnametobalance' => 'required',\n 'reportedcash' => 'required',\n 'bio' => 'required',\n \n ///////////////////////////////////// fish\n \n 'machineonecurrentcode' => 'required',\n 'machineonesales' => 'required',\n 'machineonepayout' => 'required',\n 'machineonefloat' => 'required'\n \n ]);\n $userid = auth('api')->user()->id;\n $datepaid = date('Y-m-d');\n $inpbranch = $request['branchnametobalance'];\n $dateinq = $request['datedone'];\n\n\n\n\n/// checking for Machine resets status \n $machineresetstatus = \\DB::table('machineresets')->where('branch', $inpbranch)->where('machine', '101')->orderBy('id', 'Desc')->limit(1)->value('resetdate');\n \n \nif( $machineresetstatus != $dateinq)\n{\n\n\n\n /// getting the expenses\n $totalexpense = \\DB::table('madeexpenses')->where('datemade', '=', $dateinq)->where('branch', '=', $inpbranch)->where('explevel', '=', 1)\n ->where('approvalstate', '=', 1)\n ->sum('amount');\n \n /// getting the cashin\n $totalcashin = \\DB::table('couttransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)\n ->sum('amount');\n /// getting the cashout\n $totalcashout = \\DB::table('cintransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)->sum('amount');\n \n /// getting the payout\n $totalpayout = \\DB::table('branchpayouts')->where('datepaid', '=', $dateinq)->where('branch', '=', $inpbranch)->sum('amount');\n \n \n /// checking if a record exists for balancing\n $branchinbalanced = \\DB::table('shopbalancingrecords')->where('branch', '=', $inpbranch) ->count();\n \n ///getting the openning balance\n if($branchinbalanced > 0)\n {\n $openningbalance = Shopbalancingrecord::where('branch', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('clcash');\n }\n if($branchinbalanced < 1)\n {\n $openningbalance = Branch::where('branchno', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('openningbalance');\n }\n \n /// working on fish sales and codes\n //gitting the days code from sles and payout\n\n $dateinact = $request['datedone'];\n $yearmade = date('Y', strtotime($dateinact));\n $monthmade = date('m', strtotime($dateinact));\n\n $machineoneopenningcode = \\DB::table('currentmachinecodes')->where('branch', $inpbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('machinecode');\n \n\n\n\n\n\n\n\n $machineonecurrentcode = $request['machineonecurrentcode'];\n $machineonesales = $request['machineonesales'];\n $machineonepayout = $request['machineonepayout'];\n $machineonefloat = $request['machineonefloat'];\n \n \n $machineoneclosingcode = $machineonecurrentcode;\n $fishincome = ($machineoneclosingcode - $machineoneopenningcode)*500;\n $closingbalance = $openningbalance + $fishincome + $totalcashin - $totalcashout -$totalexpense -$totalpayout;\n Shopbalancingrecord::Create([\n 'fishincome' => $fishincome,\n 'fishsales' => $machineonesales,\n 'fishpayout' => $machineonepayout,\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'scpayout' => 0,\n 'scsales' =>0,\n 'sctkts' => 0,\n 'vsales' => 0,\n 'vcan' => 0,\n 'vprof' => 0,\n 'vpay' => 0,\n 'vtkts' => 0,\n 'comment' => $request['comment'],\n 'expenses' => $totalexpense,\n 'cashin' => $totalcashin,\n 'cashout' => $totalcashout,\n 'opbalance' => $openningbalance,\n 'clcash' => $closingbalance,\n 'reportedcash' => $request['reportedcash'],\n 'comment' => $request['bio'],\n \n 'ucret' => $userid,\n \n ]);\n //// Saving the current machinecodes\n Currentmachinecode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'machinecode' => $machineoneclosingcode,\n 'ucret' => $userid,\n \n ]);\n //ooooooooooooooooooooooooooooooooooooooooooooooooooooooo\n /// working and Updating the daily Codes\n /////////////////////////////////////////// checking if there is a sale or payout\n $existpreviouswork = \\DB::table('dailyreportcodes')->where('branch', '=', $inpbranch)->where('machineno', '=', 101)->count();\n // //latest sales\n \n // $resetcodestatus = \\DB::table('dailyreportcodes')->where('branch', '=', $inpbranch)\n // ->where('machineno', '=', 101)\n // ->where('resetstatus', '=', 1)\n // ->count();\n if($existpreviouswork > 0)\n {\n $previoussalesfigure = \\DB::table('dailyreportcodes')->where('branch', $inpbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('salescode');\n $previouspayoutfigure = \\DB::table('dailyreportcodes')->where('branch', $inpbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('payoutcode');\n }\n if($existpreviouswork < 1)\n {\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n }\n // if($resetcodestatus > 0)\n // $previoussalesfigure = 0;\n // $previouspayoutfigure = 0;\n \n \n // if($existpreviouswork < 1)\n // {\n // $previoussalesfigure = 0;\n // $previouspayoutfigure = 0;\n \n // }\n //00000000000000000000000000000000000000000000000000000000000000000\n\n\n/// calculating the current or dayz sales and payout\n$todayssaes1 = $machineonesales - $previoussalesfigure;\n$todayspayout11 = $machineonepayout - $previouspayoutfigure;\nif($todayssaes1 >= 0)\n{\n $todayssaes = $todayssaes1;\n}\nif($todayssaes1 < 0)\n{\n $todayssaes = $machineonesales;\n}\n//\nif($todayspayout11 >= 0)\n{\n $todayspayout = $todayspayout11;\n}\nif($todayspayout11 < 0)\n{\n $todayspayout = $machineonepayout;\n}\n///// getting the branch order\n$dorder = \\DB::table('branches')->where('id', '=', $userbranch)->count('dorder');\n/// deleting the existing record\n$bxn = $request['branchnametobalance'];\n$datedonessd = $request['datedone'];\nDB::table('dailyreportcodes')->where('branch', $bxn)->where('datedone', $datedonessd)->where('machineno', 101)->delete();\n\n\n /// working and Updating the daily Codes\n Dailyreportcode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'closingcode' => $machineoneclosingcode,\n \n 'openningcode' => $machineoneopenningcode,\n 'salescode' => $machineonesales,\n 'payoutcode' => $machineonepayout,\n 'profitcode' => $machineonesales-$machineonepayout,\n 'previoussalesfigure' => $previoussalesfigure,\n 'previouspayoutfigure' => $previouspayoutfigure,\n 'currentpayoutfigure' => $todayspayout,\n 'currentsalesfigure' => $todayssaes,\n 'dorder' => $dorder,\n 'ucret' => $userid,\n 'monthmade' => $monthmade,\n 'yearmade' => $yearmade,\n \n ]);\n \n \n \n Salesdetail::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n \n 'previoussalesfigure' => $previoussalesfigure,\n 'previouspayoutfigure' => $previouspayoutfigure,\n \n 'currentsalesfigure' => $machineonesales,\n 'currentpayoutfigure' => $machineonepayout,\n \n 'salesamount' => ($machineonesales - $machineonepayout)*500,\n 'salesfigure' => $machineonesales - $machineonepayout,\n \n 'monthmade' => $monthmade,\n 'yearmade' => $yearmade,\n \n \n 'ucret' => $userid,\n \n ]);\n \n } /// COSING IF THE MACHINE WAS NOT RESET\n\n \nif( $machineresetstatus == $dateinq)\n{\n\n\n\n /// getting the expenses\n $totalexpense = \\DB::table('madeexpenses')->where('datemade', '=', $dateinq)->where('branch', '=', $inpbranch)->where('explevel', '=', 1)\n ->where('approvalstate', '=', 1)\n ->sum('amount');\n \n /// getting the cashin\n $totalcashin = \\DB::table('couttransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)\n ->sum('amount');\n /// getting the cashout\n $totalcashout = \\DB::table('cintransfers')->where('transferdate', '=', $dateinq)->where('branchto', '=', $inpbranch)->where('status', '=', 1)->sum('amount');\n \n /// getting the payout\n $totalpayout = \\DB::table('branchpayouts')->where('datepaid', '=', $dateinq)->where('branch', '=', $inpbranch)->sum('amount');\n \n \n /// checking if a record exists for balancing\n $branchinbalanced = \\DB::table('shopbalancingrecords')->where('branch', '=', $inpbranch) ->count();\n \n ///getting the openning balance\n if($branchinbalanced > 0)\n {\n $openningbalance = Shopbalancingrecord::where('branch', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('clcash');\n }\n if($branchinbalanced < 1)\n {\n $openningbalance = Branch::where('branchno', $inpbranch)->orderBy('id', 'Desc')->limit(1)->value('openningbalance');\n }\n \n /// working on fish sales and codes\n //gitting the days code from sles and payout\n\n $dateinact = $request['datedone'];\n $yearmade = date('Y', strtotime($dateinact));\n $monthmade = date('m', strtotime($dateinact));\n\n $machineoneopenningcode = \\DB::table('currentmachinecodes')->where('branch', $inpbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('machinecode');\n \n\n\n\n\n\n\n\n $machineonecurrentcode = $request['machineonecurrentcode'];\n $machineonesales = $request['machineonesales'];\n $machineonepayout = $request['machineonepayout'];\n $machineonefloat = $request['machineonefloat'];\n \n \n $machineoneclosingcode = $machineonecurrentcode;\n $fishincome = ($machineoneclosingcode)*500;\n $closingbalance = $openningbalance + $fishincome + $totalcashin - $totalcashout -$totalexpense -$totalpayout;\n Shopbalancingrecord::Create([\n 'fishincome' => $fishincome,\n 'fishsales' => $machineonesales,\n 'fishpayout' => $machineonepayout,\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'scpayout' => 0,\n 'scsales' =>0,\n 'sctkts' => 0,\n 'vsales' => 0,\n 'vcan' => 0,\n 'vprof' => 0,\n 'vpay' => 0,\n 'vtkts' => 0,\n 'comment' => $request['comment'],\n 'expenses' => $totalexpense,\n 'cashin' => $totalcashin,\n 'cashout' => $totalcashout,\n 'opbalance' => $openningbalance,\n 'clcash' => $closingbalance,\n 'reportedcash' => $request['reportedcash'],\n 'comment' => $request['bio'],\n \n 'ucret' => $userid,\n \n ]);\n //// Saving the current machinecodes\n Currentmachinecode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'machinecode' => $machineoneclosingcode,\n 'ucret' => $userid,\n \n ]);\n //ooooooooooooooooooooooooooooooooooooooooooooooooooooooo\n /// working and Updating the daily Codes\n /////////////////////////////////////////// checking if there is a sale or payout\n $existpreviouswork = \\DB::table('dailyreportcodes')->where('branch', '=', $inpbranch)->where('machineno', '=', 101)->count();\n // //latest sales\n \n // $resetcodestatus = \\DB::table('dailyreportcodes')->where('branch', '=', $inpbranch)\n // ->where('machineno', '=', 101)\n // ->where('resetstatus', '=', 1)\n // ->count();\n if($existpreviouswork > 0)\n {\n $previoussalesfigure = \\DB::table('dailyreportcodes')->where('branch', $inpbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('salescode');\n $previouspayoutfigure = \\DB::table('dailyreportcodes')->where('branch', $inpbranch)->where('machineno', '101')->orderBy('id', 'Desc')->limit(1)->value('payoutcode');\n }\n if($existpreviouswork < 1)\n {\n $previoussalesfigure = 0;\n $previouspayoutfigure = 0;\n }\n // if($resetcodestatus > 0)\n // $previoussalesfigure = 0;\n // $previouspayoutfigure = 0;\n \n \n // if($existpreviouswork < 1)\n // {\n // $previoussalesfigure = 0;\n // $previouspayoutfigure = 0;\n \n // }\n //00000000000000000000000000000000000000000000000000000000000000000\n\n\n/// calculating the current or dayz sales and payout\n$todayssaes1 = $machineonesales - $previoussalesfigure;\n$todayspayout11 = $machineonepayout - $previouspayoutfigure;\nif($todayssaes1 >= 0)\n{\n $todayssaes = $todayssaes1;\n}\nif($todayssaes1 < 0)\n{\n $todayssaes = $machineonesales;\n}\n//\nif($todayspayout11 >= 0)\n{\n $todayspayout = $todayspayout11;\n}\nif($todayspayout11 < 0)\n{\n $todayspayout = $machineonepayout;\n}\n///// getting the branch order\n$dorder = \\DB::table('branches')->where('id', '=', $userbranch)->count('dorder');\n/// deleting the existing record\n$bxn = $request['branchnametobalance'];\n$datedonessd = $request['datedone'];\nDB::table('dailyreportcodes')->where('branch', $bxn)->where('datedone', $datedonessd)->where('machineno', 101)->delete();\n\n\n /// working and Updating the daily Codes\n Dailyreportcode::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n 'closingcode' => $machineoneclosingcode,\n \n 'openningcode' => $machineoneopenningcode,\n 'salescode' => $machineonesales,\n 'payoutcode' => $machineonepayout,\n 'profitcode' => $machineonesales-$machineonepayout,\n 'previoussalesfigure' => $previoussalesfigure,\n 'previouspayoutfigure' => $previouspayoutfigure,\n 'currentpayoutfigure' => $todayspayout,\n 'currentsalesfigure' => $todayssaes,\n 'dorder' => $dorder,\n 'ucret' => $userid,\n 'monthmade' => $monthmade,\n 'yearmade' => $yearmade,\n \n ]);\n \n \n \n Salesdetail::Create([\n 'machineno' => '101',\n 'datedone' => $request['datedone'],\n 'branch' => $request['branchnametobalance'],\n \n 'previoussalesfigure' => $previoussalesfigure,\n 'previouspayoutfigure' => $previouspayoutfigure,\n \n 'currentsalesfigure' => $machineonesales,\n 'currentpayoutfigure' => $machineonepayout,\n \n 'salesamount' => ($machineonesales - $machineonepayout)*500,\n 'salesfigure' => $machineonesales - $machineonepayout,\n \n 'monthmade' => $monthmade,\n 'yearmade' => $yearmade,\n \n \n 'ucret' => $userid,\n \n ]);\n \n } /// COSING IF THE MACHINE WAS RESET TO ZERO\n\n \n } /// closing for one machine\n \n // llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll\n \n \n } //// closing working with fish\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n }", "function kv_bank_balance(){\n $today = Today();\n $today = date2sql($today);\n// $sql = \"SELECT bank_act, bank_account_name, bank_curr_code, SUM(amount) balance FROM \" . TB_PREF . \"bank_trans bt\n// INNER JOIN \" . TB_PREF . \"bank_accounts ba ON bt.bank_act = ba.id WHERE trans_date <= '$today' AND inactive <> 1 GROUP BY bank_act, bank_account_name ORDER BY bank_account_name\";\n\n $sql = \"select b.account_name as bank_account_name,ROUND(sum(amount),2) balance from 0_gl_trans a \nleft join 0_chart_master b on b.account_code = a.account \n inner join 0_bank_accounts c on c.account_code=b.account_code \n where a.tran_date <= '$today' \ngroup by account order by b.account_name limit 10\";\n\n $result = db_query($sql);\n //echo trans(\"Bank Account Balances\");//display_title($title);\n ?>\n <table class=\"table table-hover\">\n <thead class=\"text-warning\">\n <tr>\n <th>Account</th>\n <th style=\"text-align: right;\">Balance</th>\n </tr>\n </thead><?php $k = 0; //row colour counter\n while ($myrow = db_fetch($result)) {\n alt_table_row_color($k);\n label_cell($myrow[\"bank_account_name\"]);\n amount_cell($myrow['balance']);\n end_row();\n }\n end_table(1);\n}", "function sellStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qtyRequested = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n\n //check how many of the stock you own\n $qtyYouOwn = getStockQuantity($username,$sym);\n \n //Make sure you have more or equal qty in portfolio compared to what you wanna sell\n if($qtyYouOwn >= $qtyRequested)\n {\n //Calculate the total value of your sell.\n $totalValue = $currentCost * $qtyRequested;\n }\n else //Placeholder for now, should probably not do this.\n {\n //Sell only the amount that you have in portfolio\n $totalValue = $currentCost * $qtyYouOwn;\n }\n \n \n //Call addtoAccountBalance and add $totalValue to the account balance\n $currentBalance = addtoAccountBalance($username,$totalValue,$sym);\n \n //Call deleteFromPortfolioDB and delete the previous entry\n deleteFromPortfolioDB($username, $qtyRequested, $sym);\n\n $returnString = \"Sell Order Confirmed!\";\n \n return($returnString);\n}", "public function check_balance()\n {\n $data = array(\n 'CommandID' => 'AccountBalance',\n 'PartyA' => $this->paybill,\n 'IdentifierType' => '4',\n 'Remarks' => 'Remarks or short description',\n 'Initiator' => $this->initiator_username,\n 'SecurityCredential' => $this->get_credential(),\n 'QueueTimeOutURL' => $this->balance_check_result_url,\n 'ResultURL' => $this->balance_check_result_url\n );\n $data = json_encode($data);\n $url = $this->base_url . 'accountbalance/v1/query';\n $response = $this->submit_request($url, $data);\n return $response;\n }", "function Purchase($uid, $item, $status = \"Completed\", $date = -1, $count = -1, $txnId = \"Unknown\", $duplicate = false) {\r\n if (substr($uid, 0, 2) == \"GU\")\r\n return false;\r\n \r\n if (file_exists(\"App/db\")) {\r\n $dir = \"App/db/purchases\";\r\n $fileName = \"$dir/$uid.txt\";\r\n\t}\r\n else {\r\n \t$dir = \"db/purchases\";\r\n $fileName = \"$dir/$uid.txt\";\r\n\t}\r\n \r\n if (!file_exists($dir))\r\n \tmkdir($dir, 0777, true); \r\n \r\n class Ud {};\r\n \r\n if (file_exists($fileName))\r\n {\r\n $json = file_get_contents($fileName);\r\n\r\n if ($json === false)\r\n {\r\n error_log(\"Error opening file $fileName\");\r\n return false;\r\n }\r\n \r\n $ud = json_decode($json);\r\n }\r\n\r\n if (empty($ud))\r\n $ud = new Ud();\r\n \r\n if (empty($ud->purchases))\r\n $ud->purchases = new Ud();\r\n\r\n if (empty($ud->purchases->$item))\r\n $ud->purchases->$item = new Ud();\r\n\r\n if ($count >= 0)\r\n $cnt = $count;\r\n else\r\n {\r\n $cnt = empty($ud->purchases->$item->count) ? 0 : $ud->purchases->$item->count;\r\n if ($cnt < 0) $cnt = 0;\r\n $cnt = $cnt + 1;\r\n }\r\n $ud->purchases->$item->count = $cnt;\r\n \r\n if ($date >= 0)\r\n $ud->purchases->$item->date = $date;\r\n else\r\n $ud->purchases->$item->date = time() * 1000;\r\n\r\n $ud->purchases->$item->status = $status;\r\n $ud->purchases->$item->txnId = $txnId;\r\n if ($duplicate === true)\r\n $ud->purchases->$item->duplicate = true;\r\n \r\n $result = @file_put_contents($fileName, json_encode($ud));\r\n if ($result === false)\r\n {\r\n error_log(\"Error writing to file $fileName\");\r\n return false;\r\n }\r\n return true;\r\n}", "public function processPCTWalletTransfer($payload)\n\t{\n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $result = $this->user->sign_in($this->input->post('user-name'), $this->input->post('user-password'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnId = \"PCTINT\".time();\n\t $fromUser = $result;\n\t $toUser = $this->input->post('to-account');\n\t $txnType = 'User To User Transfer';\n\t $txnPoints = $this->input->post('pct-transfer-points');\n\t $txnTopic = $this->input->post('pct-topic');\n\t $txnMessage = $this->input->post('pct-message');\n\t \n\t # Now before actually making the transaction store, we need to add points to users account\n\t \n\t $profile = $this->user->getUserProfile($result);\n\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t if($txnPoints > $walletAmount){\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE_INSUFFICIENT_FUND);\n\t return $response;\n\t }\n\t \n\t $toUserProfile = $this->user->getUserProfile($toUser);\n\t \n\t $this->db->where(User::_ID, $toUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => $toUserProfile->{User::_PCT_WALLET_AMOUNT} + $txnPoints));\n\t $this->db->where(User::_ID, $fromUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => ($walletAmount- $txnPoints)));\n\t \n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($fromUser, $toUser, $txnId, $txnType, $txnPoints, $txnTopic, $txnMessage);\n\t \n\t # Now once the payment is successfull, we should get the balance once again and pass this\n\t \n\t $profile = $this->user->getUserProfile($fromUser);\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t \n\t if($result) $response = array('flag'=>1, 'message'=>Message::PCT_PAYMENT_TRANSFER_SUCCESS, 'walletAmount'=>$walletAmount);\n\t else $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE);\n\t \n\t return $response;\n\t}", "public function getBalance();", "function acceptBet()\n\t\t{\n\t\t\t$userId= $this->input->get_post('user_id');\n\t\t\t$userCoins= $this->input->get_post('user_coins');\n\t\t\t$betId= $this->input->get_post('bet_id');\n\t\t\t$betWager =$this->input->get_post('bet_wager');\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif($userId == false || $userId == \"\"){\n\t\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t\t$this->_jsonData['message']=\"User Id is Missing\";\n\t\t\t\t}else if($userCoins == false || $userCoins == \"\"){\n\t\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t\t$this->_jsonData['message']=\"User Coins is Missing\";\n\t\t\t\t}else if($betId == false || $betId == \"\"){\n\t\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t\t$this->_jsonData['message']=\"Bet Id is Missing\";\n\t\t\t\t}else if($betWager == false || $betWager == \"\"){\n\t\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t\t$this->_jsonData['message']=\"Bet Wager is Missing\";\n\t\t\t\t}else{\n\t\t\t\t\tif($userCoins>=$betWager){\n\t\t\t\t\t\t$this->userModel->updateBet($userId,$betId);\n\t\t\t\t\t\t$this->_jsonData['status']=\"SUCCESS\";\n\t\t\t\t\t\t$this->_jsonData['message']=\"Bet Accepted Successfully\";\n\t\t\t\t\t\t$this->_jsonData['data']='';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t\t\t$this->_jsonData['message']=\"User Coins is less then bet wager\";\n\t\t\t\t\t\t$this->_jsonData['data']='';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(Exception $e){\n\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t$this->_jsonData['message']=\"Error Occured\";\n\t\t\t}\n\t\t\techo json_encode($this->_jsonData);\t\n\t\t\t$this->ServicesModel->createService($_REQUEST,$this->_jsonData,$_SERVER['SERVER_ADDR'],'acceptBet',$_FILES);\n\n\t\t}", "public function transferToAccount(Request $request){\n\n //Validation of data\n $rules = [\n 'type_acc_sender' => 'required',\n 'type_acc_receiver'=>'required',\n 'montant_virement'=>'required',\n 'type'=>'required | integer | between:0,1'\n ];\n $data=$request->json()->all();\n $validator = Validator::make($data, $rules);\n if (!$validator->passes()) {\n dispatch(new LogJob('','', 'Input validation error',11,LogJob::FAILED_STATUS));\n return response()->json(['message' => $validator->errors()->all()], 400);\n }\n try{\n DB::beginTransaction();\n $currency = new CurrenciesController();\n $amount = $data['montant_virement'];\n $new_amount = $amount;\n\n //Get the id of the customer\n $id_customer = $request->user()->id;\n\n\n //sender and receiver account\n $account_sender = $this->accountService->findAccountByType($data['type_acc_sender'],$id_customer,0);\n $account_receiver = $this->accountService->findAccountByType($data['type_acc_receiver'],$id_customer,0);\n //if the receiver account dosen't exist\n if(is_null($account_receiver)){\n //log\n dispatch(new LogJob($account_sender->id_customer,null,'receiver not found',11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message'=>'receiver not found']),404);\n }\n //if the receiver account != current account\n if($data['type_acc_receiver'] == $data['type_acc_sender']) {\n //log\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, 'Transfer to the same account', 11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message' => 'Virement vers le meme compte ']), 400);\n }\n //if the amount is bigger than the sender balance\n if ($amount > $account_sender->balance) {\n //log\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, 'Transfer with insuffsant balance', 11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message' => 'balance insuffisant ']), 400);\n }\n\n\n // type currency dollar or euro\n if($data['type_acc_sender'] >= 3 || $data['type_acc_receiver'] >= 3 ){\n\n $new_amount = $currency->exchangeRate($amount,$account_sender->currency_code,$account_receiver->currency_code);\n }\n\n //Find the commission code\n $codeCommission = $this->codeCommission($data['type_acc_sender'], $data['type_acc_receiver']);\n\n\n $this->virementInterneService->create($codeCommission, 0, $amount,$new_amount, $account_sender, $account_receiver, $data['type']);\n\n\n DB::commit();\n $newBalance = $account_receiver->balance;\n // Send mail\n $customer = $request->user();\n $this->virementInterneService->sendVirementSameUserNotifMAil($customer->email,\n $account_sender->getCode(),$account_receiver->getCode(),\n $new_amount,$account_receiver->code_curr_receiver);\n\n return response(json_encode(['message' => 'transfer success', 'balance' => $newBalance]),201);\n } catch (\\Exception $e) {\n DB::rollback();\n //log information\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, $e->getMessage(), 11, LogJob::FAILED_STATUS));\n return response()->json(['message' => $e->getMessage()], 500);\n }\n }", "public function userStoreWithdrawal(Request $request)\n {\n // return dd($request);\n $user = User::whereId(auth()->user()->id)->firstOrFail();\n if (!isset($user->withdrawalBank->bank_code) || !isset($user->withdrawalBank->account_name) || !isset($user->withdrawalBank->account_number)) {\n $response['status'] = \"info\";\n $response['message'] = \"Your Withdrawal bank details is not setup, visit your profile to update it.\";\n return redirect()->route('dashboard')->with($response['status'], $response['message']);\n }\n\n $minAmount = 100;\n $maxAmount = $user->available_balance;\n if ($user->available_balance < 100) {\n $response['status'] = \"info\";\n $response['message'] = \"You do not have suffient available balance to withdraw.\";\n return redirect()->route('dashboard')->with($response['status'], $response['message']);\n }\n $this->validate($request, [\n 'amount' => \"required|integer|min:50\",\n ]);\n if ($user->available_balance < $request->amount) {\n $response['status'] = \"info\";\n $response['message'] = \"You do not have suffient available balance for the amount you selected. Please select an amount within your available balance\";\n return redirect()->route('dashboard')->with($response['status'], $response['message']);\n }\n $userBank = $user->withdrawalBank;\n Withdrawal::create([\n 'user_id' => $user->id,\n 'amount' => $request->amount,\n 'status' => 'pending',\n 'completed_at' => null,\n 'bank_code' => $userBank->bank_code,\n 'account_name' => $userBank->account_name,\n 'account_number' => $userBank->account_number,\n ]);\n $user->available_balance -= $request->amount;\n $user->update();\n $response['status'] = \"success\";\n $response['message'] = \"Your Withdrawal of #{$request->amount} has been placed.\";\n return redirect()->route('withdrawal_history')->with($response['status'], $response['message']);\n }", "public function checkAction()\n {\n $result = $this->_checkBalance();\n $this->getResponse()->setBody($result);\n }", "public function handle()\n {\n $this->info('Starting to process deposits');\n $this->info('Initiating Wallet...');\n $host = config('app.wallet.ip');\n $wallet = new Wallet($host);\n $this->info('Wallet initiated');\n \n $this->info('Get all banks');\n $banks = Bank::all();\n if (count($banks) > 0) {\n $deposits = 0;\n $success = 0;\n $bar = $this->output->createProgressBar(count($banks));\n $start = Carbon::now();\n foreach ($banks as $bank) {\n $user = User::find($bank->user_id);\n if ($user !== null) {\n $splitIntegrated = $wallet->splitIntegratedAddress($bank->address);\n $splitIntegrated = json_decode($splitIntegrated);\n \n if ($splitIntegrated !== '') {\n $payments = $wallet->getPayments($splitIntegrated->payment_id);\n $payments = json_decode($payments);\n \n if ($payments !== []) {\n if (isset($payments->payments)) {\n $payments = $payments->payments;\n foreach ($payments as $payment) {\n $entry_found = RecTxid::where('txid', $payment->tx_hash)->first();\n if ($entry_found === null) {\n sleep(1);\n $stats = file_get_contents('http://superior-coin.info:8081/api/transaction/'.$payment->tx_hash);\n $stats = json_decode($stats);\n $stats = $stats->data;\n\n $txid = $stats->tx_hash;\n $timestamps = $stats->timestamp_utc;\n $height = $stats->block_height;\n\n // FOR DOUBLE CHECKING\n $entry_found_again = RecTxid::where('txid', $txid)->first();\n if ($entry_found_again === null) {\n $rec_txids = new RecTxid;\n if ($height >= 10) {\n $rec_txids->status = 1;\n }else{\n $rec_txids->status = 0;\n }\n $rec_txids->user_id = $user->id;\n $rec_txids->recadd = $bank->address;\n $rec_txids->txid = $txid;\n $rec_txids->date = $timestamps;\n $rec_txids->height = $height;\n $rec_txids->coins = $payment->amount / 100000000;\n $rec_txids->save();\n \n $success++;\n }\n }\n $deposits++;\n }\n }\n }\n }\n }\n $bar->advance();\n }\n $end = Carbon::now();\n $total_run = $start->diffInSeconds($end);\n $run_time = gmdate('H:i:s', $total_run);\n $bar->finish();\n $this->info('Total run: ' . $run_time);\n $this->info('Processed ' . $success . ' out of ' . $deposits . ' deposits from ' . count($banks) . ' banks');\n } else {\n $this->info('No Banks found');\n }\n $this->info('Process end!');\n }", "public function store_convert_to_wallet_funds(Request $request)\n {\n $max = ((Auth()->user()->bonus) * 0.98);\n request()->validate([\n 'funding_amount' => 'required|numeric|min:10|max:' . $max,\n ]);\n\n if ($request->has('funding_amount')) {\n try {\n $new_trx = new Transaction();\n $new_trx->amount = $request->funding_amount;\n $new_trx->status = 'created';\n $new_trx->type = 'funding';\n $new_trx->user_id = Auth()->id();\n\n $new_bonus_trx = new Bonus();\n $new_bonus_trx->user_id = Auth()->user()->id;\n $new_bonus_trx->amount = -$request->funding_amount;\n $new_bonus_trx->status = 'created';\n $new_bonus_trx->type = 'wallet_convert';\n $new_bonus_trx->save();\n $new_bonus_trx->transaction()->save($new_trx);\n $new_trx->status = 'completed';\n $new_trx->update();\n $user = User::where('id',Auth()->user()->id)->first();\n $user->bonus -= $new_trx->amount;\n $user->wallet += $new_trx->amount;\n $user->update();\n\n //collect service charge\n $new_sc_trx = new Transaction();\n $new_sc_trx->amount = - ($request->funding_amount * 0.02);\n $new_sc_trx->status = 'created';\n $new_sc_trx->type = 'funding_fee';\n $new_sc_trx->user_id = $user->id;\n\n $new_sc_bonus_trx = new Bonus();\n $new_sc_bonus_trx->user_id = $user->id;\n $new_sc_bonus_trx->amount = - ($request->funding_amount * 0.02);\n $new_sc_bonus_trx->status = 'created';\n $new_sc_bonus_trx->type = 'bonus_convert_fee';\n $new_sc_bonus_trx->save();\n $new_sc_bonus_trx->transaction()->save($new_sc_trx);\n $new_sc_trx->status = 'completed';\n $new_sc_trx->update();\n // $user = User::where('id',Auth()->user()->id)->first();\n $user->bonus -= ($request->funding_amount * 0.02);\n $user->update();\n\n //receive service charge\n $admin = User::whereRole(\"admin\")->firstOrFail();\n $new_scr_trx = new Transaction();\n $new_scr_trx->amount = ($request->funding_amount * 0.02);\n $new_scr_trx->status = 'created';\n $new_scr_trx->type = 'bonus';\n $new_scr_trx->user_id = $admin->id;\n\n $new_scr_bonus_trx = new Bonus();\n $new_scr_bonus_trx->user_id = $admin->id;\n $new_scr_bonus_trx->amount = ($request->funding_amount * 0.02);\n $new_scr_bonus_trx->status = 'created';\n $new_scr_bonus_trx->type = 'bonus_convert_charge';\n $new_scr_bonus_trx->save();\n $new_scr_bonus_trx->transaction()->save($new_trx);\n $new_scr_trx->status = 'completed';\n $new_scr_trx->update();\n $admin->bonus += $new_scr_trx->amount;\n $admin->update();\n return redirect()->route('user_home')->with('success', \"Your wallet was successfully funded with {$request->amount} from your bonus\");\n } catch (\\Exception $e) {\n return back()->with('error', sprintf('Could not fund your wallet: %s', $e->getMessage()));\n }\n }\n }", "public function actionWithdrawMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Check if the wallet have enough fund\n if ($wallet->balance >= $result['converted_amount']) {\n // Perform the balance withdraw with conversion\n $wallet->balance -= $result['converted_amount'];\n } else {\n // Log the transaction as complete\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' does not have enough fund for this operation.');\n }\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Check if the wallet have enough fund\n if ($wallet->balance >= $amount) {\n // Perform the balance withdraw without conversion\n $wallet->balance -= $amount;\n } else {\n // Log the transaction as incomplete\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' does not have enough fund for this operation.');\n }\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the withdraw\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }", "public function testActiveAccountPayoutWithTinyBalance()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '10000'\n ]);\n\n $activeAccounts = factory(ActiveAccount::class, 3)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE\n ]);\n\n $activeAccount = factory(ActiveAccount::class)->create([\n 'balance' => '0.0000001' * StellarAmount::STROOP_SCALE\n ]);\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $payoutAmount = $this->payoutService->calculateActiveAccountPayoutAmount($activeAccount);\n \n $this->assertEquals(0, $payoutAmount);\n }", "public function balance($table, $parameters = array()) {\n\t\t\t$response = array(\n\t\t\t\t'message' => array(\n\t\t\t\t\t'status' => 'error',\n\t\t\t\t\t'text' => ($defaultMessage = 'Error adding balance amount to your account, please try again.')\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['data']['balance']) &&\n\t\t\t\t!empty($parameters['user']['id'])\n\t\t\t) {\n\t\t\t\t$response['message']['text'] = 'Invalid account balance amount, please try again.';\n\t\t\t\t$balanceData = $this->fetch('products', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'type' => 'balance'\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'minimum_quantity',\n\t\t\t\t\t\t'maximum_quantity',\n\t\t\t\t\t\t'type'\n\t\t\t\t\t),\n\t\t\t\t\t'limit' => 1,\n\t\t\t\t\t'sort' => array(\n\t\t\t\t\t\t'field' => 'modified',\n\t\t\t\t\t\t'order' => 'DESC'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (\n\t\t\t\t\t!empty($balanceData['count']) &&\n\t\t\t\t\tis_numeric($parameters['data']['balance'])\n\t\t\t\t) {\n\t\t\t\t\t$response['message']['text'] = 'Balance amount added must be <strong>less than ' . number_format($balanceData['data'][0]['maximum_quantity'], 2, '.', ',') . ' ' . $this->settings['billing']['currency'] . '</strong> and <strong>greater than ' . number_format($balanceData['data'][0]['minimum_quantity'], 2, '.', ',') . ' ' . $this->settings['billing']['currency'] . '</strong>, please try again.';\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t$parameters['data']['balance'] < $balanceData['data'][0]['maximum_quantity'] &&\n\t\t\t\t\t\t$parameters['data']['balance'] > $balanceData['data'][0]['minimum_quantity']\n\t\t\t\t\t) {\n\t\t\t\t\t\t$response['message']['text'] = $defaultMessage;\n\t\t\t\t\t\t$invoiceConditions = array(\n\t\t\t\t\t\t\t'cart_items' => sha1($parameters['data']['balance'] . uniqid() . time()),\n\t\t\t\t\t\t\t'status' => 'unpaid',\n\t\t\t\t\t\t\t'subtotal' => $parameters['data']['balance'],\n\t\t\t\t\t\t\t'total' => $parameters['data']['balance'],\n\t\t\t\t\t\t\t'user_id' => $parameters['user']['id']\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$invoiceData = array(\n\t\t\t\t\t\t\t$invoiceConditions\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif ($this->save('invoices', $invoiceData)) {\n\t\t\t\t\t\t\t$invoice = $this->fetch('invoices', array(\n\t\t\t\t\t\t\t\t'conditions' => $invoiceConditions,\n\t\t\t\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t\t\t\t'id'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t\tif (!empty($invoice['count'])) {\n\t\t\t\t\t\t\t\t$response = array(\n\t\t\t\t\t\t\t\t\t'message' => array(\n\t\t\t\t\t\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t\t\t\t\t\t'text' => 'Invoice for balance payment created successfully.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'redirect' => $this->settings['base_url'] . 'invoices/' . $invoice['data'][0] . '#payment'\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\n\t\t\treturn $response;\n\t\t}", "public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}", "function buy($amount,$symbol)\n {\n //balance should be greater than stock value to buy\n if($amount<=$this->totalamount)\n {\n //buy book stock\n if($symbol==\"Book\"){\n echo $this->new_account.\" owned Book Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->bookstock_buy++;\n $this->object_linkedlist->insertfirst(\"Book: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n //buy newspaper stock\n elseif($symbol==\"Newspaper\")\n {\n echo $this->new_account.\" owned Newspaper Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->newspaperstock_buy++;\n $this->object_linkedlist->insertfirst(\"Newspaper: \");\n $this->object_linkedlist->insertfirst(date('Y-m-d H:i:s'));\n }\n }\n //if balance is less than stock value\n else{\n echo \"Your Balance is low than Stock price\\n\";\n }\n }", "public function test_amount_less_than_rate_cost()\n {\n\n\n\n $data=[\"amount\"=> 100,\n \"unpaid_appliance_rates\"=> 2,\n \"appliance_rate_cost\"=> 200,\n \"tariff_fixed_costs\"=> 160,\n \"price_per_kwh\"=> 700\n ];\n\n $response = $this->post('/api/transactions', $data);\n // $response->assertStatus(200);\n $response->assertJson( [\"data\"=> [\n \"type\"=> \"transaction\",\n \"attributes\"=> [\n \"paid_for_appliance_rates\"=> 0,\n \"fully_covered_appliance_rate\"=> 0,\n \"paid_for_fixed_tariff\"=> 100,\n \"paid_for_energy\"=> 0,\n \"topup_for_energy\"=> 0,\n \"sold_energy\"=> 0\n ]\n ]]);\n }", "function update_wallet($cust_id,$amount,$sale_id,$user_id,$sale_type){\n\tglobal $connection; \n\t$trans=\"CUSTOMER PAID UPFRONT\"; \n\t$update_wallet=mysqli_query($connection,\"INSERT INTO kp_sc (cust_id,amount) VALUES ('$cust_id', '$amount') ON DUPLICATE KEY UPDATE amount=amount+'$amount'\") or die(mysqli_error($connection));\n\n\tif ($update_wallet) {\n\t\t$create_history = mysqli_query($connection,\"INSERT INTO kp_sc_hist(cust_id,amount,trans,user_id,trans_id,trans_type,day) \n\t\tVALUES('$cust_id','$amount','$trans','$user_id','$sale_id','$sale_type',CURRENT_DATE)\") or die(mysqli_error($connection));\n\t}else{\n\t\t error_logs(\"PAY CREDIT ORDER\",\"COULDN'T UPDATE WALLET FOR SALE ID $sale_id\");\n\t}\n\t\n}", "public function merchantTransaction(Request $request) {\n \n $input = $request->all();\n //echo \"<pre>\";\n //print_r($input); exit;\n \n $mobileNumber = $input['mobile_number'];\n $amount = $input['amount'];\n \n if( isset( $mobileNumber ) && !empty( $mobileNumber ) ) {\n $billBalanceAmt = $usrTransAmt = $usrPoint = 0;\n $userDetail = new UserDetail();\n $mobileNoExists = $userDetail->checkUserMobileNoExists( $mobileNumber );\n\n //echo \"<pre>\";\n //print_r($mobileNoExists); exit;\n\n if( isset( $mobileNoExists ) && !empty( $mobileNoExists ) ) {\n \n $response = array();\n $getUserDetail = new RedeemCode();\n $userDetails = $getUserDetail->getUserTransactionDetails( $input );\n \n //echo \"<pre>\";\n //print_r($userDetails); exit;\n\n $merZoinPoint = $userDetails[0]->merBalance;\n $zoinPoint = $userDetails[0]->zoin_point;\n $maxBillAmt = $userDetails[0]->max_bill_amount;\n $maxCheckIn = $userDetails[0]->max_checkin;\n \n $getUserTransactions = new Transaction();\n $usrTransAmt = $getUserTransactions->getUserTransactions( $userDetails );\n \n //$loyaltyBalance = new LoyaltyBalance();\n //$usrBalanceAmt = $loyaltyBalance->checkLoyaltyBalance( $userDetails );\n $usrBalanceAmt = ( isset( $userDetails[0]->user_balance ) && !empty( $userDetails[0]->user_balance ) ? $userDetails[0]->user_balance : 0);\n if( isset( $usrBalanceAmt ) && !empty( $usrBalanceAmt ) ) {\n $usrTransAmt = $usrTransAmt + $usrBalanceAmt; \n }\n \n $usrBillAmt = $amount;\n if( isset( $usrTransAmt ) && !empty( $usrTransAmt ) ) { \n $usrBillAmt = $usrTransAmt + $amount;\n }\n \n //echo $usrBillAmt; exit;\n\n $zoinPoints = $usrBillAmt / $maxBillAmt;\n $zoinPointVal = (int) $zoinPoints;\n \n //$usrPoint = $zoinPointVal * $zoinPoint;\n $usrPoint = $zoinPoint;\n \n if($merZoinPoint > 0) {\t\n \n if( $merZoinPoint > $usrPoint) {\n\n $getTransactions = new Transaction();\n $transaction_id = $getTransactions->saveNewTransaction( $input, $amount );\n \n $userIncrement = new RedeemCode();\n $usrCheckIn = $userIncrement->getUserCheckInIncrement( $input );\n \n $getTransactionRecords = new Transaction();\n $transactionRecords = $getTransactionRecords->getTransactionDetails( $transaction_id );\n\n /* echo \"<pre>\";\n print_r($transactionRecords);\n exit; */\n\n $notifiDetailSave = new Notification();\n $notifiDetailSave->saveTransactionNotification( $transactionRecords );\n\n if( $usrBillAmt >= $maxBillAmt && $usrCheckIn >= $maxCheckIn ) {\n \n // $billBalAmt = $usrBillAmt % $maxBillAmt; //Balance Amount\n\n $loyaltyUser = new LoyaltyBalance();\n $existUser = $loyaltyUser->checkLoyaltyBalance( $userDetails ); \n \n if( empty( $existUser ) ) {\n $saveLoyaltyBalance = new LoyaltyBalance();\n $saveLoyaltyBalance->saveUserLoyaltyBalance( $userDetails );\n }\n\n $loyaltyMerchant = new LoyaltyBalance();\n $existMerchant = $loyaltyMerchant->checkMerchantLoyaltyBalance( $userDetails ); \n \n if( empty( $existMerchant ) ) {\n $saveLoyaltyBalance = new LoyaltyBalance();\n $saveLoyaltyBalance->saveMerchantLoyaltyBalance( $userDetails );\n }\n \n $getUsrBalance = new ZoinBalance();\n $usrTotAmt = $getUsrBalance->getUserBalance( $userDetails );\n \n if( isset( $usrTotAmt ) && !empty( $usrTotAmt ) ) {\n \n DB::table('zoin_balance')->where('vendor_or_user_id', $userDetails[0]->user_id)->increment('zoin_balance', $usrPoint);\n \n } else {\n \n $userDetailSave = new ZoinBalance(); \n $userDetailSave->vendor_or_user_id = $userDetails[0]->user_id; \n $userDetailSave->zoin_balance = $usrPoint;\n $userDetailSave->save(); \n }\n\n $billBalanceAmt = $usrBillAmt - $maxBillAmt; //Balance Amount\n if( isset( $billBalanceAmt ) && !empty( $billBalanceAmt ) ) {\n //$saveUserBalance = new LoyaltyBalance();\n //$saveUserBalance->userLoyaltyBalanceIncrement( $userDetails[0]->user_id, $billBalanceAmt );\n $saveUserBalance = new RedeemCode();\n $saveUserBalance->userLoyaltyBalanceIncrement( $userDetails, $billBalanceAmt );\n } else {\n $saveUserBalDec = new RedeemCode();\n $saveUserBalDec->userLoyaltyBalanceDecrement( $userDetails, $billBalanceAmt );\n }\n \n //Zoin Merchant Balance reduce\n DB::table('zoin_balance')->where('vendor_or_user_id', $userDetails[0]->vendor_id)->decrement('zoin_balance', $usrPoint);\n\n $notifiDetailSave = new Notification();\n $notifiDetailSave->saveUserPointNotification( $userDetails[0]->vendor_id, $userDetails[0]->user_id, $usrPoint, $transactionRecords['transaction_id'] );\n\n $notifiDetailsSave = new Notification();\n $notifiDetailsSave->saveMerchantPointNotification( $userDetails[0]->vendor_id, $userDetails[0]->user_id, $usrPoint, $transactionRecords['transaction_id'] );\n\n DB::table('transactions')->where(['vendor_id' => $userDetails[0]->vendor_id])->where(['user_id' => $userDetails[0]->user_id])->where(['loyalty_id' => $userDetails[0]->loyalty_id])->update( ['status'=> Config::get('constant.NUMBER.ONE') ] );\n DB::table('loyalty_balance')->where('user_id', $userDetails[0]->user_id)->increment('claimed_loyalty');\n DB::table('loyalty_balance')->where('vendor_id', $userDetails[0]->vendor_id)->increment('claimed_loyalty');\n\n if( $usrCheckIn >= $maxCheckIn ) {\n \n $balCheckIn = $usrCheckIn - $maxCheckIn; //Balance Checkin \n // DB::table('loyalty_balance')->where(['user_id' => $userDetails[0]->user_id])->update( ['total_loyalty'=> $balCheckIn ] ); \n DB::table('redeem_code')->where(['vendor_id' => $userDetails[0]->vendor_id])->where(['user_id' => $userDetails[0]->user_id])->where(['loyalty_id' => $userDetails[0]->loyalty_id])->update( ['user_checkin'=> $balCheckIn ] ); \n }\t\n \n $this->__getUserResponseDetails( $userDetails, $usrBillAmt );\n $response['transaction_id'] = $transactionRecords['transaction_id'];\n $response['message'] = $this->printTransanctionCompleted();\n return response()->json(['success' => $this->successStatus, 'message' => $response ], $this->successStatusCode );\n \n } else {\n \n $this->__getUserResponseDetails( $userDetails, $usrBillAmt );\n $response['transaction_id'] = $transactionRecords['transaction_id'];\n $response['message'] = $this->printTransanctionCompleted();\n return response()->json(['success' => $this->successStatus, 'message' => $response ], $this->successStatusCode );\n \n }\n \n } else {\n //echo \"Merchant Point is not enough\";\n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMerchantPoint() ], $this->failureStatusCode );\n }\n } else {\n //echo \"Merchant Balance is not enough\";\n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMerchantBalance() ], $this->failureStatusCode );\n }\n\n\n } else { \n \n return response()->json(['success' => $this->failureStatus, 'message' => $this->printCorrectMobileNumber() ], $this->failureStatusCode );\n } \n \n } else {\n \n return response()->json(['success' => $this->failureStatus, 'message' => $this->printMobileNoMissing() ], $this->failureStatusCode );\n } \n \n }", "function accountwithdrawal()\n\t\t\t{\n\t\t\t\techo\"<h3>You are withdrawing from main account</h3>\";\n\t\t\t\techo\"<br/><hr/>\";\n\t\t\t\techo\"<form action='industrynemurabinik' method='post' style=''>\";\n\t\t\t\techo\"Given to:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='nameofperson' placeholder='enter name of person assigned' size='32' required='required'/><br/><br/>\";\n\t\t\t\techo\"enter amount<input type='text' name='amount' placeholder='enter amount to withdraw' size='32' required='required'/><br/><br/>\";\n\t\t\t\t\n\t\t\t\t$vote=mysqli_query($con,\"select * from voteheads where termit='one'\");\n\t\t\t\techo\"amount use: <select name='votehead' style='width:39%;'>\";\n\t\t\t\twhile($head=mysqli_fetch_array($vote))\n\t\t\t\t{\n\t\t\t\t\techo\"<option>\".$head['name'].\"</option>\";\n\t\t\t\t}\n\t\t\t\techo\"<option>other</option>\";\n\t\t\t\techo\"</select><br/><br/>\";\n\t\t\t\techo\"<input type='submit' value='withdraw cash'/>\";\n\t\t\t\techo\"</form>\";\n\t\t\t\t//end of making payments\n\t\t\t}", "function calculateBalance3420($serviceArray, $exportData, $recordNumber){\r\n\t$minorFound = 0; //flag to tell if we've found a minor on this account - if so, put them in the notes\r\n\t$mostRecentDate = \"0\"; //this is the placeholder for the date evaluation to see which is the most recent\r\n\t$minorstring = \"\"; //this is a string of text to be prepended to the notes if a minor is found\r\n\t$notestring = \"\"; //this is the overall note string we will ultimately split\r\n\r\n\tforeach($serviceArray as $k=>$v){ //we could have multiple service lines for each visit so we need to loop through it\r\n\t\t$exportData[01]['balance'] += (float) $v->Balance;\r\n\t\t$dateToCheck = (string) $v->DOS; //this is the date that we'll check to see if it is more recent\r\n\t\t$serviceDate = strtotime($dateToCheck); //make a timestamp\r\n\r\n\t\t\tif($serviceDate > $mostRecentDate){ //do a date comparison to get the most recent\r\n\t\t\t\t$exportData[01]['dateOfService'] = $dateToCheck; //set thus as the date since it's more recent\r\n\t\t\t\t$mostRecentDate = $serviceDate; //update the flag for next comparison\r\n\t\t\t}\r\n\r\n\t\t$notesBalance = number_format((float) $v->Balance, 2); //placeholder\r\n\t\t$notestring .= $v->DOS.\" Provider: \".$v->Provider.\" \".$notesBalance.\" | \";\r\n\r\n\t\t\tif($exportData[01]['debtorSs'] != $v->PatientSSN){ //we have a minor so we need to adjust the debtor/RP info\r\n\r\n\t\t\t\t$exportData[01]['rpName'] = $exportData[01]['debtorName'];\r\n\t\t\t\t$exportData[01]['rpPhone'] = $exportData[01]['debtorPhone'];\r\n\t\t\t\t$exportData[01]['rpSs'] = $exportData[01]['debtorSs'];\r\n\t\t\t\t$exportData[01]['debtorSs'] = $v->PatientSSN;\r\n\t\t\t\t$exportData[01]['debtorPhone'] = \"\"; //reset this because we don't get phone info on the service lines\r\n\t\t\t\t$exportData[01]['debtorName'] = $v->Patient;\r\n\t\t\t\tif(strlen($minorstring)==0)$minorstring .= \"MINOR: \".$v->Patient.\" DOB:\".$v->PatientDOB.\" | \"; //do this once\r\n\t\t\t}else{ //this is an adult so we don't need to have duplicate info - reset the RP fields\r\n\t\t\t\t$exportData[01]['rpPhone'] = '';\r\n\t\t\t\t$exportData[01]['rpName'] = '';\r\n\t\t\t\t$exportData[01]['rpSs'] = '';\r\n\t\t\t}\r\n\t}\r\n\t$exportData[03]['Note1'] = $minorstring.$notestring;\r\n\treturn $exportData;\r\n}", "public function wallet(Request $request,$userid,$type)\n { \n if($type=='request')\n {\n $were = array('uid'=>$userid);\n $data['applyrequests'] = Withdraw::getbycondition22($were);\n if(count($data['applyrequests']['data']) > 0)\n {\n foreach($data['applyrequests']['data'] as $key=>$dd)\n { \n if($dd['status']=='0')\n {\n $data['applyrequests']['data'][$key]['status'] = 'Pending';\n }else if($dd['status']=='1')\n {\n $data['applyrequests']['data'][$key]['status'] = 'Declined'; \n }else\n {\n $data['applyrequests']['data'][$key]['status'] = 'Approve'; \n }\n \n } \n }else\n {\n $data['applyrequests']['data'] = array();\n }\n $were = array('uid'=>$userid,'status'=>'2');\n \n $data2['applyrequests2'] = Withdraw::getbycondition($were);\n $were2 = array('uid'=>$userid,'status'=>'1');\n $data2['reffered'] = Reffer::getbycondition($were2);\n $data2['transactions2'] = Transaction::getbycondition(array('user_id'=>$userid));\n $data['walletamount']=0;\n $data['reffer_amount'] =0;\n foreach($data2['reffered'] as $reffer)\n {\n if(!empty($reffer->amount))\n {\n $data['walletamount'] += $reffer->amount;\n $data['reffer_amount'] += $reffer->amount;\n }\n }\n \n foreach($data2['transactions2'] as $reffers)\n {\n if(!empty($reffers->walletuse))\n {\n $data['walletamount'] -= $reffers->walletuse;\n }\n }\n \n $data['withdrwaamount']=0;\n foreach($data2['applyrequests2'] as $reffers)\n {\n if(!empty($reffers->amount))\n {\n $data['walletamount'] -= $reffers->amount;\n $data['withdrwaamount'] +=$reffers->amount;\n }\n }\n \n if(count($data2['reffered']) == 0 || $data['walletamount'] < 0)\n {\n $data['walletamount']=0; \n }\n\n \n }\n else\n { \n $data['transactions'] = Transaction::getoption23(array('user_id'=>$userid));\n foreach($data['transactions']['data'] as $key=>$dd)\n { \n \n if($dd['amount'] != '0' && $dd['transaction_id'] =='0')\n {\n $data['transactions']['data'][$key]['transaction_id'] = 'Wallet';\n }\n elseif($dd['transaction_id'] != '0')\n {\n $data['transactions']['data'][$key]['transaction_id'] = '#'.$dd['transaction_id'];\n }else\n {\n $data['transactions']['data'][$key]['transaction_id'] = 'Free';\n }\n \n $data['transactions']['data'][$key]['packagename'] = Subscription_content::getname($dd['package_id']);\n \n if($dd['package_id'] == '1')\n {\n $data['transactions']['data'][$key]['method'] = '--';\n }\n elseif($dd['amount'] != '0' && $dd['transaction_id'] =='0')\n {\n $data['transactions']['data'][$key]['method'] ='Wallet';\n }\n else\n {\n $data['transactions']['data'][$key]['method'] ='Card';\n }\n \n if($data['transactions']['current_page']=='1')\n {\n $datek = Hours::getdetailsuserret($userid,'expiry');\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime($datek));\n }else\n {\n if(!empty($dd['exp']) && $dd['exp']!='')\n {\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime($dd['exp']));\n }else\n {\n \n $date = strtotime($dd['created']);\n if($dd['package_id'] == '1'){\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime(\"+7 day\", $date));\n }else if($dd['package_id'] == '3')\n { \n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime(\"+1 year\", $date)); \n }\n else{\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime(\"+1 month\", $date)); \n }\n } \n }\n }\n }\n\n $messags['message'] = \"Wallet data.\";\n $messags['status']= 1; \n $messags['data']= $data; \n echo json_encode($messags);\n die;\n }", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "function withdrawal($account, $amount, $id_user) {\r\n\r\n //Crear la conexión\r\n $base = conection();\r\n\r\n //Verificar que el usuario tenga disponible ese dinero\r\n $sql = \"SELECT balance, pending FROM users WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result = $base->prepare($sql);\r\n\r\n //Ejecutar consulta\r\n $result->execute(array(\":id_user\"=>$id_user));\r\n\r\n //Contar registros encontrados\r\n $count = $result->rowCount();\r\n \r\n //Verificar si se ingresó el registro\r\n if ($count > 0) {\r\n\r\n while ($row=$result->fetch(PDO::FETCH_ASSOC)) {\r\n $balance = $row[\"balance\"];\r\n $pending = $row[\"pending\"];\r\n }\r\n\r\n if ($balance >= $amount) {\r\n\r\n //Restamos el dienro al usuario\r\n $new_balance = $balance - $amount;\r\n $new_pending = $pending + $amount;\r\n \r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_new_balance = \"UPDATE `users` SET `balance`= :balance, `pending`= :pending WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result_new_balance = $base->prepare($sql_new_balance);\r\n\r\n //Ejecutar consulta\r\n $result_new_balance->execute(array(\":balance\"=>$new_balance, \":pending\"=>$new_pending, \":id_user\"=>$id_user));\r\n\r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_withdrawal = \"INSERT INTO `withdrawal`(`account`, `amount`, `date`, `id_user`) VALUES (:account, :amount , NOW(), :id_user)\";\r\n\r\n //Preparar consulta\r\n $result_withdrawal = $base->prepare($sql_withdrawal);\r\n\r\n //Ejecutar consulta\r\n $result_withdrawal->execute(array(\":account\"=>$account, \":amount\"=>$amount, \":id_user\"=>$id_user));\r\n\r\n $count_withdrawal = $result_withdrawal->rowCount();\r\n\r\n if ($count_withdrawal > 0) {\r\n\r\n //Enviar email\r\n $msg = \"The user with the id $id_user has requested a withdrawal in the amount of $amount for their Payeer account $account\";\r\n \r\n mail(\"[email protected]\", \"New Withdrawal request - $id_user\", $msg);\r\n\r\n return \"<b>Your withdrawal request has been sent</b>\\nIn less than 24 hours your order will be processed\";\r\n }\r\n\r\n }else {\r\n return \"You don't have enough funds\";\r\n }\r\n \r\n }else {\r\n return \"fatal error 3\";\r\n }\r\n\r\n}", "public function postBankDeposit(Request $request) {\n $validator = \\Validator::make($request->all(), \\Solunes\\Payments\\App\\OnlineBankDeposit::$rules_send);\n $sale_payment_id = $request->input('sale_payment_id');\n if(!$validator->passes()){\n return redirect($this->prev)->with('message_error', 'Debe llenar todos los campos obligatorios.')->withErrors($validator)->withInput();\n } else {\n $sale_payment = \\Solunes\\Sales\\App\\SalePayment::find($sale_payment_id);\n $sale = $sale_payment->sale;\n if($sale_payment->status=='holding'&&$sale = \\Solunes\\Sales\\App\\Sale::findId($sale_payment->parent_id)->checkOwner()->first()){\n $cancel_url = url('');\n $transaction = \\BankDeposit::generateSalePayment($sale_payment->payment, $cancel_url);\n if($sale_payment->online_bank_deposit){\n $online_bank_deposit = $sale_payment->online_bank_deposit;\n } else {\n $online_bank_deposit = new \\Solunes\\Payments\\App\\OnlineBankDeposit;\n $online_bank_deposit->sale_payment_id = $sale_payment->id;\n $online_bank_deposit->status = 'holding';\n }\n $online_bank_deposit->parent_id = $request->input('online_bank_id');\n $online_bank_deposit->transaction_id = $transaction->id;\n $online_bank_deposit->file = \\Asset::upload_file($request->file('file'), 'online-bank-deposit-file');\n $online_bank_deposit->save();\n if(config('payments.cash_params.redirect')&&config('payments.cash_params.redirect_url')){\n if(config('payments.notify_agency_on_payment')&&$sale->agency){\n \\FuncNode::make_email('verify-payment', [$sale->agency->email], []);\n }\n return redirect(config('payments.cash_params.redirect_url'))->with('message_success', 'Su pago fue recibido, deberá ser confirmado en las próximas horas y le enviaremos un email confirmando la recepción del pago. ¡Muchas gracias!');\n } else {\n return redirect($this->prev)->with('message_success', 'Su pago fue recibido, deberá ser confirmado en las próximas horas y le enviaremos un email confirmando la recepción del pago. ¡Muchas gracias!');\n }\n } else {\n return redirect($this->prev)->with('message_error', 'Hubo un error al encontrar su pago.');\n }\n }\n }", "public function calculateTotalAmount()\n {\n\n $total = 0;\n $base_currency_total = 0;\n $items_in_bag = Session::get('items');\n\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n $priceAccessoiresMust = 0;\n $priceAccessoires = 0;\n if (!empty($item['orderItemAccessories'])) {\n foreach ($item['orderItemAccessories'] as $orderItemAccessorie) {\n if (Session::get('cur_currency') === 'USD') {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n } else {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n }\n }\n }\n\n if (Session::get('cur_currency') === 'USD') {\n $price = $item['quantity'] * ($item['price'] * Session::get('amount_per_unit'));\n } else {\n $price = $item['quantity'] * $item['price'];\n }\n\n $base_currency_total = $base_currency_total + ($item['price'] * $item['quantity']) + $priceAccessoiresMust + $priceAccessoires;\n $total = round($total + $price + $priceAccessoiresMust + $priceAccessoires, 2);\n\n }\n }\n\n Session::put('total', $total);\n Session::put('bc_currency_total', $base_currency_total);\n return $total;\n }", "function bill_pay_card_with_wallet() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t$wt_category = $_REQUEST['wt_category'];\n\t\t// wt_category = 11 pay bill\n\t\t$bill_category_id = $_REQUEST['bill_category_id'];\n\t\t// 1- Water, 2- Movies etc\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\t$bill_amount = $_REQUEST['bill_amount'];\n\t\t$bill_consumer_no = $_REQUEST['bill_consumer_no'];\n\t\t$card_no = $_REQUEST['card_number'];\n\t\t$cvv_no = $_REQUEST['cvv_no'];\n\t\t$wallet_type = 2;\n\t\t// 1- Credit, 2-Debit\n\t\t$bill_pay_status = 1;\n\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_desc = 'PaY Bill';\n\t\tif (!empty($bill_consumer_no) && !empty($biller_id) && !empty($bill_amount) && !empty($recharge_user_id)) {\n\t\t\t//$bill_records = $this -> conn -> get_table_row_byidvalue('biller_user', 'biller_customer_id_no', $bill_consumer_no);\n\t\t\t$bill_records = $this -> conn -> get_table_field_doubles('biller_user', 'biller_customer_id_no', $bill_consumer_no, 'biller_id', $biller_id);\n\t\t\tif (!empty($bill_records)) {\n\t\t\t\t$bill_user_id = $bill_records['0']['biller_user_id'];\n\t\t\t\t$bill_pay_status = $bill_records['0']['bill_pay_status'];\n\t\t\t\tif ($bill_pay_status == '2') {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$wallet_used_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t\t$card_deduct_amount = $bill_amount - $wallet_amount;\n\n\t\t\t\t\t$admin = $this -> conn -> get_all_records('admin');\n\t\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,user_wallet_rec_amount,user_card_card_rec_amount', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $bill_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $wallet_amount . '\",\"' . $card_deduct_amount . '\"');\n\n\t\t\t\t\tif ($recharge) {\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('bill_recharge', 'bill_user_id,bill_transaction_id,bill_category_id, biller_id,bill_consumer_no,bill_amount,bill_pay_date,bill_pay_status', '\"' . $recharge_user_id . '\",\"' . $transaction_id . '\",\"' . $bill_category_id . '\",\"' . $biller_id . '\",\"' . $bill_consumer_no . '\",\"' . $bill_amount . '\",\"' . $current_date . '\",\"' . $bill_pay_status . '\"');\n\n\t\t\t\t\t\tif (!empty($walletrecharge)) {\n\n\t\t\t\t\t\t\t$data_frnd['bill_paid_date'] = $current_date;\n\t\t\t\t\t\t\t$data_frnd['bill_pay_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('biller_user', 'biller_user_id', $bill_user_id, $data_frnd);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\t\tif ($reffer_status == '2') {\n\t\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\n\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$wt_type = 2;\n\t\t\t\t\t\t\t// credit in frnd acconnt\n\t\t\t\t\t\t\t$refferamount = $refferal_amount;\n\t\t\t\t\t\t\t// reffer amount\n\t\t\t\t\t\t\t$wt_category = 9;\n\t\t\t\t\t\t\t// refferal amount recieved in wallet\n\t\t\t\t\t\t\t$wt_desc = \"Refferal amount add in your wallet using by \" .$mobile;\n\n\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records', 'refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\n\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t\t$data_frnd['wallet_amount'] = $wallet + $refferal_amount;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user11_id, $data_frnd);\n\n\t\t\t\t\t\t\t// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t$data12['reffer_amount_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data12);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$cashback_record_id = $recharge_number;\n\t\t\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\tif (!empty($coupon_apply)) {\n\n\t\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' . $transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\n\n\t\t\t\t\t\t\t\t// wallet amont set zero\n\t\t\t\t\t\t\t\t$wallet_amount = 0;\n\t\t\t\t\t\t\t\t$user_wallet = $wallet_amount + $coupon_amount;\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$wallet_amount = 0;\n\t\t\t\t\t\t\t$user_wallet = $wallet_amount + $coupon_amount;\n\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t\t$admin_update_wallet = $admin_wallet + $recharge_amount;\n\t\t\t\t\t\t$data_admin['admin_wallet'] = $admin_update_wallet;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('admin', 'admin_id', 1, $data_admin);\n\t\t\t\t\t\t$res = file_get_contents(SITE_URL . \"/createpdf/pdf/\" . $bill_consumer_no);\n\t\t\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Recharge Successfully\", \"recharge_id\" => $recharge, 'recharge_number' => $rec_number, 'bill_amount' => $bill_amount, 'wallet_used_amount' => $wallet_used_amount, 'card_used_amount' => $card_deduct_amount, 'wallet_amount' => $wallet_amount, 'recharge_date' => $current_date, 'transaction_id' => $transaction_id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"bill pay failed\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"These Bill already paid\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $recharge_user_id, 'bill_category_id' => $bill_category_id, 'biller_id' => $biller_id, 'wt_category' => $wt_category, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}", "function processPayment() {\n \n if ($this->creditPayment != 0.00){\n$fieldParse = new parseGatewayFields(); \n$fieldParse-> setCardName($this->cardName);\n$fieldParse-> setAchName($this->accountName);\n$fieldParse-> setCardType($this->cardType);\n$fieldParse-> setAccountType($this->accountType);\n$fieldParse-> setCardExpDate($this->cardYear);\n$fieldParse-> parsePaymentFields();\n\n //reassign vars for CS Credit Cards\n$ccFirstName = $fieldParse-> getCredtCardFirstName();\n$ccLastName = $fieldParse-> getCredtCardLastName();\n$ccCardType = $fieldParse-> getCardType();\n$ccCardYear = $fieldParse-> getCardYear(); \n$ccCardMonth = $this->cardMonth;\n$ccCardNumber = $this->cardNumber;\n$ccCardCvv = $this->cardCvv;\n\n\n \n$club_id = $_SESSION['location_id'];\n \n$dbMain = $this->dbconnect();\n\n\n$stmt = $dbMain->prepare(\"SELECT MIN(club_id) FROM club_info WHERE club_name != ''\");//>=\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($club_id); \n$stmt->fetch();\n$stmt->close();\n \n$stmt = $dbMain ->prepare(\"SELECT gateway_id, passwordfd FROM billing_gateway_fields WHERE club_id= '$club_id'\");\n$stmt->execute(); \n$stmt->store_result(); \n$stmt->bind_result($userName, $password);\n$stmt->fetch();\n$stmt->close();\n \n$amount = $this->creditPayment;\n \n //credit\"\";//\n$ccnumber = $ccCardNumber;//\"4111111111111111\";\n$ccexp = \"$this->cardMonth$this->cardYear\";//\"1010\";\n$cvv = \"$this->cardCvv\";\n //==================\n$reference = \"CMP Balance\";\n$vaultFunction = \"\";//'add_customer';//'add_customer' or 'update_customer'\n$orderId = \"$this->contractKey\";\n$merchField1 = \"$reference $this->contractKey\";\n$payTypeFlag = \"creditcard\";//\"creditcard\"; // '' or 'check'\nif(isset($_SESSION['track1'])){\n $track1 = $_SESSION['track1'];\n}else{\n $track1 = \"\";\n}\nif(isset($_SESSION['track2'])){\n $track2 = $_SESSION['track2'];\n}else{\n $track2 = \"\";\n}\n\n \n$gw = new gwapi;\n$gw->setLogin(\"$userName\", \"$password\");\n$r = $gw->doSale($amount, $ccnumber, $ccexp, $cvv, $payTypeFlag, $orderId, $merchField1, $track1, $track2, $ccFirstName, $ccLastName);\n$ccAuthDecision = $gw->responses['responsetext'];\n$vaultId = $gw->responses['customer_vault_id'];\n$authCode = $gw->responses['authcode']; \n$transactionId = $gw->responses['transactionid'];\n$ccAuthReasonCode = $gw->responses['response_code'];\n//echo \"fubar $ccAuthReasonCode\";\n // exit;\n\n if($ccAuthReasonCode != 100) {\n \n $this->paymentStatus = \"$ccAuthDecision: $ccAuthDecision\";\n //$this->transactionId = $ccAuthReasonCode; \n }else{ \n $_SESSION['cc_request_id'] = $authCode;\n $this->paymentStatus = 1;\n //$this->transactionId = $ccAuthRequestId;\n }\n }\n if ($this->creditPayment == 0.00){\n $this->paymentStatus = 1;\n }\n}", "public function testSendWithRequestWalletBalance()\n {\n $service = $this->getStubForTest(file_get_contents(__DIR__ . '/TestAsset/Response/wallet_balance.txt'));\n\n $request = new Request\\WalletBalance();\n\n /* @var $response Response\\WalletBalance */\n $response = $service->send($request);\n\n $this->assertEquals(0, $response->getBalance());\n\n $this->assertEquals(\n $this->getLastRawRequestExpected(__DIR__ . '/TestAsset/Request/wallet_balance.txt'),\n $this->getLastRawRequest($service),\n 'Requests does not match'\n );\n }", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "public function AddTransactionWithDraw($data){\n \t$this->_name='cs_withdraw';\r\n \t$session_user=new Zend_Session_Namespace('auth');\n \t$user_id = $session_user->user_id;\r\n \tif(empty($data['withdraw_dollar'])){\r\n \t\t$w_dollar = 0;\r\n \t}else{\r\n \t\t$w_dollar =$data['withdraw_dollar'] ;\r\n \t\t$rs_dollar = $this->getMoneyInAccountBySender($data['sender'],1);\r\n \t\t$this->updateOldDeposit($w_dollar,$rs_dollar);\r\n \t}\r\n \tif(empty($data['withdraw_bath'])){\r\n \t\t$w_bath = 0;\r\n \t}else{\r\n \t\t$w_bath =$data['withdraw_bath'];\r\n \t\t$rs_bath = $this->getMoneyInAccountBySender($data['sender'],2);\r\n \t\t$this->updateOldDeposit($w_bath,$rs_bath);\r\n \t}\r\n \tif(empty($data['withdraw_riel'])){\r\n \t\t$w_riel = 0;\r\n \t}else{\r\n \t\t$w_riel = $data['withdraw_riel'];\r\n \t\t$rs_riel = $this->getMoneyInAccountBySender($data['sender'],3);\r\n \t\t$this->updateOldDeposit($w_riel,$rs_riel);\r\n \t}\r\n \t$this->_name='cs_withdraw';\r\n \t$data = array(\r\n \t\t\t'sender_id'=>$data['sender'],\r\n \t\t\t'invoice'=>$data['invoice_no'],\r\n \t\t\t'wd_amountdollar'=>$w_dollar,\r\n \t\t\t'wd_amountbath'=>$w_bath,\r\n \t\t\t'wd_amountriel'=>$w_riel,\r\n \t\t\t'user_id'=>$user_id,\r\n \t\t\t'create_date'=>$data['send_date'],\r\n \t);\r\n \t$id = $this->insert($data);\n \t\n \t$process = 0;\r\n \t$amount = 0;\r\n \t$dbc = new Application_Model_DbTable_DbCapital();\r\n \tfor($i=1; $i<4; $i++){//for add capital detail and update current capital by staff\r\n \t\tif(!empty($w_dollar) AND $i==1){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 1;\r\n \t\t\t$amount = $w_dollar;\r\n \t\t}elseif(!empty($w_bath) AND $i==2){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 2;\r\n \t\t\t$amount = $w_bath;\r\n \t\t}elseif(!empty($w_riel) AND $i==3){\r\n \t\t\t$process = 1;\r\n \t\t\t$curr_type = 3;\r\n \t\t\t$amount = $w_riel;\r\n \t\t}\r\n \t\tif($process==1){//with draw tran_type = 7\r\n \t\t\t$_arr = array(\r\n \t\t\t\t\t'tran_id' \t=>$id,\r\n \t\t\t\t\t'tran_type' =>7,\r\n \t\t\t\t\t'curr_type'\t=>$curr_type,\r\n \t\t\t\t\t'amount'\t=>-$amount,//cos withdraw money to customer\r\n \t\t\t\t\t'user_id'\t=>$user_id\r\n \t\t\t);\r\n \t\r\n \t\t\t$dbc->addMoneyToCapitalDetail($_arr);\r\n \t\t\t \r\n \t\t\t$rs = $dbc->DetechCapitalExist($user_id, $curr_type,null);\r\n \t\t\tif(!empty($rs)){//update old user\r\n \t\t\t\t$arr = array(\r\n \t\t\t\t\t\t'amount'=>$rs['amount']-$amount\r\n \t\t\t\t);\r\n \t\t\t\t$dbc->updateCurrentBalanceById($rs['id'],$arr);\r\n \t\t\t}else{\r\n \t\t\t\t$date = date(\"Y-m-d H:i:s\");\r\n \t\t\t\t$arr =array(\r\n \t\t\t\t\t\t'amount'=>-$amount,\r\n \t\t\t\t\t\t'currencyType'=>$curr_type,\r\n \t\t\t\t\t\t'userid'=>$user_id,\r\n \t\t\t\t\t\t'statusDate'=>$date\r\n \t\t\t\t);\r\n \t\t\t\t$dbc->AddCurrentBalanceById($arr);\r\n \t\t\t}\r\n \t\r\n \t\t}\r\n \t\t \r\n \t\t$process = 0;\r\n \t}\n }", "public function getCashierReportBalance($month,$day,$year,$fromTime_hour,$fromTime_minutes,$fromTime_seconds,$toTime_hour,$toTime_minutes,$toTime_seconds,$username,$status) {\n\necho \"\n<style type='text/css'>\ntr:hover { background-color:yellow; color:black;}\na { text-decoration:none; color:black; }\n</style>\";\n\n$dateSelected = $month.\"_\".$day.\"_\".$year;\n$fromTimez = $fromTime_hour.\":\".$fromTime_minutes.\":\".$fromTime_seconds;\n$toTimez = $toTime_hour.\":\".$toTime_minutes.\":\".$toTime_seconds;\n\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT upper(pr.completeName) as completeName,pc.description,pc.sellingPrice,pc.quantity,pc.discount,pc.total,pc.cashUnpaid,pb.amountPaid,pb.paidBy,pc.dateCharge FROM patientRecord pr,registrationDetails rd,patientCharges pc,patientBalance pb WHERE pb.itemNo=pc.itemNo and pr.patientNo = rd.patientNo and rd.registrationNo = pc.registrationNo and pb.datePaid = '$dateSelected' and (pb.timePaid between '$fromTimez' and '$toTimez') and (pc.status='PAID' or pc.status='BALANCE') and pc.paidBy='$username' group by pc.itemNo order by completeName asc \");\n\n\n$this->balance_salesTotal=0;\n$this->balance_salesUnpaid=0;\n$this->blance_sales_salesPaid=0;\nwhile($row = mysqli_fetch_array($result))\n {\n\n$price = preg_split (\"/\\//\", $row['sellingPrice']); \n\necho \"<tr>\";\necho \"<td>&nbsp;\".$row['completeName'].\"&nbsp;</td>\";\necho \"<td>&nbsp;<font>\".$row['description'].\"</font><br>&nbsp;<font size=2 color=red>\".$row['dateCharge'].\"</font>&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($price[0],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['quantity'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['discount'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['amountPaid'],2).\"<br><font size=2\t color=red>Previous Balance</font>&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashUnpaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['amountPaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['paidBy'].\"&nbsp;</td>\";\n$this->balance_salesTotal+=$row['amountPaid'];\n$this->balance_salesUnpaid+=$row['cashUnpaid'];\n$this->balance_salesPaid+=$row['amountPaid'];\necho \"</tr>\";\n }\n\n\n\n}", "public function Check() {\n\tthrow new exception('Does anything call this?');\n\t$intCalc = $this->AmountCents();\n\t$intSaved = $this->nSaved;\n\tif ($intSaved == $intCalc) {\n\t $htOut = $prcSaved.'</td><td><font color=green>ok</font>';\n\t} else {\n\t if ($intSaved < $intCalc) {\n\t\t$htOut = '<font color=blue>'.$prcSaved.'</font></td><td> under by <b>'.($prcCalc-$prcSaved).'</b>';\n\t } else {\n\t\t$htOut = '<font color=red>'.$prcSaved.'</font></td><td> over by <b>'.($prcSaved-$prcCalc).'</b>';\n\t }\n\t $this->Root()->FoundMismatch(TRUE);\t// calculations do not match saved balance\n\t}\n\treturn $htOut;\n }", "public function showAllBalance(){\n $user=Auth::user();\n $userProfit=Buy::where('rev_id',$user->id)->where('finish',1)->sum('buy_price');\n $userPay=Buy::where('user_id',$user->id)->where('finish','!=',2)->sum('buy_price');\n $userCharge=Pay::where('user_id',$user->id)->sum('price');\n $profitDone= Profit::where(\"user_id\",$user->id)->sum(\"profit_price\");\n\n $getWaitProfit=Profit::where(\"user_id\",$user->id)->where(\"status\",0)->sum(\"profit_price\");\n $getDoneProfit=Profit::where(\"user_id\",$user->id)->where(\"status\",1)->sum(\"profit_price\");\n\n $p= $userProfit - $profitDone;\n\n $array= [\n 'user' => $user,\n 'userProfit' => $p,\n 'userPay' => $userPay,\n 'userCharge' => $userCharge,\n 'waitProfit' => $getWaitProfit,\n \"DoneProfit\" => $getDoneProfit\n ];\n return $array;\n\n }", "public function get_balance($wallet_id) { \n\n\t// Get balance\n\t$balance = DB::queryFirstField(\"SELECT sum(amount) FROM coin_inputs WHERE wallet_id = %d AND is_spent = 0\", $wallet_id);\n\tif ($balance == '') { $balance = 0; }\n\n\t// Withdraw pending sends\n\t$pending_sends = DB::queryFirstField(\"SELECT sum(amount) FROM coin_sends WHERE wallet_id = %d AND status = 'pending'\", $wallet_id);\n\t$balance -= $pending_sends;\n\n\t// Return\n\treturn fmoney_coin($balance);\n\n}", "public function actionDepositMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Set the new wallet balance with conversion\n $wallet->balance += $result['converted_amount'];\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Set the new wallet balance without conversion\n $wallet->balance += $amount;\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the deposit\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }", "function CheckCreateCurrencyOps($tablename) {\r\n//get database info\r\n$db = new mysqli(\"localhost\", \"root\", \"\", \"trading\");\r\n//if here the table doesn't exist and\r\n//we have to create a new one.\r\n$query = \"CREATE TABLE IF NOT EXIST $tablename (\r\n\t\t ID int(11) AUTO_INCREMENT, PRIMARY KEY(ID),\r\n\t\t M1toM2 DOUBLE, M1toM3 DOUBLE, M1toM4 DOUBLE,\r\n\t\t M2toM1 DOUBLE, M2toM3 DOUBLE, M2toM4 DOUBLE,\r\n\t\t M3toM1 DOUBLE, M3toM2 DOUBLE, M3toM4 DOUBLE,\r\n\t\t M4toM1 DOUBLE, M4toM2 DOUBLE, M4toM3 DOUBLE,\r\n\t\t \r\n\t\t P1toP2 TEXT, P1toP3 TEXT, P1toP4 TEXT,\r\n\t\t P2toP1 TEXT, P2toP3 TEXT, P2toP4 TEXT,\r\n\t\t P3toP1 TEXT, P3toP2 TEXT, P3toP4 TEXT,\r\n\t\t P4toP1 TEXT, P4toP2 TEXT, P4toP3 TEXT,\r\n\t\t \r\n\t\t AvgM1toM2 DOUBLE, \r\n\t\t AvgM1toM3 DOUBLE, \r\n\t\t AvgM1toM4 DOUBLE,\r\n\t\t \r\n\t\t AvgM2toM1 DOUBLE, \r\n\t\t AvgM2toM3 DOUBLE, \r\n\t\t AvgM2toM4 DOUBLE,\r\n\t\t \r\n\t\t AvgM3toM1 DOUBLE, \r\n\t\t AvgM3toM2 DOUBLE, \r\n\t\t AvgM3toM4 DOUBLE,\r\n\t\t \r\n\t\t AvgM4toM1 DOUBLE, \r\n\t\t AvgM4toM2 DOUBLE, \r\n\t\t AvgM4toM3 DOUBLE\r\n\r\n\t\t )\";\r\n$create_tbl = $db->query($query);\r\n\r\n}", "public function test_withDraw_called_substractFromWinningsAndStoreTransaction()\n {\n $this->markTestSkipped('Revisar este test TransactionService failed');\n $user = UserMother::aUserWith50Eur()->build();\n $user->setWallet(Wallet::create(3000,4000));\n $withdraw_amount = new Money(2600, new Currency('EUR'));\n $data = [\n 'accountBankId' => 1,\n 'amountWithdrawed' => $withdraw_amount->getAmount(),\n 'state' => 'pending',\n 'user' => $user,\n 'now' => new \\DateTime(),\n 'walletBefore' => $user->getWallet(),\n 'walletAfter' => $user->getWallet(),\n ];\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $entityManager_stub = $this->getEntityManagerDouble();\n $entityManager_stub->persist($user)->shouldBeCalled();\n $entityManager_stub->flush()->shouldBeCalled();\n $this->transactionService_double->storeTransaction(TransactionType::WINNINGS_WITHDRAW,$data)->shouldBeCalled();\n $sut->withDraw($user, $withdraw_amount);\n //$this->assertEquals($expected_wallet, $user->getWallet());\n }", "function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "function cf_cashbank_valid_amount($params)\n\t{\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\t// debug($params);\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$invoice_id = $params->invoice_id;\n\t\t$str = \"SELECT (net_amount - (select coalesce(sum(amount),0) from cf_cashbank_line t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id)) as amount \n\t\t\tfrom cf_invoice t1 where t1.id = $invoice_id\";\n\t\t$row = $this->db->query($str)->row();\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "function marketerMoneyBox($user_id,$userStatus)\n\t{\n\t\tglobal $obj_rep;\n\t\t\n\t\t$startDate=date(\"Y-m-d\",strtotime(\"-1 month\"));\n\t\t$current=date(\"Y-m-d\");\n\t\t\n\t\t////////////////////checking commision higher //////////////////\n\t\t$sqlDirectcheck = mysql_query(\"SELECT SUM(commission) AS commission, level_income.income_id,user_registration.ts FROM level_income inner join user_registration on user_registration.user_id=level_income.income_id WHERE CAST(level_income.ts AS DATE) BETWEEN '\".$startDate.\"' AND '\".$current.\"' AND STATUS='1' and paid_status='0' GROUP BY level_income.income_id ORDER BY commission DESC, ts LIMIT 1\");\n\t\t$fetchDirects = mysql_fetch_assoc($sqlDirectcheck);\n\t\t\n\t\t\n\t\t/////////////////////commision calculation//////////////////////\n\t\t\n\t\t$commisions=mysql_fetch_assoc(mysql_query(\"select sum(tbpv) as tbpv from money_box where date between '\".$startDate.\"' and '\".$current.\"' and m_status='0'\"));\n\t\t$commission=($commisions['tbpv']*(2/100))*1;\n\t\t\n\t\t$check=mysql_fetch_assoc(mysql_query(\"select * from level_income where income_id='\".$user_id.\"' group by commission limit 1\"));\n\t\t\n\t\t\n\t\t\n\t\tif($check['income_id']==$fetchDirects['income_id'] && !empty($fetchDirects['income_id']))\n\t\t{\n\t\t\t\t$sqlLevel = \"INSERT INTO marketer_money_box_income SET income_id='\" . $fetchDirects['income_id'] . \"',\n remark='Getting Best Marketer Moneybox', \n commission = '\" . $commission. \"', \n status='0'\n \";\n\t\t\t\t\t\t\t\t\t\tmysql_query($sqlLevel);\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t$sqlqeyr=mysql_query(\"select * from marketer_money_box_income where income_id='\".$fetchDirects['income_id'].\"'\");\n\t\t\t\n\t\t\t$fetchDirect = mysql_fetch_assoc($sqlqeyr);\n /** Update commission in level_income */\n\t\t $updateDirect = \"update level_income SET status='1' where income_id='\" . $fetchDirect['income_id'] . \"'\";\n mysql_query($updateDirect);\n \n /** update amount in final ewallet */\n mysql_query(\"update final_e_wallet set amount=(amount+$commission) where user_id='\" . $fetchDirect['income_id'] . \"'\");\n \n \n /** get amount from final ewallet */\n $args_amount = mysql_fetch_assoc(mysql_query(\"select amount from final_e_wallet where user_id='\" . $fetchDirect['income_id'] . \"'\"));\n \n \n /** Insert amount in credit_debit */\n $insert_cr_dr = \"INSERT INTO credit_debit SET user_id='\" . $fetchDirect['income_id'] . \"' , \n transaction_no='\" . $this->generate_transaction_number() . \"',\n credit_amt='\" . $commission . \"',\n final_bal='\" . $args_amount['amount'] . \"',\n receiver_id='\" . $fetchDirect['income_id'] . \"',\n sender_id='\" . $user_id . \"',\n receive_date='\" . date(\"Y-m-d\") . \"',\n TranDescription = 'Getting Best Marketer Moneybox',\n Remark='Getting Best Marketer Moneybox'\n \";\n mysql_query($insert_cr_dr);\n\t\t\t\n\t\t\t\n\t\t\tmysql_query(\"update level_income set paid_status='1' where cast(ts as date) between '\".$startDate.\"' and '\".$current.\"' and status='1'\");\n\t\t\t$updat=mysql_query(\"update marketer_money_box_income set status='1' where income_id='\".$fetchDirect['income_id'].\"' and status=0\");\n\t\t\tmysql_query(\"update money_box set m_status='1' where date between '\".$startDate.\"' and '\".$current.\"' and m_status='0'\");\n\t\t\t\n } /////num check ///////////\n\t\t\n\t}", "public function balance()\n\t{\n\t\treturn $this->curl('/ovo/balance', Constant::HTTP_POST);\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'balance' => 'required|max:10|between:0,99.99|',\n 'amount' => 'required|max:10|between:0,99.99|lte:balance|gt:0',\n 'market_place_id' => 'required|integer',\n 'payment_method_id' => 'required|integer',\n 'package_id' => 'required|integer',\n 'comment' => 'max:1000|nullable',\n ]);\n $user = auth('api')->user(); \n $min_amount = $user->currency->name == 'ZAR' ? 150 : 10;\n $max_amount = $user->currency->name == 'ZAR' ? 16000 : 3000;\n \n $market_place_balance = MarketPlace::where('id',$request->market_place_id)->first()->balance;\n\n if($market_place_balance < $request->amount)\n {\n $rdata = array(\n 'status' => 'error',\n 'message' => 'Sorry you are late. Someone offered to pay this already'\n );\n return response()->json($rdata, 404);\n }\n\n //Get current users offers older than today\n $user_previous_unpaid_offers = $user->offers()->whereDate('created_at', '<', Carbon::today())->whereIn('status', [2, 101])->get()->count();\n\n //Get total offers for today\n $user_today_total = $user->offers()->whereDate('created_at', '=', Carbon::today())->whereIn('status', [2, 101])->get()->sum('amount');\n\n //Get count number of todays transactions for user \n $user_today_offers = $user->offers()->whereDate('created_at', '=', Carbon::today())->whereIn('status', [2, 101])->get()->count();\n\n if ($min_amount <= $request->amount && $max_amount >= $request->amount) {\n //Check if user has offers not yet approved\n if ($user_previous_unpaid_offers > 0) {\n $rdata = array(\n 'status' => 'error',\n 'message' => 'You have offers which are not yet paid please pay in time to avoid being blocked by the system'\n );\n return response()->json($rdata, 500);\n }\n // //Check if user has not exceeded maximum daily transactions\n if ($user_today_offers >= 3) {\n $rdata = array(\n 'status' => 'error',\n 'message' => 'You reached your daily limit of 3 offers per day'\n );\n return response()->json($rdata, 500);\n }\n // //Check if user has not reached daily limit\n if (($user_today_total + $request->input('amount')) > $max_amount) {\n $rdata = array(\n 'status' => 'error',\n 'message' => 'You are only allowed maximum of ' . $max_amount . ' per day. Please try tomorrow'\n );\n return response()->json($rdata, 500);\n }\n // //Check if remaining amount can be placed on market place again\n if (($market_place_balance- $request->input('amount') < $min_amount) && ($market_place_balance - $request->input('amount') != 0) ) {\n $rdata = array(\n 'status' => 'error',\n 'message' => 'You are recommended to take all the amount because remaining balance will be less than ' . $min_amount\n );\n return response()->json($rdata, 500);\n } else {\n try {\n DB::beginTransaction();\n $pending_payment = new PendingPayment;\n $pending_payment->amount = $request->input('amount');\n $pending_payment->market_place_id = $request->input('market_place_id');\n $pending_payment->payment_method_id = $request->input('payment_method_id');\n $pending_payment->package_id = $request->input('package_id');\n $pending_payment->transaction_code = Carbon::now()->timestamp . '-' . $user->id;\n $pending_payment->user_id = $user->id;\n $pending_payment->comment = $request->input('comment');\n $pending_payment->expiration_time = Carbon::now()->addHours(12);\n $pending_payment->ipAddress = request()->ip();\n $pending_payment->save();\n\n $amount = $request->input('amount');\n $balance = MarketPlace::where('id',$request->market_place_id)->first()->balance;\n //Get market place and then reduce its value by amount offered by current user\n $market_place = MarketPlace::findOrFail($request->input('market_place_id'));\n if ($amount == $balance) {\n $market_place->balance -= $amount;\n $market_place->status = 100;\n } else {\n $market_place->balance -= $amount;\n }\n $market_place->save();\n DB::commit();\n //Broadcast this event\n $marketplaces = MarketPlace::where('status', '1')->with('payment_detail')->get(); //Take all market places\n event(new MarketPlaceEvent()); //broadcast it to all users\n return MarketPlaceResource::collection($marketplaces);\n } catch (\\Exception $e) {\n DB::rollback();\n throw $e;\n }\n }\n } else {\n $rdata = array(\n 'status' => 'error',\n 'message' => 'Check if amount is between allowed minimum and maximum daily limit'\n );\n return response()->json($rdata, 500);\n }\n }", "function updateAddressBalance( $address=null, $asset_list=null ){\n global $mysqli, $counterparty, $addresses, $assets;\n // Lookup any balance for this address and asset\n $balances = getAddressBalances($address, $asset_list);\n if(count($balances)){\n foreach($balances as $balance){\n $address_id = $addresses[$balance['address']]; // Translate address to address_id\n $asset = $balance['asset'];\n $asset_id = $assets[$asset]; // Translate asset to asset_id\n $quantity = $balance['quantity'];\n $results = $mysqli->query(\"SELECT id FROM balances WHERE address_id='{$address_id}' AND asset_id='{$asset_id}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n // Update asset balance\n $results = $mysqli->query(\"UPDATE balances SET quantity='{$quantity}' WHERE address_id='{$address_id}' AND asset_id='{$asset_id}'\");\n if(!$results)\n byeLog('Error while trying to update balance record for ' . $address . ' - ' . $asset);\n } else {\n // Create asset balance only if the quantity is greater than 0\n if($quantity){\n $results = $mysqli->query(\"INSERT INTO balances (asset_id, address_id, quantity) values ('{$asset_id}','{$address_id}','{$quantity}')\");\n if(!$results)\n byeLog('Error while trying to create balance record for ' . $address . ' - ' . $asset);\n }\n }\n } else {\n byeLog('Error while trying to lookup balance record for ' . $address . ' - ' . $asset);\n }\n }\n }\n}", "public function store(Request $request)\r\n {\r\n $validator = Validator::make($request->all(), [\r\n //'user_id' =>'required',\r\n 'package_id' => 'required',\r\n 'description' => 'required',\r\n //'amount' => 'required',\r\n //'coins' => 'required',\r\n //'balance_coins' => 'required',\r\n ]);\r\n\r\n if ($validator->fails()) {\r\n $response = api_create_response($validator->errors(), $this->failureText, 'Please enter valid input.');\r\n return response()->json($response, $this->statusCodes->bad_request);\r\n }\r\n\r\n $packageId = $request->package_id;\r\n $packageDetails = PackageModel::find($packageId);\r\n\r\n if(empty($packageDetails)) {\r\n // NOT FOUND\r\n $response = api_create_response(2, $this->failureText, 'Package Not Found.');\r\n return response()->json($response, $this->statusCodes->not_found);\r\n\r\n }\r\n\r\n $userData = Auth::user();\r\n $balanceCoin = $userData->balance_coins;\r\n $newBalanceCoin = $balanceCoin + $packageDetails->coins;\r\n\r\n // Update balance in user table\r\n User::where('id', $userData->id)->update(['balance_coins' => $newBalanceCoin]);\r\n\r\n\r\n $transaction = [\r\n 'user_id' => $userData->id,\r\n 'package_article_id' => $packageDetails->package_id,\r\n 'description' => $request->description,\r\n 'amount' => $packageDetails->price,\r\n 'coins' => $packageDetails->coins,\r\n 'balance_coins' => $newBalanceCoin,\r\n 'transaction_mode' => 'CR',\r\n 'created_at' => date('Y-m-d H:i:s')\r\n ];\r\n\r\n $result = CoinModel::insertGetId($transaction);\r\n \r\n if (!empty($result)) {\r\n\r\n $transaction['id'] = $result;\r\n $this->responseStatusCode = $this->statusCodes->success;\r\n $response = api_create_response($transaction, $this->successText, 'Coins Added Successfully.');\r\n\r\n } else {\r\n\r\n $this->responseStatusCode = $this->statusCodes->bad_request;\r\n $response = api_create_response(2, $this->failureText, 'Something went wrong.');\r\n\r\n }\r\n \r\n return response()->json($response, $this->responseStatusCode);\r\n }", "public function storeBoth()\n {\n if(Auth::user()->role == 8) {\n $inputs = Input::all();\n $mode = $inputs['c'];\n $guestid = $inputs['gid'];\n $amount = $inputs['a'];\n $stime = $inputs['s'];\n $total = $inputs['t'];\n\n $gbill = Bil::whereRaw('guestid = ? and servicetime = ? and date = ?', array($guestid, $stime, date('Y-m-d')))->first();\n\n if($mode == \"cash\"){\n\n\n\n if($amount > $total){\n return \"no\";\n }else{\n $gbill->paymentmode = $mode;\n $gbill->amount = $amount;\n $gbill->remain = (double)($total - $amount);\n $gbill->cleared='yes';\n $gbill->save();\n return \"ok\";\n }\n\n }else{\n $gbill->paymentmode = $mode;\n $gbill->save();\n return \"ok\";\n }\n }\n\n }", "function checkBuyBids()\n{\n $mysql_server = '192.168.1.101'; //reference global mysql_server\n $mysqli = new mysqli($mysql_server, \"badgers\", \"honey\", \"user_info\");\n \n //Retrieve all Values from BestBidOffer\n $indexQry = \"SELECT * FROM BuyBestBidOffer\";\n $indexResult = $mysqli->query($indexQry);\n \n //Create Info Stacks to store Information\n $stackUsername = array();\n $stackSymbol = array();\n $stackQty = array();\n $stackAsk = array();\n $stackIndexNo = array();\n $stackBidType = array();\n \n //Copy the info into arrays in exact same order\n if($indexResult->num_rows > 0)\n { //if there is something in the DB then...\n while ($row = $indexResult->fetch_assoc())\n {\n array_push($stackUsername, $row['username']);\n array_push($stackSymbol, $row['stockSymbol']);\n array_push($stackQty, $row['qty']);\n array_push($stackIndexNo, $row['indexNo']);\n array_push($stackAsk, $row['askPrice']);\n }\n }\n //Get the size of Arrays\n $arraySize = count($stackUsername);\n \n //Get the List of Unique tickers in BuyBids DB\n $BuyBidsTickers = getBuyBidStockTickers();\n \n //Array that contains Current Price for Stocks\n $currentPriceStack = array();\n \n //get information about DISTINCT tickers only\n foreach($BuyBidsTickers[\"Stocks\"] as $symbol)\n {\n \n $tempVar = getInfo($symbol);\n $tempObj = json_decode($tempVar);\n array_push($currentPriceStack, $tempObj->Close[0]); //get the current prices for Tickers\n }\n \n //var_dump($currentPriceStack);\n \n //Loop and compare each Ticker asking price with Current Prices. Ignore Username at this Level.\n foreach($stackSymbol as $key => $symbol)\n {\n //for each Ticker excluding duplicates in your buy bids DB\n foreach($BuyBidsTickers[\"Stocks\"] as $compareKey => $compareSymbol)\n {\n //if ticker in records matches a ticker in currentPrice data list\n if ($symbol == $compareSymbol)\n {\n if($stackAsk[$key] <= $currentPriceStack[$compareKey])\n {\n //Find the user linked to this current items.\n //var_dump($stackUsername[$key]);\n //Create Data Object and Run Buy function\n $tempArray = array(\"Username\" => $stackUsername[$key],\n \"Symbol\" => $stackSymbol[$key],\n \"Quantity\" => $stackQty[$key]);\n buyStock($tempArray);\n //delete the IndexNo of this record in BuyBestBidOffer Table\n deleteFromBuyBids($stackIndexNo[$key]);\n }\n }\n }\n }\n \n}", "public function store() {\n // validate\n // read more on validation at http://laravel.com/docs/validation\n // store\n\n $deposits = new Deposit;\n $deposits->account_id = Input::get('account_id');\n $deposits->amount = Input::get('amount');\n $deposits->member_id = Input::get('member_id');\n \n\n $depositrow = DB::table('lpay_mmv_account')\n ->where('account_id', $deposits->account_id)->first();\n\n if ($depositrow->balance > $deposits->amount) {\n $deposits->save();\n DB::table('lpay_mmv_member_master')\n ->where('member_id', $deposits->member_id)\n ->increment('wallet', $deposits->amount);\n\n DB::table('lpay_mmv_account')\n ->where('account_id', $deposits->account_id)\n ->decrement('balance', $deposits->amount);\n\n // redirect\n Session::flash('message', 'Deposit done successfully !');\n return Redirect::to('deposits/index/' . $deposits->member_id);\n } else {\n Session::flash('message', 'You don\\'t have sufficeint balance to do the transaction.Your current account balance is $'.$depositrow->balance);\n return Redirect::to('deposits/index/' . $deposits->member_id);\n }\n }", "function create_user_withdrawal_request()\n\t{ \n\t\trequire_once(\"config.php\");\n $input = @file_get_contents(\"php://input\");\n\t //$event_json = json_decode($input,true);\n\t\t$event_json = json_decode($input,true);\n\n\t \tif(!isset($event_json['fb_id']) || $event_json['fb_id']==\"\") \n\t\t\t{ \n\t\t\t\t$msg_out=\"Validation Error fb_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['uwr_amount']) || $event_json['uwr_amount']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_amount Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['uwr_coin']) || $event_json['uwr_coin']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_coin Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['uwr_payment_method']) || $event_json['uwr_payment_method']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_payment_method Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\n\t\t\t$uwr_payment_method=$event_json['uwr_payment_method'];\n\n\t \t//'Bank Transfer'\n\t\t\t$uwr_bank_name=\"\";\n\t\t\t$uwr_account_type=\"\";\n\t\t $uwr_account_number=\"\";\n\t\t $uwr_ifsc=\"\";\n\t\n\t\tif($uwr_payment_method==\"Bank Transfer\")\n\t\t{\n\t\t\t\tif(!isset($event_json['uwr_bank_name']) || $event_json['uwr_bank_name']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_bank_name Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\tif(!isset($event_json['uwr_account_type']) || $event_json['uwr_account_type']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_account_type Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['uwr_account_number']) || $event_json['uwr_account_number']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_account_number Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\n\t\t\tif(!isset($event_json['uwr_ifsc']) || $event_json['uwr_ifsc']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_ifsc Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\n \t\t$uwr_bank_name=$event_json['uwr_bank_name'];\n\t\t\t$uwr_account_type=$event_json['uwr_account_type'];\n\t\t $uwr_account_number=$event_json['uwr_account_number'];\n\t\t $uwr_ifsc=$event_json['uwr_ifsc'];\n\t }\n\n\t\t//other\n\t\t$uwr_other =\"\";\n\t \n\t\tif($uwr_payment_method!=\"Bank Transfer\")\n\t\t{\n\n\t\t if(!isset($event_json['uwr_other']) || $event_json['uwr_other']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_other Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\n\t\t$uwr_other =$event_json['uwr_other'];\n\t }\n\n\n\n\t\t\t//\n\t\t \tif(!isset($event_json['uwr_name']) || $event_json['uwr_name']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_name Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\tif(!isset($event_json['uwr_contact']) || $event_json['uwr_contact']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_contact Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\tif(!isset($event_json['uwr_email']) || $event_json['uwr_email']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error uwr_email Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\t$uwr_coin=$event_json['uwr_coin'];\n\t\t\t$uwr_amount=$event_json['uwr_amount'];\n\t\t\t\n\t\t\t$uwr_fb_id=$event_json['fb_id'];\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t \n\t $uwr_name=$event_json['uwr_name'];\n\t $uwr_contact=$event_json['uwr_contact'];\n\t $uwr_email=$event_json['uwr_email'];\n\n\t $DATE_TIME=custom_current_date_time();\n\t $qrry_get='INSERT INTO `user_withdrawal_request` (`uwr_fb_id`, `uwr_amount`, `uwr_coin`, `uwr_request_cr_date`,`uwr_bank_name`,`uwr_account_number`, `uwr_ifsc`, `uwr_account_type`, `uwr_other`, `uwr_payment_method`,`uwr_name`, `uwr_contact`, `uwr_email`) VALUES (\"'.$uwr_fb_id.'\",\"'.$uwr_amount.'\",\"'.$uwr_coin.'\",\"'.$DATE_TIME.'\",\"'.$uwr_bank_name.'\",\"'.$uwr_account_number.'\",\"'.$uwr_ifsc.'\",\"'.$uwr_account_type.'\",\"'.$uwr_other.'\",\"'.$uwr_payment_method.'\",\"'.$uwr_name.'\",\"'.$uwr_contact.'\",\"'.$uwr_email.'\")';\n\t\t\t \n\t\t\t $res=mysqli_query($conn,$qrry_get)or die(mysqli_error($conn));\n \t\t \t $lastid=mysqli_insert_id($conn);\n\t\t\tif($lastid)\n\t\t\t{\n\t\t\t $last_data =mysqli_fetch_assoc(mysqli_query($conn,\"select * from user_withdrawal_request WHERE uwr_id = '$lastid' \"));\n\t\t\t \n\t\t\t//update beans\n $UPDATE_beans_user=\"update users set total_beans=total_beans-\".$uwr_coin.\" WHERE fb_id=\".$uwr_fb_id;\n mysqli_query($conn,$UPDATE_beans_user);\n \n\t\t\t $msg_out=\"Withdrawal Request Create Successfully\";\t\n\t\t\t\t$output=array( \"code\" => \"200\", \"msg\" => $msg_out ,\"data\" => $last_data);\n\t\t\t}else{\n\t\t\t\t$msg_out=\"Error In Withdrawal Request\";\n\t\t\t $output=array( \"code\" => \"500\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t}\n\t\t\tprint_r(json_encode($output, true));\n }", "public function testActiveAccountTotalPayoutAmount()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '10000'\n ]);\n\n\n $activeAccounts = factory(ActiveAccount::class, 4)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE\n ]);\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $totalPayoutAmount = $this->payoutService->calculateAcitveAccountTotalPayoutAmount($activeAccounts->first());\n\n $this->assertEquals('25000000000', $totalPayoutAmount);\n }", "public function handle()\n {\n ini_set('memory_limit','4096M');\n $agents = User::whereIn('role', [1, 3])->get();\n $casinoFit = config('partner.casino_fit');\n $now = Carbon::now()->startOfDay();\n\n $transactionsUser = Transaction::where('created_at', '<', $now->toDateTimeString())\n ->where('created_at', '>', $now->subDay()->toDateTimeString())\n ->get()\n ->groupBy('user_id');\n\n $now->addDay();\n\n foreach ($transactionsUser as $userId => $transactions) {\n $userSum = new UserSum();\n $userSum->user_id = $userId;\n $userSum->deposits = 0;\n $userSum->created_at = $now;\n $userSum->bets = 0;\n $userSum->wins = 0;\n $userSum->bonus = 0;\n $userSum->bet_count = 0;\n $depositBonusSum = 0;\n foreach ($transactions as $transaction) {\n if ($transaction->type == 3) {\n $userSum->deposits += $transaction->sum;\n } elseif ($transaction->type == 1 or $transaction->type == 2) {\n if ($transaction->type == 1) {\n $userSum->bets += $transaction->sum;\n $userSum->bet_count += 1;\n } else {\n $userSum->wins += $transaction->sum;\n }\n\n $userSum->bonus += $transaction->bonus_sum;\n }\n if ($transaction->type == 5) {\n $depositBonusSum += $transaction->bonus_sum;\n }\n }\n //Formula:\n //\n //Net Gaming Revenue = *Bets - Wins - Bonuses - Admin Fee (18%)\n // *we have bets as negative\n $userSum->sum = ($userSum->bets + $userSum->wins + $depositBonusSum) * (100 - $casinoFit) / 100;\n $userSum->save();\n\n if ($agent_id = @User::find($userId)->agent_id and $agent = $agents->where('id', $agent_id)->first()) {\n //if someone want to change user's agent we need old information\n $userSum->parent_id = $agent->id;\n $userSum->percent = $agent->commission;\n $userSum->save();\n\n\n $agentSum = AgentSum::where('user_id', $agent_id)->where('created_at', $now->toDateTimeString())->first();\n if (!$agentSum) {\n $agentSum = new AgentSum();\n $agentSum->user_id = $agent_id;\n $agentSum->created_at = $now;\n }\n $agentSum->total_sum += $userSum->sum;\n $agentSum->agent_percent = $agent->koefs->koef;\n if ($agent->agent_id) {\n $agentSum->parent_percent = $agent->parentKoef->koef;\n $agentSum->parent_profit += $userSum->sum * ($agentSum->parent_percent - $agentSum->agent_percent) / 100;\n $parent = $agents->where('id', $agent->agent_id)->first();\n //if parent has parent -> add parent profit recursively\n if ($parent->agent_id) {\n $this->addParentProfit($agent->agent_id, $userSum->sum, $now, $agents);\n }\n }\n $agentSum->save();\n }\n }\n }", "function massageFacsPaymentData(){\r\n\t$accountsSkipped = 0; //this is a flag for accounts that don't have a principal\r\n\t$accountsProcessed = 0; //this is a flag to track the records we have processed on the file\r\n\t$dp = 0;\r\n\t$dpTotal = 0; //flag to track total amount collected(?)\r\n\t$totalAccountsNotListed = 0; //number of accounts not listed\r\n\t$detailRecordNum = 0;\r\n\t$paidAgencyPrinc = 0; //this is the amount the collection agency has collected\r\n\t$totalPaidClient = 0;\r\n\t$totalPaidAgency = 0;\r\n\t$totalDueAgency = 0;\r\n\t$totalPayments = 0;\r\n\t$maxlines = count($this->exportData); \r\n\t$date = date(\"Ymd\");\r\n\t$paymentFileName = \"/home/nobody/Y9650/GuarPmt_EFS_\".$date.\".txt\";\r\n\t$exportDataReplace = \"\"; //this is a string we will use to build the text for the export file\r\n\t\r\n\tforeach($this->exportData['accountData'] as $k=>$v){\r\n\t\t$this->addDecimalForPaymentFile($k, $this->exportData['accountData'][$k]['AppliedPrincipal'], 'AppliedPrincipal');\r\n\t\tif($this->exportData['accountData'][$k]['DueAgency'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['DueAgency'], 'DueAgency'); }\t\r\n\t\tif($this->exportData['accountData'][$k]['PaidAgency'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['PaidAgency'], 'PaidAgency'); }\t\r\n\t\tif($this->exportData['accountData'][$k]['Balance'] > 0){ $this->addDecimalForPaymentFile($k, $this->exportData[$k]['Balance'], 'Balance'); }\t\r\n\r\n\t\t$vals = explode(\"_\", $this->exportData['accountData'][$k]['ReferenceNumber']);\r\n\t\t$this->exportData['accountData'][$k]['ReceivableGroupID']\t=\t$vals[0];\r\n\t\t$this->exportData['accountData'][$k]['BillingPeriodSequence']\t=\t$vals[1];\r\n\t\t$this->exportData['accountData'][$k]['ResponsibleParty']\t\t=\ttrim($vals[2]);\r\n\t\t$this->exportData['accountData'][$k]['ClientDebtorNumber'] = $this->exportData[$k]['ReceivableGroupID'];\r\n\t}\r\n}", "public function saveRoyalty($saleId, $vehicleId, $productId, $dateTime, $quantity, $royaltyAccountId, $royaltyOwnerAccountId)\n {\n if(empty($saleId) || empty($vehicleId) || empty($productId) || empty($dateTime) || empty($quantity) || empty($royaltyAccountId) || empty($royaltyOwnerAccountId)) {\n return 1;\n }\n\n $vehicle = Vehicle::find($vehicleId);\n if(!empty($vehicle) && !empty($vehicle->id)) {\n $vehicleNumber = $vehicle->reg_number;\n $vehicleType = $vehicle->vehicleType->name;\n //$royaltyRecord = RoyaltyChart::where('vehicle_type_id', $vehicle->vehicle_type_id)->where('product_id', $productId)->first();\n $vehicleTypeRecord = VehicleType::where('id', $vehicle->vehicle_type_id)->with('products')->first();\n if(!empty($vehicleTypeRecord) && !empty($vehicleTypeRecord->id)) {\n foreach($vehicleTypeRecord->products as $product) {\n if($product->id == $productId) {\n $royaltyAmount = ($product->pivot->amount * $quantity);\n }\n }\n } else {\n return 2;\n }\n } else {\n return 3;\n }\n\n $royaltyTransaction = new Transaction;\n $royaltyTransaction->debit_account_id = $royaltyAccountId; //royalty account id\n $royaltyTransaction->credit_account_id = $royaltyOwnerAccountId;\n $royaltyTransaction->amount = !empty($royaltyAmount) ? $royaltyAmount : '0';\n $royaltyTransaction->date_time = $dateTime;\n $royaltyTransaction->particulars = \"Royalty credited for \". $quantity .\" Load. :\".$vehicleNumber.\" - \".$vehicleType.\"[sale \". $saleId .\"]\";\n $royaltyTransaction->status = 1;\n $royaltyTransaction->created_user_id = Auth::user()->id;\n if($royaltyTransaction->save()) {\n $royalty = new Royalty;\n $royalty->transaction_id = $royaltyTransaction->id;\n $royalty->sale_id = $saleId;\n $royalty->vehicle_id = $vehicleId;\n $royalty->date_time = $dateTime;\n $royalty->amount = $royaltyAmount;\n $royalty->status = 1;\n if($royalty->save()) {\n return 0;\n } else {\n //delete the transaction if associated royalty saving failed.\n $royaltyTransaction->delete();\n\n return 4;\n }\n } else {\n return 5;\n }\n }", "function check_transfers() {\r\n\tglobal $option;\r\n\t$timestamp = mktime();\r\n\t/* Holt alle Auktionen, bei denen die Endzeit vorbei ist */\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => ($timestamp - 30), \"func\" => \"<\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => \"\", \"func\" => \"IS NOT NULL\");\r\n\t$cond[] = array(\"col\" => \"end\", \"value\" => 0, \"func\" => \"!=\");\r\n\t$cond[] = array(\"col\" => \"history\", \"value\" => 0);\r\n\t$result = uli_get_results('auctions', $cond);\r\n\tif ($result){\r\n\t\tforeach ($result as $auction){\r\n\t\t\t/* Transfer vorbereiten */\r\n\t\t\tif (trade_player($auction['playerID'], $auction['leagueID'], $auction)){\r\n\t\t\t\tarchive_auctions($auction['playerID'], $auction['leagueID']);\r\n\t\t\t}\r\n\t\t}}\r\n}", "function bitfinex_get_balances($key, $secret) {\n // has stuff like available funds...\n return bitfinex_generic_read($key, $secret, 'balances');\n}", "function addTransaction() {\nrequire(\"/home/course/cda540/u05/public_html/project/dbguest.php\");\n\n//It will import all variables such as $host , $user, $pass and $db\n\n//mysqli_connect() is to connect the database\n$link = mysqli_connect($host, $user, $pass, $db);\n\n//Check the connection. Give error message if any error\nif (!$link) die(\"Couldn't connect to MySQL\");\n\n\n//mysqli_select_db() is used to select the database\nmysqli_select_db($link, $db)\n or die(\"Couldn't open $db: \".mysqli_error($link));\n\n$result_cusID=(int)$_POST['customerID'];\n\n$string_itemID=$_POST['items'];\n\n$string_itemsPrice = $_POST['itemsPrice'];\n\n$result_itemID = explode(\"\\n\",$string_itemID);\n\n$result_itemPrice = explode(\"\\n\",$string_itemsPrice);\n\n$itemIDs = implode (\",\" , $result_itemID);\n\n$result_customer=mysqli_query($link,\"SELECT * FROM CUSTOMER where _id=$result_cusID\");\n\n$result_itemIDs = mysqli_query($link,\"SELECT * FROM ITEM where _id IN ('$itemIDs')\");\n\n$totalpurchaseprice = 0;\n\nforeach($result_itemPrice as $itemprice)\n{\n $totalpurchaseprice = $totalpurchaseprice+$itemprice;\n}\n\n\nif ((mysqli_num_rows($result_customer)>0)&& (mysqli_num_rows($result_itemIDs)>0))\n{\n \n $result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,now(),'$totalpurchaseprice','$result_cusID')\");\n \n $result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n $obj = mysqli_fetch_object($result_no);\n $transno= $obj-> transactionNumber;\n \n foreach ($result_itemID as $itemID)\n {\n $result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$transno','$itemID')\"); \n }\n\necho '<span style=\"color:#008000;text-align:center;\">Success!!! Customer ID Found and added a new transaction...</span>';\n\n\n}\n\nelse\n{\necho '<span style=\"color:#FF0000;text-align:center;\">Sorry!!! Unable to add a new transaction (Check Customers and Items)...</span>';\n}\n\n//$string_itemID=$_POST['items'];\n\n//$result_itemID = explode(\"\\n\",$string_itemID);\n\n//$j=1;\n\n//foreach ($result_itemID as $item_val)\n//{\n//echo \"$item_val <br>\";\n//$item_intval=int(\"$item_val\");\n\n//Working\n//$result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,'2019jun21',13.14,1)\");\n//$result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n\n//$value = mysql_fetch_object($result_no);\n//$transno = $value->transactionNumber;\n//echo \"$transno\";\n//$result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES(5,1)\");\n//$j=$j+1;\n//}\n\n\n//mysqli_query will execute the query and stores into $result\n\n//mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$result')\");\n//Close the connection\nmysqli_close($link);\n\n}", "public function returnSellPost(Request $request)\n { \n $transactionId = $request->get('transaction_id');\n $transaction = Transaction::find($transactionId);\n \n if (!$transaction) {\n return redirect()->back()->withMessage('Transaction was not found.');\n }\n\n $previousTotal = $transaction->total;\n $previosInvoiceTax = $transaction->invoice_tax;\n //$previosProductTax = $transaction->total_tax - $previosInvoiceTax;\n\n $total = 0;\n $updatedCostPrice = 0;\n $total_product_tax = 0;\n $total_return_quantity = 0;\n\n $client = Client::find($transaction->client_id);\n $due = $client->transactions->sum('net_total') - $client->payments->where('type', 'credit')->sum('amount');\n\n foreach ($transaction->sells as $sell) {\n\n $returnQuantity = intval($request->get('quantity_'. $sell->id)) ?: 0;\n $total_return_quantity += $returnQuantity;\n\n //new\n $unitProductTax = $sell->product_tax / $sell->quantity;\n \n if ($returnQuantity === 0) {\n $total = $total + $sell->sub_total;\n $total_product_tax = $total_product_tax + $sell->product_tax;\n continue;\n }\n\n $returnUnitPrice = floatval($request->get('unit_price_'. $sell->id));\n \n $sellId = $request->get('sell_'. $sell->id);\n\n $sell = Sell::find($sellId);\n\n if($returnQuantity > $sell->quantity){\n $warning = \"Return Quantity (\".$returnQuantity.\") Can't be greater than the Selling Quantity (\".$sell->quantity.\")\";\n return redirect()->back()->withWarning($warning);\n }\n\n $updatedSellQuantity = $sell->quantity - $returnQuantity;\n $updatedProductTax = $unitProductTax * $updatedSellQuantity;\n $subTotal = $updatedSellQuantity * $returnUnitPrice;\n\n if($previosInvoiceTax > 1){\n if(settings('invoice_tax_type') == 1){\n $return_tax_amount = (settings('invoice_tax_rate') * ($returnQuantity * $returnUnitPrice)) / 100;\n }else{\n $return_tax_amount = settings('invoice_tax_rate');\n }\n }else{\n $return_tax_amount = 0;\n }\n\n $sell->quantity = $updatedSellQuantity;\n $sell->sub_total = $subTotal;\n $sell->product_tax = $updatedProductTax;\n $sell->save();\n\n //update the cost price to deduct from transaction table\n $updatedCostPrice += $returnQuantity * $sell->unit_cost_price;\n\n $product = $sell->product;\n $currentStock = $product->quantity;\n $product->quantity = $currentStock + $returnQuantity;\n $product->save();\n \n $total += $subTotal;\n $total_product_tax = $total_product_tax + $updatedProductTax;\n\n // Save Return statement\n $return = new ReturnTransaction;\n $return->sells_id = $sell->id;\n $return->client_id = $sell->client_id;\n $return->return_vat = $unitProductTax * $returnQuantity;\n $return->sells_reference_no = $sell->reference_no;\n $return->return_units = $returnQuantity;\n $return->return_amount = ($returnQuantity * $returnUnitPrice) + $return_tax_amount + ($unitProductTax * $returnQuantity);\n $return->returned_by = \\Auth::user()->id;\n $return->save();\n }\n\n //invoice tax\n if($previosInvoiceTax > 1){\n if(settings('invoice_tax_type') == 1){\n $invoice_tax = (settings('invoice_tax_rate') * $total) / 100;\n }else{\n $invoice_tax = settings('invoice_tax_rate');\n }\n }else{\n $invoice_tax = 0;\n }\n //ends\n\n if($total_return_quantity <= 0){\n $quantityerror = \"You Can't return Zero Quantity\";\n return redirect()->back()->withQuantityerror($quantityerror);\n }\n \n //update transaction for this return\n $transaction->total = $total;\n $transaction->invoice_tax = $invoice_tax;\n $transaction->total_tax = $total_product_tax + $invoice_tax;\n $transaction->net_total = $total + $invoice_tax + $transaction->labor_cost + $total_product_tax;\n $transaction->total_cost_price = $transaction->total_cost_price - $updatedCostPrice;\n $transaction->return = true;\n $transaction->save();\n\n $diff = ( $previousTotal + $previosInvoiceTax /*+ $previosProductTax*/) - ($total + $invoice_tax + $total_product_tax);\n\n //if difference is greater than due amount then we need to return some money to the customer\n if ($diff > $due) {\n $payment = new Payment;\n $payment->client_id = $client->id;\n $payment->amount = $due < 0 ? $diff : $diff - $due;\n $payment->method = 'cash';\n $payment->type = \"return\";\n $payment->reference_no = $transaction->reference_no;\n $payment->note = \"Return for \".$transaction->reference_no;\n $payment->save();\n }\n\n return redirect()->route('sell.index');\n }", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "public function testCorrectCanBuyWithSurplusMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(2000);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}" ]
[ "0.623104", "0.6131377", "0.59933424", "0.58860695", "0.5863259", "0.586054", "0.5703325", "0.5697477", "0.56622493", "0.56587803", "0.56531745", "0.564827", "0.563078", "0.5592341", "0.5540358", "0.5524614", "0.5522887", "0.5509819", "0.55057406", "0.5504987", "0.5489582", "0.54741013", "0.5463091", "0.54587567", "0.5446275", "0.5445936", "0.54364425", "0.5435925", "0.54282993", "0.54249865", "0.54077613", "0.5402362", "0.5396435", "0.5363876", "0.53542244", "0.5351296", "0.53464556", "0.5345596", "0.53358907", "0.5326344", "0.53230816", "0.53189707", "0.531502", "0.530432", "0.5301426", "0.530006", "0.5298736", "0.52980506", "0.52962244", "0.52943337", "0.52828974", "0.527827", "0.52725786", "0.52626765", "0.52580816", "0.5241173", "0.5240378", "0.52344185", "0.5233982", "0.52286935", "0.5204761", "0.5190698", "0.5190605", "0.51898795", "0.518885", "0.5187147", "0.5176045", "0.51713204", "0.516249", "0.515903", "0.51582736", "0.51578045", "0.5155338", "0.51497185", "0.5148196", "0.51451945", "0.514364", "0.5141833", "0.5135142", "0.51283836", "0.51185197", "0.5108606", "0.5105923", "0.5102356", "0.5094234", "0.5089619", "0.5088035", "0.5084734", "0.50832903", "0.5082651", "0.50816995", "0.5074194", "0.50734675", "0.5071607", "0.5071194", "0.50707287", "0.5069383", "0.5068217", "0.5067509", "0.50643605" ]
0.6858027
0
Returns a rendered input.
public function renderInput(): string { return FormFacade::textarea( $this->getKey(), $this->getInputValue(), $this->getInputAttributes(), )->toHtml(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function renderInput();", "public function renderInput()\n {\n $result = $this->renderHiddenInput();\n $result .= $this->renderFileInput();\n return $result;\n }", "public function renderInput(){\n $row = '';\n $row .= \"<input type=\\\"$this->type\\\" id=\\\"$this->id\\\" name=\\\"$this->name\\\" $this->required \";\n\n return $row;\n }", "public function render() : string\r\n {\r\n return '<input type=\"text\" />';\r\n }", "public function render()\n {\n return view('components.form.input');\n }", "protected function renderInput()\n {\n if ($this->hasModel()) {\n $input = Html::activeTextArea($this->model, $this->attribute, $this->options);\n } else {\n $input = Html::textArea($this->name, $this->value, $this->options);\n }\n Html::addCssClass($this->previewOptions, 'hidden');\n $preview = Html::tag('div', '', $this->previewOptions);\n return $input . \"\\n\" . $preview;\n }", "public function render()\n {\n return $this->getFormCreator()->render();\n }", "public function renderWidget()\n {\n if ($this->data !== null) {\n $this->htmlAttributes['value'] = $this->data;\n }\n\n // And to be sure to generate a proper html text input with the proper name...\n $this->htmlAttributes['type'] = $this->type;\n $this->htmlAttributes['name'] = $this->name;\n $this->htmlAttributes['id'] = $this->getId();\n\n $output = '<input ';\n\n $output .= $this->renderHtmlAttributes();\n\n $output .= '/>';\n\n return $output;\n }", "public function render()\n {\n return view('sendportal::components.text-field');\n }", "public function get_input_template() {\n\t\t$options = $this->build_options();\n\n\t\treturn '<ul %s>' . $options . '</ul>';\n\t}", "protected function input()\n {\n return '<input type=\"' . $this->property->input_type . '\" placeholder=\"Значение\" ' .\n 'name=\"property[' . $this->property->id . ']\" class=\"form-control\">';\n }", "public function input(){\n\t\treturn '<input '.\n\t\t\t\t\t'type=\"'. $this->tipo .'\" '.\n\t\t\t\t\t'id=\"'. $this->name .'\" '.\n\t\t\t\t\t'name=\"'. $this->name .'\" '.\n\t\t\t\t\t'class=\"form-control\" '.\n\t\t\t\t\t'value=\"'.( isset($_POST[$this->name]) ? $_POST[$this->name] : '').'\"'.\n\t\t\t\t'/>';\n\t}", "public function getInput(): string\n {\n return $this->input;\n }", "public function get_input_content();", "public function render(): string;", "public function render(): string;", "public function render(): string;", "protected function getInput()\n { \n return ConditionBuilder::render($this->name, $this->value, $this->getConditionsList());\n }", "public function render()\n {\n // dd($this->value);\n return view(load_view('components.forms.render'));\n }", "public function getInput();", "public function getInput();", "public function getInput();", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "protected function getInput()\n { \n $file = $this->get(\"file\", false);\n $text = $this->get(\"text\", false);\n $label = $this->get(\"label\", false);\n\n if (!$label)\n {\n $html[] = '</div><div class=\"freetext '.$this->get(\"class\").'\">';\n }\n\n if ($file)\n {\n $html[] = $this->renderContent($this->get(\"file\"), $this->get(\"path\"), $this); \n }\n\n if ($text)\n {\n $html[] = $this->prepareText($text);\n }\n\n return implode(\" \", $html);\n }", "public function getInput() {}", "public function render()\n {\n return view('components.admin.file-input');\n }", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render();", "public function render()\n {\n return $this->renderer->render($this->variables);\n }", "abstract protected function getInputHtml();", "public function render(): string\n {\n return $this->getForm()->getRenderer()->render($this);\n }", "public function render(): void\n {\n $this->label->render();\n $this->input = $this->reader->read();\n }", "public function getInputHtml()\n\t{\n\t\treturn $this->input_html;\n\t}" ]
[ "0.8338876", "0.792744", "0.74798894", "0.7450018", "0.7447201", "0.71658176", "0.6783463", "0.6756269", "0.67187005", "0.66830474", "0.6638415", "0.66204995", "0.66123545", "0.66096616", "0.6600416", "0.6600416", "0.6600416", "0.6588928", "0.6564932", "0.6546373", "0.6546373", "0.6546373", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.6530792", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.65302473", "0.6523387", "0.6516975", "0.6509974", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6495615", "0.6486284", "0.64725494", "0.6469148", "0.6447124", "0.64378405" ]
0.72607315
5
Seed the application's database.
public function run() { // \App\Department::create(['dept'=>'CS','sec'=>'A','sem'=>1]); // \App\Department::create(['dept'=>'CS','sec'=>'B','sem'=>1]); // \App\Department::create(['dept'=>'IS','sec'=>'C','sem'=>2]); // \App\Subject::create(['subname'=>'CO','subcode'=>'4d56d']); // \App\_Class::create(['subject_id'=>1,'department_id'=>1,'staff_id'=>1]); // \App\Student::create(['name'=>'abc','usn'=>'123','phone'=>'12345','address'=>'fghjk','dob'=>now(),'department_id'=>1]); // \App\Student::create(['name'=>'hjj','usn'=>'233','phone'=>'12345','address'=>'fghjk','dob'=>now(),'department_id'=>1]); // \App\Mark::create(['subject_id'=>1,'student_id'=>1,'mark'=>20,'ia'=>1]); // \App\Mark::create(['subject_id'=>1,'student_id'=>2,'mark'=>20,'ia'=>1]); \App\Role::create(['permission'=>"admin"]); \App\Role::create(['permission'=>"staff"]); \App\Role::create(['permission'=>"officer"]); \App\Staff::create(['name'=>'Rajath','ssn'=>'abc','pwd'=>'1234','role_id'=>1]); // $this->call(UsersTableSeeder::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=1;');// <- SHOULD RESET ANYWAY BUT JUST TO MAKE SURE!\n\t\t}\n\t}", "protected function seedDB()\n {\n $ans = $this->ask('Seed your database?: ', 'y');\n\n // Check if the answer is true\n if (preg_match('/^y/', $ans))\n {\n $this->call('db:seed');\n $this->comment('');\n $this->comment('Database successfully seeded.');\n $this->comment('=====================================');\n echo \"Your app is now ready!\";\n }\n }", "protected function seedDatabase(): void\n {\n $this->seedProductCategories();\n $this->seedProducts();\n }", "public function setupDatabase()\n {\n Artisan::call('migrate:refresh');\n Artisan::call('db:seed');\n\n self::$setupDatabase = false;\n }", "public function run()\n {\n $this->seed('FormsMenuItemsTableSeeder');\n $this->seed('FormsDataTypesTableSeeder');\n $this->seed('FormsDataRowsTableSeeder');\n $this->seed('FormsPermissionsTableSeeder');\n $this->seed('FormsSettingsTableSeeder');\n $this->seed('FormsTableSeeder');\n }", "public function run()\n {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"\\n--- Seeding ---\\n\", TRUE));\n\n if (App::environment('production')) {\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- ERROR: Seeding in Production is prohibited ---\\n\", TRUE));\n return;\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n $this->call(ConfigContentsTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n if (defined('STDERR')) fwrite(STDERR, print_r(\"Set FOREIGN_KEY_CHECKS=1 --- DONE\\n\", TRUE));\n\n // \\Artisan::call('command:regenerate-user-feeds');\n\n \\Cache::flush();\n\n if (defined('STDERR')) fwrite(STDERR, print_r(\"--- End Seeding ---\\n\\n\", TRUE));\n }", "protected function setupDatabase()\n {\n $this->call('migrate');\n $this->call('db:seed');\n\n $this->info('Database migrated and seeded.');\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 seedDatabase(): void\n {\n echo \"Running seeds\";\n\n // Folder where all the seeds are.\n $folder = __DIR__ . '/../seeds/';\n\n // Scan all files/folders inside database.\n $files = \\scandir($folder);\n\n $seeders = [];\n foreach ($files as $key => $file) {\n\n // All files that don't start with a dot.\n if ($file[0] !== '.') {\n\n // Load the file.\n require_once $folder . $file;\n\n // We have to call the migrations after because\n // some seeds are dependant from other seeds.\n $seeders[] = explode('.', $file)[0];\n }\n }\n\n // Run all seeds.\n foreach ($seeders as $seeder) {\n (new $seeder)->run();\n }\n }", "protected function seedDatabase()\n {\n //$this->app->make('db')->table(static::TABLE_NAME)->delete();\n\n TestExtendedModel::create([\n 'unique_field' => '999',\n 'second_field' => null,\n 'name' => 'unchanged',\n 'active' => true,\n 'hidden' => 'invisible',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1234567',\n 'second_field' => '434',\n 'name' => 'random name',\n 'active' => false,\n 'hidden' => 'cannot see me',\n ]);\n\n TestExtendedModel::create([\n 'unique_field' => '1337',\n 'second_field' => '12345',\n 'name' => 'special name',\n 'active' => true,\n 'hidden' => 'where has it gone?',\n ]);\n }", "public function initDatabase()\n {\n $this->call('migrate');\n\n $userModel = config('admin.database.users_model');\n\n if ($userModel::count() == 0) {\n $this->call('db:seed', ['--class' => AdminSeeder::class]);\n }\n }", "public function run ()\n {\n if (App::environment() === 'production') {\n exit('Seed should be run only in development/debug environment.');\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('role_user')->truncate();\n\n // Root user\n $user = User::find(1);\n $user->assignRole('owner');\n\n $user = User::find(2);\n $user->assignRole('admin');\n\n $user = User::find(3);\n $user->assignRole('admin');\n\n $user = User::find(4);\n $user->assignRole('moderator');\n\n $user = User::find(5);\n $user->assignRole('moderator');\n \n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(RolesTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(EntrustTableSeeder::class);\n\n $this->call(AccounttypeSeeder::class);\n $this->call(AppUserTableSeeder::class);\n $this->call(AppEmailUserTableSeeder::class);\n\n\n $this->call(CountryTableSeeder::class);\n $this->call(CityTableSeeder::class);\n\n\n $this->call(PostTypeTableSeeder::class);\n $this->call(PostSubTypeTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(AppPostSolvedTableSeeder::class);\n\n\n $this->call(AppCommentTypeTableSeeder::class);\n // $this->call(AppCommentTableSeeder::class);\n // $this->call(AppSubCommentTableSeeder::class);\n\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('users')->truncate();\n DB::table('password_resets')->truncate();\n DB::table('domains')->truncate();\n DB::table('folders')->truncate();\n DB::table('bookmarks')->truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n $this->seedUserAccount('[email protected]');\n $this->seedUserAccount('[email protected]');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n // $this->call(UsersTableSeeder::class);\n /* Schema::dropIfExists('employees');\n Schema::dropIfExists('users');\n Schema::dropIfExists('requests');\n Schema::dropIfExists('requeststatus');*/\n User::truncate();\n InstallRequest::truncate();\n RequestStatus::truncate();\n\n $cantidadEmployyes = 20;\n $cantidadUsers = 20;\n $cantidadRequestStatus = 3;\n $cantidadRequests = 200;\n\n factory(User::class, $cantidadUsers)->create();\n factory(RequestStatus::class, $cantidadRequestStatus)->create();\n factory(InstallRequest::class, $cantidadRequests)->create();\n }", "public function run()\n {\n Model::unguard();\n foreach (glob(__DIR__ . '/seeds/*.php') as $filename) {\n require_once($filename);\n }\n // $this->call(UserTableSeeder::class);\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n// $this->call('CustomerTableSeeder');\n $this->call('PhotoTableSeeder');\n// $this->call('ProductTableSeeder');\n// $this->call('StaffTableSeeder');\n// $this->call('PasswordResetsTableSeeder');\n// $this->call('UsersTableSeeder');\n $this->call('CustomersTableSeeder');\n $this->call('EmployeesTableSeeder');\n $this->call('InventoryTransactionTypesTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrderDetailsStatusTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('InvoicesTableSeeder');\n $this->call('OrdersTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n $this->call('OrdersStatusTableSeeder');\n $this->call('OrderDetailsTableSeeder');\n\n $this->call('OrdersTaxStatusTableSeeder');\n $this->call('PrivilegesTableSeeder');\n $this->call('EmployeePrivilegesTableSeeder');\n $this->call('ProductsTableSeeder');\n $this->call('InventoryTransactionsTableSeeder');\n $this->call('PurchaseOrderDetailsTableSeeder');\n\n $this->call('PurchaseOrderStatusTableSeeder');\n $this->call('PurchaseOrdersTableSeeder');\n $this->call('SalesReportsTableSeeder');\n $this->call('ShippersTableSeeder');\n $this->call('StringsTableSeeder');\n $this->call('SuppliersTableSeeder');\n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n Model::reguard();\n }", "public function run()\n\t{\n $this->cleanDatabase();\n\n Eloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('CartsTableSeeder');\n $this->call('StoreTableSeeder');\n $this->call('AdvertisementsTableSeeder');\n \n\t}", "public function run()\n {\n \tDB::table('seeds')->truncate();\n\n $seeds = array(\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_18_2013',\n ),\n array(\n 'name' => 'PreferencesTableSeeder_Update_11_20_2013',\n ),\n );\n\n // Uncomment the below to run the seeder\n DB::table('seeds')->insert($seeds);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "protected function setUp(): void\n {\n $db = new DB;\n\n $db->addConnection([\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n ]);\n\n $db->bootEloquent();\n $db->setAsGlobal();\n\n $this->createSchema();\n }", "public function run()\n {\n //$this->call('UserTableSeeder');\n //$this->call('ProjectTableSeeder');\n //$this->call('TaskTableSeeder');\n\n /**\n * Prepare seeding\n */\n $faker = Faker::create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Model::unguard();\n\n /**\n * Seeding user table\n */\n App\\User::truncate();\n factory(App\\User::class)->create([\n 'name' => 'KCK',\n 'email' => '[email protected]',\n 'password' => bcrypt('password')\n ]);\n\n /*factory(App\\User::class, 9)->create();\n $this->command->info('users table seeded');*/\n\n /**\n * Seeding roles table\n */\n Spatie\\Permission\\Models\\Role::truncate();\n DB::table('model_has_roles')->truncate();\n $superAdminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '최고 관리자'\n ]);\n $adminRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '관리자'\n ]);\n $regularRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '정회원'\n ]);\n $associateRole = Spatie\\Permission\\Models\\Role::create([\n 'name' => '준회원'\n ]);\n\n App\\User::where('email', '!=', '[email protected]')->get()->map(function ($user) use ($regularRole) {\n $user->assignRole($regularRole);\n });\n\n App\\User::whereEmail('[email protected]')->get()->map(function ($user) use ($superAdminRole) {\n $user->assignRole($superAdminRole);\n });\n $this->command->info('roles table seeded');\n\n /**\n * Seeding articles table\n */\n App\\Article::truncate();\n $users = App\\User::all();\n\n $users->each(function ($user) use ($faker) {\n $user->articles()->save(\n factory(App\\Article::class)->make()\n );\n });\n $this->command->info('articles table seeded');\n\n /**\n * Seeding comments table\n */\n App\\Comment::truncate();\n $articles = App\\Article::all();\n\n $articles->each(function ($article) use ($faker, $users) {\n for ($i = 0; $i < 10; $i++) {\n $article->comments()->save(\n factory(App\\Comment::class)->make([\n 'author_id' => $faker->randomElement($users->pluck('id')->toArray()),\n //'parent_id' => $article->id\n ])\n );\n };\n });\n $this->command->info('comments table seeded');\n\n /**\n * Seeding tags table\n */\n App\\Tag::truncate();\n DB::table('article_tag')->truncate();\n $articles->each(function ($article) use ($faker) {\n $article->tags()->save(\n factory(App\\Tag::class)->make()\n );\n });\n $this->command->info('tags table seeded');\n\n /**\n * Seeding attachments table\n */\n App\\Attachment::truncate();\n if (!File::isDirectory(attachment_path())) {\n File::deleteDirectory(attachment_path(), true);\n }\n\n $articles->each(function ($article) use ($faker) {\n $article->attachments()->save(\n factory(App\\Attachment::class)->make()\n );\n });\n\n //$files = App\\Attachment::pluck('name');\n\n if (!File::isDirectory(attachment_path())) {\n File::makeDirectory(attachment_path(), 777, true);\n }\n\n /*\n foreach ($files as $file) {\n File::put(attachment_path($file), '');\n }\n */\n\n $this->command->info('attachments table seeded');\n\n /**\n * Close seeding\n */\n Model::reguard();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\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(CountriesTableSeeder::class);\n $this->call(StatesTableSeeder::class);\n $this->call(CitiesTableSeeder::class);\n\n factory(Group::class)->create();\n factory(Contact::class, 5000)->create();\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('AdminTableSeeder');\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->call('MenuTableSeeder');\n\t\t// $this->call('ProductTableSeeder');\n\t\t// $this->call('CategoryTableSeeder');\n\t\t// $this->call('OptionTableSeeder');\n\t\t// $this->call('OptionGroupTableSeeder');\n\t\t// $this->call('TypeTableSeeder');\n\t\t// $this->call('LayoutTableSeeder');\n\t\t// $this->call('LayoutDetailTableSeeder');\n\t\t// $this->call('BannerTableSeeder');\n\t\t// $this->call('ConfigureTableSeeder');\n\t\t// $this->call('PageTableSeeder');\n\t\t// $this->call('ImageTableSeeder');\n\t\t// $this->call('ImageableTableSeeder');\n\t\t// ======== new Seed =======\n\t\t$this->call('AdminsTableSeeder');\n\t\t$this->call('BannersTableSeeder');\n\t\t$this->call('CategoriesTableSeeder');\n\t\t$this->call('ConfiguresTableSeeder');\n\t\t$this->call('ImageablesTableSeeder');\n\t\t$this->call('ImagesTableSeeder');\n\t\t$this->call('LayoutsTableSeeder');\n\t\t$this->call('LayoutDetailsTableSeeder');\n\t\t$this->call('MenusTableSeeder');\n\t\t$this->call('OptionablesTableSeeder');\n\t\t$this->call('OptionsTableSeeder');\n\t\t$this->call('OptionGroupsTableSeeder');\n\t\t$this->call('PagesTableSeeder');\n\t\t$this->call('PriceBreaksTableSeeder');\n\t\t$this->call('ProductsTableSeeder');\n\t\t$this->call('ProductsCategoriesTableSeeder');\n\t\t$this->call('SizeListsTableSeeder');\n\t\t$this->call('TypesTableSeeder');\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->call('ContactsTableSeeder');\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->call('PermissionsTableSeeder');\n\t\t$this->call('PermissionRoleTableSeeder');\n\t\t$this->call('AssignedRolesTableSeeder');\n\t\t$this->call('OrdersTableSeeder');\n\t\t$this->call('OrderDetailsTableSeeder');\n\t\tCache::flush();\n\t\t// BackgroundProcess::copyFromVI();\n\t}", "public function run()\n {\n Model::unguard();\n\n User::create([\n 'email' => '[email protected]',\n 'name' => 'admin',\n 'password' => Hash::make('1234'),\n 'email_verified_at' => Carbon::now()\n ]);\n\n factory(User::class, 200)->create();\n\n // $this->call(\"OthersTableSeeder\");\n }", "public function run()\n {\n $this->seedRegularUsers();\n $this->seedAdminUser();\n }", "public function run()\n {\n if (\\App::environment() === 'local') {\n\n // Delete existing data\n\n\n Eloquent::unguard();\n\n //disable foreign key check for this connection before running seeders\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // Truncate all tables, except migrations\n $tables = array_except(DB::select('SHOW TABLES'), ['migrations']);\n foreach ($tables as $table) {\n $tables_in_database = \"Tables_in_\" . Config::get('database.connections.mysql.database');\n DB::table($table->$tables_in_database)->truncate();\n }\n\n // supposed to only apply to a single connection and reset it's self\n // but I like to explicitly undo what I've done for clarity\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\n //get roles\n $this->call('AccountSeeder');\n $this->call('CountrySeeder');\n $this->call('StateSeeder');\n $this->call('CitySeeder');\n $this->call('OptionSeeder');\n $this->call('TagSeeder');\n $this->call('PrintTemplateSeeder');\n $this->call('SettingsSeeder');\n\n\n\n if(empty($web_installer)) {\n $admin = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"admin\",\n 'first_name' => 'Admin',\n 'last_name' => 'Doe',\n ));\n $admin->user_id = $admin->id;\n $admin->save();\n\n $adminRole = Sentinel::findRoleById(1);\n $adminRole->users()->attach($admin);\n }\n else {\n $admin = Sentinel::findById(1);\n }\n\n //add dummy staff and customer\n $staff = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"staff\",\n 'first_name' => 'Staff',\n 'last_name' => 'Doe',\n ));\n $admin->users()->save($staff);\n\n foreach ($this->getPermissions() as $permission) {\n $staff->addPermission($permission);\n }\n $staff->save();\n\n $customer = Sentinel::registerAndActivate(array(\n 'email' => '[email protected]',\n 'password' => \"customer\",\n 'first_name' => 'Customer',\n 'last_name' => 'Doe',\n ));\n Customer::create(array('user_id' => $customer->id, 'belong_user_id' => $staff->id));\n $staff->users()->save($customer);\n\n //add respective roles\n\n $staffRole = Sentinel::findRoleById(2);\n $staffRole->users()->attach($staff);\n $customerRole = Sentinel::findRoleById(3);\n $customerRole->users()->attach($customer);\n\n\n\n DB::table('sales_teams')->truncate();\n DB::table('opportunities')->truncate();\n\n //Delete existing seeded users except the first 4 users\n User::where('id', '>', 3)->get()->each(function ($user) {\n $user->forceDelete();\n });\n\n //Get the default ADMIN\n $user = User::find(1);\n $staffRole = Sentinel::getRoleRepository()->findByName('staff');\n $customerRole = Sentinel::getRoleRepository()->findByName('customer');\n\n //Seed Sales teams for default ADMIN\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($user->id, $j, $user);\n $this->createOpportunity($user, $user->id, $j);\n }\n\n\n //Get the default STAFF\n $staff = User::find(2);\n $this->createSalesTeam($staff->id, 1, $staff);\n $this->createSalesTeam($staff->id, 2, $staff);\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 4) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $staff->id, $j);\n }\n\n foreach (range(1, 3) as $i) {\n $staff = $this->createStaff($i);\n $user->users()->save($staff);\n $staffRole->users()->attach($staff);\n\n $customer = $this->createCustomer($i);\n $staff->users()->save($customer);\n $customerRole->users()->attach($customer);\n $customer->customer()->save(factory(\\App\\Models\\Customer::class)->make());\n\n\n //Seed Sales teams for each STAFF\n foreach (range(1, 5) as $j) {\n $this->createSalesTeam($staff->id, $j, $staff);\n $this->createOpportunity($staff, $i, $j);\n }\n\n }\n\n //finally call it installation is finished\n file_put_contents(storage_path('installed'), 'Welcome to LCRM');\n }\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function setupDatabase()\n {\n exec('rm ' . storage_path() . '/testdb.sqlite');\n exec('cp ' . 'database/database.sqlite ' . storage_path() . '/testdb.sqlite');\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 # truncates tables before seeding\n foreach ($this->toTruncate as $table) {\n DB::table($table)->delete();\n }\n\n factory(App\\Models\\Product::class, 25)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Post::truncate();\n Comment::truncate();\n // CommentReply::truncate();\n \n\n\n factory(User::class,10)->create();\n factory(Post::class,20)->create();\n factory(Comment::class,30)->create();\n // factory(CommentReply::class,30)->create();\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\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "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 /** \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 DB::statement('SET foreign_key_checks = 0');\n DB::table('topics')->truncate();\n\n factory(\\App\\Topic::class, 100)->create();\n // ->each(function($topic) {\n\n // // Seed para a relação com group\n // $topic->group()->save(factory(App\\Group::class)->make());\n\n // // Seed para a relação com topicMessages\n // $topic->topicMessages()->save(factory(App\\TopicMessage::class)->make());\n\n // // Seed para a relação com user\n // $topic->user()->save(factory(App\\User::class)->make());\n // });\n \n DB::statement('SET foreign_key_checks = 1');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n Categoria::truncate();\n Atractivo::truncate();\n Galeria::truncate();\n User::truncate();\n\n $this->call(CategoriasTableSeeder::class);\n $this->call(AtractivosTableSeeder::class);\n $this->call(GaleriasTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n }", "public function run(Faker $faker)\n {\n Schema::disableForeignKeyConstraints();\n DB::table('users')->insert([\n 'name' => $faker->name(),\n 'email' => '[email protected]',\n 'password' => Hash::make('12345678'),\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\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n \t// DB::table('webapps')->delete();\n\n $webapps = array(\n\n );\n\n // Uncomment the below to run the seeder\n // DB::table('webapps')->insert($webapps);\n }", "public function run()\n {\n $this->cleanDatabase();\n\n factory(User::class, 50)->create();\n factory(Document::class, 30)->create();\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 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 $tables = array(\n 'users',\n 'companies',\n 'stands',\n 'events',\n 'visitors',\n 'api_keys'\n );\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n }\n\n foreach ($tables as $table) {\n DB::table($table)->truncate();\n }\n\n $this->call(UsersTableSeeder::class);\n $this->call(EventsTableSeeder::class);\n $this->call(CompaniesTableSeeder::class);\n $this->call(StandsTableSeeder::class);\n $this->call(VisitorsTableSeeder::class);\n\n if (!App::runningUnitTests()) {\n DB::statement('SET FOREIGN_KEY_CHECKS = 1');\n }\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 $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n $this->call(PaisSeeder::class);\n $this->call(DepartamentoSeeder::class);\n $this->call(MunicipioSeeder::class);\n $this->call(PersonaSeeder::class);\n }", "public function run()\n {\n //\n if (App::environment() === 'production') {\n exit('Do not seed in production environment');\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints\n\n DB::table('events')->truncate();\n \n Event::create([\n 'id' => 1,\n 'name' => 'Spot Registration For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n Event::create([\n 'id' => 2,\n 'name' => 'Spot Screening For Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'screen',\n 'formId'\t\t=> 1,\n ]);\n \n Event::create([\n 'id' => 3,\n 'name' => 'Spot Registration For Skin Cancer',\n 'cancerId' => 2,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addMonths(12),\n 'eventType'\t\t=> 'register',\n 'formId'\t\t=> null,\n ]);\n\n\n Event::create([\n 'id' => 3,\n 'name' => 'Registration cum Screening camp for Throat Cancer',\n 'cancerId' => 1,\n 'startDate'\t\t=> Carbon::now(),\n 'endDate'\t\t=> Carbon::now()->addWeeks(1),\n 'eventType'\t\t=> 'register_screen',\n 'formId'\t\t=> 1,\n ]);\n \n DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n $this->call(\\Database\\Seeders\\GroupByRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\SingleIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\MultiIndexRecordTableSeeder::class);\n $this->call(\\Database\\Seeders\\JoinFiveTablesSeeder::class);\n\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// // 試しに一回流す\n// $data = $this->makeData(0, 'userFactory', 1);\n// DB::table('users')->insert($data);\n// $data = $this->makeData(0, 'userDetailFactory', 1);\n// DB::table('user_details')->insert($data);\n//\n// // $this->call(UsersTableSeeder::class);\n// DB::table('users')->truncate();\n// DB::table('user_details')->truncate();\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userFactory', 2500);\n// DB::table('users')->insert($data);\n// }\n//\n// for ($i = 0; $i < 40; $i++) {\n// $data = $this->makeData($i, 'userDetailFactory', 2500);\n// DB::table('user_details')->insert($data);\n// }\n }", "public function run()\n {\n $this->truncateTables([\n 'users',\n 'categories',\n 'types',\n 'courses',\n 'classrooms',\n 'contents',\n 'companies',\n ]);\n\n $this->call(CompanyTableSeeder::class);\n $this->call(TypeTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(CoursesTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(ContentTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(ClassroomTableSeeder::class);\n $this->call(TestTableSeeder::class);\n $this->call(BankTableSeeder::class);\n\n\n // factory(\\App\\User::class, 50)\n // ->create()\n // ->each(function ($user) {\n // // $user->companies()->save();\n // $company = \\App\\Company::inRandomOrder()->first();\n // $user->companies()->attach($company->id);\n // $user->assignRole(['participante']);\n // });\n /*\n factory(\\App\\User::class, 50)\n ->create()\n ->each(function ($user) {\n $user->assignRole(['participante']);\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 DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n User::truncate();\n Question::truncate();\n Option::truncate();\n// Answer::truncate();\n Quiz::truncate();\n QuizQuestion::truncate();\n\n //for admin\n $admin = factory(User::class)->create([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'is_admin' => 1,\n ]);\n\n //for user\n $user = factory(User::class)->create([\n 'name' => 'User',\n 'email' => '[email protected]',\n ]);\n\n factory(Question::class, 100)->create()->each(function ($question) {\n factory(Option::class, mt_rand(2, 4))->create([\n 'question_id' => $question->id,\n ]);\n });\n\n factory(Quiz::class, 10)->create()->each(function ($quiz) {\n\n factory(QuizQuestion::class, mt_rand(5, 10))->create();\n });\n\n\n }", "public function run()\n {\n $this->call([\n SiteSettingsSeeder::class,\n LaratrustSeeder::class,\n CountrySeeder::class,\n GovernorateSeeder::class,\n FaqSeeder::class,\n SitePageSeeder::class,\n UsersSeeder::class,\n ]);\n\n Country::whereiso(\"EG\")->update(['enable_shipping' => true]);\n\n factory(User::class, 400)->create();\n\n Category::create([\n 'en' => [\n 'name' => \"cake tools\"\n ]\n ]);\n\n Category::create([\n 'en' => [\n 'name' => \"Party Supplies\"\n ]\n ]);\n\n $this->call([\n ProductCategorySeeder::class,\n ProductSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(PermissionsTableSeeder::class);\n\n if (App::environment('local')) {\n $this->call(FakeUsersTableSeeder::class);\n $this->call(FakeArticlesTableSeeder::class);\n $this->call(FakeEventsTableSeeder::class);\n }\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(CategoryTypesTableSeeder::class);\n $this->call(CategoryTableSeeder::class);\n $this->call(AccountTypesTableSeeder::class);\n $this->call(TransactionTypesTableSeeder::class);\n\n if (App::environment() !== 'production') {\n $this->call(UserTableSeeder::class);\n $this->call(AccountBudgetTableSeeder::class);\n $this->call(TransactionTableSeeder::class);\n }\n\n Model::reguard();\n }", "public function run()\n {\n User::truncate();\n Product::truncate();\n User::forceCreate([\n 'name' => 'foo',\n 'email' => '[email protected]',\n 'password' => bcrypt('password'),\n ]);\n factory(User::class, 5)->create();\n factory(Product::class, 5)->create();\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 {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(\"OthersTableSeeder\");\n\n // DB::table('locations')->insert([\n // 'id' => 1,\n // 'name' => 'Default',\n // 'name' => 'district',\n // 'district_id' => 1,\n // 'province_id' => 1,\n // ]);\n }", "public function run()\n {\n $data = include env('DATA_SEED');\n\n \\Illuminate\\Support\\Facades\\DB::table('endpoints')->insert((array)$data);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n DB::table('admins')->truncate();\n\n for ($i = 0; $i < 10; $i++)\n {\n $faker = Factory::create('en_US');\n $values = [\n 'name' => $faker->userName,\n 'email' => $faker->freeEmail,\n 'password' => bcrypt($faker->password),\n 'phone' => $faker->phoneNumber,\n 'status' => random_int(0,1)\n ];\n admin::create($values);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n \\DB::table('provinces')->delete();\n \\DB::table('cities')->delete();\n \\DB::table('districts')->delete();\n // import provinces and cities from sql file\n $sqlFile = app_path() . '/../database/raw/administrative_indonesia_without_districts.sql';\n DB::unprepared(file_get_contents($sqlFile));\n $this->command->info('Successfully seed Provinces and Cities!');\n\n // import districts with latitude and longitude from csv file\n $csvFile = app_path() . '/../database/raw/administrative_indonesia_districts_with_lat_lng.csv';\n $districts = $this->csvToArray($csvFile);\n // check if lat lng exists\n foreach ($districts as $i => $d) {\n if ($d['latitude'] == '') $districts[$i]['latitude'] = 0;\n if ($d['longitude'] == '') $districts[$i]['longitude'] = 0;\n }\n // insert it\n $insert = District::insert($districts);\n if ($insert) $this->command->info('Successfully seed Districts!');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n DB::beginTransaction();\n// $this->seed();\n DB::commit();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }", "public function run()\n {\n User::create([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\n ]);\n\n User::create([\n 'name' => 'Leonardo',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789')\n ]);\n\n // seed sin model\n /* DB::table('users')->insert([\n 'name' => 'Regynald',\n 'email' => '[email protected]',\n 'password' => Hash::make('123456789'),\n 'url' => 'http://zreyleo-code.com',\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 {\n $this->call(UsersTableSeeder::class);\n $this->call(RegionsTableSeeder::class);\n $this->call(ProvincesTableSeeder::class);\n $this->call(DistrictsTableSeeder::class);\n $this->call(SubDistrictsTableSeeder::class);\n $this->call(PostcodesTableSeeder::class);\n\n if (env('APP_ENV') !== 'production') {\n // Wipe up 5 churches, and each church has 5 cells, and each cell has 20 members associated with.\n // In other word, we wipe up 500 church members.\n for ($i = 0; $i < 2; $i++) {\n $church = factory(\\App\\Models\\Church::class)->create();\n\n $church->areas()->saveMany(factory(\\App\\Models\\Area::class, 2)->create([\n 'church_id' => $church->id\n ])->each(function($area) {\n $area->cells()->saveMany(factory(\\App\\Models\\Cell::class, 2)->create([\n 'area_id' => $area->id\n ])->each(function($cell) {\n $cell->members()->saveMany(factory(App\\Models\\Member::class, 10)->create([\n 'cell_id' => $cell\n ]));\n }));\n }));\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\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 $this->environmentPath = env('APP_ENV') === 'production' ||\n env('APP_ENV') === 'qa' ||\n env('APP_ENV') === 'integration' ?\n 'Production':\n 'local';\n //disable FK\n Model::unguard();\n DB::statement(\"SET session_replication_role = 'replica';\");\n\n // $this->call(HrEmployeeTableSeeder::class);\n $this->call(\"Modules\\HR\\Database\\Seeders\\\\$this->environmentPath\\HrEmployeePosTableSeeder\");\n // $this->call(HrEmployeePresetsDiscountTableSeeder::class);\n\n // Enable FK\n DB::statement(\"SET session_replication_role = 'origin';\");\n Model::reguard();\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 }", "protected static function seed()\n {\n foreach (self::fetch('database/seeds', false) as $file) {\n Bus::need($file);\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n $faker = F::create('App\\Proovedores');\n for($i=0; $i < 10; $i++){\n DB::table('users')->insert([\n 'usuario' => $i,\n 'password' => $i,\n 'email' => $faker->email,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n User::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // We did this for test purposes. Shouldn't be doing this for production\n $password = Hash::make('123456');\n\n User::create([\n 'name' => 'Administrator',\n 'email' => '[email protected]',\n 'password' => $password,\n ]);\n }", "public function run()\n {\n Model::unguard();\n \n factory('App\\User','admin')->create();\n factory('App\\Evento',100)->create();\n //factory('App\\User','miembro',10)->create();\n factory('App\\Telefono',13)->create();\n factory('App\\Notificacion',10)->create();\n factory('App\\Rubro',10)->create();\n factory('App\\Tecnologia',10)->create();\n factory('App\\Cultivo',10)->create();\n factory('App\\Etapa',10)->create();\n factory('App\\Variedad',10)->create();\n factory('App\\Caracteristica',10)->create();\n factory('App\\Practica',30)->create();\n factory('App\\Tag',15)->create();\n // $this->call(PracticaTableSeeder::class);\n $this->call(TrTableSeeder::class);\n $this->call(MesTableSeeder::class);\n $this->call(SemanasTableSeeder::class);\n $this->call(PsTableSeeder::class);\n $this->call(MsTableSeeder::class);\n $this->call(CeTableSeeder::class);\n $this->call(CvTableSeeder::class);\n $this->call(PtSeeder::class);\n \n\n Model::unguard();\n }", "public function run() {\n $this->call(UserSeeder::class);\n $this->call(PermissionSeeder::class);\n $this->call(CreateAdminUserSeeder::class);\n // $this->call(PhoneSeeder::class);\n // $this->call(AddressSeeder::class);\n\n $this->call(ContactFormSeeder::class);\n //$this->call(ContactSeeder::class);\n\n User::factory()->count(20)->create()->each(function ($user) {\n // Seed the relation with one address\n $address = Address::factory()->make();\n $user->address()->save($address);\n\n // Seed the relation with one phone\n $phone = Phone::factory()->make();\n $user->phone()->save($phone);\n\n // Seed the relation with 15 contacts\n $contact = Contact::factory()->count(25)->make();\n $user->contacts()->saveMany($contact);\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 DB::statement('SET FOREIGN_KEY_CHECKS=0');\n Activity::truncate();\n User::truncate();\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n $this->call(UserTableSeeder::class);\n $this->call(ActivityTableSeeder::class);\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\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n \\App\\User::truncate();\n \\App\\Category::truncate();\n \\App\\Product::truncate();\n \\App\\Transaction::truncate();\n DB::table('category_product')->truncate();\n\n \\App\\User::flushEventListeners();\n \\App\\Category::flushEventListeners();\n \\App\\Product::flushEventListeners();\n \\App\\Transaction::flushEventListeners();\n\n\n $usersQuentity = 1000;\n $categoriesQuentity = 30;\n $productsQuentity = 1000;\n $transactionsQuentity = 1000;\n\n factory(\\App\\User::class, $usersQuentity)->create();\n factory(\\App\\Category::class, $categoriesQuentity)->create();\n factory(\\App\\Product::class, $productsQuentity)->create()->each(\n function ($product){\n $categories = \\App\\Category::all()->random(mt_rand(1, 5))->pluck('id');\n\n $product->categories()->attach($categories);\n }\n );\n factory(\\App\\Transaction::class, $transactionsQuentity)->create();\n\n }", "public static function setUpBeforeClass()\n {\n parent::setUpBeforeClass();\n $app = require __DIR__ . '/../../bootstrap/app.php';\n /** @var \\Pterodactyl\\Console\\Kernel $kernel */\n $kernel = $app->make(Kernel::class);\n $kernel->bootstrap();\n $kernel->call('migrate:fresh');\n\n \\Artisan::call('db:seed');\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public function run()\n {\n Model::unguard();\n\n if( !User::where('email', '[email protected]')->count() ) {\n User::create([\n 'nombre'=>'Nick'\n ,'apellidos'=>'Palomino'\n ,'email'=>'[email protected]'\n ,'password'=> Hash::make('1234567u')\n ,'celular'=>'966463589'\n ]);\n }\n\n $this->call('CategoriaTableSeeder');\n $this->call('WhateverSeeder');\n $this->call('ProductTableSeeder');\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 Model::unguard();\n\n $this->command->info('seed start!');\n\n // 省市县\n $this->call('RegionTableSeeder');\n // 用户、角色\n $this->call('UserTableSeeder');\n // 权限\n $this->call('PurviewTableSeeder');\n // 博文分类\n $this->call('CategoryTableSeeder');\n // 博文、评论、标签\n $this->call('ArticleTableSeeder');\n // 心情\n $this->call('MoodTableSeeder');\n // 留言\n $this->call('MessageTableSeeder');\n // 文件\n $this->call('StorageTableSeeder');\n\n $this->command->info('seed end!');\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 $this->call(RolesDatabaseSeeder::class);\n $this->call(UsersDatabaseSeeder::class);\n $this->call(LocalesDatabaseSeeder::class);\n $this->call(MainDatabaseSeeder::class);\n }", "public function run()\n {\n // DB::table('users')->insert([\n // ['id'=>1, 'email'=>'nhat','password'=>bcrypt(1234), 'lever'=>0]\n // ]);\n // $this->call(UsersTableSeeder::class);\n // $this->call(CatTableSeeder::class);\n // $this->call(TypeTableSeeder::class);\n // $this->call(AppTableSeeder::class);\n // $this->call(GameTableSeeder::class);\n \n \n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\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 $this->seedUsers();\n $this->seedAdmins();\n $this->seedMeals();\n\n $this->seedOrder();\n $this->seedOrderlist();\n\n $this->seedReload();\n }", "public function run()\n\t{\n\t\t//composer require fzaninotto/faker\n\t\t\n\t\t$this->call(populateAllSeeder::class);\n\t\t\n\t}", "public function run()\n {\n Model::unguard();\n\n $faker =Faker\\Factory::create();\n\n // $this->call(UserTableSeeder::class);\n\n $this->seedTasks($faker);\n $this->seedTags($faker);\n\n Model::reguard($faker);\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 $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 $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 Schema::disableForeignKeyConstraints();\n\n $this->call([\n CountriesSeeder::class,\n ProvincesSeeder::class,\n SettingsSeeder::class,\n AdminsTableSeeder::class,\n ]);\n }" ]
[ "0.8065584", "0.7848217", "0.76748335", "0.7244791", "0.7217673", "0.7133266", "0.70984626", "0.70752525", "0.7050456", "0.69926506", "0.6988436", "0.6985116", "0.69669306", "0.68992233", "0.68682885", "0.6847507", "0.6831097", "0.68208444", "0.68041754", "0.68041754", "0.68032914", "0.6790816", "0.67898446", "0.6787946", "0.678716", "0.6777025", "0.6775358", "0.67726433", "0.67660606", "0.67634314", "0.6758109", "0.673368", "0.67331403", "0.6729675", "0.67294586", "0.67255825", "0.67230934", "0.6722171", "0.67213213", "0.6715509", "0.67079365", "0.67062575", "0.6703651", "0.670358", "0.6702433", "0.6702257", "0.66971296", "0.66941136", "0.6686706", "0.6684891", "0.6678387", "0.66765666", "0.66730577", "0.66660666", "0.66496396", "0.6641152", "0.66396993", "0.66393507", "0.66372746", "0.6633904", "0.6630109", "0.66281164", "0.66259885", "0.6617708", "0.66098803", "0.6602503", "0.66002655", "0.659939", "0.6597011", "0.6596365", "0.6592976", "0.65928084", "0.6592367", "0.6589387", "0.6581892", "0.6581305", "0.65805703", "0.6579974", "0.6576225", "0.65749776", "0.6574433", "0.6571225", "0.6569767", "0.6568897", "0.65635324", "0.65631485", "0.6559915", "0.6558022", "0.6556394", "0.65548515", "0.6551606", "0.6548489", "0.6548293", "0.65458405", "0.6545289", "0.6544641", "0.6543904", "0.6543258", "0.65430623", "0.6542044", "0.6539481" ]
0.0
-1
Override the default authentication of passport
public function findForPassport($username) { return $this->where('username', $username)->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function signIsUsingPassport()\n {\n Passport::actingAs(factory(User::class)->create());\n }", "abstract protected function auth();", "public function authenticate() {}", "public function __construct(){\n //laravel passport api protection against unauthenticated users\n $this->middleware('auth:api');\n }", "public function use_authentication()\n {\n }", "public function authenticate() {\n }", "public function getPassport(): Passport;", "public function authenticate();", "public function authenticate();", "public function authenticate();", "public function __construct()\n {\n $this->middleware('auth:passport');\n }", "public function authByUserPassword($password) {}", "abstract public function authenticate(Request $request);", "public function __construct()\n {\n // auth here\n }", "abstract public function authenticate($user, $pass);", "public function authentication()\n {\n }", "function authenticate() {}", "protected function getBackendUserAuthentication() {}", "protected function getBackendUserAuthentication() {}", "protected function getBackendUserAuthentication() {}", "protected function getBackendUserAuthentication() {}", "protected function getBackendUserAuthentication() {}", "protected function _authByUserPassword($userPassword = '') {}", "protected function loginAuthenticate(){\n\n\t\t\n\t}", "function backend_user_authenticate()\n {\n return app('nodes.backend.auth')->authenticate();\n }", "public function setAuthenticationParams() {\n }", "public function auth()\n {\n\n if (Auth::attempt(['email' => $this->request->header('email'), 'password' => $this->request->header('password')])) {\n $this->user = Auth::user();\n\n } else {\n echo json_encode(['error' => 'Unauthorised']);\n die();\n }\n }", "protected function authenticate(){\n \\Artisan::call('passport:install');\n $user = User::create([\n 'name' => 'test',\n 'email' => '[email protected]',\n 'password' => Hash::make('secret1234'),\n ]);\n Passport::actingAs($user);\n $token = $user->createToken('myapi')->accessToken;\n $headers = [ 'Authorization' => 'Bearer $token'];\n\n return $headers;\n }", "protected function setProxyAuthScheme() {}", "public function doAuthentication();", "function assignFrontAuth() {\n AuthComponent::$sessionKey = 'Auth.User';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.merchant_id' => $this->Session->read('merchant_id'), 'User.role_id' => array('4', '5'), 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "public function setAuthenticated();", "public function setBasicAuth()\n {\n $auth = $this->auth;\n\n if (null !== $auth['user']) {\n $this->mink->getSession()->setBasicAuth(\n $auth['user'],\n $auth['password']\n );\n }\n }", "public function auth($data = null) {}", "protected function configureBackendLoginSecurity() {}", "public function authenticate($request);", "public function __construct() {\n Auth::ensureLogin();\n parent::__construct();\n }", "function assignBackAuth() {\n AuthComponent::$sessionKey = 'Auth.Admin';\n $this->Auth->authenticate = array(\n 'Form' => array(\n 'userModel' => 'User',\n 'fields' => array('username' => 'email', 'password' => 'password', 'store_id'),\n 'scope' => array('User.store_id' => $this->Session->read('admin_store_id'), 'User.role_id' => 3, 'User.is_active' => 1, 'User.is_deleted' => 0)\n )\n );\n }", "public function auth($data = null);", "function admin_auth()\n {\n return auth(config(\"admin.auth_guard\"));\n }", "public function authByOwnerPassword($password) {}", "function rest_get_authenticated_app_password()\n {\n }", "public function requiresAuthentication() {\n return false;\n }", "public function setAuth($username, $password);", "public function authenticate() { return false; }", "public function authentication(): AuthenticationInterface;", "abstract public function getAuthenticator();", "public function __construct()\n {\n \tauth()->setDefaultDriver('api');\n $this->middleware('auth:api', ['except' => ['me','login','registration','refresh','logouttest']]);\n // $this->middleware('cors');\n }", "public function authenticate(IRequest $request, AuthenticationScheme $scheme): AuthenticationResult;", "public function AuthenticateUser($name, $password);", "public function authenticate() {\n $user = Zebu_User::createInstance($this->username);\n if($user && $this->passhash == $user->passhash){\n return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS,$this->username);\n }\n return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID,$this->username);\n }", "public function __construct()\n {\n $this->middleware('auth.custom');\n }", "public function authenticate(IAuthentication $auth) ;", "abstract protected function authenticate($username, $password);", "abstract public function authenticate(CakeRequest $request, CakeResponse $response);", "public function authenticate(){\n $user = $_SERVER['PHP_AUTH_USER'];\n $pass = $_SERVER['PHP_AUTH_PW'];\n\n if(!empty($user) && $this->api_config['allowed_users'][$user] === $pass){\n return True;\n }\n return False;\n }", "public function __construct()\n {\n // authenticate on all routes\n $this->middleware('jwt.auth')\n ->except('home');\n }", "public function authUser(){\n if(!isset($this->sessionBool) || empty($this->sessionBool)){\n die($this->alerts->ACCESS_DENIED);\n }else{\n if(!$this->sessionBool){\n die($this->alerts->ACCESS_DENIED);\n }\n } \n }", "public function __construct()\n {\n $this->middleware('auth');\n parent::__construct();\n }", "public function authenticate()\n {\n \n if($this->username === 'admin' && $this->password === 'admin') {\n $resultCode = Result::SUCCESS;\n $identity = 'Admin';\n } else {\n $resultCode = Result::FAILURE_CREDENTIAL_INVALID;\n $identity = 'guest';\n }\n \n return new \\Zend\\Authentication\\Result($resultCode, $identity);\n }", "public function __construct()\n {\n// $this->middleware('auth:api', ['except' => ['login']]);\n }", "public function setAuthParams()\n {\n if( $this->getUseSession() )\n {\n // FIXME Need to add session functionality\n }\n else\n {\n $this->getHttpClient()->setParameterGet( 'user', $this->getUsername() );\n $this->getHttpClient()->setParameterGet( 'password', $this->getPassword() );\n $this->getHttpClient()->setParameterGet( 'api_id', $this->getApiId() );\n }\n }", "protected function loginIfRequested() {}", "function test_authourization_fun( $vars ){\r\n\r\n if (isset($_GET['user']) && $_GET['user']){\r\n $_SERVER[\"PHP_AUTH_USER\"] = $_GET['user'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_USER\"] = 'NOUSER';\r\n }\r\n if (isset($_GET['pw']) && $_GET['pw']){\r\n $_SERVER[\"PHP_AUTH_PW\"] = $_GET['pw'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_PW\"] = 'ERRORPASSWORD';\r\n }\r\n}", "public function initialize()\n {\n parent::initialize();\n $this->Auth->allow(\n [\n 'login',\n 'logout',\n 'register',\n 'recover'\n ]\n );\n }", "public function __construct()\n {\n $this->middleware('authenticate');\n }", "private function authenticate()\n {\n $this->_validator->setCredentials($this->_user, $this->_pass);\n if ($this->_validator->authenticate()) {\n $this->_accepted = true;\n }\n }", "public function auth(){\n \tif (Auth::guest()) return Redirect::to('admin/login');\n }", "public function auth($username, $password)\n {\n\n }", "function auth(){\n\t\t//TODO auth implementieren\n\t\treturn true;\n\t}", "public function authenticate(Request $request): ?User;", "private function setUserPass(){\n if($this->_request->get(login_user)){\n $this->_user = $this->_request->get(login_user);\n }else{\n $this->_user = $this->getCookie();\n }\n $this->_pass = $this->_request->get('login-password');\n }", "function setAuth($user, $pass) {\n\t\t$this->authUser = $user;\n\t\t$this->authPass = $pass;\n\t}", "public function getAuthenticationProvider();", "public function isAuth() {}", "public function __construct()\r\r\n\t{\r\r\n\t\t$this->import('BackendUser', 'User');\r\r\n\t\tparent::__construct();\r\r\n\r\r\n\t\t$this->User->authenticate();\r\r\n\t}", "public function __construct()\n {\n $this->middleware('auth');\n\t\tparent::__construct();\n }", "public function __construct()\n {\n $this->middleware('auth');\n\t\tparent::__construct();\n }", "public function authenticate()\n {\n if (Auth::attempt(['email' => Request::input('email'), 'password' => Request::input('password')]))\n {\n return redirect()->intended('/admin');\n } else {\n\n session()->flash('unsuccessful', 'Username atau password yang Anda masukan salah!');\n\n return redirect()->back();\n }\n }", "public function __construct()\n {\n \tparent::__construct();\n $this->middleware('auth');\n }", "public function __construct()\n {\n parent::__construct();\n \n $this->middleware('auth');\n \n }", "public function __construct()\n {\n $this->middleware('auth');\n parent::__construct();\n }", "public function __construct()\n {\n $this->middleware('auth');\n parent::__construct();\n }", "public function __construct()\n {\n $this->middleware('auth');\n parent::__construct();\n }", "public function __construct()\n {\n $this->middleware('auth');\n parent::__construct();\n }", "public function initialize()\n {\n parent::initialize();\n $this->Auth->allow(['logout','nfsaLogin','home', 'login', 'ercmsRequest', 'index']);\n }", "protected function _initAuth()\n {\n $dm = Registry::getInstance()->get('dm');\n $user = $dm->getRepository('Domain\\User\\Entity\\User')->find('4de999713eecad69a02e4145');\n \n // Simulate logged in User.\n Registry::getInstance()->set('user', $user);\n }", "private function changeAuthenticationRedirect()\n {\n $this->line('Change default authentication redirect');\n\n $file = app_path('Http/Middleware/Authenticate.php');\n $content = $this->files->get($file);\n\n $this->files->replace($file, Str::replaceArray(\"route('login')\", [\"config('admin.url')\"], $content));\n }", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function isAuthenticated();", "public function __construct()\n {\n\n $this->middleware('auth');\n\t\tparent::__construct();\n\n }", "public abstract function authenticate(array &$options, Request $request);", "public function getAuth();", "public function getAuth();", "private function login()\n {\n if (!isset($_SERVER['PHP_AUTH_USER']) || !$this->isAdmin()) {\n header('WWW-Authenticate: Basic realm=\"My Realm\"');\n header('HTTP/1.0 401 Unauthorized');\n exit;\n }\n }", "public function getPassport()\n {\n return $this->passport;\n }", "public function __construct() {\n parent::__construct(\n self::USER_PHP_USERNAME, self::USER_PHP_CREDENTIALS_FILENAME);\n }", "protected function isUserAllowedToLogin() {}", "public function __construct() {\n parent::__construct();\n $this->middleware('auth');\n }" ]
[ "0.6610484", "0.64006037", "0.62985826", "0.6219269", "0.61618006", "0.6100052", "0.6067972", "0.6008136", "0.6008136", "0.6008136", "0.5884848", "0.5871231", "0.5860892", "0.585119", "0.5844856", "0.58335334", "0.5826608", "0.58125556", "0.58116984", "0.58102363", "0.58102363", "0.5808837", "0.5783136", "0.57805127", "0.57461494", "0.5743082", "0.57383907", "0.5732405", "0.5729045", "0.5664626", "0.5655592", "0.5646402", "0.56334764", "0.5614169", "0.5598833", "0.5588", "0.55165344", "0.55079186", "0.54963315", "0.5495196", "0.5478821", "0.5478657", "0.5475989", "0.54636943", "0.5452818", "0.54382414", "0.54342186", "0.54320294", "0.54210794", "0.5416597", "0.541425", "0.5398041", "0.5382712", "0.53666675", "0.5348742", "0.53408325", "0.53284967", "0.5310886", "0.530722", "0.5305843", "0.5304885", "0.53026354", "0.5278767", "0.5278616", "0.5277587", "0.52765495", "0.5276212", "0.526601", "0.5263251", "0.5259154", "0.52570397", "0.525521", "0.52537227", "0.52467495", "0.524519", "0.52404636", "0.52377474", "0.52377474", "0.5217565", "0.5216067", "0.52114743", "0.5208176", "0.5208176", "0.5208176", "0.5208176", "0.51995367", "0.51959497", "0.51954305", "0.5190559", "0.5190559", "0.5190559", "0.5190559", "0.51831126", "0.5182547", "0.51817554", "0.51817554", "0.5181185", "0.51764655", "0.5175247", "0.51685405", "0.5167785" ]
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\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}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\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 }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Constructs new message container and clears its internal state
public function __construct() { $this->reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clear()\n {\n $this->messages = [];\n }", "public function clear(){\r\n\t\t$this->_init_messages();\r\n\t}", "public function clearMessages()\n {\n $this->_messages = array();\n return $this;\n }", "public function clear(): void\n {\n $this->messages = [];\n }", "public function\n\tclearMessages()\n\t{\n\t\t$this -> m_aStorage = [];\n\t}", "public function clear(){\n\t\t$this->stack = array();\n\t\t$this->messages = array();\n\t\treturn $this;\n\t}", "public function clear()\r\n {\r\n $this->messages->clear();\r\n }", "public function clear_messages() {\n\t\t$this->_write_messages( null );\n\t}", "public function reset()\n {\n $this->messages = [];\n }", "function clearContainer()\r\n {\r\n foreach ($this->container as $k => $v)\r\n unset($this->container[$k]);\r\n }", "public function clearMessage()\n {\n $this->setMessage(null);\n $this->clearFormState();\n return $this;\n }", "protected function constructEmpty()\r\n\t{\r\n\t\t$this->transitionCount = 0;\r\n\t\t$this->transitions = array();\r\n\t\t// TODO: this should probably contain at least one item\r\n\t\t$this->types = array();\r\n\t}", "public function __destruct()\n\t{\n\t\t\\Message::reset();\t\n\t}", "public function reset()\n {\n $this->values[self::MESSAGE] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "protected function createBag()\n\t{\n\t\t$this->bag = new MessageBag;\n\n\t\t// Are there any default errors, from a form validator for example?\n\t\tif ($this->session->has('errors'))\n\t\t{\n\t\t\t$errors = $this->session->get('errors')->all(':message');\n\n\t\t\t$this->bag->merge(['error' => $errors]);\n\t\t}\n\n\t\t// Do we have any flashed messages already?\n\t\tif ($this->session->has($this->sessionKey))\n\t\t{\n\t\t\t$this->bag->merge(json_decode($this->session->get($this->sessionKey), true));\n\t\t}\n\t}", "protected static function newMessage()\n {\n self::$message = \\Swift_Message::newInstance();\n }", "function clear()\n\t{\n\t\t$this->to \t\t= '';\n\t\t$this->from \t= '';\n\t\t$this->reply_to\t= '';\n\t\t$this->cc\t\t= '';\n\t\t$this->bcc\t\t= '';\n\t\t$this->subject \t= '';\n\t\t$this->message\t= '';\n\t\t$this->debugger = '';\n\t}", "public function reset()\n {\n $this->_to = array();\n $this->_headers = array();\n $this->_subject = null;\n $this->_message = null;\n $this->_wrap = 78;\n $this->_params = null;\n $this->_attachments = array();\n $this->_uid = $this->getUniqueId();\n return $this;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function __destruct() {\n $this->flushMessages();\n }", "public function clear()\n {\n $this->fromArray(array());\n }", "public function initMessage() {}", "protected function initializeMessages()\n {\n $this->messages = array(\n \n );\n }", "public function clearContent()\n {\n $this->content = array();\n\n return $this;\n }", "public function clear_content(){\n\t\t$this->content=array();\n\t\treturn $this;\n\t}", "public function clear()\n {\n if (null !== $this->getDraft()) {\n $this->getDraft()->clear();\n } else {\n $this->_subcontent->clear();\n $this->subcontentmap = array();\n $this->_data = array();\n $this->index = 0;\n }\n }", "public function __construct()\n\t{\n\t\t$this->clear();\n\t}", "public function reset()\n {\n $this->values[self::_SAY] = null;\n $this->values[self::_FRESH] = null;\n $this->values[self::_FETCH] = null;\n $this->values[self::_CHAT_ADD_BL] = null;\n $this->values[self::_CHAT_DEL_BL] = null;\n $this->values[self::_CHAT_BLACKLIST] = null;\n $this->values[self::_CHAT_BORAD_SAY] = null;\n }", "protected function emptyMessagesFromSession()\n {\n $this->session->set('messages', null);\n }", "protected function clearMessageBody()\n {\n $this->messageBody = '';\n \n if ($this->isHeaderSet(self::CONTENT_LENGTH_HEADER))\n {\n $this->removeHeader(self::CONTENT_LENGTH_HEADER);\n }\n }", "public function delete_messages()\n {\n $this->message=array();\n Session::instance()->delete(\"hana_message\");\n }", "public function __destruct() {\n foreach ($this->_messages as $key => $message) {\n unset($this->_messages[$key]);\n $message->close();\n }\n\n $this->_stream->stop();\n }", "protected function _init()\n {\n global $injector, $notification, $prefs, $registry;\n\n /* The message text and headers. */\n $expand = array();\n $header = array(\n 'to' => '',\n 'cc' => '',\n 'bcc' => ''\n );\n $msg = '';\n $this->title = _(\"Compose Message\");\n\n /* Get the list of headers to display. */\n $display_hdrs = array(\n 'to' => _(\"To: \"),\n 'cc' => _(\"Cc: \"),\n 'bcc' => (\"Bcc: \")\n );\n\n /* Set the current identity. */\n $identity = $injector->getInstance('IMP_Identity');\n if (!$prefs->isLocked('default_identity') &&\n isset($this->vars->identity)) {\n $identity->setDefault($this->vars->identity);\n }\n\n /* Determine if mailboxes are readonly. */\n $drafts = IMP_Mailbox::getPref(IMP_Mailbox::MBOX_DRAFTS);\n $readonly_drafts = $drafts && $drafts->readonly;\n $sent_mail = $identity->getValue(IMP_Mailbox::MBOX_SENT);\n $save_sent_mail = (!$sent_mail || $sent_mail->readonly)\n ? false\n : $prefs->getValue('save_sent_mail');\n\n /* Determine if compose mode is disabled. */\n $compose_disable = !IMP_Compose::canCompose();\n\n /* Initialize objects. */\n $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($this->vars->composeCache);\n\n /* Are attachments allowed? */\n $attach_upload = $imp_compose->canUploadAttachment();\n\n foreach (array_keys($display_hdrs) as $val) {\n $header[$val] = $this->vars->$val;\n\n /* If we are reloading the screen, check for expand matches. */\n if ($this->vars->composeCache) {\n $expanded = array();\n for ($i = 0; $i < 5; ++$i) {\n if ($tmp = $this->vars->get($val . '_expand_' . $i)) {\n $expanded[] = $tmp;\n }\n }\n if (!empty($expanded)) {\n $header['to'] = strlen($header['to'])\n ? implode(', ', $expanded) . ', ' . $header['to']\n : implode(', ', $expanded);\n }\n }\n }\n\n /* Add attachment. */\n if ($attach_upload &&\n isset($_FILES['upload_1']) &&\n strlen($_FILES['upload_1']['name'])) {\n try {\n $atc_ob = $imp_compose->addAttachmentFromUpload('upload_1');\n if ($atc_ob[0] instanceof IMP_Compose_Exception) {\n throw $atc_ob[0];\n }\n if ($this->vars->a == _(\"Expand Names\")) {\n $notification->push(sprintf(_(\"Added \\\"%s\\\" as an attachment.\"), $atc_ob[0]->getPart()->getName()), 'horde.success');\n }\n } catch (IMP_Compose_Exception $e) {\n $this->vars->a = null;\n $notification->push($e, 'horde.error');\n }\n }\n\n /* Run through the action handlers. */\n switch ($this->vars->a) {\n // 'd' = draft\n // 'en' = edit as new\n // 't' = template\n case 'd':\n case 'en':\n case 't':\n try {\n switch ($this->vars->a) {\n case 'd':\n $result = $imp_compose->resumeDraft($this->indices, array(\n 'format' => 'text'\n ));\n $this->view->resume = true;\n break;\n\n case 'en':\n $result = $imp_compose->editAsNew($this->indices, array(\n 'format' => 'text'\n ));\n break;\n\n case 't':\n $result = $imp_compose->useTemplate($this->indices, array(\n 'format' => 'text'\n ));\n break;\n }\n\n $msg = $result['body'];\n $header = array_merge(\n $header,\n $this->_convertToHeader($result)\n );\n if (!is_null($result['identity']) &&\n ($result['identity'] != $identity->getDefault()) &&\n !$prefs->isLocked('default_identity')) {\n $identity->setDefault($result['identity']);\n $sent_mail = $identity->getValue(IMP_Mailbox::MBOX_SENT);\n }\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e);\n }\n break;\n\n case _(\"Expand Names\"):\n foreach (array_keys($display_hdrs) as $val) {\n if (($val == 'to') || ($this->vars->action != 'rc')) {\n $res = $this->_expandAddresses($header[$val]);\n if (is_string($res)) {\n $header[$val] = $res;\n } else {\n $header[$val] = $res[0];\n $expand[$val] = array_slice($res, 1);\n }\n }\n }\n\n if (isset($this->vars->action)) {\n $this->vars->a = $this->vars->action;\n }\n break;\n\n // 'r' = reply\n // 'rl' = reply to list\n // 'ra' = reply to all\n case 'r':\n case 'ra':\n case 'rl':\n $actions = array(\n 'r' => IMP_Compose::REPLY_SENDER,\n 'ra' => IMP_Compose::REPLY_ALL,\n 'rl' => IMP_Compose::REPLY_LIST\n );\n\n try {\n $reply_msg = $imp_compose->replyMessage(\n $actions[$this->vars->a],\n $this->_getContents(),\n array(\n 'format' => 'text',\n 'to' => $header['to']\n )\n );\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n break;\n }\n\n $header = $this->_convertToHeader($reply_msg);\n\n $notification->push(_(\"Reply text will be automatically appended to your outgoing message.\"), 'horde.message');\n $this->title = _(\"Reply\");\n break;\n\n // 'f' = forward\n case 'f':\n try {\n $fwd_msg = $imp_compose->forwardMessage(\n IMP_Compose::FORWARD_ATTACH,\n $this->_getContents(),\n false\n );\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n break;\n }\n\n $header = $this->_convertToHeader($fwd_msg);\n\n $notification->push(_(\"Forwarded message will be automatically added to your outgoing message.\"), 'horde.message');\n $this->title = _(\"Forward\");\n break;\n\n // 'rc' = redirect compose\n case 'rc':\n $imp_compose->redirectMessage($this->indices);\n $this->title = _(\"Redirect\");\n break;\n\n case _(\"Redirect\"):\n try {\n $num_msgs = $imp_compose->sendRedirectMessage($header['to']);\n $imp_compose->destroy('send');\n\n $notification->push(ngettext(\"Message redirected successfully.\", \"Messages redirected successfully.\", count($num_msgs)), 'horde.success');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n } catch (Horde_Exception $e) {\n $this->vars->a = 'rc';\n $notification->push($e);\n }\n break;\n\n case _(\"Save Draft\"):\n case _(\"Send\"):\n switch ($this->vars->a) {\n case _(\"Save Draft\"):\n if ($readonly_drafts) {\n break 2;\n }\n break;\n\n case _(\"Send\"):\n if ($compose_disable) {\n break 2;\n }\n break;\n }\n\n $message = strval($this->vars->message);\n $f_to = $header['to'];\n $old_header = $header;\n $header = array();\n\n switch ($imp_compose->replyType(true)) {\n case IMP_Compose::REPLY:\n try {\n $reply_msg = $imp_compose->replyMessage(IMP_Compose::REPLY_SENDER, $imp_compose->getContentsOb(), array(\n 'to' => $f_to\n ));\n $msg = $reply_msg['body'];\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n $msg = '';\n }\n $message .= \"\\n\" . $msg;\n break;\n\n case IMP_Compose::FORWARD:\n try {\n $fwd_msg = $imp_compose->forwardMessage(IMP_Compose::FORWARD_ATTACH, $imp_compose->getContentsOb());\n $msg = $fwd_msg['body'];\n } catch (IMP_Exception $e) {\n $notification->push($e, 'horde.error');\n }\n $message .= \"\\n\" . $msg;\n break;\n }\n\n try {\n $header['from'] = strval($identity->getFromLine(null, $this->vars->from));\n } catch (Horde_Exception $e) {\n $header['from'] = '';\n }\n $header['replyto'] = $identity->getValue('replyto_addr');\n $header['subject'] = strval($this->vars->subject);\n\n foreach (array_keys($display_hdrs) as $val) {\n $header[$val] = $old_header[$val];\n }\n\n switch ($this->vars->a) {\n case _(\"Save Draft\"):\n try {\n $notification->push($imp_compose->saveDraft($header, $message), 'horde.success');\n if ($prefs->getValue('close_draft')) {\n $imp_compose->destroy('save_draft');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n }\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e);\n }\n break;\n\n case _(\"Send\"):\n try {\n $imp_compose->buildAndSendMessage(\n $message,\n $header,\n $identity,\n array(\n 'readreceipt' => ($prefs->getValue('request_mdn') == 'always'),\n 'save_sent' => $save_sent_mail,\n 'sent_mail' => $sent_mail\n )\n );\n $imp_compose->destroy('send');\n\n $notification->push(_(\"Message sent successfully.\"), 'horde.success');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e);\n\n /* Switch to tied identity. */\n if (!is_null($e->tied_identity)) {\n $identity->setDefault($e->tied_identity);\n $notification->push(_(\"Your identity has been switched to the identity associated with the current recipient address. The identity will not be checked again during this compose action.\"));\n }\n }\n break;\n }\n break;\n\n case _(\"Cancel\"):\n $imp_compose->destroy('cancel');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n exit;\n\n case _(\"Discard Draft\"):\n $imp_compose->destroy('discard');\n IMP_Minimal_Mailbox::url(array('mailbox' => $this->indices->mailbox))->redirect();\n exit;\n }\n\n /* Grab any data that we were supplied with. */\n if (empty($msg)) {\n $msg = strval($this->vars->message);\n }\n if (empty($header['subject'])) {\n $header['subject'] = strval($this->vars->subject);\n }\n\n $this->view->cacheid = $imp_compose->getCacheId();\n $this->view->hmac = $imp_compose->getHmac();\n $this->view->menu = $this->getMenu('compose');\n $this->view->url = self::url();\n $this->view->user = $registry->getAuth();\n\n switch ($this->vars->a) {\n case 'rc':\n $this->_pages[] = 'redirect';\n $this->_pages[] = 'menu';\n unset($display_hdrs['cc'], $display_hdrs['bcc']);\n break;\n\n default:\n $this->_pages[] = 'compose';\n $this->_pages[] = 'menu';\n\n $this->view->compose_enable = !$compose_disable;\n $this->view->msg = $msg;\n $this->view->save_draft = ($injector->getInstance('IMP_Factory_Imap')->create()->access(IMP_Imap::ACCESS_DRAFTS) && !$readonly_drafts);\n $this->view->subject = $header['subject'];\n\n $select_list = $identity->getSelectList();\n $default_identity = $identity->getDefault();\n\n if ($prefs->isLocked('default_identity')) {\n $select_list = array(\n $default_identity => $select_list[$default_identity]\n );\n }\n\n $tmp = array();\n foreach ($select_list as $key => $val) {\n $tmp[] = array(\n 'key' => $key,\n 'sel' => ($key == $default_identity),\n 'val' => $val\n );\n }\n $this->view->identities = $tmp;\n\n if ($attach_upload) {\n $this->view->attach = true;\n if (count($imp_compose)) {\n $atc_part = $imp_compose[0]->getPart();\n $this->view->attach_name = $atc_part->getName();\n $this->view->attach_size = IMP::sizeFormat($atc_part->getBytes());\n $this->view->attach_type = $atc_part->getType();\n }\n }\n\n $this->title = _(\"Message Composition\");\n }\n\n $hdrs = array();\n foreach ($display_hdrs as $key => $val) {\n $tmp = array(\n 'key' => $key,\n 'label' => $val,\n 'val' => $header[$key]\n );\n\n if (isset($expand[$key])) {\n $tmp['matchlabel'] = (count($expand[$key][1]) > 5)\n ? sprintf(_(\"Ambiguous matches for \\\"%s\\\" (first 5 matches displayed):\"), $expand[$key][0])\n : sprintf(_(\"Ambiguous matches for \\\"%s\\\":\"), $expand[$key][0]);\n\n $tmp['match'] = array();\n foreach ($expand[$key][1] as $key2 => $val2) {\n if ($key2 == 5) {\n break;\n }\n $tmp['match'][] = array(\n 'id' => $key . '_expand_' . $key2,\n 'val' => $val2\n );\n }\n }\n\n $hdrs[] = $tmp;\n }\n\n $this->view->hdrs = $hdrs;\n $this->view->title = $this->title;\n }", "public static function reset()\n {\n $container = static::getInstance();\n $container->values = array();\n $container->factories = array();\n $container->raw = array();\n }", "public function resetMessage() {\n self::$message = '';\n }", "public function reset()\n {\n $this->to = [];\n $this->from = [];\n $this->sender = [];\n $this->replyTo = [];\n $this->readReceipt = [];\n $this->returnPath = [];\n $this->cc = [];\n $this->bcc = [];\n $this->messageId = true;\n $this->subject = '';\n $this->headers = [];\n $this->textMessage = '';\n $this->htmlMessage = '';\n $this->message = [];\n $this->emailFormat = static::MESSAGE_TEXT;\n $this->priority = null;\n $this->charset = 'utf-8';\n $this->headerCharset = null;\n $this->transferEncoding = null;\n $this->attachments = [];\n $this->emailPattern = static::EMAIL_PATTERN;\n\n return $this;\n }", "public function reset()\n {\n $this->cbuff = [];\n }", "public function reset()\n {\n $this->from = [];\n $this->to = [];\n $this->subject = null;\n $this->body = null;\n $this->html = true;\n }", "protected function clear() {}", "function clear() {\n\t\t\t$this->items = [];\n\t\t}", "function clear()\n {\n $this->p_size = '';\n $this->p_bidList = array();\n\n }", "public function clear()\n {\n $this->items = array();\n $this->length = 0;\n\n return $this;\n }", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}", "public function clear()\n {\n $this->_data = [];\n }", "public function clearMsg() {\n\t\t$_SESSION['msg'] = null;\n\t}", "public function clear() {\n $this->_data = [];\n }", "public function __construct() {\n $this->messages = CommonFacade::getMessages();\n }", "public function __construct() {\n $this->messages = CommonFacade::getMessages();\n }", "public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }", "public function clear() {\n\t\t$this->array = array();\n\t}", "public static function clear()\n {\n self::$actionList = new \\SplPriorityQueue();\n self::$errors = [];\n self::$warnings = [];\n }", "public function clear () {\n \n }", "public function clearState()\n {\n $this->fields = array();\n }", "public function __destruct() {\r\n\t\t\t$_SESSION['mod_messages'] = $this->messages;\r\n\t\t}", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_ACCESSORY] = null;\n }", "public function reset()\n {\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_SPEAKER_UID] = null;\n $this->values[self::_SPEAKER_SUMMARY] = null;\n $this->values[self::_TARGET_UID] = null;\n $this->values[self::_TARGET_SUMMARY] = null;\n $this->values[self::_SPEAKER_POST] = null;\n $this->values[self::_SPEAK_TIME] = null;\n $this->values[self::_CONTENT_TYPE] = null;\n $this->values[self::_CONTENT] = null;\n }", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function clear() {}", "public function __destruct()\n {\n if ($this->cache) {\n $this->cache->setItem(self::CACHE_KEY, $this->messagesWritten);\n }\n }", "function Clear()\r\n {\r\n $this->_items = array();\r\n }", "public function clear(): self;", "function clear()\r\n\t\t{\r\n\t\t\t$this->elements = array();\r\n\t\t}", "public function clear()\n {\n $this->items = array();\n $this->itemsCount = 0;\n }", "public static function clear()\n {\n self::$context = new Context();\n self::$macros = array();\n self::$citationItem = false;\n self::$context = new Context();\n self::$rendered = new Rendered();\n self::$bibliography = null;\n self::$citation = null;\n\n self::setLocale(Factory::locale());\n self::$locale->readFile();\n }", "public function clear() {\n $this->collection = [];\n $this->noteCollectionChanged();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function Clear()\n {\n $this->items = array();\n }", "public function clear(): void\n {\n $this->bufferSize = 0;\n $this->buffer = array();\n }", "public function cleanup(){\n\n //$this->_mail_type = 'html';\n //$this->_mail_encoding = 'utf-8';\n //$this->_transport_login = '';\n //$this->_transport = 'php';\n //$this->_transport_password = '';\n //$this->_transport_port = null;\n //$this->_transport_secure = null;\n //$this->_transport_host = null;\n $this->_lastError = null;\n $this->_subject = '';\n $this->_body = '';\n $this->_alt_body = '';\n $this->_attachements = array();\n $this->_from = '';\n $this->_fromName = null;\n $this->_replyto = array();\n $this->_addresses = array();\n $this->_cc = array();\n $this->_bcc = array();\n $this->_replyto = array();\n $this->_custom_headers = array();\n //$this->_is_embed_images = false;\n //$this->_is_track_links = false;\n //$this->_is_use_message_id = false;\n\n return $this;\n\n }", "public function clearMessages() {\n $this->connection->truncate($this->messageTable)\n ->execute();\n }", "public function __construct()\n\t{\n\t\t$this->container \t = array();\n\t\t$this->hiddenContainer = array();\n\t}", "public function clear() {\n $this->elements = array();\n }", "public function reset() {\n\t\t$this->_mailTo = array();\n\t\t$this->_mailCc = array();\n\t\t$this->_mailBcc = array();\n\t\t$this->_mailSubject = '';\n\t\t$this->_mailBody = '';\n\t\t$this->_mailReplyTo = '';\n\t\t$this->_mailReplyToName = '';\n\t\t$this->_mailFrom = '';\n\t\t$this->_mailFromName = '';\n\t\t$this->_mailFiles = array();\n\t\t$this->_mailPreparedHeaders = '';\n\t\t$this->_mailPreparedBody = '';\n\t}", "public function __construct() {\n $this->unset_members();\n }", "public function clear()\n {\n $this->items = array();\n }", "function clear()\r\n {\r\n $this->items=array();\r\n }", "private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }", "public function reset()\n {\n $this->values[self::CONVERSATION] = null;\n $this->values[self::SKMSG] = null;\n $this->values[self::IMAGE] = null;\n $this->values[self::CONTACT] = null;\n $this->values[self::LOCATION] = null;\n $this->values[self::URLMSG] = null;\n $this->values[self::DOCUMENT] = null;\n $this->values[self::AUDIO] = null;\n $this->values[self::VIDEO] = null;\n $this->values[self::CALL] = null;\n $this->values[self::CHAT] = null;\n }", "public function clear()\n {\n $this->data = [];\n }", "public function clear()\n\t{\n\t\t$this->items = [];\n\t}", "public function reset() {\r\n $this->header = [];\r\n $this->cookie = [];\r\n $this->content = NULL;\r\n }", "public function clear()\n {\n $this->groups = collect();\n $this->flash();\n\n return $this;\n }", "public function updateMessageContainer(array &$form, FormStateInterface $form_state) {\n return $form['message_container'];\n }", "protected function clear()\n {\n $this->innerHtml = null;\n $this->outerHtml = null;\n $this->text = null;\n }", "public function clear(): void {\n\t\t$this->m_elements = [];\n\t}", "public function emptyErrorBag() {\n\t\t$this->errorBag = [];\n\t}", "public function clear() {\n\t}", "public function mount()\n {\n $this->messageString = '';\n $this->address = '';\n }", "public function reset()\n {\n $this->data = [];\n $this->boundary = null;\n\n return $this;\n }", "public function reset()\n {\n $this->values[self::GROUP_ID] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "public function clear()\n {\n $this->stack = [];\n\n return $this;\n }", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}" ]
[ "0.6759655", "0.6694383", "0.6664635", "0.6585841", "0.65726465", "0.65234977", "0.64330304", "0.6162081", "0.6160057", "0.59145373", "0.5856848", "0.58269936", "0.5814096", "0.5718538", "0.5714013", "0.56949586", "0.56226987", "0.55620676", "0.55460143", "0.5533074", "0.54767585", "0.54622346", "0.54509383", "0.5432905", "0.5427114", "0.5426711", "0.54264224", "0.5391426", "0.53838825", "0.5383757", "0.53516746", "0.53376824", "0.52954715", "0.5294457", "0.5288429", "0.52843916", "0.5282157", "0.52715707", "0.52697587", "0.52577966", "0.52545", "0.5227543", "0.5225791", "0.5225791", "0.5217068", "0.5214303", "0.52123237", "0.51950234", "0.51950234", "0.51911044", "0.51508814", "0.5144035", "0.5142131", "0.5119759", "0.51148516", "0.51140714", "0.5113898", "0.51109874", "0.51109874", "0.51109874", "0.51109874", "0.50991213", "0.5097356", "0.509574", "0.509275", "0.5085487", "0.5082196", "0.5077796", "0.5075996", "0.5075957", "0.5072386", "0.50718457", "0.50694686", "0.50646156", "0.5062829", "0.50535804", "0.50524104", "0.5048935", "0.5047298", "0.5046331", "0.50285727", "0.5016199", "0.5015212", "0.50056255", "0.49988136", "0.49970958", "0.49918562", "0.49892822", "0.49881718", "0.49865997", "0.4983313", "0.49798554", "0.49696144", "0.49694866", "0.4968886", "0.49683005", "0.49683005", "0.49683005", "0.49683005", "0.49683005", "0.49683005" ]
0.0
-1
Clears message values and sets default ones
public function reset() { $this->values[self::PHONE] = null; $this->values[self::PASSWORD] = null; $this->values[self::EQUIPMENT] = null; $this->values[self::LOGIN_TYPE] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reset()\n {\n $this->values[self::MESSAGE] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "public function reset()\n {\n $this->values[self::CONVERSATION] = null;\n $this->values[self::SKMSG] = null;\n $this->values[self::IMAGE] = null;\n $this->values[self::CONTACT] = null;\n $this->values[self::LOCATION] = null;\n $this->values[self::URLMSG] = null;\n $this->values[self::DOCUMENT] = null;\n $this->values[self::AUDIO] = null;\n $this->values[self::VIDEO] = null;\n $this->values[self::CALL] = null;\n $this->values[self::CHAT] = null;\n }", "public function reset()\n {\n $this->values[self::_SAY] = null;\n $this->values[self::_FRESH] = null;\n $this->values[self::_FETCH] = null;\n $this->values[self::_CHAT_ADD_BL] = null;\n $this->values[self::_CHAT_DEL_BL] = null;\n $this->values[self::_CHAT_BLACKLIST] = null;\n $this->values[self::_CHAT_BORAD_SAY] = null;\n }", "public function reset()\n {\n $this->values[self::_PLAIN_MAIL] = null;\n $this->values[self::_FORMAT_MAIL] = null;\n }", "public function clear(){\r\n\t\t$this->_init_messages();\r\n\t}", "public function reset()\n {\n $this->values[self::_MAIL_CFG_ID] = null;\n $this->values[self::_PARAMS] = array();\n }", "public function resetMessage() {\n self::$message = '';\n }", "function clear()\n\t{\n\t\t$this->to \t\t= '';\n\t\t$this->from \t= '';\n\t\t$this->reply_to\t= '';\n\t\t$this->cc\t\t= '';\n\t\t$this->bcc\t\t= '';\n\t\t$this->subject \t= '';\n\t\t$this->message\t= '';\n\t\t$this->debugger = '';\n\t}", "public function reset()\n {\n $this->messages = [];\n }", "public function reset()\n {\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_SPEAKER_UID] = null;\n $this->values[self::_SPEAKER_SUMMARY] = null;\n $this->values[self::_TARGET_UID] = null;\n $this->values[self::_TARGET_SUMMARY] = null;\n $this->values[self::_SPEAKER_POST] = null;\n $this->values[self::_SPEAK_TIME] = null;\n $this->values[self::_CONTENT_TYPE] = null;\n $this->values[self::_CONTENT] = null;\n }", "public function reset()\n {\n $this->values[self::_LADDER_NOTIFY] = null;\n $this->values[self::_NEW_MAIL] = null;\n $this->values[self::_GUILD_CHAT] = null;\n $this->values[self::_ACTIVITY_NOTIFY] = null;\n $this->values[self::_ACTIVITY_REWARD] = null;\n $this->values[self::_RELEASE_HEROES] = array();\n $this->values[self::_EXCAV_RECORD] = null;\n $this->values[self::_GUILD_DROP] = null;\n $this->values[self::_PERSONAL_CHAT] = null;\n $this->values[self::_SPLITABLE_HEROES] = null;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CHAT_ID] = null;\n $this->values[self::_ACCESSORY] = null;\n }", "public function reset()\n {\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::GROUP_ID] = null;\n $this->values[self::SENDER_KEY] = null;\n }", "function reset()\n {\n $this->fromEmail = \"\";\n $this->fromName = \"\";\n $this->fromUser = null; // RMV-NOTIFY\n $this->priority = '';\n $this->toUsers = array();\n $this->toEmails = array();\n $this->headers = array();\n $this->subject = \"\";\n $this->body = \"\";\n $this->errors = array();\n $this->success = array();\n $this->isMail = false;\n $this->isPM = false;\n $this->assignedTags = array();\n $this->template = \"\";\n $this->templatedir = \"\";\n // Change below to \\r\\n if you have problem sending mail\n $this->LE = \"\\n\";\n }", "public function clear(): void\n {\n $this->messages = [];\n }", "public function clear_messages() {\n\t\t$this->_write_messages( null );\n\t}", "public function clear()\n {\n $this->messages = [];\n }", "public function reset()\n {\n $this->values[self::_WORLDCUP_QUERY_REPLY] = null;\n $this->values[self::_WORLDCUP_SUBMIT_REPLY] = null;\n }", "public function reset()\n {\n $this->values[self::_FROM] = null;\n $this->values[self::_TITLE] = null;\n $this->values[self::_CONTENT] = null;\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_WORSHIP] = null;\n $this->values[self::_DROP_INFO] = null;\n $this->values[self::_TO_CHAIRMAN] = null;\n }", "public function reset()\n {\n $this->values[self::_USER_SUMMARY] = null;\n $this->values[self::_GUILD_SUMMARY] = null;\n $this->values[self::_PARAM1] = null;\n }", "public function reset()\n\t{\n\t\t$this->method = NOTIFY_MAIL;\n\t\t$this->body = '';\n\t\t$this->subject = '';\n\t\t$this->bcc = array();\n\t\t$this->vars = array();\n\t}", "public function reset()\n {\n $this->values[self::_ITEM_ID] = null;\n $this->values[self::_RECEIVER_NAME] = null;\n $this->values[self::_SEND_TIME] = null;\n $this->values[self::_SENDER_NAME] = null;\n }", "public function clear()\r\n {\r\n $this->messages->clear();\r\n }", "public function reset()\n {\n $this->values[self::pending_pay] = null;\n $this->values[self::pending_shipped] = null;\n $this->values[self::pending_received] = null;\n $this->values[self::user_received] = null;\n $this->values[self::to_share] = null;\n }", "public function reset()\n {\n $this->values[self::_WORLD_CHAT_TIMES] = null;\n $this->values[self::_LAST_RESET_WORLD_CHAT_TIME] = null;\n $this->values[self::_BLACK_LIST] = array();\n }", "public function reset()\n {\n $this->values[self::services] = array();\n $this->values[self::mapping] = array();\n $this->values[self::short_tcp] = self::$fields[self::short_tcp]['default'];\n }", "public function resetMessage(){\n\t\t\tif (isset($_SESSION['message']) && $_SESSION['message']!='') {\n\t\t\t\t$_SESSION['message']='';\n\t\t\t}\n\t\t}", "public function reset()\n {\n $this->values[self::_CHALLENGER] = null;\n $this->values[self::_DAMAGE] = null;\n }", "public function reset()\n {\n $this->values[self::WTLOGINREQBUFF] = null;\n $this->values[self::WTLOGINIMGREQI] = null;\n $this->values[self::WXVERIFYCODERE] = null;\n $this->values[self::CLIDBENCRYPTKE] = null;\n $this->values[self::CLIDBENCRYPTINFO] = null;\n $this->values[self::AUTHREQFLAG] = null;\n $this->values[self::AUTHTICKET] = null;\n }", "public function reset()\n {\n $this->values[self::_CHALLENGER] = null;\n $this->values[self::_DAMAGE] = null;\n }", "public function reset()\n {\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_OPPOS] = array();\n $this->values[self::_IS_ROBOT] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_GUILD_INFO] = null;\n }", "public function reset() {\n $this->values[self::OPTION] = null;\n $this->values[self::CONTENT] = array();\n $this->values[self::ERROR] = null;\n }", "public function reset()\n {\n $this->values[self::_REQUEST] = null;\n $this->values[self::_CHANGE] = null;\n }", "public function\n\tclearMessages()\n\t{\n\t\t$this -> m_aStorage = [];\n\t}", "public function reset()\n {\n $this->values[self::_SYS_MAIL_LIST] = array();\n }", "public static function clear_defaults() {\n static::$defaults = [];\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_BINARY] = null;\n $this->values[self::_REPLAY] = null;\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_JOB] = Down_GuildJobT::member;\n $this->values[self::_REQ_GUILD_ID] = null;\n $this->values[self::_HIRE_HERO] = array();\n }", "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}", "public function reset()\n {\n $this->setValue($this->getDefaultValue());\n }", "public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_STATUS] = null;\n $this->values[self::_MAIL_TIME] = null;\n $this->values[self::_EXPIRE_TIME] = null;\n $this->values[self::_CONTENT] = null;\n $this->values[self::_MONEY] = null;\n $this->values[self::_DIAMONDS] = null;\n $this->values[self::_SKILL_POINT] = null;\n $this->values[self::_ITEMS] = array();\n $this->values[self::_POINTS] = array();\n }", "public function reset()\n {\n $this->values[self::TEXT] = null;\n $this->values[self::MATCHEDTEXT] = null;\n $this->values[self::CANONICALURL] = null;\n $this->values[self::DESCRIPTION] = null;\n $this->values[self::TITLE] = null;\n $this->values[self::THUMBNAIL] = null;\n }", "public function applyDefaultValues()\n\t{\n\t\t$this->closed = 0;\n\t\t$this->lastfmid = 0;\n\t\t$this->hasphotos = 0;\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 }", "public function reset()\n {\n $this->values[self::FILTER] = null;\n $this->values[self::AFTERINDEXKEY] = null;\n $this->values[self::POPULATEDOCUMENTS] = self::$fields[self::POPULATEDOCUMENTS]['default'];\n $this->values[self::INJECTENTITYCONTENT] = self::$fields[self::INJECTENTITYCONTENT]['default'];\n $this->values[self::POPULATEPREVIOUSDOCUMENTSTATES] = self::$fields[self::POPULATEPREVIOUSDOCUMENTSTATES]['default'];\n }", "public function applyDefaultValues()\n {\n $this->shnttype = '';\n $this->shntseq = 0;\n $this->shntkey2 = '';\n $this->shntform = '';\n }", "public function reset()\n {\n $this->values[self::_AVATAR] = null;\n $this->values[self::_NAME] = null;\n $this->values[self::_VIP] = null;\n $this->values[self::_LEVEL] = null;\n $this->values[self::_GUILD_NAME] = null;\n $this->values[self::_USER_ID] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_TYPE] = null;\n $this->values[self::_PARAM1] = null;\n $this->values[self::_PARAM2] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_JOIN_GUILD_ID] = null;\n $this->values[self::_GUILD_INFO] = null;\n $this->values[self::_CD_TIME] = null;\n $this->values[self::_FAIL_REASON] = null;\n }", "public function applyDefaultValues()\n {\n $this->phadtype = '';\n $this->phadid = '';\n $this->phadsubid = '';\n $this->phadsubidseq = 0;\n $this->phadcont = '';\n }", "public function reset()\n {\n $this->values[self::BOXID] = null;\n $this->values[self::DRAFTID] = null;\n $this->values[self::TOBOXID] = null;\n $this->values[self::TODEPARTMENTID] = null;\n $this->values[self::DOCUMENTSIGNATURES] = array();\n $this->values[self::PROXYBOXID] = null;\n $this->values[self::PROXYDEPARTMENTID] = null;\n }", "public function reset() {\n $this->values[self::ERR_NO] = null;\n $this->values[self::ERR_MSG] = null;\n $this->values[self::CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::ID] = null;\n $this->values[self::LEVELUP_TIME] = null;\n $this->values[self::BEHELPED_TIMES] = null;\n $this->values[self::HELP_ASKED] = self::$fields[self::HELP_ASKED]['default'];\n $this->values[self::TOTAL_TIME] = null;\n }", "public function reset()\n {\n $this->values[self::SHIPMENTRECEIPTDATE] = null;\n $this->values[self::ATTORNEY] = null;\n $this->values[self::ACCEPTEDBY] = null;\n $this->values[self::RECEIVEDBY] = null;\n $this->values[self::SIGNER] = null;\n $this->values[self::ADDITIONALINFO] = null;\n }", "public function reset()\n {\n $this->values[self::STATUS] = null;\n $this->values[self::ERRORS] = array();\n $this->values[self::VALIDATOR_REVISION] = self::$fields[self::VALIDATOR_REVISION]['default'];\n $this->values[self::SPEC_FILE_REVISION] = self::$fields[self::SPEC_FILE_REVISION]['default'];\n $this->values[self::TRANSFORMER_VERSION] = self::$fields[self::TRANSFORMER_VERSION]['default'];\n $this->values[self::TYPE_IDENTIFIER] = array();\n $this->values[self::VALUE_SET_PROVISIONS] = array();\n $this->values[self::VALUE_SET_REQUIREMENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_STATUS] = null;\n $this->values[self::_FREQUENCY] = null;\n $this->values[self::_LAST_LOGIN_DATE] = null;\n }", "public function reset()\n {\n $this->values[self::system] = null;\n $this->values[self::platform] = null;\n $this->values[self::channel] = null;\n $this->values[self::version] = null;\n }", "public function applyDefaultValues()\n {\n $this->is_active = false;\n $this->is_closed = false;\n }", "public function reset()\n {\n $this->values[self::ERRMSG] = null;\n $this->values[self::RET] = null;\n }", "public function reset()\n {\n $this->values[self::_GUILD_LOG] = array();\n }", "public function reset()\n {\n $this->values[self::_USERS] = array();\n $this->values[self::_HIRE_UIDS] = array();\n $this->values[self::_FROM] = null;\n }", "public function reset()\n {\n $this->values[self::payment_method] = null;\n $this->values[self::wechat_pay] = null;\n $this->values[self::alipay_express] = null;\n $this->values[self::order_id] = array();\n $this->values[self::order] = array();\n }", "public function reset()\n {\n $this->values[self::_USER_ID] = null;\n $this->values[self::_SUMMARY] = null;\n $this->values[self::_RANK] = null;\n $this->values[self::_WIN_CNT] = null;\n $this->values[self::_GS] = null;\n $this->values[self::_IS_ROBOT] = null;\n $this->values[self::_HEROS] = array();\n }", "public function reset(): void\n {\n /** @var array<string, mixed> $fieldsFromConfig */\n $fieldsFromConfig = config('alert.fields', []);\n\n $this->fields = $fieldsFromConfig;\n }", "public function reset()\n {\n $this->values[self::NAME] = null;\n $this->values[self::EMAIL] = null;\n $this->values[self::PHONEDA] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_INCOME] = null;\n }", "public function reset()\n {\n $this->values[self::REQUEST_HEADER] = null;\n $this->values[self::NEW_NAME] = null;\n $this->values[self::EVENT_REQUEST_HEADER] = null;\n }", "public function reset()\n {\n $this->values[self::SIGNEDCONTENT] = null;\n $this->values[self::FILENAME] = null;\n $this->values[self::COMMENT] = null;\n $this->values[self::CUSTOMDOCUMENTID] = null;\n $this->values[self::CUSTOMDATA] = array();\n }", "public function reset()\n {\n $this->values[self::_OPEN_PANEL] = null;\n $this->values[self::_APPLY_OPPO] = null;\n $this->values[self::_START_BATTLE] = null;\n $this->values[self::_END_BATTLE] = null;\n $this->values[self::_SET_LINEUP] = null;\n $this->values[self::_QUERY_RECORDS] = null;\n $this->values[self::_QUERY_REPLAY] = null;\n $this->values[self::_QUERY_RANKBORAD] = null;\n $this->values[self::_QUERY_OPPO] = null;\n $this->values[self::_CLEAR_BATTLE_CD] = null;\n $this->values[self::_DRAW_RANK_REWARD] = null;\n $this->values[self::_BUY_BATTLE_CHANCE] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_APP_QUEUE] = null;\n }", "public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_ADDR] = null;\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_APP_QUEUE] = null;\n }", "public function clearMsg() {\n\t\t$_SESSION['msg'] = null;\n\t}", "public function reset()\n {\n $this->values[self::PORTLIST] = null;\n $this->values[self::TIMEOUTLIST] = null;\n $this->values[self::MIMNOOPINTERVAL] = null;\n $this->values[self::MAXNOOPINTERVAL] = null;\n $this->values[self::TYPINGINTERVAL] = null;\n $this->values[self::NOOPINTERVALTIME] = null;\n }", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}", "function ClearMessage() {\n\t\t$_SESSION[EW_SESSION_MESSAGE] = \"\";\n\t}" ]
[ "0.7560076", "0.7473278", "0.72972125", "0.7258778", "0.7186456", "0.71419746", "0.70383257", "0.703493", "0.70287454", "0.7024615", "0.6990998", "0.69788265", "0.696552", "0.68270165", "0.68262357", "0.6796876", "0.6760336", "0.67443484", "0.6737045", "0.6725406", "0.6717753", "0.6701857", "0.66870224", "0.6665597", "0.66533816", "0.6648504", "0.6624648", "0.66093606", "0.66035336", "0.65842485", "0.6579962", "0.6571517", "0.65714324", "0.6571338", "0.65661705", "0.6564223", "0.65466607", "0.65177363", "0.650725", "0.64884657", "0.6481249", "0.6459963", "0.64538443", "0.6449445", "0.6427824", "0.6427194", "0.64204216", "0.6419908", "0.64112175", "0.6403235", "0.6398773", "0.63797826", "0.63694775", "0.63694775", "0.6368055", "0.6368055", "0.6362688", "0.63599354", "0.6355097", "0.63544345", "0.6352975", "0.6352229", "0.63440454", "0.63406473", "0.6340588", "0.63255316", "0.632459", "0.63212", "0.6320169", "0.63134986", "0.63122016", "0.63030034", "0.6292314", "0.628209", "0.62803525", "0.6276597", "0.6266353", "0.62641144", "0.62625605", "0.62624353", "0.62458056", "0.6242704", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627", "0.6228627" ]
0.63803965
51
Sets value of 'phone' property
public function setPhone($value) { return $this->set(self::PHONE, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPhone($phone)\r\n {\r\n $this->_phone = $phone;\r\n }", "public function setPhone($phone)\r\n {\r\n $this->_phone = $phone;\r\n }", "public function setPhone($phone = \"\");", "public function setPhone($phone) {\n\t\t$this->phone = $phone;\n\t}", "public function setPhone($phone)\n {\n $this->phone = $phone;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n }", "public function setPhone(string $phone): void\n {\n $this->_phone = $phone;\n }", "public function setPhone($phone) {\n $this->phone = $phone;\n }", "public function setPhone(string $phone):void\n {\n $this->phone = $phone;\n }", "public function setPhone($var)\n {\n GPBUtil::checkString($var, True);\n $this->phone = $var;\n }", "function setPhone($newPhone){\n //check if the phone number is numeric\n if(is_numeric($newPhone)) {\n $this->phone = $newPhone;\n }\n //if not set to default, 0000000000\n $this->phone = \"0000000000\";\n }", "public function setPhone($value)\n {\n return $this->set('Phone', $value);\n }", "public function setPhone($value)\n {\n $this->phone = $value;\n return $this;\n }", "public function setPhoneAttribute($value)\n {\n if (!empty($value)) {\n $this->attributes['phone'] = $this->mayaEncrypt($value);\n }\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone( $phone ) {\n\t\t$this->container['phones'] = isset( $phone ) ? array( $phone ) : null;\n\n\t\treturn $this;\n\t}", "public function setPhone($phone)\r\n {\r\n $this->phone = $phone;\r\n return $this;\r\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n return $this;\n }", "public function setPhone(?CustomerTextFilter $phone): void\n {\n $this->phone = $phone;\n }", "public function setPhone($phone) {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone(string $phone = null) : CNabuDataObject\n {\n $this->setValue('nb_icontact_prospect_phone', $phone);\n \n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setPhone($phone)\n {\n $this->phone = $phone;\n\n return $this;\n }", "public function setCustomerPhone($val)\n {\n $this->_propDict[\"customerPhone\"] = $val;\n return $this;\n }", "public function setPhone($phone)\n {\n $this->getEntity()->setPhone($phone);\n return $this;\n }", "public function setTelephone($telephone) {\n\t\t$this->telephone = $telephone;\n\t}", "public function setTelephone($telephone)\n {\n $this->telephone = $telephone;\n }", "private function setTelephone()\n {\n \tif ( empty($_POST['telephone'] ) ) {\n $this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n }\n\t\n $t = trim( $_POST['telephone'] );\n \n\t\t// Remove non-digits.\n\t\t$t = preg_replace('/[^0-9]/', '', $t);\n\t\n\t\t// Make sure it's 10 digits.\n\t\tif ( strlen($t) != 10 ) {\n\t\t\t$this->data['error']['telephone'] = 'Please provide a valid phone number.';\n $this->error = true;\n return;\n\t\t}\n\t\n $this->data['telephone'] = $t;\n }", "public function setPhone(array $phone)\n {\n $this->phone = $phone;\n return $this;\n }", "public function setPhone($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->phone !== $v) {\n $this->phone = $v;\n $this->modifiedColumns[OrdrhedTableMap::COL_PHONE] = true;\n }\n\n return $this;\n }", "public function phone($phone = null);", "public function setPhone($value)\n {\n $this->setParameter('billingPhone', $value);\n $this->setParameter('shippingPhone', $value);\n\n return $this;\n }", "public function setCustomerPhone($customer_phone){\n $this->customer_phone = $customer_phone;\n }", "public function setPhones($phones)\n {\n $this->phones = $phones;\n }", "public function __construct($phone)\n {\n $this->_phone = $phone;\n }", "public function setPhone($quote, $phone)\n {\n $quote->getBillingAddress()->setTelephone($phone)->save();\n $quote->getShippingAddress()->setTelephone($phone)->save();\n $customerAddressId = $quote->getBillingAddress()->getCustomerAddressId();\n if ($customerAddressId) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n $customerAddress->setTelephone($phone)->save();\n }\n }", "public function setPhone($quote, $phone)\n {\n $quote->getBillingAddress()->setTelephone($phone)->save();\n $quote->getShippingAddress()->setTelephone($phone)->save();\n $customerAddressId = $quote->getBillingAddress()->getCustomerAddressId();\n if ($customerAddressId) {\n $customerAddress = Mage::getModel('customer/address')->load($customerAddressId);\n $customerAddress->setTelephone($phone)->save();\n }\n }", "public function setProfilePhone($profilePhone) {\n\t\t$this->profilePhone = $profilePhone;\n\t}", "public function getPhone(){\r\n\t\t\treturn $this->phone;\r\n\t\t}", "public function setPhoneNumber($phone_number): void\n {\n $this->_phoneNumber = $phone_number;\n }", "public function get_phone() {\r\n return $this->phone;\r\n }", "public function getPhone()\r\n {\r\n return $this->phone;\r\n }", "public function setPhoneNumber($value)\n {\n return $this->setParameter('phoneNumber', $value);\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone() {\n return $this->phone;\n }", "public function getPhone() {\n return $this->phone;\n }", "public function setPhoneNumber($var)\n {\n GPBUtil::checkString($var, True);\n $this->phoneNumber = $var;\n\n return $this;\n }", "public function getPhone()\r\n {\r\n return $this->_phone;\r\n }", "public function getPhone() {\n\t\treturn $this->phone;\n\t}", "function setPrimaryPhone($primaryPhone) {\n\t\treturn $this->setData('primaryPhone', $primaryPhone);\n\t}", "public function getPhone()\n\t{\n\t\treturn $this->phone;\n\t}", "function getPhone() {\n return $this->phone;\n }", "public function setTelephone($telephone)\n {\n $this->telephone = $telephone;\n\n return $this;\n }", "public function setPhoneNumber($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->phone_number !== $v) {\n\t\t\t$this->phone_number = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::PHONE_NUMBER;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setPhone($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->phone !== $v) {\n\t\t\t$this->phone = $v;\n\t\t\t$this->modifiedColumns[] = VenuePeer::PHONE;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setPhoneNumber(String $phoneNumber)\n {\n $this->phoneNumber = $phoneNumber;\n }", "public function setNewPhone($value)\n {\n return $this->set('NewPhone', $value);\n }", "public function __construct($phone)\n {\n $this->phone = $phone;\n // $this->id = $id;\n }", "public static function convert_phone_field() {\n\n\t\t// Create a new Phone field.\n\t\tself::$field = new GF_Field_Phone();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t\t// Add Phone specific properties.\n\t\tself::$field->phoneFormat = 'standard';\n\n\t}", "public function setphoneNumber($number)\n {\n $this->_param['phone_number'] = Util::cleanNumber($number);\n return $this;\n }", "public function testCanSetAndGetPhoneNumber()\n {\n $mockPhoneNumber = '12345678990';\n\n $this->dataCenter->setPhoneNumber($mockPhoneNumber);\n\n $this->assertEquals($mockPhoneNumber, $this->dataCenter->getPhoneNumber());\n }", "public function setContactPhone($contactPhone = null)\n {\n // validation for constraint: string\n if (!is_null($contactPhone) && !is_string($contactPhone)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($contactPhone, true), gettype($contactPhone)), __LINE__);\n }\n if (is_null($contactPhone) || (is_array($contactPhone) && empty($contactPhone))) {\n unset($this->contactPhone);\n } else {\n $this->contactPhone = $contactPhone;\n }\n return $this;\n }", "public function setShippingPhone($value)\n {\n return $this->setParameter('shippingPhone', $value);\n }", "public function setPhones( $phones ) {\n\t\t$this->container['phones'] = $phones;\n\n\t\treturn $this;\n\t}", "public function setPhone($newNumber)\n\t{\n\t\t//If there are more or less than 10 digits, break.\n\t\t//Else, format as follows: \"(ABC) DEF-GHIJ\"\n\t\t$newNumber = buildPhoneNum($newNumber);\n\t\tif ($newNumber == null)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\tif (updateContact($id, 'phone', $newNumber))\n\t\t{\n\t\t\t$this->phone = $newNumber;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function setPhoneNumber($phoneNumber)\n {\n $phoneNumber = str_replace(' ', '', $phoneNumber); // perhaps using a regular expression would be easier?\n\n if(!ctype_digit($phoneNumber))\n throw new \\InvalidArgumentException('Only digits may be used within phone numbers.');\n\n $this->phoneNumber = $phoneNumber;\n }", "public function setOffice_phone($office_phone)\n {\n $this->office_phone = $office_phone;\n\n return $this;\n }", "public function setReceiverMobile($phone): JawaliAttributes\n {\n $this->attributes['body']['receiverMobile'] = $phone;\n return $this;\n }", "public function edit(Phone $phone)\n {\n //\n }", "public function edit(Phone $phone)\n {\n //\n }", "public function setTelefono($_telefono)\n {\n $this->telefono = $_telefono;\n }", "public function setTelephone(string $telephone)\n {\n $this->telephone = $telephone;\n\n return $this;\n }", "public function setCustomerPhone($customerPhone = '000-000-0000') {\n $phone = array(\n 'x_phone'=>$this->truncateChars($this->cleanPhoneNumber($customerPhone), 25),\n );\n $this->NVP = array_merge($this->NVP, $phone); \n }", "public function setPhoneNo(string $phoneNo) : self\n {\n $this->phoneNo = $phoneNo;\n return $this;\n }", "public function setMobilePhone($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->mobile_phone !== $v) {\n\t\t\t$this->mobile_phone = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::MOBILE_PHONE;\n\t\t}\n\n\t\treturn $this;\n\t}", "function set_random_us_phone($state='*')\r\n{\r\n\t// get random state\r\n\tif ( $state == '*' )\r\n\t{\r\n\t\t$_ZIP_DATA = $this->_get_random_zip_data();\r\n\t\t$state = $_ZIP_DATA[1];\r\n\t}\r\n\t\r\n\t// get random phone\r\n\t$phone = $this->_get_random_us_phone($state, 1);\r\n\t\r\n\t// set prop\r\n\t$this->phone = $phone;\r\n\treturn;\r\n}", "public function setPosterPhone($newPosterPhone) {\n\n\t\t// Verify that posterPhone is secure\n\t\t$newPosterPhone = trim($newPosterPhone);\n\t\t$newPosterPhone = filter_var($newPosterPhone, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);\n\t\tif(empty($newPosterPhone) === true) {\n\t\t\tthrow(new \\InvalidArgumentException(\"posterPhone is empty or insecure\"));\n\t\t}\n\n\t\t// Verify that posterPhone will fit in the database\n\t\tif(strlen($newPosterPhone) > 32) {\n\t\t\tthrow(new \\RangeException(\"posterPhone has too many characters in it\"));\n\t\t}\n\n\t\t// Store the posterPhone\n\t\t$this->posterPhone = $newPosterPhone;\n\n\t}" ]
[ "0.85916305", "0.85916305", "0.85852236", "0.8515284", "0.8478999", "0.8478999", "0.8472571", "0.84721684", "0.8462871", "0.83023345", "0.8114955", "0.8097845", "0.79463154", "0.79031795", "0.7883486", "0.7883208", "0.7815018", "0.76725864", "0.76725864", "0.7582905", "0.7530854", "0.7477111", "0.745787", "0.745787", "0.745787", "0.745787", "0.745787", "0.745787", "0.745787", "0.745787", "0.7441051", "0.7437941", "0.7434248", "0.7391692", "0.7379985", "0.7311823", "0.7307985", "0.7265751", "0.7241106", "0.7230915", "0.7143271", "0.71326953", "0.7120225", "0.7120225", "0.7070485", "0.7045373", "0.70320505", "0.7000885", "0.6997854", "0.69774836", "0.6964384", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.68815136", "0.6878775", "0.6878775", "0.68576264", "0.6855059", "0.68548495", "0.6853612", "0.6853139", "0.68449146", "0.67933714", "0.6733843", "0.67310846", "0.6726782", "0.6722769", "0.6708545", "0.6694074", "0.6672034", "0.66719496", "0.66217446", "0.66121674", "0.65721726", "0.6553351", "0.6507127", "0.6505005", "0.65021497", "0.6470002", "0.6470002", "0.64596635", "0.6457", "0.64492464", "0.6436881", "0.64347166", "0.6408527", "0.6391868" ]
0.78613734
17
Returns value of 'phone' property
public function getPhone() { $value = $this->get(self::PHONE); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_phone() {\r\n return $this->phone;\r\n }", "public function getPhone(){\r\n\t\t\treturn $this->phone;\r\n\t\t}", "public function getPhone()\n\t{\n\t\treturn $this->phone;\n\t}", "public function getPhone()\r\n {\r\n return $this->phone;\r\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone() {\n\t\treturn $this->phone;\n\t}", "public function getPhone() {\n return $this->phone;\n }", "public function getPhone() {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->get(self::PHONE);\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\r\n {\r\n return $this->_phone;\r\n }", "public function getPhone()\n {\n return $this->get('Phone');\n }", "public function getPhone(): string\n {\n return $this->phone;\n }", "function getPhone() {\n return $this->phone;\n }", "public function getPhone():string\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->getValue('nb_icontact_prospect_phone');\n }", "public function getPhoneNumber()\n\t{\n\t\treturn $this->getIfSet('number', $this->data->phone);\n\t}", "public function getPhone();", "public function getPhoneNumber()\n {\n return $this->phone_number;\n }", "public function getPhoneNumber()\n\t{\n\t\treturn $this->phone_number;\n\t}", "public function getPhoneNo()\n {\n return $this->phone_no;\n }", "public function getPhone()\n {\n return $this->getParameter('billingPhone');\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getProfilePhone() : string {\n\t\treturn $this->profilePhone;\n\t}", "public function getProfilePhone() {\n\t\treturn ($this->profilePhone);\n\t}", "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function getPhoneNo() : string\n {\n return $this->phoneNo;\n }", "public function getPhone()\n {\n return $this->billingPhone;\n }", "public function getContactPhone()\n {\n return isset($this->contactPhone) ? $this->contactPhone : null;\n }", "public function getPhoneNumber()\n {\n return $this->phoneNumber;\n }", "public function getPhone(): ?string\n {\n return $this->_phone;\n }", "public function getCustomerPhone()\n {\n return $this->customerPhone;\n }", "public function getPhoneNumber(): string\n {\n return $this->_phoneNumber;\n }", "public function getCustomerPhone()\n {\n if (array_key_exists(\"customerPhone\", $this->_propDict)) {\n return $this->_propDict[\"customerPhone\"];\n } else {\n return null;\n }\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getPhone() : ?string \n {\n if ( ! $this->hasPhone()) {\n $this->setPhone($this->getDefaultPhone());\n }\n return $this->phone;\n }", "public function getPhone() {\n\t\treturn empty( $this->container['phones'] ) ? null : $this->container['phones'][0];\n\t}", "public function getPhoneNumberAttribute()\n {\n return $this->attributes[ 'country_code' ].$this->attributes[ 'phone' ];\n }", "protected function getPhone()\n {\n return $this->checkoutSession->getLastRealOrder()->getBillingAddress()->getTelephone();\n }", "public function getCustomerPhone(){\n return $this->customer_phone;\n }", "public function getTelephone() {\n\t\treturn $this->telephone;\n\t}", "function getPrimaryPhone() {\n\t\treturn $this->getData('primaryPhone');\n\t}", "public function getTelephone() : string {\n return $this->telephone;\n }", "public function getPhoneNumber()\n {\n return $this->country_code.$this->phone;\n }", "public function getMobilePhone()\n\t{\n\t\treturn $this->mobile_phone;\n\t}", "public function getPhoneNumber()\n {\n return $this->getParameter('phoneNumber');\n }", "public function getMobilePhoneNo() : string\n {\n return $this->mobilePhoneNo;\n }", "public function getTelephone() {}", "public function getPhoneNumber()\n {\n return $this->scopeConfig->getValue(\n self::CONFIG_PHONE_NUMBER,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function get_telephone();", "public function getTelephoneNumber()\n {\n return $this->telephoneNumber;\n }", "public function getHuman_phone()\n {\n return $this->human_phone;\n }", "public function getBillingPhone();", "public function getOrganizationPhone(): string {\n\t\treturn ($this->organizationPhone);\n\t}", "public function getPhoneNumber()\n {\n return $this->getProfile() ? $this->getProfile()->getPhoneNumber() : null;\n }", "public function getOffice_phone()\n {\n return $this->office_phone;\n }", "public function getPhone()\n {\n $res = $this->getEntity()->getPhone();\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()->getPhone();\n\t\t}\n return $res;\n }", "protected static function phone_code(): mixed\n\t{\n\t\treturn self::$query->phone_code;\n\t}", "public function getTelephoneNumber() :string\n {\n return $this->telephoneNumber;\n }", "public function phone($phone = null);", "public function getPosterPhone() {\n\t\treturn $this->posterPhone;\n\t}", "public function getBillingPhone()\n {\n return $this->getParameter('billingPhone');\n }", "public function getSerializedPhone(Phone $phone): string;", "public function getShipToPhone();", "public function getPhoneNumber(): ?string;", "public function getReadableContact()\n {\n return Extra::getBeautifulPhone($this->contact);\n }", "public function getTelephone(): ?string;", "public function publicPhoneNumber()\n {\n return $this->state(function (array $attributes) {\n return [\n 'phone_number' => 1,\n ];\n });\n }", "public function getCallerPhone()\n\t{\n\t\treturn $this->caller_phone;\n\t}", "public function getReqMobilePhone()\n\t{\n\t\treturn $this->req_mobile_phone;\n\t}", "public static function phone()\n {\n return new TextNode('phone');\n }", "public function getShippingPhone()\n {\n return $this->getParameter('shippingPhone');\n }", "public function telephoneNumber(): TelephoneNumber\n {\n return $this->telephoneNumber;\n }", "public function getPhonetierce()\n {\n return $this->phonetierce;\n }", "function getSecondaryPhone() {\n\t\treturn $this->getData('secondaryPhone');\n\t}", "public function getApplicantTelephoneNumber()\n {\n return $this->getProperty('applicant_telephone_number');\n }", "public function getReqOfficePhone()\n\t{\n\t\treturn $this->req_office_phone;\n\t}" ]
[ "0.8726541", "0.8650274", "0.8628658", "0.8622545", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8600915", "0.8591774", "0.856373", "0.856373", "0.8547583", "0.85184544", "0.85140914", "0.84946954", "0.8482746", "0.84510803", "0.8406497", "0.8245136", "0.8174442", "0.8166847", "0.7981748", "0.79748076", "0.7963982", "0.7922329", "0.7903424", "0.7903424", "0.7903424", "0.7872646", "0.7872425", "0.78713024", "0.78713024", "0.78333795", "0.78229314", "0.7817925", "0.77861124", "0.7778634", "0.77770656", "0.7774516", "0.77735114", "0.7754934", "0.77489054", "0.77489054", "0.77489054", "0.77489054", "0.77489054", "0.77489054", "0.77409196", "0.770884", "0.77060145", "0.76688784", "0.7648436", "0.7642469", "0.76284695", "0.76217115", "0.7602949", "0.7542805", "0.7538897", "0.75286967", "0.7506211", "0.7457028", "0.744198", "0.74105966", "0.7404027", "0.73806804", "0.7360527", "0.7352557", "0.728496", "0.7280312", "0.72798353", "0.72556955", "0.7170878", "0.7136181", "0.71052355", "0.7067597", "0.7059366", "0.7022172", "0.6994474", "0.6965009", "0.6942884", "0.69383603", "0.69048554", "0.6894509", "0.68603325", "0.6752493", "0.6708734", "0.6699527", "0.66778135", "0.66753423" ]
0.84804475
27
Returns true if 'phone' property is set, false otherwise
public function hasPhone() { return $this->get(self::PHONE) !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function has_phone() {\r\n return ! empty( $this->phone );\r\n }", "public function hasPhone() : bool\n {\n return isset($this->phone);\n }", "public function hasPhone() {\n return $this->_has(5);\n }", "public function hasTelephone(): bool;", "private function isTelephoneRequired()\n {\n return $this->eavConfig->getAttribute('customer_address', 'telephone')->getIsRequired();\n }", "public function hasVerifiedPhone();", "public function hasContactInfo() {\n return ($this->phone || $this->email || $this->pager);\n }", "public function hasTelephoneExtension(): bool;", "public function isMobilePhone () : bool {\n\t}", "static function is_phone($phone) {\n $stripped=preg_replace(\"(\\(|\\)|\\-|\\.|\\+|[ ]+)\",\"\",$phone);\n return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>16)))?false:true;\n }", "function validPhone($phone)\r\n {\r\n\r\n return !empty($phone) && ctype_digit($phone);\r\n\r\n }", "public function hasVerifiedPhone()\n {\n return !is_null($this->phone_verified_at);\n }", "public function phoneCheck($phone){\n\t\t\t$sql = \"SELECT Contact_Number FROM customer WHERE Contact_Number = :Contact_Number\";\n\t\t\t$query = $this->db->pdo->prepare($sql);\n\t\t\t$query->bindValue(\":Contact_Number\", $phone);\n\t\t\t$query->execute();\n\n\t\t\tif ($query->rowCount() > 0) {\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function hasVerifiedPhone()\n {\n return ! is_null($this->phone_verified_at);\n }", "public function hasVerifiedPhone()\n {\n return ! is_null($this->phone_verified_at);\n }", "public function isPhoneSet($quote)\n {\n return $quote->getBillingAddress()->getTelephone() != '';\n }", "public function isPhoneSet($quote)\n {\n return $quote->getBillingAddress()->getTelephone() != '';\n }", "public function is_phonenumber($contact_no){\t\t\n\t\tif (!empty($contact_no) && !ctype_digit($contact_no)){\n\t\t\treturn true;\n\t\t}\n }", "public function is_phonenumber($contact_no){\t\t\n\t\tif (!empty($contact_no) && !ctype_digit($contact_no)){\n\t\t\treturn true;\n\t\t}\n }", "public function test_phone_returns_false_when_optional_input_not_phone() {\n\t\t$optional = true;\n\t\t$result = self::$validator->validate('not a phone num', $optional);\n\t\t$this->assertFalse( $result );\n\t}", "function validate_phone($phone) {\n if (isset($phone) && !preg_match(\"/^[0-9]{10}$/\", $phone) && !empty($phone)) {\n $this->form_validation->set_message('validate_phone', 'This {field} is not valid');\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function validPhone($phone)\r\n {\r\n return strlen((string)$phone) == 10 && is_numeric($phone);\r\n }", "static function isPhoneUsed(string $phone) {\n $sql = 'SELECT phone FROM users WHERE phone = '.$phone;\n $row = $db->query($sql);\n\n if (empty($row)) {\n return false;\n } else {\n return true;\n }\n }", "public function isPhoneNumberVerify()\n {\n\n return database::getInstance()->has(\"user\",[\n \"isVerify\" => user_type::PHONE_NUMBER_VERIFIED,\n \"id\" => $this->get_id()\n ]);\n\n }", "public function test_phone_returns_false_when_not_optional_input_not_phone() {\n\t\t$optional = false;\n\t\t$result = self::$validator->validate('not a phone num', $optional);\n\t\t$this->assertFalse( $result );\n\t}", "public function isPhoneVerified()\n {\n return (bool) $this->phone_verified_at;\n }", "function getPhone() {\n return $this->phone;\n }", "static function validPhone($phone)\r\n {\r\n if (preg_match('/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/', $phone)) {\r\n return $phone;\r\n } else {\r\n return !empty($age);\r\n }\r\n }", "private function valid_mobile() {\n return (strlen($this->mobile) == 10 && is_numeric($this->mobile));\n }", "public function get_phone() {\r\n return $this->phone;\r\n }", "public function hasMobile(){\n return $this->_has(4);\n }", "public function getPhone()\r\n {\r\n return $this->phone;\r\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function PhoneNoCheck($phone=\"\"){\n\t\t\t\n\t\t// if (preg_match(\"/^\\(?(\\d{3})\\)?[-\\. ]?(\\d{3})[-\\. ]?(\\d{4})$/\",$phone))\n\t\t if (preg_match(\"/^\\s*(?:\\+?(\\d{1,3}))?[-. (]*(\\d{3})[-. )]*(\\d{3})[-. ]*(\\d{4})(?: *x(\\d+))?\\s*$/\",$phone))\n\t\t\treturn true;\n\t\telse\n\t\t return false;\n\t\t}", "public function hasContactInformation() {\n\t\treturn $this->hasContactEmail() || $this->hasContactUrl();\n\t}", "protected function rule()\n {\n if (!key_exists('value', $this->admittedFields['Mobile']) && !key_exists('value', $this->admittedFields['Phone'])) {\n $this->setErrorMsg('At least mobile or phone number are required');\n\n return false;\n }\n\n return true;\n }", "public function setPhone($phone = \"\");", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function hasMobile(){\n return $this->_has(2);\n }", "public function getPhone(){\r\n\t\t\treturn $this->phone;\r\n\t\t}", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function getPhone()\n {\n return $this->phone;\n }", "public function phone($phone = null);", "public function getPhone()\n\t{\n\t\treturn $this->phone;\n\t}", "public function getPhone()\r\n {\r\n return $this->_phone;\r\n }", "public function hasMobile(){\n return $this->_has(8);\n }", "public function hasMobileIsExist(){\n return $this->_has(2);\n }", "function validPhone($phone)\n {\n //phone number should not be empty and can contain only numbers\n return !empty($phone) && filter_var($phone,FILTER_SANITIZE_NUMBER_INT);\n }", "public function getPhone() {\n return $this->phone;\n }", "public function getPhone() {\n return $this->phone;\n }", "public function hasMobileExist(){\n return $this->_has(2);\n }", "public static function checkPhone($phone)\n {\n if (strlen($phone) >= 10) {\n return true;\n }\n return false;\n }", "public function test_phone_returns_true_when_optional_input_phone_10_area_bracket() {\n\t\t$optional = true;\n\t\t$result = self::$validator->validate('(555)555-5555', $optional);\n\t\t$this->assertTrue( $result );\n\t}", "public function getPhone() {\n\t\treturn $this->phone;\n\t}", "function is_phone_available($phone) {\n\t\t// Load Models\n\t\t$this->ci->load->model('dx_auth/users', 'users');\n\t\t//$this->ci->load->model('dx_auth/user_temp', 'user_temp');\n\n\t\t$users = $this->ci->users->check_phone($phone);\n\t\t//$temp = $this->ci->user_temp->check_phone($phone);\n\t\t\n\t\t//return $users->num_rows() + $temp->num_rows() == 0;\n\t\treturn $users->num_rows() == 0;\n\t}", "private static function validate_number(&$phone)\n\t{\n\t\tif (substr($phone, 0, 1) == '+') {\n\t\t\t$phone = substr($phone, 1);\n\t\t}\n\n\n\t\tif (is_numeric($phone)) {\n\n\t\t\t// test if there's a 1 prepended.\n\t\t\tif (strlen($phone) === 11 && $phone[0] == 1) {\n\t\t\t\t//pop 1 off. \n\t\t\t\t$phone = substr($phone, 1);\n\t\t\t\treturn true;\n\n\t\t\t} elseif (strlen($phone) === 10) {\n\t\t\t\t// it's a 10 digit number... I guess that works.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// is invalid if no return by here. \n\t\treturn false;\n\t}", "function is_phone_stored($phoneNumber){\n $data = array(\"phone\"=>$phoneNumber);\n $status = CallAPI(\"ussd.myfarmnow.com/api/verifyphone\", $data);\n if($status == 1){\n return true;\n }elseif($status == 0){\n return false;\n }\n}", "public function valid()\n {\n if ($this->container['phone_region_id'] === null) {\n return false;\n }\n if ($this->container['phone_region_name'] === null) {\n return false;\n }\n if ($this->container['phone_region_code'] === null) {\n return false;\n }\n if ($this->container['phone_count'] === null) {\n return false;\n }\n if ($this->container['phone_price'] === null) {\n return false;\n }\n if ($this->container['phone_installation_price'] === null) {\n return false;\n }\n if ($this->container['phone_period'] === null) {\n return false;\n }\n return true;\n }", "public function is_phone_number_specified($username = '')\n {\n\n if($username) $this->username = $username;\n\n\n $cp = database::getInstance()->get('user',\"CP\",[\n\n \"isVerify\" => user_type::PHONE_NUMBER_VERIFIED,\n\n \"verification_code[!]\" => null,\n\n \"user_url\" => $this->username\n\n ]);\n\n\n return preg_match(REGEX::PHONE_NUMBER,$cp);\n\n }", "public function getPhone();", "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function getUserPhone() {\n\t\treturn ($this->userPhone);\n\t}", "public function canContactApplicantByPhoneAndPost()\n {\n return $this->canContactApplicantByPhoneAndPost;\n }", "public function hasMobileVerify(){\n return $this->_has(2);\n }", "public function isValid()\n {\n if(\n empty($this->getPropertyType()) ||\n empty($this->getLastName()) ||\n empty($this->getPhone()) ||\n empty($this->getOrigin()) ||\n empty($this->getInterest())\n ) {\n return false;\n }\n return true;\n }", "public function size_of_phonenumber($contact_no){\t\n\t\tif (!empty($contact_no) && ctype_digit($contact_no)){\t\t\t\n\t\t\tif (strlen($contact_no) < 10){\n\t\t\t\treturn true;\n\t\t\t}else if(strlen($contact_no) > 10){\n\t\t\t\treturn true;\n\t\t\t}\n \t }\n }", "public function passes($attribute, $value)\n {\n if (substr($this->_phone, 0, 1) == \"0\")\n return false;\n if (intval(strlen($this->_phone)) == 10)\n return true;\n return false;\n }", "public function getShowMobilePhone()\n\t{\n\t\treturn $this->show_mobile_phone;\n\t}", "public function test_phone_returns_true_when_not_optional_input_phone_10_area_bracket() {\n\t\t$optional = false;\n\t\t$result = self::$validator->validate('(555)555-5555', $optional);\n\t\t$this->assertTrue( $result );\n\t}", "public function hasPostalCode() : bool\n {\n return isset($this->postalCode);\n }", "public function testPhone()\n {\n $this->assertTrue(RuValidation::phone('+7 (342) 1234567'));\n $this->assertTrue(RuValidation::phone('+7 (41144) 1234'));\n }", "function checkPhoneNumber($telefono): bool {\n return is_string($telefono) and preg_match(\"/^([+][0-9]{1,3})?[0-9]{4,13}$/\", $telefono);\n}", "public function hasContacts() {\n return $this->_has(7);\n }", "public function size_of_phonenumber($contact_no){\t\n\t\tif (!empty($contact_no) && ctype_digit($contact_no)){\t\t\t\n\t\t\tif (strlen($contact_no) < 10){\n\t\t\t\treturn true;\n\t\t\t}else if(strlen($contact_no) > 12){\n\t\t\t\treturn true;\n\t\t\t}\n \t }\n }", "public function validate_fields() {\n\n\t\t\t\t$phone = $this->sanatizePhone( $_POST['havanao_phone_number'] );\n\n\t\t\t\tif ( strlen( trim( preg_replace( '/^(\\+?250)\\d{9}/', '', $phone ) ) ) ) {\n\t\t\t\t\twc_add_notice( __( 'Invalid phone number provided. Please provide a valid Rwanda mobile phone number', 'havanao' ), 'error' );\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}", "public function getHasDetailsToBookProperty(){\n return $this->state['service'] && $this->state['employee'] && $this->state['time'];\n \n }", "public function setPhone($var)\n {\n GPBUtil::checkString($var, True);\n $this->phone = $var;\n }", "public function hasStreet() {\n return $this->_has(1);\n }" ]
[ "0.8533158", "0.8300502", "0.80001926", "0.79809445", "0.76274854", "0.7110881", "0.70665115", "0.7055936", "0.7042675", "0.6998693", "0.6919743", "0.6907155", "0.6872557", "0.6850821", "0.6850821", "0.6687706", "0.6687706", "0.6630803", "0.6630803", "0.6546263", "0.65451443", "0.6544014", "0.65122354", "0.65121454", "0.64475185", "0.6443218", "0.644175", "0.643929", "0.64255947", "0.6410702", "0.6388885", "0.63871896", "0.6376311", "0.63708735", "0.6357804", "0.63549995", "0.63511187", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6341091", "0.6322428", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.63192", "0.6307139", "0.62931275", "0.6291007", "0.6270924", "0.62669593", "0.6261963", "0.6247013", "0.6247013", "0.62445146", "0.62412906", "0.62376887", "0.62329876", "0.6217864", "0.62139666", "0.6196079", "0.61751777", "0.6173348", "0.6159926", "0.61070436", "0.61070436", "0.6097586", "0.609177", "0.6073831", "0.60609156", "0.60594094", "0.603354", "0.6021672", "0.6015761", "0.6014497", "0.60126424", "0.60118574", "0.599205", "0.5987499", "0.59834754", "0.5974849", "0.5971282" ]
0.85411066
0
Sets value of 'password' property
public function setPassword($value) { return $this->set(self::PASSWORD, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setPassword($value);", "public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }", "public function setPassword($p) {\n $this->_password = $p;\n }", "public function setPassword($value)\n {\n $this->_password = $value;\n }", "public function setPassword($value)\r\n\t{\r\n\t\t$this->password = $value;\r\n\t}", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword($password);", "public function setPassword(){\n\t}", "public function setPasswordField($password = true) {}", "public function setPassword($newPassword);", "public function setPassword(string $password): void\n {\n }", "public function setPassword($password){\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword(string $password): self;", "public function setPassword($value) {\n $password = $this->encodePassword($value);\n $this->setRawProperty('password', $password);\n }", "function setPassword($password = false)\n {\n $this->password = $password;\n }", "public function password($password) {\n $this->password = $password;\n }", "public function setPassword($newPassword){\n\t}", "public function setPassword( $password ) \n {\n $this->_password = $password;\n }", "public function setPassword($var)\n {\n GPBUtil::checkString($var, False);\n $this->password = $var;\n }", "public function setPassword($password) {\n $this->set('password', $password, 'user');\n }", "public function setPassword($password) {\r\n\t\t$this->_password = $password;\r\n\t}", "public function setPassword($password) {\n $this->password = $password;\n }", "public function setPassword($password) {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->password = $password;\n }", "public function setPassword($password)\n {\n $this->new_password = $password;\n $this->pass = Yii::$app->security->generatePasswordHash($password);\n }", "public function setPassword($password) {\n\t\t$this->password = $password;\n\t}", "public function setPassword($password) {\n\t\t$this->_password = $password;\n\t}", "public function setPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_1'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_1'));\n\t\t\n\t\t$this->_password = $value;\n\t}", "public static function setPassword(string $password): void {\r\n self::$password = $password;\r\n }", "public function setPassword(string $password): void\n {\n $this->password = $password;\n }", "public function setPassword(string $password): void\n {\n $this->_password = $password;\n }", "function setAPIPassword($password)\n {\n $this->_password = $password;\n }", "public function setPasswordAttribute( $value ) {\n $this->attributes['password'] = Hash::make( $value );\n }", "public function setPassword($password)\n\t{\n\t\t$this->password = $password;\n\t}", "private function setPassword(string $password) {\n $this->password = $password;\n }", "public function setPassword($password){\n\t\t\t$this->password = $password;\n\t\t}", "public function setPassword($password) {\n if ($password) {\n $this->password = md5($password);\n } \n }", "private function SetPassword($password)\n {\n $this->password = md5($password);\n }", "public function setPassword($password)\n {\n // getValue -> return 123123\n $this->password_hash = \\Yii::$app->security->generatePasswordHash($password);\n }", "public function setPasswordAttribute($value) {\n \t$this->attributes['password'] = Hash::make($value);\n\t}", "public function setPassword($password)\n {\n $this->_config->set('password', $password);\n }", "public function setPassword(string $password)\n {\n $this->password = $password;\n }", "public function setPasswordAttribute($value) {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPasswordAttribute($value) {\n $this->attributes['password'] = Hash::make($value);\n }", "public function setPassword($password) {\n\t\t$this->txt_password_hash = Yii::$app->security->generatePasswordHash ( $password );\n\t}", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($password)\n {\n $this->Password = Yii::$app->security->generatePasswordHash($password);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }", "public function setPassword($value)\n {\n return $this->set('Password', $value);\n }" ]
[ "0.8727944", "0.8627111", "0.84593546", "0.8450517", "0.84426105", "0.84285575", "0.84285575", "0.84285575", "0.8390966", "0.83799237", "0.83556235", "0.82557636", "0.81871444", "0.81649405", "0.8163036", "0.81613404", "0.8125801", "0.81038576", "0.8100105", "0.80496323", "0.80244553", "0.8011644", "0.8000924", "0.79905283", "0.79905283", "0.796531", "0.796531", "0.796531", "0.796531", "0.796531", "0.7949662", "0.79483813", "0.7945864", "0.79370713", "0.7933736", "0.79302764", "0.792957", "0.791268", "0.7857086", "0.7827715", "0.78128695", "0.7812831", "0.78117055", "0.7807191", "0.7784394", "0.7771052", "0.77642554", "0.77552944", "0.7750527", "0.7750527", "0.774983", "0.7746487", "0.7746487", "0.7746487", "0.7746487", "0.7746487", "0.7746487", "0.7746487", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7746227", "0.7745248", "0.7745248", "0.7745248", "0.7745248", "0.7745248", "0.77449816", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275", "0.77445275" ]
0.0
-1
Returns value of 'password' property
public function getPassword() { $value = $this->get(self::PASSWORD); return $value === null ? (string)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPassword() {\n return $this->getValue('password');\n }", "public function getPassword()\n {\n return $this->__get(\"password\");\n }", "public function getPassword() {\n return @$this->attributes['password'];\n }", "public function getPassword()\n {\n return $this->userData[$this->passwordField];\n }", "public function getPassword(): string\n {\n return $this->attributes['password'];\n }", "private function getPassword()\n {\n return $this->password;\n }", "public function getPassword() {}", "private function getPassword(): string {\n return $this->password;\n }", "public function getPassword()\r\n {\r\n return $this->password;\r\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "function getPassword() {\n return $this->password;\n }", "function getPassword() {\n return $this->password;\n }", "public function getPassword(){\n return $this->password;\n }", "public function getPassword()\r\n {\r\n return $this->password;\r\n }", "protected function getPassword()\r\n {\r\n return $this->processor_data['processor_params']['password'];\r\n }", "public function getPassword()\n {\n return $this->Password;\n }", "public function getPassword(){\r\n\t\t\treturn $this->password;\r\n\t\t}", "public function getPassword(): string\n {\n return $this->password;\n }", "private function getPassword()\n {\n return $this->user->getPassword();\n }", "public function getPassword() {\r\n\t\treturn $this->password;\r\n\t}", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword() {\n return $this->getConfig('password', $this->defaults['password']);\n }", "public function get_password()\n {\n return $this->_password;\n }", "public function get_password()\n {\n return $this->_password;\n }", "public function getPassword() : string\r\n\t{\r\n\t\treturn $this->password;\r\n\t}", "public function getPassword(){\n return $this->password;\n }", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n\t{\n\t\treturn $this->password;\n\t}", "public function getPassword()\n {\n return $this->getConfig('password');\n }", "public function getPassword(){\n return $this->password;\n }", "public function getPassword() : string {\n return $this->password;\n }", "public function getPassword(){\n\t\t\treturn $this->password;\n\t\t}", "public function getPassword() {\n\t\treturn $this->password;\n\t}", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword() {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->_password;\n }", "public function getPassword()\n {\n return $this->_password;\n }", "public function getPassword(): string;", "public function getPassword()\n {\n return $this->Password_user;\n }", "public function getPassword() {\n return $this->get('password', 'user');\n }" ]
[ "0.8882296", "0.8716062", "0.8712735", "0.86666477", "0.86443835", "0.85650945", "0.8548693", "0.8506195", "0.84904456", "0.8482546", "0.8482546", "0.84752846", "0.84752846", "0.8468501", "0.8463195", "0.846075", "0.84455615", "0.84374374", "0.84371036", "0.84106845", "0.841045", "0.84042025", "0.84042025", "0.84042025", "0.84042025", "0.84042025", "0.84042025", "0.84042025", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.84020734", "0.8398347", "0.8394295", "0.8394295", "0.8394127", "0.83898073", "0.83532256", "0.83532256", "0.83532256", "0.83532256", "0.83519953", "0.8349788", "0.8338005", "0.8337559", "0.83334386", "0.83299786", "0.83299786", "0.83299786", "0.83299786", "0.83299786", "0.83299786", "0.8329174", "0.8329174", "0.83254486", "0.831914", "0.830711" ]
0.8493461
8
Returns true if 'password' property is set, false otherwise
public function hasPassword() { return $this->get(self::PASSWORD) !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasPassword() : bool;", "public function hasPassword()\n {\n return ($this->password !== null);\n }", "public function hasPassword()\n {\n return $this->definition->hasPassword($this);\n }", "public function isPassword($password);", "public function hasPasswd(){\n return $this->_has(3);\n }", "public function hasPasswd(){\n return $this->_has(3);\n }", "public function hasPw()\n {\n return isset($this->pw);\n }", "public function hasPw()\n {\n return isset($this->pw);\n }", "public function isPasswordField() {}", "function checkPassword(): bool\n {\n $user = FPersistantManager::getInstance()->search(\"utente\", \"UserName\", $this->getUsername());\n if($this->getPassword() == $user[0]->getPassword())\n return true;\n else\n return false;\n }", "public function isPasswordRequired(): bool\n {\n $isPasswordRequired = post_password_required($this->wpPost);\n\n return $this->setAttribute(__METHOD__, $isPasswordRequired);\n }", "public function canSetPassword()\n {\n return $this->isActive() && $this->definition->canSetPassword();\n }", "public function isPassword() {\n\t\t$pwArray = array(\n\t\t\t'password',\n\t\t\t'senha',\n\t\t\t'lozinka',\n\t\t\t'heslotajne',\n\t\t\t'helslo_tajne',\n\t\t\t'wachtwoord',\n\t\t\t'contrasena',\n\t\t\t'salasana',\n\t\t\t'motdepasse',\n\t\t\t'mot_de_passe',\n\t\t\t'passwort',\n\t\t\t'passord',\n\t\t\t'haslo',\n\t\t\t'senha',\n\t\t\t'parola',\n\t\t\t'naponb',\n\t\t\t'contrasena',\n\t\t\t'loesenord',\n\t\t\t'losenord',\n\t\t\t'sifre',\n\t\t\t'naponb',\n\t\t\t'matkhau',\n\t\t\t'mat_khau'\n\t\t);\n\t\treturn \\in_array($this->name, $pwArray);\n\t}", "public static function password($data=''){\n\t\t\treturn true;\n\t\t}", "public function password_verifies() {\n\t\treturn AuthComponent::password($this->data[$this->alias]['old_password']) === $this->data[$this->alias]['password'];\n\t}", "private function valid_password() {\n return (strlen($this->password) == 6);\n }", "public function comparePassword() {\r\n if ($this->data[$this->name]['Password'] !== $this->data[$this->name]['RetypePass']) {\r\n return FALSE;\r\n } else {\r\n return TRUE;\r\n }\r\n }", "function checkPassword($password) {\n\t\treturn ($this->_password === $password);\n\t}", "function passwordValid($password) {\n\treturn true;\n}", "public function password_required() {\n\t\treturn post_password_required($this->ID);\n\t}", "public function isConfirmPassword(){\n \tif(empty($this->data['User']['confirm_password'])){\n \t\treturn false;\n \t}\n \tif(!empty($this->data['User']['confirm_password']) && !empty($this->data['User']['password'])){\n \t\tif($this->data['User']['confirm_password'] == $this->data['User']['password']){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}\n }", "public function setPasswordField($password = true) {}", "function setPassword($password) {\n return false;\n }", "public function hasPwIsExist(){\n return $this->_has(2);\n }", "public function hasPwIsExist(){\n return $this->_has(4);\n }", "public function passwordEqual() {\n if($this->getPassword() == $this->getPasswordRepeat()) return TRUE;\n else return FALSE;\n }", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "public function getPassword() {\n return @$this->attributes['password'];\n }", "function passwordExists() {\n //DOES NOT CHECK IF IT'S A VALID PASSWORD\n global $PHP_AUTH_PW;\n global $sessionId;\n global $serverScriptHelper;\n global $isMonterey;\n if ((!$isMonterey) && $serverScriptHelper->hasCCE()) {\n if ($sessionId) {\n return true;\n } else {\n return false;\n }\n } else {\n if ($PHP_AUTH_PW) {\n return true;\n } else {\n return false;\n }\n }\n}", "public function passwordCheck($password) {\n return $password == $this->password ? TRUE : FALSE;\n }", "public function passwordValide () {\n $password = $this->donnees[self::PASSWORD_REF];\n // Le champ password ne doit pas ?tre vide\n if ($password == null) {\n $this->erreur[self::PASSWORD_REF] = \"Veuillez remplir le champ password\";\n return false;\n }\n // Si le password entr? correspond au password contenu dans la base de donn?es on retourne true\n if ($this->utilisateurs->identificationUser($this->donnees[self::LOGIN_REF], $this->donnees[self::PASSWORD_REF])) {\n return true;\n // Sinon on cr?e une erreur et on renvoie false\n } else {\n $this->erreur[self::PASSWORD_REF] .= \"Mot de passe erron?\";\n return false;\n }\n }", "private function validate_password($password){\n\t\treturn TRUE;\n\t}", "function userCanSetDbPassword(){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "function confirmPassword() {\n\t\t$fields = $this->_settings['fields'];\n\t\tif (\n\t\t\tSecurity::hash($this->model->data[$this->model->name][$fields['confirm_password']], null, true) \n\t\t\t== $this->model->data[$this->model->name][$fields['password']]\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function is_password_required()\n {\n $edit = $this->uri->segment(2);\n\n if ($edit != 'edit') {\n $password = $this->input->post('password', true);\n if (empty($password)) {\n $this->form_validation->set_message('is_password_required', '%s harus diisi.');\n return false;\n }\n }\n return true;\n }", "public function check_password($password)\n {\n return FALSE;\n }", "public function checkCredentials(string $email, string $password):bool;", "public function checkPassword($value);", "public function validatePassword()\n {\n $result = false;\n if (strlen($this->password) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function isPasswordChangeEnabled();", "public function hasAdminPassword()\n {\n return $this->admin_password !== null;\n }", "function can_change_password() {\n return !empty($this->config->changepasswordurl);\n }", "public function validatePassword($password) {\r\n return $this->password===$password;\r\n\r\n }", "public function setPassword($password) {\n $this->password = $password;\n return true;\n }", "public function verify($password): bool;", "static public function GetAuthPassword() {\n if (isset(self::$authPassword))\n return self::$authPassword;\n else\n return false;\n }", "public function check_password($password)\n {\n }", "public function getPassword() {\n if (isset($_REQUEST['password']))\n return $_REQUEST['password'];\n else\n return false;\n }", "function validateUserPass($username, $password) {\n\n return ($username == 'username' && $password == 'password');\n\n }", "public function checkPassword( $password ) {\n\t\treturn (isset($this->password) && $password == $this->password);\n\t}", "public function estValide () {\n // Si les clefs n'existent pas on retourne false\n if (! key_exists(self::PASSWORD_REF, $_POST) or ! key_exists(self::LOGIN_REF, $_POST)) {\n return false;\n }\n $login_valide = $this->loginValide();\n $password_valide = $this->passwordValide();\n return $login_valide and $password_valide;\n }", "public function hasLogin()\r\n\t{\r\n\t\treturn (!empty($this->username) && !empty($this->password));\r\n\t}", "function validPassword($password){\t\r\n \tglobal $API;\r\n return $API->userValidatePassword($this->username,$password); \r\n }", "public function getPassword() {}", "public function passwordEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // also check if it matches confirmpassword\r\n // set the var equal to function call of getpassword\r\n $password = $this->getPassword();\r\n // If the fields empty\r\n if ( empty($password) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"password\"] = \"Password is missing.\";\r\n } \r\n // Calls the password function above and if its not equal to the orgincal password returns error\r\n else if ( $this->getConfirmpassword() !== $this->getPassword() ){\r\n // Message displayed to user\r\n $this->errors[\"password\"] = \"Password does not match confirmation password.\";\r\n }\r\n // Also goes test the password against the password is valid function in the validator class\r\n else if ( !Validator::passwordIsValid($this->getPassword()) ) {\r\n $this->errors[\"password\"] = \"Password is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"password\"]) ? true : false ) ;\r\n }", "public function getPasswordSet(){\n\t\t$passwordSet = $this->config->getAppValue('owncollab_ganttchart', 'sharepassword', 0);\n\t\tif ($passwordSet == 0){\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 1;\n\t\t}\n\t}", "private function hasValidPassword($input) {\n\t\t$this->person = get_user_by('login', $input->user);\n\n\t\tif ($this->person && wp_check_password($input->key, $this->person->data->user_pass, $this->person->ID)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setPassword($value);", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function getPassword()\n {\n }", "public function validatePassword($password)\n {\n return $this->hashPassword($password)===$this->password;\n }", "function check_password($password)\n{\n return ($password == 'qwerty');\n}", "public function testverifyIfPasswordIsNotSet()\n {\n $state=Database::findAdmin($this->db->getPdo(),\"\",\"cool\");\n $this->assertFalse($state);\n }", "public function isValidPassword($uid, $password);", "public function getAuthPassword()\n {\n \treturn $this->getGuarded('password');\n }", "function validatePassword() : bool\n {\n if($this->Password && preg_match('/^[[:alnum:]]{6,20}$/', $this->Password)) // solo numeri-lettere da 6 a 20\n {\n return true;\n }\n else\n return false;\n }", "public function isLoaded()\n {\n return $this->password && $this->username;\n }", "public function setPassword($password) {\n\t\tif ( !$this->validate('password', $password) ) {\n\t\t\treturn false;\n\t\t}\n\t\t$this->password = $password;\n\t\treturn true;\n\t}", "public function canLogin()\n {\n $email = $this->getEmail();\n $password = $this->getPassword();\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"SELECT * FROM users WHERE email = :email\");\n $statement->bindValue(\":email\", $email);\n $statement->execute();\n $user = $statement->fetch();\n $hash = $user[\"password\"];\n\n if (!$user) {\n return false;\n }\n\n // use password_verify() to verify your user\n // this function should return true or false and nothing else\n if (password_verify($password, $hash)) {\n return true;\n } else {\n return false;\n }\n }", "public function hasPassWord(){\n return $this->_has(3);\n }", "public function getPassword():? string;", "public function can_change_password() {\n return false;\n }", "public function getPassword(){\n return $this->password;\n }", "public function password()\n {\n }", "public function getAuthPassword()\n {\n }", "public function getAuthPassword()\n {\n }", "public function getAuthPassword()\n {\n }", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword();", "public function getPassword(): string;", "public function validatePassword($password)\t{\n\t\treturn crypt($password,$this->password) === $this->password;\n\t}", "public function testPasswordSetVerify()\n {\n $password = \"testPasswordForTesting\";\n $user = new User();\n\n // Set our password\n $user->setPassword($password);\n\n // Verify that our password works\n $this->assertTrue($user->verifyPassword($password));\n\n // Verify that an invalid password doesn't work\n $password .= \"ThisIsNowInvalid\";\n $this->assertFalse($user->verifyPassword($password));\n }", "public function setPassword(){\n\t}", "function auth($username, $password) {\n\n if ($password == 'password') { \n return true;\n }\n return false;\n\n}", "function oldPassword() {\n\t\t$fields = $this->_settings['fields'];\n\t\tif (\n\t\t\tSecurity::hash($this->model->data[$this->model->name][$fields['old_password']], null, true) \n\t\t\t== $this->model->field($fields['password'])\n\t\t) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setPasswordcheck($password)\n {\n // Do nothing\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function getPassword()\n {\n return $this->password;\n }", "public function confirmPassword($password = null) {\n\t\tif ((isset($this->data[$this->alias]['password']) && isset($password['temppassword']))\n\t\t\t&& !empty($password['temppassword'])\n\t\t\t&& ($this->data[$this->alias]['password'] === $password['temppassword'])) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isCurrentPassword($password) {\n return $this->getPassword() === sha1(LICENSE_KEY . $password);\n }", "public function getPassword() {\n return $this->getValue('password');\n }" ]
[ "0.830581", "0.82117563", "0.81346875", "0.7750036", "0.7728643", "0.7728643", "0.7688435", "0.7688435", "0.7680248", "0.76726466", "0.76584375", "0.76144224", "0.7562214", "0.74715567", "0.7414661", "0.7413202", "0.7298486", "0.7288954", "0.7267807", "0.7217423", "0.71660894", "0.7163989", "0.71615845", "0.7160999", "0.71416783", "0.7129509", "0.71227515", "0.71224713", "0.7104476", "0.71000147", "0.7086402", "0.7060774", "0.702469", "0.7019156", "0.7009428", "0.70029944", "0.69973075", "0.69922405", "0.6939538", "0.6927997", "0.6926018", "0.692572", "0.6916942", "0.6909328", "0.6887814", "0.6881879", "0.6869422", "0.6854969", "0.6851767", "0.6818602", "0.68111193", "0.6786203", "0.6775907", "0.6772611", "0.67440695", "0.6741798", "0.671858", "0.67129904", "0.66446257", "0.66446257", "0.66446257", "0.66446257", "0.66446257", "0.66446257", "0.66344583", "0.6625109", "0.6600202", "0.6591643", "0.6589668", "0.65886563", "0.65716326", "0.65708447", "0.6569135", "0.65647", "0.6561811", "0.6550268", "0.6550196", "0.6538671", "0.65301895", "0.65301895", "0.65301895", "0.65229416", "0.65229416", "0.65229416", "0.65229416", "0.65229416", "0.65229416", "0.65229416", "0.6512134", "0.65101933", "0.6507197", "0.6505232", "0.65049773", "0.6504703", "0.64970344", "0.64940673", "0.64940673", "0.64934206", "0.6491631", "0.6490844" ]
0.85238624
0
Sets value of 'equipment' property
public function setEquipment($value) { return $this->set(self::EQUIPMENT, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setEquipment($value) {\n if (empty($value))\n throw new InvalidArgumentException('An equipment cannot be empty');\n if (strlen($value) > 64)\n throw new Exception('An equipment cannot be longer than 64 characters');\n $this->equipment = $value;\n return $this;\n\t}", "public function update_equipment($data)\n\t {\n\t }", "public function edit(Equipment $equipment)\n {\n //\n }", "public function setCharacterEquipment(CharacterEquipment $characterEquipment) {\n $this->characterEquipment = $characterEquipment;\n }", "public function setEquipmentName($equipmentName = null)\n {\n // validation for constraint: string\n if (!is_null($equipmentName) && !is_string($equipmentName)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($equipmentName)), __LINE__);\n }\n if (is_null($equipmentName) || (is_array($equipmentName) && empty($equipmentName))) {\n unset($this->EquipmentName);\n } else {\n $this->EquipmentName = $equipmentName;\n }\n return $this;\n }", "public function setEquipmentName($equipmentName = null)\n {\n // validation for constraint: string\n if (!is_null($equipmentName) && !is_string($equipmentName)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($equipmentName)), __LINE__);\n }\n if (is_null($equipmentName) || (is_array($equipmentName) && empty($equipmentName))) {\n unset($this->EquipmentName);\n } else {\n $this->EquipmentName = $equipmentName;\n }\n return $this;\n }", "public function setEquipmentDetails($equipmentData)\n {\n foreach ($equipmentData as $key => $value) {\n $equipmentData[$key] = ($key != 'expire') ? mysql_escape_string($value) : $value;\n }\n\n //$this->db->select_db(DB_NAME);\n //\tsave to trash_bin\n $this->save2trash('U', $equipmentData['equipment_id']);\n//\n //\tcheck expire date change\n $recalculteMixLimits = false;\n if ($this->isExpireDateChanged($equipmentData[\"equipment_id\"], $equipmentData[\"expire\"])) {\n $recalculteMixLimits = true;\n }\n\n //\tcheck daily limit change\n if ($this->isDailyLimitChanged($equipmentData[\"equipment_id\"], $equipmentData[\"daily\"])) {\n $recalculteMixLimits = true;\n }\n\n $query = \"UPDATE \" . TB_EQUIPMENT . \" SET \";\n\n $query.=\"department_id='\" . $this->db->sqltext($equipmentData[\"department_id\"]) . \"', \";\n $query.=\"equip_desc='\" . $this->db->sqltext($equipmentData[\"equip_desc\"]) . \"', \";\n $query.=\"inventory_id='\" . $this->db->sqltext($equipmentData[\"inventory_id\"]) . \"', \";\n $query.=\"permit='\" . $this->db->sqltext($equipmentData[\"permit\"]) . \"', \";\n $query.=\"expire='\" . strtotime($equipmentData[\"expire\"]->formatInput()) . \"', \";\n $query.=\"daily='\" . $this->db->sqltext($equipmentData[\"daily\"]) . \"', \";\n $query.=\"dept_track='\" . $this->db->sqltext($equipmentData[\"dept_track\"]) . \"', \";\n $query.=\"facility_track='\" . $this->db->sqltext($equipmentData[\"facility_track\"]) . \"', \";\n $query .= \"model_number='\" . $this->db->sqltext($equipmentData[\"model_number\"]) . \"', \";\n $query .= \"serial_number='\" . $this->db->sqltext($equipmentData[\"serial_number\"]) . \"', \";\n $query.=\"creater_id='\" . $this->db->sqltext($equipmentData[\"creater_id\"]) . \"', \";\n $query.=\"voc_emissions='\" . $this->db->sqltext($this->getVocEmissions()) . \"'\";\n\n $query.=\" WHERE equipment_id=\" . $equipmentData['equipment_id'];\n\n $this->db->query($query);\n }", "public function equipment() {\n\t\treturn $this->belongsTo(Equipment::class, 'equipment_id');\n\t}", "public function setEquipmentCode($equipmentCode = null)\n {\n // validation for constraint: string\n if (!is_null($equipmentCode) && !is_string($equipmentCode)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($equipmentCode)), __LINE__);\n }\n if (is_null($equipmentCode) || (is_array($equipmentCode) && empty($equipmentCode))) {\n unset($this->EquipmentCode);\n } else {\n $this->EquipmentCode = $equipmentCode;\n }\n return $this;\n }", "public function setServiceEquipment(?array $serviceEquipment): self\n {\n $this->serviceEquipment = $serviceEquipment;\n\n return $this;\n }", "public function getEquipmentRef()\n {\n return $this->equipmentRef;\n }", "public function setEquipmentRef(array $equipmentRef)\n {\n $this->equipmentRef = $equipmentRef;\n return $this;\n }", "public function equip(Char $char)\n {\n Item::whereCharId($char->id)->whereEquipped(1)->whereType($this->type)->update(['equipped'=> 0]);\n $this->equipped = 1;\n $this->Update();\n self::Log('equpped', $char->id);\n }", "public function getEquipment()\n {\n return $this->hasOne(Equipment::className(), ['id' => 'equipment_id']);\n }", "public function __construct(equipment $equipment)\n\t{\n\t\t$this->equipment = $equipment;\n\t\t// if you add this then equipment pages can only be viewed by users\n\t\t//$this->middleware('auth');\n\t}", "public function update(Request $request, Equipment $equipment){\n $request->installation_time = $this->formatDate($request->installation_time);\n $request->pos_rep_date = $this->formatDate($request->pos_rep_date);\n\n $equipment->installation_time = $request->installation_time;\n $equipment->pos_rep_date = $request->pos_rep_date;\n $status = $equipment->update(\n $request->only(['code', 'serial_number', 'model_number', 'manufacturer_name', 'description', 'category_id', 'unit_id', 'status', 'location', 'year_of_purchase', 'equipment_cost', 'service_vendor_cost'])\n );\n\n return response()->json([\n 'data' => $equipment,\n 'message' => $status ? 'Equipment Updated' : 'Error updating equipment'\n ]);\n }", "public function getEquipment()\n {\n $value = $this->get(self::EQUIPMENT);\n return $value === null ? (integer)$value : $value;\n }", "public function unequip()\n {\n $this->equipped = 0;\n $this->Update();\n self::Log('unequpped', $this->char_id);\n }", "public function getCharacterEquipment() {\n return $this->characterEquipment;\n }", "public function quoteRemEquipmentAction()\n {\n \t$this->_helper->layout()->disableLayout();\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$quoteId = $this->_request->getParam('qId');\n \t$eqKey = $this->_request->getParam('key', -1);\n \t\n \tif (empty($quoteId) || $eqKey == -1) {\n \t\techo 'Invalid request'; exit;\n \t}\n \t\n \t$db = Zend_Registry::get('db');\n \t$equipment = $db->fetchOne(\"SELECT equipment FROM quotes WHERE id = {$quoteId}\");\n \tif (!empty($equipment)) {\n \t\t$equipmentArr = Zend_Json::decode($equipment, true);\n \t\tif (count($equipmentArr)) {\n \t\t\tif (!empty($equipmentArr[$eqKey])) {\n \t\t\t\tunset($equipmentArr[$eqKey]);\n \t\t\t\t$equipmentArr = array_values($equipmentArr);\n \t\t\t\t\n \t\t\t\t$newEquipment = Zend_Json::encode($equipmentArr);\n \t\t\t\t$db->update('quotes', array('equipment' => $newEquipment), \"id = {$quoteId}\");\n \t\t\t}\n \t\t}\n \t}\n }", "public function destroy(Equipment $equipment)\n {\n //\n }", "private function ImportEquipment()\n {\n\t\tDebug::log('<hr><h3>Common Equipment</h3>', LEVEL_NORMAL);\n\n global $mysql;\n\n $equipment = simplexml_load_file($this->vehicles_path . '/common/optional_devices.xml');\n\n foreach($equipment->children() as $node => $item) {\n $icon = (string)$item->icon;\n $icon = explode(' ', $icon);\n $icon = $icon[0];\n $icon = str_replace('../maps/icons/artefact/', '', $icon);\n \n $price = 0;\n $price_gold = 0;\n if (isset($item->price->gold))\n {\n $price_gold = (int)$item->price;\n }else{\n $price = (int)$item->price;\n }\n \n $weight = 0;\n if (isset($item->script->weight))\n $weight = (int)$item->script->weight;\n \n $include = '';\n $exclude = '';\n \n $inc = 'include';\n if (isset($item->vehicleFilter->$inc->vehicle->tags)){\n $include = (string)$item->vehicleFilter->$inc->vehicle->tags;\n }\n if (isset($item->vehicleFilter->exclude->vehicle->tags)){\n $exclude = (string)$item->vehicleFilter->exclude->vehicle->tags;\n }\n \n //remove tabs\n $include = preg_replace('/\\s+/', ' ', $include);\n $exclude = preg_replace('/\\s+/', ' ', $exclude);\n \n $data = array(\n 'wot_version_id' => $this->versionId,\n 'name' => $this->TranslateToLocal((string)$item->userString),\n 'name_node' => $node,\n 'description' => $this->TranslateToLocal((string)$item->description),\n 'icon' => $icon,\n 'price' => $price,\n 'price_gold' => $price_gold,\n 'removable' => (mb_strtolower(((string)$item->removable)) == mb_strtolower('true') ? 1 : 0),\n 'weight' => $weight,\n 'vehicle_tags_include' => $mysql->quoteString($include),\n 'vehicle_tags_exclude' => $mysql->quoteString($exclude)\n );\n \n $this->InsertData('wot_equipment',$node,\"name_node = '$node' AND wot_version_id = '$this->versionId'\",$data);\n\n $equipment_id = $mysql->query(\"SELECT wot_equipment_id FROM wot_equipment WHERE name_node = '$node' AND wot_version_id = '$this->versionId'\");\n $equipment_id = $mysql->row($equipment_id);\n $equipment_id = $equipment_id['wot_equipment_id'];\n\n $break = false;\n \n foreach($item->script->children() as $param_node => $param_value) {\n if ($param_node == 'weight'){\n continue;\n }\n if ($param_node == 'attribute' || $param_node == 'value' || $param_node == 'factor') {\n $data = array(\n 'wot_equipment_id' => $equipment_id,\n 'param' => (string)$item->script->attribute,\n 'value' => isset($item->script->value) ? (string)$item->script->value : (string)$item->script->factor\n );\n $break = true;\n } else {\n $data = array(\n 'wot_equipment_id' => $equipment_id,\n 'param' => (string)$param_node,\n 'value' => (string)$param_value\n );\n }\n if (strpos($data['param'], '/'))\n {\n $data['param'] = substr($data['param'], strpos($data['param'], '/')+1);\n }\n \n $this->InsertData('wot_equipment_params',$node,\"wot_equipment_id = '$equipment_id' AND param = '{$data['param']}'\",$data);\n\n if ($break)\n {\n break;\n }\n }\n \n }\n }", "public function edit(equipo $equipo)\n {\n //\n }", "public function get_equipment_type();", "public function update(Request $request, Equipment $equipment)\n {\n $attributes = $this->validateEquipment('edit');\n $equipment->update($attributes);\n flash('equipment has been updated');\n return redirect($equipment->path('show'));\n }", "function equip_item () {\r\n if (!$this->ShouldUseAjax()) {\r\n $this->fof();\r\n return;\r\n }\r\n\r\n Configure::write('ajaxMode', 1);\r\n $this->autoRender = false;\r\n\r\n $userItemId = @$this->params['form']['userItemId'];\r\n $characterId = @$this->params['form']['characterId'];\r\n\r\n $userItem = $this->Item->UserItem->GetUserItem($userItemId);\r\n $character = $this->Character->GetCharacter($characterId);\r\n\r\n // Make sure both belong to logged in user\r\n $userId = $this->GameAuth->GetLoggedInUserId();\r\n if ($character['Character']['user_id'] != $userId || $userItem['UserItem']['user_id'] != $userId) {\r\n return AJAX_ERROR_CODE;\r\n }\r\n\r\n // Find other character that might've had this item equipped and unequip it\r\n $this->Character->UnequipItem($userItemId);\r\n\r\n $this->Character->EquipItem($characterId, $userItemId);\r\n }", "public function edit(Equipo $equipo)\n {\n //\n }", "public function setPower()\n {\n $this->_role->power = 100;\n }", "public function setPower()\n {\n $this->_role->power = 200;\n }", "function snmpset ($hostname, $community, $object_id, $type, $value, $timeout = null, $retries = null) {}", "public function edit(EquipmentAllocation $equipmentAllocation)\n {\n //\n }", "public function setArmor($armor)\n {\n if (!filter_var($armor, FILTER_VALIDATE_INT)) {\n throw new \\OutOfBoundsException('Parameter Error: A non integer value was provided.');\n }\n $this->_armor = $armor;\n return $this;\n }", "public function setVoiture($voiture){\n $this->$voiture = $voiture;\n }", "private function _invalid_data(&$checked) {\n // nastavi vsetky veci co zadal korektne\n $this->set('equipment', $checked);\n }", "public function appendEquipmentingItem($value)\n {\n return $this->append(self::EQUIPMENTING_ITEM, $value);\n }", "public function edit(Equipment $equipment)\n {\n $equipment = Equipment::where('id',$equipment->id)->first();\n $equipcategories=Equipcategory::orderBy('name','asc')->get();\n return view('admin.equipment.edit', array('user' => Auth::user()), compact('equipment','equipcategories'));\n }", "public function setToolsAttribute($value) {\n $this->attributes['tools'] = json_encode($value);\n }", "public function getEquipmentCode()\n {\n return isset($this->EquipmentCode) ? $this->EquipmentCode : null;\n }", "public function setEquipment($id, $obj, $objType=0){\n\t\t\tif ($objType === 0){\n\t\t\t\t$objType = getObjType($obj);\n\t\t\t}\n\t\t\t\n\t\t\t$query = new Query();\n\t\t\t\n\t\t\t$query->tables = array(\"tblpg_ogg\");\n\t\t\t$query->fields = array(\"IdPG\", \"IdOgg\", \"TipoOgg\");\n\t\t\t$query->values = array($id, $obj, $objType);\n\n\t\t\treturn ($query->DoInsert())?true:false;\n\t\t}", "public function addToEquipmentRef($equipmentRef)\n {\n $this->equipmentRef[] = $equipmentRef;\n return $this;\n }", "public function equipment()\n {\n return view('site_preparation.equipment');\n }", "public function manufacturer()\n {\n return $this->belongsTo(EquipmentManufacturer::class);\n }", "private function update_equipment_associations($equipment_list,$ticket_id){\n $existing_equipment = array();\n \n $equipment_identifier_splitter = '/^([^_]+)_(\\d+)$/';\n \n $DB_data = $this->load->database('default',TRUE);\n \n $query = $DB_data->select('equipment_identifier')->get_where('ticket_equipment_associations', array('ticket_id' => $ticket_id));\n \n if($query && $query->num_rows() > 0){\n foreach($query->result() as $row){\n preg_match($equipment_identifier_splitter,$row->equipment_identifier,$matches);\n $equip_id = intval($matches[2]);\n $extracted_equip_type = $matches[1];\n $existing_equipment[$extracted_equip_type] = $row->equipment_identifier;\n }\n }\n \n $null_equipment = array();\n $equipment_insert = array();\n \n foreach($equipment_list as $type => $item){\n $null_equipment[$type] = \"{$type}_0000\";\n }\n \n $non_changing_equipment = array_intersect($existing_equipment,$equipment_list);\n \n $old_equip_to_update = array_diff($equipment_list,$non_changing_equipment);\n \n $delete_list = array_diff($existing_equipment,$equipment_list);\n \n $insert_list = array_diff($old_equip_to_update, $null_equipment);\n \n \n foreach($delete_list as $equip_type => $equip_id){\n $DB_data->where(array('ticket_id' => $ticket_id, 'equipment_identifier' => $equip_id))->from('ticket_equipment_associations')->delete();\n }\n \n foreach($insert_list as $equip_type => $equip_id){\n $equipment_insert[$equip_id] = array(\n 'equipment_identifier' => $equip_id,\n 'ticket_id' => $ticket_id,\n 'created_at' => null,\n 'updated_at' => null,\n 'creator_id' => $this->user_id,\n 'updater_id' => $this->user_id\n );\n }\n if(sizeof($equipment_insert) > 0){\n $DB_data->insert_batch('ticket_equipment_associations',$equipment_insert);\n if($DB_data->affected_rows() > 0){\n $equipment_updated = true;\n trigger_solr_update();\n }\n }\n \n \n \n \n // echo \"\\nexisting\\n\";\n // var_dump($existing_equipment);\n// \n // echo \"\\nnew\\n\";\n // var_dump($equipment_list);\n// \n // echo \"\\nto delete\\n\";\n // var_dump($delete_list);\n// \n // echo \"\\nto insert\\n\";\n // var_dump($insert_list);\n \n\n }", "public function changeEquipementAction()\n {\n $user = Auth::getUser();\n $siteID = $_POST['site_id'];\n $equipementManager = new EquipementManager();\n\n if ($user->isSuperAdmin()) {\n $all_equipment = EquipementManager::getAllEquipementsBySiteId($siteID);\n } else {\n $all_equipment = EquipementManager::getEquipementsBySiteId($siteID, $user->group_id);\n }\n\n View::renderTemplate('Others/changeEquipementForm.html', [\n 'all_equipment' => $all_equipment,\n ]);\n }", "public function quoteGetEquipmentAction()\n {\n \t$this->_helper->layout()->disableLayout();\n \t\n \t$this->view->quoteId = $this->_request->getParam('id');\n \t$this->view->equipments = array();\n \tif (!empty($this->view->quoteId)) {\n \t\t$db = Zend_Registry::get('db');\n \t\t$equipment = $db->fetchOne(\"SELECT equipment FROM quotes WHERE id = {$this->view->quoteId}\");\n \t\tif (!empty($equipment)) {\n \t\t\t$equipment = Zend_Json::decode($equipment, true);\n \t\t\tif (count($equipment)) {\n \t\t\t\tforeach ($equipment as $key => $step) {\n \t\t\t\t\t$eqName = $db->fetchOne(\"SELECT name FROM equipments WHERE id = {$step['equipment_id']}\");\n \t\t\t\t\t$tmpArr = array();\n \t\t\t\t\t$tmpArr['key'] = $key;\n \t\t\t\t\t$tmpArr['name'] = $eqName;\n \t\t\t\t\t$tmpArr['quantity'] = $step['quantity'];\n \t\t\t\t\t$tmpArr['extra'] = $step['extra'];\n \t\t\t\t\t\n \t\t\t\t\tif ($tmpArr['extra'] === 'yes') {\n \t\t\t\t\t\t$tmpArr['extra'] = 'W/ dealer';\n \t\t\t\t\t} elseif ($tmpArr['extra'] === 'no') {\n \t\t\t\t\t\t$tmpArr['extra'] = 'W/O dealer';\n \t\t\t\t\t} else {\n \t\t\t\t\t\t$tmpArr['extra'] .= ' hours';\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t$this->view->equipments[] = $tmpArr;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }", "function setEditableManufacturerID($epmid)\n {\n// if ($this->isCorrectManufacturerId($epmid))\n// {\n $this->editableManufacturerID = $epmid;\n// }\n }", "function set_employee($emp)\n\t\t{\n\t\t\t$this->employee = $emp;\n\t\t}", "public function setRoom($room)\n {\n $this->room = $room;\n }", "public function update(EquipmentUpdateRequest $request, Equipment $equipment)\n {\n if ($request->hasFile('image')) {\n //for equipment image\n $equipmentimage=$request->file('image');\n $imagefilename = time() . '.' . $request->image->getClientOriginalExtension();\n Image::make($equipmentimage)->resize(600, 600)->save(public_path('equipment_images/' . $imagefilename));\n\n $equipment=Equipment::find($equipment->id);\n $equipment->name=$request->name;\n if ($request->existing_name!=$request->name) {\n $equipment->slug=Str::slug($request->name);\n }\n $equipment->slug=$equipment->slug;\n $equipment->description=$request->description;\n $equipment->price=$request->price;\n $equipment->equipcategory_id=$request->equipcategory_id;\n $equipment->user_id=Auth::user()->id;\n $equipment->image=$imagefilename;\n $equipment->save();\n\n }else{\n $equipment=Equipment::find($equipment->id);\n $equipment->name=$request->name;\n if ($request->existing_name!=$request->name) {\n $equipment->slug=Str::slug($request->name);\n }\n $equipment->slug=$equipment->slug;\n $equipment->description=$request->description;\n $equipment->price=$request->price;\n $equipment->equipcategory_id=$request->equipcategory_id;\n $equipment->user_id=Auth::user()->id;\n $equipment->image=$request->existing_image;\n $equipment->save();\n }\n\n\n return redirect()->route('equipment.index')->with('success','Equipment updated Successfully!');\n }", "public function store(EquipmentRequest $request)\n {\n $equipment = new Equipment;\n $equipment->fill($request->all());\n $equipment->user_id = auth()->id();\n\n if (! $equipment->save()) {\n return response()->json(['message' => __('app.database.save_error')], 422);\n }\n\n $equipment = Equipment::querySelectJoins()->findOrFail($equipment->id);\n event(new ECreate($equipment));\n\n return response()->json([\n 'message' => __('app.equipments.store'),\n 'equipment' => $equipment,\n ]);\n }", "private function setDataToEquipmentInstances($equipmentInstances) {\n foreach ($equipmentInstances as $equipmentInstance) {\n $expired = $equipmentInstance->isDateExpired('minPeriodicControlDate');\n if ($expired) $equipmentInstance->setControlStatus('expired');\n }\n return $equipmentInstances;\n }", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function hasEquipment()\n {\n return $this->get(self::EQUIPMENT) !== null;\n }", "public function getEquipmentStatusId()\n\t{\n\t return $this->equipmentStatusId;\n\t}", "function get_equipment($equipment_id){\n $equipment_index = get_equipment_index();\n\n if(!array_key_exists($equipment_id, $equipment_index)){\n return new Unequipped();\n }\n return new $equipment_index[$equipment_id]();\n }", "public function edit(Equipment $equipment)\n {\n $rooms = Room::all();\n $types = Equipmenttype::all();\n $users = User::all();\n return view('equipment.edit', compact('equipment', 'rooms', 'types', 'users'));\n }", "public function update(Request $request, $id)\n\t{\n\t\t$equipment = Equipment::where('id', $id)->first();\n\t\t$manufacturers = Manufacturer::lists('manufacturer_name', 'id');\n\t\t$customers = Customer::lists('company_name', 'id');\n\t\t\n\t\t$rules = array(\n\t\t\t'description' => 'required',\n\t\t\t'type' => 'required',\n\t\t);\n\t\t\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// process the login\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('equipments/' . $id . '/edit')\n\t\t\t\t->withErrors($validator); \n\t\t} else {\n\t\t\t$equipment->make = Input::get('make');\n\t\t\t$equipment->model = Input::get('model');\n\t\t\t$equipment->description = Input::get('description');\n\t\t\t$equipment->manufacturer_id = Input::get('manufacturer_id');\n\t\t\t$equipment->serial_no = Input::get('serial_no');\n\t\t\t$equipment->type = Input::get('type');\n\t\t\t$equipment->license_no = Input::get('license_no');\n\t\t\t$equipment->manufacturer_warranty_period = Input::get('manufacturer_warranty_period');\n\t\t\t\n\t\t\t$equipment->customer_id = Input::get('customer_id');\n\t\t\t$equipment->install_date = Input::get('install_date');\n\t\t\t$equipment->internal_warranty_period = Input::get('internal_warranty_period');\n\t\t\t$equipment->purchase_value = Input::get('purchase_value');\n\t\t\t$equipment->payment_method = Input::get('payment_method');\n\t\t\t$equipment->notes = Input::get('notes');\n\t\t\t$equipment->save();\n\t\t\t\n\t\t\treturn Redirect::to('equipments/' . $id)->with('message','Successfully updated equipment!');\n\t\t}\n\t}", "public function setMinDamage(){ $this->minDamage = 10; }", "public function setCharacter(Character $character): CharacterInformationBuilder {\n $this->character = $character;\n\n $this->inventory = $character->inventory->slots->where('equipped', true);\n\n return $this;\n }", "public function setResistanceAttribute($value)\n {\n $this->attributes['resistance'] = $this->makeCollection($value);\n }", "public function setCoEquipo($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_equipo !== $v) {\n\t\t\t$this->co_equipo = $v;\n\t\t\t$this->modifiedColumns[] = C060InventarioPeer::CO_EQUIPO;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getEquipmentDamageType()\n {\n return $this->equipmentDamageType;\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'description' => 'required',\n\t\t\t'type' => 'required',\n\t\t);\n\t\t\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// process the login\n\t\tif ($validator->fails()) {\n\t\t\treturn Redirect::to('equipments/create')\n\t\t\t\t->withErrors($validator);\n\t\t} else {\n\t\t\t// store\n\t\t\t//$company_name = str_replace('.','',Input::get('company_name'));\n\t\t\t\n\t\t\t$equipment = new equipment;\n\t\t\t$equipment->make = Input::get('make');\n\t\t\t$equipment->model = Input::get('model');\n\t\t\t$equipment->description = Input::get('description');\n\t\t\t$equipment->manufacturer_id = Input::get('manufacturer_id');\n\t\t\t$equipment->serial_no = Input::get('serial_no');\n\t\t\t$equipment->type = Input::get('type');\n\t\t\t$equipment->license_no = Input::get('license_no');\n\t\t\t$equipment->manufacturer_warranty_period = Input::get('manufacturer_warranty_period');\n\t\t\t\n\t\t\t$equipment->customer_id = Input::get('customer_id');\n\t\t\t$equipment->install_date = Input::get('install_date');\n\t\t\t$equipment->internal_warranty_period = Input::get('internal_warranty_period');\n\t\t\t$equipment->purchase_value = Input::get('purchase_value');\n\t\t\t$equipment->payment_method = Input::get('payment_method');\n\t\t\t$equipment->notes = Input::get('notes');\n\t\t\t$equipment->save();\n\n\t\t\t// redirect\n\t\t\treturn Redirect::to('equipments')->with('message', 'Successfully created equipment!');\n\t\t}\n\t}", "public function update(PatchRequest $request, $company_id, $equipment_id)\n {\n $equipment = CompanyEquipment::find($equipment_id);\n \n if ($request->filled('notes')) {\n $equipment->notes = $request->get('notes');\n }\n if ($request->filled('name')) {\n $equipment->name = $request->get('name');\n }\n if ($request->filled('company_equipment_status_id')) {\n $equipment->company_equipment_status_id = $request->get('company_equipment_status_id');\n }\n \n $equipment->save();\n\n return response()->json($equipment, 200);\n }", "public function equipments() {\n return $this->belongsToMany('Rockit\\Models\\Equipment', 'attributions')->withTrashed()\n ->withPivot('quantity', 'cost');\n }", "public function massWorkshopIdAction()\n {\n $equipmentIds = $this->getRequest()->getParam('equipment');\n if (!is_array($equipmentIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_logistics')->__('Please select equipments.')\n );\n } else {\n try {\n foreach ($equipmentIds as $equipmentId) {\n $equipment = Mage::getSingleton('bs_logistics/equipment')->load($equipmentId)\n ->setWorkshopId($this->getRequest()->getParam('flag_workshop_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d equipments were successfully updated.', count($equipmentIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_logistics')->__('There was an error updating equipments.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function set($data);", "public function testDestiny2EquipItem()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function massOtherroomIdAction()\n {\n $equipmentIds = $this->getRequest()->getParam('equipment');\n if (!is_array($equipmentIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_logistics')->__('Please select equipments.')\n );\n } else {\n try {\n foreach ($equipmentIds as $equipmentId) {\n $equipment = Mage::getSingleton('bs_logistics/equipment')->load($equipmentId)\n ->setOtherroomId($this->getRequest()->getParam('flag_otherroom_id'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d equipments were successfully updated.', count($equipmentIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_logistics')->__('There was an error updating equipments.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }", "public function show($company_id, $equipment_id, CompanyEquipment $equipment)\n {\n return response()->json($equipment);\n }", "public function store(AddEquipmentRequest $request )\n {\n \n $equipment = Equipment::where('name', trim( $request->equipment_name ) )\n ->where('manufacturer', trim( $request->equipment_manufacturer) )\n ->where('model', trim( $request->equipment_model) )\n ->first();\n\n $institute = auth()->user()->institute;\n\n if( $equipment)\n {\n $institute->addEquipment( $request->except('_token') + [ 'equipment_id' => $equipment->id ] );\n\n $message = 'Equipment Added Successfully';\n \n } else {\n\n $equipment = new Equipment;\n $equipment->name = $request->equipment_name;\n $equipment->manufacturer = $request->equipment_manufacturer;\n $equipment->model = $request->equipment_model;\n $equipment->institute_id = $institute->id ;\n\n $equipment->save();\n\n $institute->addEquipment( $request->except('_token') + [ 'equipment_id' => $equipment->id ] );\n\n $message = 'Equipment Created Successfully, Please update more information';\n }\n\n return redirect()->route('admin.institute-equipments.edit', $equipment->id )\n ->withMessage($message);\n ;\n }", "public function update(EquipmentRequest $request, int $id)\n {\n $equipment = Equipment::findOrFail($id);\n\n // Edit only own equipments\n if (! $this->_user->perm(Perm::EQUIPMENTS_EDIT_ALL) && Gate::denies('owner', $equipment)) {\n return $this->responseNoPermission();\n }\n\n $equipment->fill($request->all());\n\n if (! $equipment->save()) {\n return $this->responseDatabaseSaveError();\n }\n\n // Update model new data from relationship\n $equipment = Equipment::querySelectJoins()->findOrFail($equipment->id);\n event(new EUpdate($equipment->id, $equipment));\n\n return response()->json([\n 'message' => __('app.equipments.update'),\n 'equipment' => $equipment,\n ]);\n }", "public function appendItems(Down_HeroEquip $value)\n {\n return $this->append(self::_ITEMS, $value);\n }", "public function store(Request $request)\n {\n //dd($request->all());\n //\n $i = new Inventory();\n $e = new Equipment();\n $i->description = $request->description;\n $i->equipment_id = $request->equipment_id;\n //ACTUALIZANDO EL EQUIPO QUE SE REGISTRA Y SE ACTUALIZA EL CAMPO\n //QUE INDICA SI ESTA EN INVENTARIO O NO.\n Equipment::where('id', $request->equipment_id)\n ->update([\n 'hard_driver_id' => $request->hd_id,\n 'ram_id' => $request->ram_id,\n 'video_id' => $request->video_id,\n 'motherboard_id' => $request->ms_id,\n 'read_driver_id' => $request->rd_id,\n 'net_card_id' => $request->net_id,\n 'microprocessor_id'=> $request->cpu_id,\n 'display_id' => $request->display_id,\n 'keyboard_id' => $request->keyboard_id,\n 'mouse_id' => $request->mouse_id,\n 'inventory' => '1',\n 'updated_at' => date(\"Y-m-d H:i:s\")]);\n\n //ACTUALZANDO EL COMPONENTE QUE LE PERTENECE AL COMPUTADOR\n HardDrive::where('id', $request->hd_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n Ram::where('id', $request->ram_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n Video::where('id', $request->video_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n\n Motherboard::where('id', $request->ms_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n ReadDriver::where('id', $request->rd_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n\n Microprocessor::where('id', $request->cpu_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n NetCard::where('id', $request->net_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n\n Component::where('id', $request->display_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n\n OtherComponent::where('id', $request->keyboard_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n\n OtherComponent::where('id', $request->mouse_id)->update([\n 'registered' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")\n ]);\n\n $i->save();\n\n Record::create([\n 'date' => date(\"Y-m-d H:i:s\"),\n 'user' => Auth::user()->name.' '.Auth::user()->lastname,\n 'host' => $request->ip(),\n 'operation' => 'INSERT',\n 'table' => 'Inventario',\n 'reason' => 'registro de equipo en inventario'\n ]);\n\n Session::flash('message-success', 'EQUIPO EN INVENTARIO');\n return redirect()->To('inventories');\n }", "public function getEquipmentDepartment()\n {\n return $this->hasOne(Equipment::className(), ['equipment_department' => 'equipment_department']);\n }", "public function setWearEquipReply(Down_WearEquipReply $value)\n {\n return $this->set(self::_WEAR_EQUIP_REPLY, $value);\n }", "public function edit($id)\n {\n $data['equipment'] = Equipment::findorFail($id);\n $data['customer'] = Customer::select(DB::Raw(\"concat(customer ,' - ', IFNULL(name,'')) AS customer, id\"))->orderby('name', 'asc')->pluck('customer', 'id');\n $data['equipment']->install_date = $data['equipment']->install_date ? date('d.m.Y', strtotime($data['equipment']->install_date)) : \"\";\n $data['equipment']->last_repair_date = $data['equipment']->last_repair_date ? date('d.m.Y', strtotime($data['equipment']->last_repair_date)) : \"\";\n $language = Session::get('language') ? Session::get('language') : 'no';\n $data['equipement_category_from_dropdown'] = DropdownHelper::where('language', $language)->where('groupcode', '012')->orderBy('keycode', 'asc')->pluck('label', 'keycode')->toArray();\n // get deleted equipment category also\n $data['equipment_category'] = EquipmentCategory::getAllEquipmentCategories();\n $parentequipemnts = EquipmentChild::select('equipment_id')->where('equipment_id', '=', $id)->get();\n $parentequipemnts_array = array();\n foreach ($parentequipemnts as $key => $value) {\n $parentequipemnts_array[] = $value->equipment_id;\n $parent_equipment_id = Equipment::getParentEquipments($parentequipemnts_array, $value->equipment_id);\n }\n\n $order_details = Order::Where('equipment_id', '=', $id)->get();\n $data['order_count'] = count($order_details);\n\n if (@$parent_equipment_id) {\n $data['equipments'] = Equipment::select(DB::Raw(\"concat(internalnbr ,' - ', IFNULL(description,'')) AS description, id\"))->where('customer_id', '=', $data['equipment']->customer_id)->where('id', '!=', $id)->whereNotIn('id', @$parent_equipment_id)->pluck('description', 'id');\n } else {\n $data['equipments'] = Equipment::select(DB::Raw(\"concat(internalnbr ,' - ', IFNULL(description,'')) AS description, id\"))->where('customer_id', '=', $data['equipment']->customer_id)->where('id', '!=', $id)->pluck('description', 'id');\n }\n $data['selected_child_equipments'] = [];\n $data['child_equipments'] = EquipmentChild::where('equipment_id', '=', $id)->get();\n if ($data['child_equipments'] != '') {\n foreach ($data['child_equipments'] as $key => $value) {\n $data['selected_child_equipments'][] = $value->child_equipment_id;\n }\n }\n //Added on 19.1.2018\n $data['parent_equipents'] = EquipmentChild::where('child_equipment_id', '=', $id)->get();\n if (@$data['parent_equipents']) {\n foreach ($data['parent_equipents'] as $key => $value) {\n $data['selected_parent_equipment'] = $value->equipment_id;\n }\n }\n\n $data['btn_value'] = 1;\n $child_equipments_array = EquipmentChild::select('equipment_id')->where('child_equipment_id', '=', $id)->get();\n if (@$child_equipments_array->toArray()) {\n $data['btn_value'] = 3;\n }\n $data['child_equipments_details'] = Equipment::whereIn('id', $data['selected_child_equipments'])->get();\n $data['orders'] = Order::where('equipment_id', '=', $id)->get();\n $data['customers'] = Customer::where('status', '=', '0')->orderby('name', 'asc')->pluck('name', 'id');\n $language = Session::get('language') ? Session::get('language') : 'no';\n $data['order_status'] = DropdownHelper::where('language', $language)->where('groupcode', '005')->orderBy('keycode', 'asc')->pluck('label', 'keycode');\n return view('equipment.edit', $data);\n }", "public function addNewEquipment($equipmentData)\n {\n foreach ($equipmentData as $key => $value) {\n $equipmentData[$key] = ($key != \"expire\") ? mysql_escape_string($value) : $value;\n }\n\n \n //$this->db->select_db(DB_NAME);\n\n $query = \"INSERT INTO \" . TB_EQUIPMENT . \" (department_id, equip_desc, inventory_id, permit, expire, daily, dept_track, facility_track, model_number, serial_number, creater_id, voc_emissions) VALUES (\";\n\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"department_id\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"equip_desc\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"inventory_id\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"permit\"]) . \"', \";\n $query .= \"'\" . strtotime($equipmentData[\"expire\"]->formatInput()) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"daily\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"dept_track\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"facility_track\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"model_number\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"serial_number\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($equipmentData[\"creater_id\"]) . \"', \";\n $query .= \"'\" . $this->db->sqltext($this->getVocEmissions()) . \"'\";\n $query .= \")\";\n\n $this->db->query($query);\n $this->db->query(\"SELECT LAST_INSERT_ID() id\");\n $equipmentID = $this->db->fetch(0)->id;\n\n $this->setEquipmentNR();\n\n //\tsave to trash_bin\n $this->save2trash('C', $equipmentID);\n//\n return $equipmentID;\n }", "public function update(Request $request, Equipo $equipo)\n {\n //\n }", "public function update(EquipmentRequest $request, $id)\n {\n $input = $request->all();\n $equipment = Equipment::findorFail($id);\n $old_customer_id = $equipment->customer_id;\n\n if ($input['customer_id'] != $old_customer_id) {\n\n $child_equipment_ids = EquipmentChild::select('child_equipment_id')->where('equipment_id', '=', $id)->get();\n if (@$child_equipment_ids) {\n foreach ($child_equipment_ids as $key => $value) {\n Equipment::updateCustomerByParent($value->child_equipment_id, $input['customer_id']);\n Equipment::where('id', $value->child_equipment_id)->update(['customer_id' => $input['customer_id']]);\n }\n }\n }\n\n $input['install_date'] = $request->get('install_date') ? date('Y-m-d', strtotime($input['install_date'])) : null;\n $input['last_repair_date'] = $request->get('last_repair_date') ? date('Y-m-d', strtotime($input['last_repair_date'])) : null;\n $input['updated_by'] = Session::get('currentUserID');\n $equipment->fill($input);\n $equipment->save();\n\n EquipmentChild::where('child_equipment_id', $id)->delete();\n\n if (@$request->get('child_equipment_id')) {\n $child_equipment_id = $request->get('child_equipment_id');\n\n $child_equipment_id_details['equipment_id'] = $child_equipment_id;\n\n $child_equipment_id_details['child_equipment_id'] = $id;\n\n EquipmentChild::create($child_equipment_id_details);\n\n }\n\n return Redirect::route($this->route)->with($this->success, trans($this->updatemsg));\n }", "public function __SET($att, $valor){\r\n $this->$att = $valor;\r\n}", "public function edit($room){\r\n $sql=\"UPDATE salas SET nombre_sala=:name,is3d=:is3D,capacidad=:capacity WHERE id_sala=:roomId\";\r\n $parameters[\"name\"]=$room->getName();\r\n $parameters[\"capacity\"]=$room->getCapacity();\r\n $parameters[\"is3D\"]=$room->getIs3D();\r\n $parameters[\"roomId\"]=$room->getId(); \r\n try\r\n {\r\n $this->connection = Connection::getInstance();\r\n return $this->connection->ExecuteNonQuery($sql, $parameters);\r\n }\r\n catch(PDOException $ex)\r\n {\r\n throw $ex;\r\n }\r\n }", "public function setProduct()\n {\n // get the existing products array\n $products = $this->getProducts();\n // push the new product to the array\n array_push($products, $this);\n $file = fopen($_SERVER['DOCUMENT_ROOT'] . \"/mpm_challenge/problem4/db/db.json\", \"w+\") or die(\"not opened\");\n fwrite($file, json_encode($products));\n fclose($file);\n }", "abstract function set ($item, $data);", "public function setEntity( $entity )\n {\n \n $this->entity = $entity;\n \n }", "public function store(Request $request)\n {\n $result = true;\n $validator = $request->validate([\n //'serial_number' => 'required|string',\n //'model_number' => 'required|string',\n //'manufacturer_name' => 'required|string',\n //'description' => 'required',\n //'location' => 'required',\n //'year_of_purchase' => 'required',\n //'installation_time' => 'required',\n //'pos_rep_date' => 'required',\n //'equipment_cost' => 'required',\n 'code' => 'required',\n 'category_id' => 'required',\n 'user_id' => 'required',\n 'maintenance_frequency' => 'required',\n 'unit_id' => 'required'\n ]);\n\n $equipment = new Equipment();\n\n //$equipment->code = $request->code;\n /*$hospital = Hospital::findOrFail($request->hospital_id);\n\n $hospital_code = $this->generatePrefix($hospital->name, $request->hospital_id);\n $last_equipment = Equipment::where(\"hospital_id\", \"=\", $hospital->id)->latest()->first();\n \n\n if($last_equipment == null){\n $code = 1;\n }else{\n $code = substr($last_equipment->code, -1, 13);\n $code = (int)$code + 1;\n }\n\n $code = sprintf(\"%010d\", $code);*/\n\n $request->installation_time = $this->formatDate($request->installation_time);\n $request->pos_rep_date = $this->formatDate($request->pos_rep_date);\n \n $equipment->code = $request->code; //$hospital_code.\"-\".$code;\n $equipment->serial_number = $request->serial_number != null ? $request->serial_number : 'N/A';\n $equipment->model_number = $request->model_number != null ? $request->model_number : 'N/A';\n $equipment->manufacturer_name = $request->manufacturer_name != null ? $request->manufacturer_name : 'N/A';\n $equipment->description = $request->description != null ? $request->description : 'N/A';\n $equipment->category_id = $request->category_id;\n $equipment->status = $request->status;\n $equipment->hospital_id = $request->hospital_id;\n $equipment->user_id = $request->user_id;\n $equipment->maintenance_frequency = $request->maintenance_frequency;\n $equipment->unit_id = $request->unit_id;\n $equipment->location = $request->location != null ? $request->location : 'N/A';\n $equipment->year_of_purchase = $request->year_of_purchase != null ? $request->year_of_purchase : 'N/A';\n $equipment->installation_time = $request->installation_time;\n $equipment->pos_rep_date = $request->pos_rep_date;\n $equipment->equipment_cost = $request->equipment_cost;\n $equipment->service_vendor_id = $request->service_vendor_id;\n\n\n if($equipment->save()){\n $result = false;\n }\n\n return response()->json([\n 'error' => $result,\n 'data' => $equipment,\n 'message' => !$result ? 'Equipment created successfully' : 'Error creating equipment'\n ]);\n }", "public function equip_type()\n {\n return $this->hasOne(ReferenceProperty::class, 'id', 'equip_type_reference_id');\n }", "public function store(CreateRequest $request, CustomerEquipment $customerequipment)\n {\n $user = $this->user();\n $customer = $this->customer();\n if (!$customer) {\n return error_json('没有权限建立设备');\n }\n\n $data = $request->only([\n 'cust_id',\n 'item_id',\n 'name',\n 'model',\n 'type',\n// 'code_id',\n 'contract_number',\n 'installation_staff',\n 'technology_staff',\n 'number',\n 'sets',\n 'main_no',\n 'control_box_no',\n 'main_model',\n 'control_box_model',\n 'welding_machine_no',\n 'welding_machine_model',\n 'axis1_no',\n 'axis2_no',\n 'axis3_no',\n 'axis4_no',\n 'axis5_no',\n 'axis6_no',\n 'code_chinese',\n 'identification_code',\n 'manufacture_date',\n 'purchase_date',\n 'installation_date',\n 'acceptance_date',\n 'warranty_date',\n 'maintenance_times',\n 'remark'\n ]);\n $data['dfrom'] = 1;\n $data['cust_id'] = (int)$customer->id;\n $data['item_id'] = (int)$data['item_id'];\n $data['type'] = (int)$data['type'];\n// $data['code_id'] = (int)$data['code_id'];\n $data['maintenance_times'] = (int)$data['maintenance_times'];\n\n $data['manufacture_date'] = date('Y-m-d', strtotime($data['manufacture_date']));\n $data['purchase_date'] = date('Y-m-d', strtotime($data['purchase_date']));\n $data['installation_date'] = date('Y-m-d', strtotime($data['installation_date']));\n $data['acceptance_date'] = date('Y-m-d', strtotime($data['acceptance_date']));\n $data['warranty_date'] = date('Y-m-d', strtotime($data['warranty_date']));\n if (empty($data['manufacture_date']) || ($data['manufacture_date'] <= '1991-01-01')) $data['manufacture_date'] = NULL;\n if (empty($data['purchase_date']) || ($data['purchase_date'] <= '1991-01-01')) $data['purchase_date'] = NULL;\n if (empty($data['installation_date']) || ($data['installation_date'] <= '1991-01-01')) $data['installation_date'] = NULL;\n if (empty($data['acceptance_date']) || ($data['acceptance_date'] <= '1991-01-01')) $data['acceptance_date'] = NULL;\n if (empty($data['warranty_date']) || ($data['warranty_date'] <= '1991-01-01')) $data['warranty_date'] = NULL;\n\n $qrcode_key = 'CEQ'.md5(microtime());\n $data['qrcode_key'] = $qrcode_key;\n $data['qrcode_url'] = 'https://mp.mxhj.net/machine/'.$qrcode_key;\n $data['qrcode_img'] = 'qrcodes/'.$qrcode_key.'.png';\n //产生QRCODE\n QrCode::format('png')->size(300)->generate($data['qrcode_url'], public_path($data['qrcode_img']));\n\n $data['created_by'] = $user->userable_name;\n $data['updated_by'] = $user->userable_name;\n\n $ret = $customerequipment->forceFill($data)->save();\n\n if ($ret) {\n return success_json($customerequipment, '');\n }\n\n return error_json('新增失败,请检查');\n }", "public function edit($id)\n\t{\n\t\t$equipment = equipment::where('id', $id)->first();\n\t\t$customers = Customer::lists('company_name', 'id');\n\t\t$manufacturers = Manufacturer::lists('manufacturer_name', 'id');\n\t\t\n\t\t//if(Auth::user()->hasRole('Manager') && $equipment->users()->find(Auth::user()->id)){\n\t\t\treturn view('equipments.edit', compact('equipment', 'customers', 'manufacturers'));\n\t\t//} else {\n\t\t\t//return Redirect::to('equipments')->with('alert', 'You do not have permission to edit this equipment');\n\t\t//}\n\t}", "public function update(Request $request, vendorequipment $vendorequipment)\n {\n\t\t$main_id = $request->input('main_id');\n\t\t$equipments = DB::table('vendorequipments')\n\t\t\t\t\t->join('vendorequipmendetails', 'vendorequipmendetails.ve_id', '=', 'vendorequipments.ve_id','left')\n\t\t\t\t\t->join('vendorequipment_loans', 'vendorequipment_loans.ve_id', '=', 'vendorequipments.ve_id','left')\n\t\t\t\t\t->where('vendorequipments.ve_id',$main_id)\n\t\t\t\t\t->select('vendorequipments.*', 'vendorequipmendetails.*', 'vendorequipment_loans.*','vendorequipments.ve_id as main_id')\n\t\t\t\t\t->get();\n\t\t\t\t\t$equipment = $equipments[0];\n\t\t\n\t\t//dd($equipment);\n ini_set('memory_limit','256M');\n $validatedData = $request->validate([ \n 've_product_type' => 'required', \n 've_equipment_type' => 'required',\n 've_brand' => 'required',\n 've_year' => 'required',\n 've_model' => 'required',\n 've_capacity' => 'required',\n 've_type_of_work' => 'required',\n 've_vehicle_number' => 'required',\n 've_expected_mileage' => 'required',\n \n ],[], \n\t\t[\n\t\t\t've_product_type' => 'product type', \n\t\t\t've_equipment_type' => 'Equipment type', \n\t\t\t've_brand' => 'Brand', \n\t\t\t've_year' => 'Year', \n\t\t\t've_model' => 'Model', \n\t\t\t've_capacity' => 'Capacity', \n\t\t\t've_type_of_work' => 'Type of work', \n\t\t\t've_vehicle_number' => 'vehicle number', \n\t\t\t've_expected_mileage' => 'expected mileage', \n\t\t \n\t\t]\n\t\t\t);\n\t\t//$values = $request->except('url');\n\t\t$values = array(\n\t\t\n\t\t\"ve_product_type\"=> $request->input('ve_product_type'),\n\t\t\"ve_equipment_type\"=> $request->input('ve_equipment_type'),\n\t\t\"ve_brand\"=> $request->input('ve_brand'),\n\t\t\"ve_year\"=> $request->input('ve_year'),\n\t\t\"ve_model\"=> $request->input('ve_model'),\n\t\t\"ve_capacity\"=> $request->input('ve_capacity'),\n\t\t\"ve_type_of_work\"=> $request->input('ve_type_of_work'),\n\t\t\"ve_vehicle_number\"=> $request->input('ve_vehicle_number'),\n\t\t\"ve_expected_mileage\"=> $request->input('ve_expected_mileage'),\n\t\t\"ve_vehicle_code\"=> $request->input('ve_vehicle_code'),\n\t\t\"service_details_at\"=> $request->input('service_details_at'),\n\t\t\"service_details_at_type\"=> $request->input('service_details_at_type'),\n\t\t\"service_details_days\"=> $request->input('service_details_days'),\n\t\t\"last_serviced_at\"=> $request->input('last_serviced_at'),\n\t\t\"last_serviced_at_type\"=> $request->input('last_serviced_at_type'),\n\t\t\"last_serviced_at_date\"=> $request->input('last_serviced_at_date'),\n\t\t\"loan_taken\"=> $request->input('loan_taken'),\n\t\t\"ve_vendor_id\"=> $request->input('ve_vendor_id'),\n\t\t\n\t\t);\n //$id = vendorequipment::create($values)->id;\n\t\t\n\t\t\n\t\tDB::table('vendorequipments')\n\t\t\t->where('ve_id', $main_id)\n\t\t\t->update($values);\n\t\t\n\t\t\t/* foreach ($_FILES['image']['tmp_name'] as $key => $value) {\n \n $file_tmpname = $_FILES['image']['tmp_name'][$key];\n $file_name = $_FILES['image']['name'][$key];\n \n // $filepath = \"/home/ubuntu/infraweb/public/images/\".time().$file_name;\n $filepath = \"C:/xampp/htdocs/tatainfra/public/images/\".time().$file_name;\n \n move_uploaded_file($file_tmpname, $filepath);\n\t\t\t\t \n $imagename[] = time().$file_name;\n \n } */\n\t\tif($_FILES['upload']['tmp_name']){\n\t\t $file_tmpname1 = $_FILES['upload']['tmp_name'];\n $file_name1 = $_FILES['upload']['name'];\n\t\t //$filepath1 = \"/home/ubuntu/infraweb/public/images/\".time().$file_name1;\n\t\t $filepath1 = \"C:/xampp/htdocs/tatainfra/public/images/\".time().$file_name1;\n\t\t $file_name2 = time().$file_name1;\n\t\t move_uploaded_file($file_tmpname1, $filepath1); \n\t\t}else{\n\t\t$file_name2 =\t$equipment->upload_rental_contract;\n\t\t}\n\t\t /****RC **/\n\t\t if($_FILES['d_vechile_rc']['tmp_name']){\n\t\t $d_vechile_rc_tmpname1 = $_FILES['d_vechile_rc']['tmp_name'];\n $d_vechile_rc_name = $_FILES['d_vechile_rc']['name'];\n\t\t //$d_vechile_rc_path = \"/home/ubuntu/infraweb/public/images/\".time().$d_vechile_rc_name;\n\t\t $d_vechile_rc_path = \"C:/xampp/htdocs/tatainfra/public/images/\".time().$d_vechile_rc_name;\n\t\t $d_vechile_rc = time().$d_vechile_rc_name;\n\t\t move_uploaded_file($d_vechile_rc_tmpname1, $d_vechile_rc_path);\n\t\t }else{\n\t\t\t$d_vechile_rc =\t$equipment->ve_vehicle_rc; \n\t\t }\n\t\t /**insurance*/\n\t\t if($_FILES['d_insurance']['tmp_name']){\n\t\t$d_insurance_tmpname1 = $_FILES['d_insurance']['tmp_name'];\n $d_insurance_name = $_FILES['d_insurance']['name'];\n\t\t// $d_insurance_path = \"/home/ubuntu/infraweb/public/images/\".time().$d_insurance_name;\n\t\t $d_insurance_path = \"C:/xampp/htdocs/tatainfra/public/images/\".time().$d_insurance_name;\n\t\t $d_insurance = time().$d_insurance_name;\n\t\t move_uploaded_file($d_insurance_tmpname1, $d_insurance_path);\n\t\t }else{\n\t\t\t $d_insurance =\t$equipment->ve_insurance; \n\t\t }\n\t\t /**road tax*/\n\t\t if($_FILES['d_road_tax']['tmp_name']){\n\t\t $d_road_tax_tmpname1 = $_FILES['d_road_tax']['tmp_name'];\n $d_road_tax_name = $_FILES['d_road_tax']['name'];\n\t\t// $d_road_tax_path = \"/home/ubuntu/infraweb/public/images/\".time().$d_road_tax_name;\n\t\t $d_road_tax_path = \"C:/xampp/htdocs/tatainfra/public/images/\".time().$d_road_tax_name;\n\t\t $d_road_tax = time().$d_road_tax_name;\n\t\t move_uploaded_file($d_road_tax_tmpname1, $d_road_tax_path);\n\t\t }else{\n\t\t\t $d_road_tax =\t$equipment->ve_road_tax;\n\t\t }\n\t\t /***road permit**/\n\t\t if($_FILES['d_road_permit']['tmp_name']){\n\t\t $d_road_permit_tmpname1 = $_FILES['d_road_permit']['tmp_name'];\n $d_road_permit_name = $_FILES['d_road_permit']['name'];\n\t\t// $d_road_permit_name_path = \"/home/ubuntu/infraweb/public/images/\".time().$d_road_permit_name;\n\t\t $d_road_permit_name_path = \"C:/xampp/htdocs/tatainfra/public/images/\".time().$d_road_permit_name;\n\t\t $d_road_permit = time().$d_road_permit_name;\n\t\t move_uploaded_file($d_road_permit_tmpname1, $d_road_permit_name_path);\n\t\t }else{\n\t\t\t $d_road_permit =\t$equipment->ve_road_permit; \n\t\t }\n\t\t /*****fitness******/\n\t\t if($_FILES['d_fitness']['tmp_name']){\n\t\t $d_fitness_tmpname1 = $_FILES['d_fitness']['tmp_name'];\n $d_fitness_name = $_FILES['d_fitness']['name'];\n\t\t// $d_fitness_name_path = \"/home/ubuntu/infraweb/public/images/\".time().$d_fitness_name;\n\t\t $d_fitness_name_path = \"C:/xampp/htdocs/tatainfra/public/images/\".time().$d_fitness_name;\n\t\t $d_fitness = time().$d_fitness_name;\n\t\t move_uploaded_file($d_fitness_tmpname1, $d_fitness_name_path);\n\t\t }else{\n\t\t\t $d_fitness =\t$equipment->ve_fitness;\n\t\t }\n\t\t /**********/\n\t\t$values_details = array(\n\t\t\"ve_rental_start_date\"=>$request->input('ve_rental_start_date'),\n\t\t\"ve_rental_end_date\"=>$request->input('ve_rental_end_date'),\n\t\t\"ve_noofdays\"=>$request->input('ve_noofdays'),\n\t\t\"ve_rental_cost\"=>$request->input('ve_rental_cost'),\n\t\t\"ve_billing_cycle\"=>$request->input('ve_billing_cycle'),\n\t\t\"rc_start_date\"=>$request->input('rc_start_date'),\n\t\t\"rc_end_date\"=>$request->input('rc_end_date'),\n\t\t\"ins_start_date\"=>$request->input('ins_start_date'),\n\t\t\"ins_end_date\"=>$request->input('ins_end_date'),\n\t\t\"tax_start_date\"=>$request->input('tax_start_date'),\n\t\t\"tax_end_date\"=>$request->input('tax_end_date'),\n\t\t\"permit_end_date\"=>$request->input('permit_end_date'),\n\t\t\"permit_start_date\"=>$request->input('permit_start_date'),\n\t\t\"fitness_end_date\"=>$request->input('fitness_end_date'),\n\t\t\"fitness_start_date\"=>$request->input('fitness_start_date'),\n\t\t\"project_name\"=>$request->input('project_name'),\n\t\t\"project_state\"=>$request->input('project_state'),\n\t\t\"project_city\"=>$request->input('project_city'),\n\t\t\"project_address\"=>$request->input('project_address'),\n\t\t\"client_name\"=>$request->input('client_name'),\n\t\t\"client_designation\"=>$request->input('client_designation'),\n\t\t\"client_phoneno\"=>$request->input('client_phoneno'),\n\t\t\"client_emailid\"=>$request->input('client_emailid'),\n\t\t\"client_state\"=>$request->input('client_state'),\n\t\t\"client_city\"=>$request->input('client_city'),\n\t\t//\"ve_images\"=>json_encode($imagename),\n\t\t\"ve_vehicle_rc\"=>$d_vechile_rc,\n\t\t\"ve_insurance\"=>$d_insurance,\n\t\t\"ve_road_tax\"=>$d_road_tax,\n\t\t\"ve_road_permit\"=>$d_road_permit,\n\t\t\"ve_fitness\"=>$d_fitness,\n\t\t\"upload_rental_contract\"=>$file_name2,\n\t\t);\n\t\t\n\t\n\t\t\n // vendorequipmendetails::create($values_details);\n\t\t\tDB::table('vendorequipmendetails')\n\t\t\t->where('ve_id', $main_id)\n\t\t\t->update($values_details);\n\t\t\n\t\t\n\t\t\n\t\t$loan_details = array(\n\t\t\t\t\t\t\t\t\"bank_name\"=>$request->input('bank_name'),\n\t\t\t\t\t\t\t\t\"bank_location\"=>$request->input('bank_location'),\n\t\t\t\t\t\t\t\t\"total_loan_amount\"=>$request->input('total_loan_amount'),\n\t\t\t\t\t\t\t\t\"total_loan_amount_type\"=>$request->input('total_loan_amount_type'),\n\t\t\t\t\t\t\t\t\"loan_period\"=>$request->input('loan_period'),\n\t\t\t\t\t\t\t\t\"loan_start_date\"=>$request->input('loan_start_date'),\n\t\t\t\t\t\t\t\t\"loan_end_date\"=>$request->input('loan_end_date'),\n\t\t\t\t\t\t\t\t\"emi_amount\"=>$request->input('emi_amount'),\n\t\t\t\t\t\t\t\t\"emi_amount_type\"=>$request->input('emi_amount_type'),\n\t\t\t\t\t\t\t\t\"emi_last_date\"=>$request->input('emi_last_date'),\n\t\t\t\t);\n\tDB::table('vendorequipment_loans')\n\t\t\t->where('ve_id', $main_id)\n\t\t\t->update($loan_details);\n\n return redirect('/vendorequipment');\n }", "public function edit(Technology $technology)\n {\n //\n }", "public function setProduct(Product $product);", "public function testDestiny2EquipItems()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function assign($spec, $value = null);", "public function store(EquipmentRequest $request)\n {\n $input = $request->all();\n $input['id'] = GanticHelper::gen_uuid();\n $input['install_date'] = $request->get('install_date') ? date('Y-m-d', strtotime($input['install_date'])) : null;\n $input['last_repair_date'] = $request->get('last_repair_date') ? date('Y-m-d', strtotime($input['last_repair_date'])) : null;\n $input['added_by'] = Session::get('currentUserID');\n Equipment::create($input);\n if (@$request->get('child_equipment_id')) {\n $child_equipment_id = $request->get('child_equipment_id');\n $child_equipment_id_details['child_equipment_id'] = $input['id'];\n $child_equipment_id_details['equipment_id'] = $child_equipment_id;\n EquipmentChild::create($child_equipment_id_details);\n }\n if ($input['btn_value'] == 1) {\n return Redirect::route($this->route)->with($this->success, trans($this->createmsg));\n }\n if ($input['btn_value'] != 1) {\n return Redirect::action('EquipmentController@edit', [$input['btn_value']])->with($this->success, trans($this->createmsg));\n }\n\n }", "public function edit(JIndustrySpecialization $jIndustrySpecialization)\n {\n //\n }", "public function set($identifier, $participation);", "public function setElUnit($elUnit) {\n $this->cElUnit = $elUnit;\n \n }", "public function setPromotion(?PromotionInterface $promotion): void\n {\n }" ]
[ "0.7307018", "0.67316765", "0.64434934", "0.63210505", "0.6241121", "0.6241121", "0.6099168", "0.6065673", "0.5974956", "0.58432096", "0.5737236", "0.5658813", "0.56544924", "0.56105804", "0.5593093", "0.5544235", "0.5533005", "0.5448461", "0.5375866", "0.5354048", "0.53041476", "0.5189272", "0.5169238", "0.5149945", "0.51280975", "0.50616044", "0.50548506", "0.5052935", "0.50421065", "0.50212204", "0.5002231", "0.49963143", "0.4994629", "0.4993561", "0.49790156", "0.49662867", "0.49097973", "0.49027497", "0.48989967", "0.48910886", "0.48799297", "0.48754847", "0.48742706", "0.4873649", "0.48652217", "0.4828014", "0.482485", "0.481966", "0.48169088", "0.48164126", "0.4805687", "0.47928488", "0.47928488", "0.4790204", "0.47617367", "0.47551763", "0.47374415", "0.47279957", "0.47008502", "0.46990886", "0.46830094", "0.46689877", "0.46578807", "0.46247515", "0.4622166", "0.4608044", "0.45883265", "0.45568493", "0.45421624", "0.4538735", "0.45232555", "0.45211732", "0.45176944", "0.4496394", "0.44963795", "0.4485981", "0.44697154", "0.44660062", "0.44639295", "0.44635242", "0.44535983", "0.44378138", "0.4437001", "0.44287053", "0.44240823", "0.4423201", "0.4420479", "0.442008", "0.44133565", "0.4411467", "0.44089177", "0.44047076", "0.43983632", "0.43962854", "0.43906504", "0.43866625", "0.43808278", "0.4380136", "0.4373848", "0.43718648" ]
0.7188809
1
Returns value of 'equipment' property
public function getEquipment() { $value = $this->get(self::EQUIPMENT); return $value === null ? (integer)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEquipmentRef()\n {\n return $this->equipmentRef;\n }", "public function get_equipment_type();", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function getEquipmentName()\n {\n return isset($this->EquipmentName) ? $this->EquipmentName : null;\n }", "public function getEquipment()\n {\n return $this->hasOne(Equipment::className(), ['id' => 'equipment_id']);\n }", "public function getCharacterEquipment() {\n return $this->characterEquipment;\n }", "public function getEquipmentCode()\n {\n return isset($this->EquipmentCode) ? $this->EquipmentCode : null;\n }", "public function equipment() {\n\t\treturn $this->belongsTo(Equipment::class, 'equipment_id');\n\t}", "public function getEquipmentDamageType()\n {\n return $this->equipmentDamageType;\n }", "public function quoteGetEquipmentAction()\n {\n \t$this->_helper->layout()->disableLayout();\n \t\n \t$this->view->quoteId = $this->_request->getParam('id');\n \t$this->view->equipments = array();\n \tif (!empty($this->view->quoteId)) {\n \t\t$db = Zend_Registry::get('db');\n \t\t$equipment = $db->fetchOne(\"SELECT equipment FROM quotes WHERE id = {$this->view->quoteId}\");\n \t\tif (!empty($equipment)) {\n \t\t\t$equipment = Zend_Json::decode($equipment, true);\n \t\t\tif (count($equipment)) {\n \t\t\t\tforeach ($equipment as $key => $step) {\n \t\t\t\t\t$eqName = $db->fetchOne(\"SELECT name FROM equipments WHERE id = {$step['equipment_id']}\");\n \t\t\t\t\t$tmpArr = array();\n \t\t\t\t\t$tmpArr['key'] = $key;\n \t\t\t\t\t$tmpArr['name'] = $eqName;\n \t\t\t\t\t$tmpArr['quantity'] = $step['quantity'];\n \t\t\t\t\t$tmpArr['extra'] = $step['extra'];\n \t\t\t\t\t\n \t\t\t\t\tif ($tmpArr['extra'] === 'yes') {\n \t\t\t\t\t\t$tmpArr['extra'] = 'W/ dealer';\n \t\t\t\t\t} elseif ($tmpArr['extra'] === 'no') {\n \t\t\t\t\t\t$tmpArr['extra'] = 'W/O dealer';\n \t\t\t\t\t} else {\n \t\t\t\t\t\t$tmpArr['extra'] .= ' hours';\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\t$this->view->equipments[] = $tmpArr;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }", "public function getCoEquipo()\n\t{\n\t\treturn $this->co_equipo;\n\t}", "public function getEquipmentStatusId()\n\t{\n\t return $this->equipmentStatusId;\n\t}", "public function getSpecialEquipPref()\n {\n return $this->specialEquipPref;\n }", "public function equipment()\n {\n return view('site_preparation.equipment');\n }", "public function getEquipmentInfo(){\n \treturn array(\n \t\t'code' => 'CF8222', \n \t\t'name' => 'Celltac F Mek 8222', \n \t\t'description' => 'Automatic analyzer with 22 parameters and WBC 5 part diff Hematology Analyzer',\n \t\t'testTypes' => array(\"Full Haemogram\", \"WBC\")\n \t\t);\n }", "public function getServiceEquipment(): ?array\n {\n return $this->serviceEquipment;\n }", "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 hasEquipment()\n {\n return $this->get(self::EQUIPMENT) !== null;\n }", "public function getPropertyDetails(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Model\\Attributes' );\n }", "public function equip_type()\n {\n return $this->hasOne(ReferenceProperty::class, 'id', 'equip_type_reference_id');\n }", "public function getWearEquipReply()\n {\n return $this->get(self::_WEAR_EQUIP_REPLY);\n }", "public function getEquipmentDepartment()\n {\n return $this->hasOne(Equipment::className(), ['equipment_department' => 'equipment_department']);\n }", "private static function getArmor(): array\n {\n return [\n PlayerEquipment::create('No armor', 0, 0, 0),\n\n PlayerEquipment::create('Leather', 13, 0, 1),\n PlayerEquipment::create('Chainmail', 31, 0, 2),\n PlayerEquipment::create('Splintmail', 53, 0, 3),\n PlayerEquipment::create('Bandedmail', 75, 0, 4),\n PlayerEquipment::create('Platemail', 102, 0, 5),\n\n ];\n }", "public function getHealth()\t\t\t\t\t{ return (string)$this->charXMLObj->characterTab->characterBars->health->attributes()->effective; }", "public function &getValue()\n {\n return $this->getChildren()->getControl($this->name . '_items', true)->getValue();\n }", "function get_equipment($equipment_id){\n $equipment_index = get_equipment_index();\n\n if(!array_key_exists($equipment_id, $equipment_index)){\n return new Unequipped();\n }\n return new $equipment_index[$equipment_id]();\n }", "public function getEnergyAttribute()\n {\n $energy = 0;\n\n if (! empty($this->attributes['energy'])) {\n $energy = $this->attributes['energy'];\n }\n\n $produced = round(\n $this->production_rate / 3600 * Carbon::now()->diffInSeconds($this->last_energy_changed)\n );\n\n return $energy + $produced;\n }", "public function show($company_id, $equipment_id, CompanyEquipment $equipment)\n {\n return response()->json($equipment);\n }", "public function getToolAttribute()\n {\n\n return $this->tools->first();\n }", "public function setEquipment($value)\n {\n return $this->set(self::EQUIPMENT, $value);\n }", "public function armor() {\r\n\t\tif ($this->isPlating()) {\r\n\t\t\treturn $this->techData['armor'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "public function show(Request $request) {\n return response()->json(Equipment::find($request->equipment_id));\n }", "public function getValue(){\n return $this->getData();\n }", "public function product()\n {\n return $this->m_product;\n }", "public function equipment_type(){\n\t\t\t$equip_type_qry = $this->db->prepare(\"SELECT * FROM truck_type WHERE status = '1'\");\n\t\t\t$equip_type_qry->execute();\n\t\t\t$fetch= array();\n\t\t\twhile($equip_type_row = $equip_type_qry->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$fetch[]=$equip_type_row;\n\t\t\t}\n\t\t\treturn $fetch;\n\t\t}", "public function show(Equipment $equipment)\n {\n return view('admin.institutes.equipments.show', compact( 'equipment') );\n }", "public function getProdAircraftreg()\n {\n return $this->prod_aircraftreg;\n }", "public function getValue()\n\t{\n\t\treturn $this->data['value'];\n\t}", "public function show(Equipment $equipment)\n {\n $equipment = Equipment::find($equipment->id);\n return view('admin.equipment.show', array('user' => Auth::user()), compact('equipment'));\n }", "public function edit(Equipment $equipment)\n {\n //\n }", "public function getValue() {\n\t\treturn $this -> value;\n\t}", "public function manufacturer()\n {\n return $this->belongsTo(EquipmentManufacturer::class);\n }", "public function equipments() {\n return $this->belongsToMany('Rockit\\Models\\Equipment', 'attributions')->withTrashed()\n ->withPivot('quantity', 'cost');\n }", "public function getValue(){\n \treturn $this->value;\n }", "public function getValue() {\n\t\treturn $this->data[\"value\"];\n\t}", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "public function getProduct() {\n return $this->getValueOrDefault('Product');\n }", "public function getTxNombreEquipo()\n\t{\n\t\treturn $this->tx_nombre_equipo;\n\t}", "public function getTxFunsionEquipo()\n\t{\n\t\treturn $this->tx_funsion_equipo;\n\t}", "public function getValue(){\n return $this->value;\n }", "public function getValue(){\n return $this->value;\n }", "public function getProperty();", "public function getValue()\n {\n\treturn $this->value;\n }", "public function get_weapons() {\n return $this->get_items_by_type(static::$WEAPONS);\n }", "public function getValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}", "public function setEquipment($value) {\n if (empty($value))\n throw new InvalidArgumentException('An equipment cannot be empty');\n if (strlen($value) > 64)\n throw new Exception('An equipment cannot be longer than 64 characters');\n $this->equipment = $value;\n return $this;\n\t}", "public function getEquipo(){\n\t\t$result= $this->Lecturas->getEquipo();\n\t\techo json_encode($result);\n\t}", "function getValue(){\r\n\t\treturn $this->value;\r\n\t}", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {\n return $this->value;\n }", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue() {}", "public function getValue()\n {\n\t\treturn $this->value;\n\t}", "public function getManufacturer()\n {\n }", "public function getHotel()\n {\n return $this->hotel;\n }", "public function getValue(){\n return $this->_value;\n }", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue()\r\n {\r\n return $this->value;\r\n }", "public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}", "public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}", "function getValue() {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }", "public function getValue()\n {\n return $this->value;\n }" ]
[ "0.75044477", "0.74099183", "0.725311", "0.725311", "0.71265334", "0.7118596", "0.7004367", "0.68406177", "0.6401796", "0.6281171", "0.62010264", "0.6175649", "0.61753607", "0.6145305", "0.6131653", "0.5876235", "0.5874623", "0.58564734", "0.5812939", "0.57632977", "0.5735072", "0.5691635", "0.5640271", "0.5635729", "0.5605943", "0.56006217", "0.5585734", "0.5568531", "0.5538927", "0.5523065", "0.5495938", "0.5463637", "0.54505056", "0.54077476", "0.53951645", "0.537842", "0.5376044", "0.5367561", "0.5365683", "0.5362769", "0.5351347", "0.53280944", "0.5326606", "0.53221625", "0.5319907", "0.53143877", "0.53143877", "0.53135556", "0.53079087", "0.5306944", "0.53029275", "0.53029275", "0.52854466", "0.5274458", "0.5273876", "0.52655846", "0.52619606", "0.52607805", "0.52594155", "0.5258282", "0.5258282", "0.5258282", "0.5255629", "0.5255629", "0.5255629", "0.5255629", "0.5255629", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.5255199", "0.52543473", "0.5251801", "0.52421", "0.5241991", "0.524186", "0.524186", "0.524186", "0.524186", "0.524186", "0.524186", "0.52392095", "0.52286977", "0.52286977", "0.5228053", "0.5226034", "0.5226034", "0.5226034", "0.5226034", "0.5226034" ]
0.78620464
0
Returns true if 'equipment' property is set, false otherwise
public function hasEquipment() { return $this->get(self::EQUIPMENT) !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasEquipmentingItem()\n {\n return count($this->get(self::EQUIPMENTING_ITEM)) !== 0;\n }", "public function isEquipped() {\n return in_array(true, $this->equipped);\n }", "protected function checkEquipped()\r\n\t{\r\n\t\t$check = $this->db->getone(\"select count(*) as `count` from `player_items` where `type`=? and `player`=? and `equipped`=1\", array($this->item['type'], $this->item['player']));\r\n\t\t\r\n\t\tif ($check == 0)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function hasTowerinfo(){\n return $this->_has(1);\n }", "public function issetEquipmentRef($index)\n {\n return isset($this->equipmentRef[$index]);\n }", "public function hasOccupancy()\n {\n return $this->occupancy !== null;\n }", "public function getHasDetailsToBookProperty(){\n return $this->state['service'] && $this->state['employee'] && $this->state['time'];\n \n }", "public function hasMaterial() : bool;", "public function get_equipment_type();", "public function getEquipment()\n {\n return $this->hasOne(Equipment::className(), ['id' => 'equipment_id']);\n }", "public function isUsable(){\n return ($this->isValid() && $this->isEnabled() && !$this->isDeleted());\n }", "public function isExpert(): bool\n {\n return (bool) $this->_getEntity()->isExpert();\n }", "public function hasInfo()\n {\n return !empty($this->info) || !empty($this->seat);\n }", "public function issetMovementType(): bool\n {\n return isset($this->movementType);\n }", "public function hasResistance()\n {\n return $this->resistance !== null;\n }", "public function hasChip(): bool\n {\n return (bool) $this->getChipId();\n }", "public function hasItemQualitySet()\n {\n return $this->item_quality_set !== null;\n }", "public function valid()\n {\n return isset($this->drivers[$this->key()]);\n }", "public function hasInitialInventory()\n {\n return $this->initial_inventory !== null;\n }", "public function isInInventorySection() {\n if (Mage::app()->getRequest()->getParam('inventoryplus') == '1') {\n return true;\n }\n return false;\n }", "public function hasProduct()\n {\n return $this->Product !== null;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function valid(){\n return isset($this->items[$this->key()]);\n }", "public function equipment() {\n\t\treturn $this->belongsTo(Equipment::class, 'equipment_id');\n\t}", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasOptItem(){\n return $this->_has(2);\n }", "public function hasActivePokemon()\n {\n return $this->ActivePokemon !== null;\n }", "public function getCharacterEquipment() {\n return $this->characterEquipment;\n }", "public function hasAutomotive()\n {\n return $this->automotive !== null;\n }", "public function allow_inventory_access(){\n if (!empty($this->flags['player_battle'])){ return false; }\n elseif (!empty($this->flags['challenge_battle'])){ return false; }\n return true;\n }", "public function reserved(){\n\n return $this->attributes['status'] == 1;\n\n }", "public function hasArtifacts(): bool {\n return $this->fetchInventory()->filter(function ($slot) {\n return $slot->item->type === 'artifact' && $slot->equipped;\n })->isNotEmpty();\n }", "public function equipmentAvailable($equipmentId, $reservationId){\n\n $LoanContractMapper = new LoanContractMapper();\n $LoanContract = $LoanContractMapper->findByReservationId($reservationId);\n\n /**\n * @var $LoanedEquipment LoanedEquipment\n */\n foreach ($this->getLoanedEquipment() as $LoanedEquipment) {\n // If the equipment belongs to this reservation, consider it not taken\n if($LoanContract != null){\n if($LoanedEquipment->getLoanContractId() == $LoanContract->getLoanContractiD()){\n continue;\n }\n }\n\n // if we found the equipment\n if ($equipmentId == $LoanedEquipment->getEquipmentId()) {\n return false;\n }\n }\n\n return true;\n }", "public function hasExperiment(){\n return $this->_has(2);\n }", "public function hasAttr(){\n return (is_array($this->attr) && !empty($this->attr));\n }", "public function isAvailable()\n {\n return $this->getTypeInstance(true)->isSalable($this)\n || Mage::helper('catalog/product')->getSkipSaleableCheck();\n }", "public function isMandatory() {\n\t\t$this->getMandatory();\n\t}", "public function isGotPromotion()\n {\n return $this->promotion->checkCondition()?true:false;\n }", "public function hasMaconomyId(): bool\n {\n return !empty($this->data['instancekeyField']);\n }", "public function valid()\n {\n return isset($this->items[$this->k]);\n }", "public function hasItemRaritySet()\n {\n return $this->item_rarity_set !== null;\n }", "public function isSetValueActive() {}", "public function valid()\n {\n\n if ($this->container['warehouse_id'] === null) {\n return false;\n }\n if ($this->container['lob_id'] === null) {\n return false;\n }\n if ($this->container['sku'] === null) {\n return false;\n }\n if ($this->container['location_id'] === null) {\n return false;\n }\n if ($this->container['quantity'] === null) {\n return false;\n }\n if ($this->container['weight_per_wrap'] === null) {\n return false;\n }\n return true;\n }", "public function valid()\n {\n return !!current($this->properties);\n }", "public function hasDamageaddper(){\r\n return $this->_has(33);\r\n }", "public function hasItemdata(){\n return $this->_has(22);\n }", "public function hasCombatStatus(){\r\n return $this->_has(2);\r\n }", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function valid()\n {\n\n $allowed_values = $this->getCapacityValueUomNameAllowableValues();\n if (!in_array($this->container['capacity_value_uom_name'], $allowed_values)) {\n return false;\n }\n $allowed_values = $this->getUnitValuesUomNameAllowableValues();\n if (!in_array($this->container['unit_values_uom_name'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function hasDamageaddper(){\r\n return $this->_has(30);\r\n }", "public function hasItemQuality()\n {\n return $this->item_quality !== null;\n }", "public function getEquipmentRef()\n {\n return $this->equipmentRef;\n }", "public function hasSeat()\n {\n return !empty($this->seat);\n }", "public static function isApplicable(): bool;", "public function getCanShipPartiallyItem();", "public function getAvailable() : bool\n {\n return $this->available;\n }", "public function valid()\n {\n\n if ($this->container['sku'] === null) {\n return false;\n }\n return true;\n }", "public function hasOption(){\n return $this->_has(35);\n }", "public function isUsedInAssessments(){\n return ($this->assessments == 1);\n }", "public function isSalable()\n {\n Mage::dispatchEvent('catalog_product_is_salable_before', array(\n 'product' => $this\n ));\n\n $salable = $this->isAvailable();\n\n $object = new Varien_Object(array(\n 'product' => $this,\n 'is_salable' => $salable\n ));\n Mage::dispatchEvent('catalog_product_is_salable_after', array(\n 'product' => $this,\n 'salable' => $object\n ));\n return $object->getIsSalable();\n }", "public function hasItemid(){\n return $this->_has(11);\n }", "public function hasOpal() {\n return $this->_has(25);\n }", "public function isEtablissementActif(): bool{\n return true;\n }", "public function isApplicable();", "public function issetProductDescription(): bool\n {\n return isset($this->productDescription);\n }", "public function issetProductDescription(): bool\n {\n return isset($this->productDescription);\n }", "public function productExist()\n {\n if ($this->product) {\n $ret = true;\n } else {\n $ret = false;\n }\n \n return $ret;\n }", "public function issetQuantity(): bool\n {\n return isset($this->quantity);\n }", "public function hasGuardPokemonId()\n {\n return $this->GuardPokemonId !== null;\n }", "public function hasPeteat(){\n return $this->_has(6);\n }", "public function hasExperimentInfos(){\n return $this->_has(2);\n }", "public function hasObjectives() {\n return $this->_has(8);\n }", "public function hasPromotion()\n {\n if($this->promotion instanceof PromotionInterface){\n return true;\n }\n return false;\n }", "function is_item_enabled() {\n\t\tif (get_post_meta($this->id, '_apptivo_enabled', true)=='yes') return true;\n\t\treturn false;\n\t}", "private function _exists() {\n // taky typ uz existuje ?\n $id = $this->equipment->getID();\n if ($id > 0) {\n $this->flash(\"Také vybavenie už existuje.<br/>Presmerované na jeho editáciu.\", \"error\");\n $this->redirect(\"ape/equipment/edit/$id\");\n }\n }", "public function hasItemid(){\n return $this->_has(13);\n }", "public function hasAvailableHotels()\n {\n return ($this->hotelCount > 0);\n }", "public function hasMovementType()\n {\n return $this->movement_type !== null;\n }", "public function hasProbs(){\n return $this->_has(1);\n }", "public function valid(): bool\n {\n return key($this->drivers) !== null;\n }", "public function hasArticulations()\n {\n return ($this->articulations->count()) ? true : false;\n }", "public function valid()\n {\n $map = $this->__getSerialisablePropertyMap();\n $mapKeys = array_keys($map);\n return isset($mapKeys[$this->iteratorPosition]);\n }", "public function valid()\n {\n $allowed_values = [\"Purchase\", \"Adjustment\", \"Transfer\"];\n if (!in_array($this->container['procurement_type'], $allowed_values)) {\n return false;\n }\n return true;\n }", "public function hasProfession(){\n return $this->_has(20);\n }", "public function issetUnitOfMeasure(): bool\n {\n return isset($this->unitOfMeasure);\n }", "function valid()\n {\n if (isset($this->aid))\n return true;\n else\n return false;\n }", "function exists() {\n\t\t$ret = (bool) (\n\t\t\t$this->getAddLine1() ||\n\t\t\t$this->getAddLine2() ||\n\t\t\t$this->getTown() ||\n\t\t\t$this->getPostalCode() ||\n\t\t\t$this->getLat() ||\n\t\t\t$this->getLng()\n\t\t);\n\t\treturn $ret;\n\t}", "public function getIsEletiva()\n {\n return $this->isEletiva;\n }", "public function hasObjectives() {\n return $this->_has(9);\n }", "public function hasItemLevelSet()\n {\n return $this->item_level_set !== null;\n }", "public function valid()\n {\n\n if ($this->container['incrementId'] === null) {\n return false;\n }\n if ($this->container['entityId'] === null) {\n return false;\n }\n if ($this->container['orderId'] === null) {\n return false;\n }\n if ($this->container['orderIncrementId'] === null) {\n return false;\n }\n if ($this->container['storeId'] === null) {\n return false;\n }\n if ($this->container['customerId'] === null) {\n return false;\n }\n if ($this->container['dateRequested'] === null) {\n return false;\n }\n if ($this->container['customerCustomEmail'] === null) {\n return false;\n }\n if ($this->container['items'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['comments'] === null) {\n return false;\n }\n if ($this->container['tracks'] === null) {\n return false;\n }\n return true;\n }", "function is_valid() {\n\t\treturn $this->_request_data($this->_existance_action, null, 'xml', true);\n\n\t}", "public function valid()\n {\n if ($this->container['priority'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n if ($this->container['stop_if_true'] === null) {\n return false;\n }\n if ($this->container['above_average'] === null) {\n return false;\n }\n if ($this->container['color_scale'] === null) {\n return false;\n }\n if ($this->container['data_bar'] === null) {\n return false;\n }\n if ($this->container['formula1'] === null) {\n return false;\n }\n if ($this->container['formula2'] === null) {\n return false;\n }\n if ($this->container['icon_set'] === null) {\n return false;\n }\n if ($this->container['operator'] === null) {\n return false;\n }\n if ($this->container['style'] === null) {\n return false;\n }\n if ($this->container['text'] === null) {\n return false;\n }\n if ($this->container['time_period'] === null) {\n return false;\n }\n if ($this->container['top10'] === null) {\n return false;\n }\n if ($this->container['link'] === null) {\n return false;\n }\n return true;\n }", "public function hasChargingIdentity(): bool\n {\n return $this->has(ChargingIdentityAttributeValue::OID);\n }", "public function hasItemtype(){\n return $this->_has(40);\n }" ]
[ "0.7230235", "0.71762776", "0.62670135", "0.6013654", "0.59173244", "0.5907857", "0.5862923", "0.58472854", "0.5783906", "0.57758063", "0.5743426", "0.5733208", "0.5728458", "0.5723166", "0.5713287", "0.5712821", "0.56873256", "0.56662446", "0.5652115", "0.5634654", "0.5616129", "0.56129605", "0.5603988", "0.5603988", "0.5595345", "0.55885094", "0.55885094", "0.55885094", "0.55885094", "0.55885094", "0.5572086", "0.55681753", "0.55227363", "0.5520319", "0.55171317", "0.55125594", "0.5509674", "0.55082476", "0.5499537", "0.54878795", "0.5460418", "0.54423803", "0.54342926", "0.5427743", "0.5425424", "0.54130995", "0.5409087", "0.5403182", "0.53959846", "0.5395336", "0.5395115", "0.53859806", "0.53717333", "0.5369996", "0.5368968", "0.5367134", "0.53655905", "0.5357952", "0.5354864", "0.5354323", "0.5340377", "0.5329352", "0.53280866", "0.53131336", "0.53124297", "0.53073233", "0.53048354", "0.5297096", "0.52948385", "0.5290155", "0.5290155", "0.52841604", "0.5281146", "0.52799606", "0.5277986", "0.5277083", "0.52650046", "0.5262159", "0.5260134", "0.52595234", "0.52526104", "0.525195", "0.5248637", "0.52466965", "0.52446663", "0.5239704", "0.5234828", "0.52325684", "0.52318263", "0.522747", "0.5227208", "0.5217654", "0.52159786", "0.5204108", "0.520174", "0.519878", "0.51952153", "0.5193327", "0.5190784", "0.518785" ]
0.8513972
0
Sets value of 'login_type' property
public function setLoginType($value) { return $this->set(self::LOGIN_TYPE, $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAuthenticationType( $type ) {\n\t\t$this->_mAuthenticationType = $type;\n\t}", "public function getLoginType()\n {\n $value = $this->get(self::LOGIN_TYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function setLogin($login);", "public function setUserType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function setLogin($login)\n {\n $this->login = $login;\n }", "public function setLogin(string $login): void\n {\n }", "public function setRoleLogin($value)\n {\n $this->role_login = $value;\n }", "public function _setLogin($Login)\n {\n $this->Login = $Login;\n\n }", "function getLoginUserType()\n {\n if (evo()->isFrontend() && evo()->session('webValidated')) {\n return 'web';\n }\n\n if (evo()->isBackend() && evo()->session('mgrValidated')) {\n return 'manager';\n }\n\n return '';\n }", "function setLoginFlag($loginflag)\n\t\t{\n\t\t\t$this->loginflag = $loginflag;\n\t\t}", "public function setLogin(string $login)\n {\n $this->email = $login;\n }", "public function setLogin($Login)\n {\n $this->__set(\"login\", $Login);\n }", "public function setLogin($sLogin) {\n $this->sLogin = $sLogin;\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "public function setLogin($value)\n {\n return $this->set('Login', $value);\n }", "static function setLogin(&$rsData, $login)\n {\n $rsData['login'] = $login;\n }", "public function actionLogin($type) {\n\t\t$type = @$_GET['type'];\n\t\tif (!$type)\n\t\t\treturn $this->redirect(array('site/index'));\n\t\tYii::app()->session['type'] = $type;\n\t\t$authUrl = Yii::app()->singly->getAuthServiceUrl($this->getCallbackUrl(), $type);\n\t\t$this->redirect($authUrl);\n\t}", "private function set_login($_login)\n {\n if (!$_login) {\n throw new MonaeException('Le login est obligatoire.');\n }\n $this->_login = $_login;\n }", "function UpdateSessionUserType($user_type = NULL) {\n if (!empty($user_type))\n $this->user_type = $user_type;\n $q = \"UPDATE `\" . TblSysSession . \"` SET `user_type`='\" . $this->user_type . \"' WHERE `login`='\" . $this->login . \"'\";\n $this->db->db_Query($q);\n //echo '<br> $q='.$q.' $this->db->result='.$this->db->result;\n if (!$this->db->result)\n return false;\n return true;\n }", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function setType(String $type){\n $type = strtoupper($type);\n if(!in_array($type, self::getUserTypes())){\n throw new \\Exception('Incorrect User Type');\n }\n $this->type = constant('self::'. $type);\n }", "public function setLoginId(): void\n {\n }", "public function setLogin($value)\n {\n $this->_login = $value;\n return $this;\n }", "public function setLogin($value)\n {\n $this->_login = $value;\n return $this;\n }", "public function set_login($data){\n\t\t\tif( is_array($data) ){\n\t\t\t\tforeach($data as $i=>$v){\n\t\t\t\t\t$this->set($i, $v);\n\t\t\t\t}\n\t\t\t\t$this->extend_login();\n\t\t\t}\n\t\t}", "public function hasLoginType()\n {\n return $this->get(self::LOGIN_TYPE) !== null;\n }", "public static function update_login_type($id)\n\t\t {\n SocialAccount::whereId($id)->update([\n 'updated_at' => new \\DateTime\n ]);\n\n\t\t }", "public function set_type($type)\n {\n $this->set_default_property(self::PROPERTY_TYPE, $type);\n }", "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 setType($type) {\n $this->type = $type;\n }", "public function modifyUITemplate( &$template, &$type )\n {\n if ($type == 'login')\n {\n $template->set('usedomain', false); // We do not want a domain name.\n $template->set('create', true); // Remove option to create new accounts from the wiki.\n $template->set('useemail', false); // Disable the mail new password box.\n }\n }", "public function SetType($type){\r\r\n\t\t$this->type = (string) $type;\r\r\n\t}", "function setType($type = \"\")\n\t\t{\n\t\t\t$this->type = $type;\n\t\t}", "public function checkLogin($type=''){\n\t\tif ($type == 'A'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n\t\t}else if ($type == 'P'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n\t\t}else if ($type == 'U'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n\t\t}else if ($type == 'T'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\n\t\t}\n }", "public function set_type( $type ) {\n\t\t$this->report_type = $type;\n\t\tupdate_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_TYPE_KEY, $type );\n\t}", "public function setLogin($login)\n {\n $this->login = $login;\n\n return $this;\n }", "public function checkLogin($type=''){\n \tif ($type == 'A'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n \t}else if ($type == 'P'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n \t}else if ($type == 'U'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n \t}else if ($type == 'T'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\t\t\t\n \t}\n }", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "function setType($type) {\n\t\t$this->_type = $type;\n\t}", "public function setTunnelType($type){\n\t\t$this->tunnel_type = $type;\n\t}", "public function setType($type)\r\n {\r\n $this->type = $type;\r\n }", "public function SetType($type){\r\n\t\t$this->type = (string) $type;\r\n\t}", "abstract public function createLoginService($type='');", "function setAuthType($authtype){\n $this->authType=$authtype;\n }", "function setAuthType($authtype){\n $this->authType=$authtype;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "public function setType($type) {\n $this->type = $type;\n }", "function setAuthType($authtype){\r\n\t\t$this->authType=$authtype;\r\n\t}", "public function setType($type) {\n\t\t$this->data['type'] = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->type = $type;\n\t}", "public function isLogin()\n\t{\n\t\t$type = Bn::getValue('user_type');\n\t\treturn (!empty($type));\n\t}", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType($type)\n {\n $this->type = $type;\n }", "public function setType( $type ) {\n\n\t\t$this->type = $type;\n\t}", "public function setLogin($login)\n {\n $this->login = $login;\n\n return $this;\n }", "public function setLogin($login)\n {\n $this->login = $login;\n\n return $this;\n }", "public function setLogin($login)\n {\n $this->login = $login;\n\n return $this;\n }", "public function setLogin($login)\n {\n $this->login = $login;\n\n return $this;\n }", "public function setLogin($login)\n {\n $this->login = $login;\n\n return $this;\n }", "public function setLogin($login)\n {\n $this->login = $login;\n\n return $this;\n }", "public function setLoginPromt($loginPromt)\n {\n $this->loginPromt = $loginPromt;\n }", "public function login($login,$password,$type){\r\n if($type == 1)\r\n {\r\n $user = Table::query('SELECT * FROM candidat WHERE email = :login',[':login'=>$login], true);\r\n }\r\n elseif($type == 2)\r\n {\r\n $user = Table::query('SELECT * FROM entreprise WHERE email = :login',[':login'=>$login], true);\r\n }\r\n if($user){\r\n if($user->password == ($password)){\r\n $this->session->write('dbauth',$user);\r\n return true;\r\n }else{\r\n return \"Votre mot de passe est incorrect\";\r\n }\r\n }else{\r\n return \"Votre adresse email est incorrecte\";\r\n }\r\n }", "function setType($a_type)\n\t{\n\t\t$this->il_type = $a_type;\n\t}", "public static function searchLoginType($login) {\n\t\t$user = new User();\n\t\t$keys = $user->getConfig('identification');\n\t\t$keys = is_array($keys) ? $keys : array($keys);\n\n\t\t$count = 0;\n\t\tif($keys) {\n\t\t\tforeach ($keys as $key) {\n\t\t\t\tif ($user::dbCount(array(array($key, '=', $login)))) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private function setLoginOption() {\r\n\t\t$this->options = array(\r\n\t\t\t'http' => array(\r\n\t\t\t\t'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n\t\t\t\t'method' => 'POST',\r\n\t\t\t\t'content' => http_build_query($this->data)\r\n\t\t\t),\r\n\t\t);\r\n\t}", "public function setType($type)\n {\n parent::setAttr(\"type\", $type);\n }", "private function set_log_type () {\n\t\t# check settings\n\t\t$this->log_type = $this->settings->log;\n\t}", "public function logIn($type, $username, $email) {\n $user = $this->findOAuthUser($email);\n if(!$user) {\n $this->register($type, $username, $email);\n $user = $this->findOAuthUser($email);\n }\n $login = new LoginModel();\n $login->addUserToSession($user);\n }", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setType($type)\n\t{\n\t\t$this->_type = $type;\n\t}", "public function setLogin($login)\n\t{\n\t\t$this->login = $login;\n\n\t\treturn $this;\n\t}", "function verify_login($user_type, $index_page){\n\t$user_info = isset($_SESSION['user_info']) ? unserialize($_SESSION['user_info']) : null;\n\t//echo \"info: \".var_dump($user_info);\n\n\t// if the user isn't logged in or it doesn't have the proper rights\n\tif ($user_info == null or \n\t\t$user_info->user_type != strtolower($user_type) or \n\t\t!isset($_SESSION['authorized']) or \n\t\t$_SESSION['authorized'] != 1) {\n\t\treserved_area_message($index_page);\n\t\texit();\n\t}\n\n\t// Ohterwise show the username\n\t$username = $user_info->username; \n\techo \"$user_type username: $username\";\n}", "public function setLogin($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->login !== $v || $v === 0) {\n\t\t\t$this->login = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::LOGIN;\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function set_type() {\n\n\t\t\t$this->type = 'kirki-editor';\n\n\t\t}", "public function setUploadType($type = 'image') {\r\n if (in_array($type, array('image', 'video'))) {\r\n $this->getSession()->setUploadType($type);\r\n }\r\n }", "public function setType($type)\n {\n $this['type'] = $type;\n }", "public function setClientAuthenticationType($val)\n {\n $this->_propDict[\"clientAuthenticationType\"] = $val;\n return $this;\n }", "protected function set_type() {\n\t\t$this->type = 'kirki-color';\n\t}", "function set_login ($login)\r\n {\r\n $_SESSION[\"login\"] = $login;\r\n }", "public function set_type($type)\n {\n $check = '';\n\n if (empty($type)) {\n $check = new WP_Error('forgot_type',\n __('Specify the data type to sanitize.', $this->plugin_name));\n }\n\n if (is_wp_error($check)) {\n wp_die($check->get_error_message(), __('Forgot data type.', $this->plugin_name));\n }\n\n $this->type = $type;\n }" ]
[ "0.70229393", "0.6878211", "0.68520254", "0.68094367", "0.6724743", "0.65325505", "0.6500946", "0.63951683", "0.62962353", "0.6283707", "0.625432", "0.6154072", "0.61525506", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.6132838", "0.61082625", "0.61069864", "0.6091725", "0.60792893", "0.6075839", "0.6066535", "0.6009468", "0.60038036", "0.60038036", "0.59197515", "0.59014857", "0.5897748", "0.58082294", "0.57826227", "0.5758925", "0.5709211", "0.5704609", "0.5702677", "0.569939", "0.5691149", "0.56907594", "0.5689762", "0.56759393", "0.56759393", "0.5660631", "0.56413054", "0.56407595", "0.56017274", "0.55994904", "0.55994904", "0.559773", "0.559773", "0.559773", "0.5591314", "0.5591314", "0.55865455", "0.5570982", "0.5570462", "0.5570462", "0.5558314", "0.55574125", "0.55574125", "0.55574125", "0.55574125", "0.55574125", "0.55574125", "0.55574125", "0.55574125", "0.55574125", "0.55413157", "0.55302465", "0.55302465", "0.55302465", "0.55302465", "0.55302465", "0.55302465", "0.55237013", "0.55155057", "0.5504978", "0.54999167", "0.5497944", "0.5491313", "0.54896486", "0.5476255", "0.5466568", "0.5466568", "0.5464799", "0.5462785", "0.5458682", "0.54527915", "0.5445026", "0.54023343", "0.53942806", "0.53798234", "0.5376665", "0.53621334" ]
0.7849736
0
Returns value of 'login_type' property
public function getLoginType() { $value = $this->get(self::LOGIN_TYPE); return $value === null ? (integer)$value : $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLoginUserType()\n {\n if (evo()->isFrontend() && evo()->session('webValidated')) {\n return 'web';\n }\n\n if (evo()->isBackend() && evo()->session('mgrValidated')) {\n return 'manager';\n }\n\n return '';\n }", "public function get_login_method() \n {\n return $this->login_method;\n }", "public function GetUserType(){\n\t\treturn $this->user_type;\n }", "public function checkLogin($type=''){\n \tif ($type == 'A'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n \t}else if ($type == 'P'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n \t}else if ($type == 'U'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n \t}else if ($type == 'T'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\t\t\t\n \t}\n }", "public function checkLogin($type=''){\n\t\tif ($type == 'A'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n\t\t}else if ($type == 'P'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n\t\t}else if ($type == 'U'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n\t\t}else if ($type == 'T'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\n\t\t}\n }", "public function setLoginType($value)\n {\n return $this->set(self::LOGIN_TYPE, $value);\n }", "public function hasLoginType()\n {\n return $this->get(self::LOGIN_TYPE) !== null;\n }", "public function getUserType();", "public function getUserType();", "public function getLogin()\n {\n return $this->Login;\n }", "public static function searchLoginType($login) {\n\t\t$user = new User();\n\t\t$keys = $user->getConfig('identification');\n\t\t$keys = is_array($keys) ? $keys : array($keys);\n\n\t\t$count = 0;\n\t\tif($keys) {\n\t\t\tforeach ($keys as $key) {\n\t\t\t\tif ($user::dbCount(array(array($key, '=', $login)))) {\n\t\t\t\t\treturn $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "public function getLogin()\n {\n return $this->__get(\"login\");\n }", "public function get_login() \n {\n return $this->login;\n }", "public function getType(){\n return ucfirst(array_search($this->type, self::userTypes()));\n }", "public function info_login()\r\n\t{ \r\n\t\treturn $this->login;\r\n\t}", "public function getLogin()\n {\n return $this->_login;\n }", "public function getLogin()\n {\n return $this->_login;\n }", "public function getLogin()\n\t{\n\t\treturn $this->login;\n\t}", "public function getLogin()\n\t{\n\t\treturn $this->login;\n\t}", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getLogin()\n {\n return $this->login;\n }", "public function getAuthenticationType() {\n\t\treturn $this->_mAuthenticationType;\n\t}", "function getLogin() {\n return $this->login;\n }", "public function type()\n {\n return $this->session->get('izime.type');\n }", "public function isLogin()\n\t{\n\t\t$type = Bn::getValue('user_type');\n\t\treturn (!empty($type));\n\t}", "public function loginAttribute()\n {\n return UserSettings::get('login_attribute', UserSettings::LOGIN_EMAIL);\n }", "public function loginAttribute()\n {\n return UserSettings::get('login_attribute', UserSettings::LOGIN_EMAIL);\n }", "public function getLogin()\n {\n return $this->getAttribute('login', '', 'subscriber');\n }", "public function getUserType()\n {\n return $this->userType;\n }", "function getLoggedInUserType($token)\n\t{\n\t\tglobal $db;\n\t\t$userId = $this->GetUserIdByToken($token);\n\t\tif(isset($userId))\n\t\t{\n\t\t\t$user = $db->smartQuery(array(\n\t\t\t\t\t'sql' => \"SELECT type FROM `user` WHERE `userid`=:userId;\",\n\t\t\t\t\t'par' => array('userId' => $userId),\n\t\t\t\t\t'ret' => 'fetch-assoc'\n\t\t\t));\n\t\t\treturn $user['type'];\n\t\t}\n\t\treturn false;\n\t}", "public function getUserType()\n {\n return $this->type;\n }", "public function getUserType()\n\t{\n\t\treturn $this->type;\n\t}", "function get_usertype($link,$cookiename=\"login\"){//get the type of user\n\t//debug_string(\"get_usertype\");\n $username = get_username($cookiename);\n\tif (\"\"==$username) return -1;\n\t$user = MYSQLComplexSelect($link,array(\"*\"),array(\"user\"),array(\"username='$username' limit 1\"),array(),0);\n\tif(count($user)<1) return -1;\n\t$type = $user[0]['type'];\n return $type;\n}", "public function getLogin () {\n if ($this->donnees !== null and key_exists(self::LOGIN_REF, $this->donnees)) {\n return $this->donnees[self::LOGIN_REF];\n } else {\n return \"\";\n }\n }", "function getLoginFlag()\n\t\t{\n\t\t\treturn $this->loginflag;\n\t\t}", "public function loginStatus ()\r\n {\r\n return $this->_loginStatus;\r\n }", "function getTypeUser($a_s_login) {\n\t$connect = connectDB();\n\t$select = \"SELECT id_type_utilisateur FROM guichetdb.utilisateur WHERE \";\n\t$select .= \"login = '\".$a_s_login['login'].\"'\";\n\t$result = mysqli_query($connect, $select);\n\t\n\tif ( $row = mysqli_fetch_assoc($result) ){\n\t\tdisconnectDB($connect);\n\t\treturn $row['id_type_user'];\n\t}\n}", "public static function getLogin($userType)\n {\n if ($userType == self::ID_USER_ADMIN) {\n return \\Yii::$app->params['adminEmail'];\n }\n\n return isset(self::$_logins[$userType]) ?\n self::$_logins[$userType] : false;\n }", "function checkUserType() {\n\n $userType = $this->user_model->checkUserType();\n\n return $userType;\n }", "public function get_user_type() {\n return $this->session->userdata('user_type');\n}", "public function getLoginName()\n {\n return $this->loginName;\n }", "function verify_login($user_type, $index_page){\n\t$user_info = isset($_SESSION['user_info']) ? unserialize($_SESSION['user_info']) : null;\n\t//echo \"info: \".var_dump($user_info);\n\n\t// if the user isn't logged in or it doesn't have the proper rights\n\tif ($user_info == null or \n\t\t$user_info->user_type != strtolower($user_type) or \n\t\t!isset($_SESSION['authorized']) or \n\t\t$_SESSION['authorized'] != 1) {\n\t\treserved_area_message($index_page);\n\t\texit();\n\t}\n\n\t// Ohterwise show the username\n\t$username = $user_info->username; \n\techo \"$user_type username: $username\";\n}", "function getType ()\n\t{\n\t\tswitch ( $this->get () )\n\t\t{\n\t\t\tcase self::DB_TOKEN:\n\t\t\t\treturn self::DB_TOKEN ;\n\n\t\t\tcase self::SERVICES_TOKEN:\n\t\t\t\treturn self::SERVICES_TOKEN ;\n\n\t\t\tcase self::REST_TOKEN:\n\t\t\t\treturn self::REST_TOKEN ;\n\n\t\t\tcase self::DEV_TOKEN:\n\t\t\t\treturn self::DEV_TOKEN ;\n\t\t}\n\n\t\treturn null ;\n\t}", "public function getName()\n {\n return 'user_type';\n }", "public function getStoredLogin(): string\n {\n return $this->login;\n }", "public function accountType()\n {\n return auth()->user()->account->level;\n }", "public function getUserLogin() {\n\t\treturn $this->_userLogin;\n\t}", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "public function getAuthTokenType()\n {\n return $this->authTokenType;\n }", "public function getUserLogin()\n {\n return $this->userLogin;\n }", "public function getSessionType();", "function getType()\n {\n return self::TYPE_USER;\n }", "function login_user_type(){\n\t\t$fa=$this->session->userdata('flexi_auth');\n\t\t$email=$fa['user_identifier'];\n\t\t//$this->firephp->log(\"User type for:\".$email);\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'group_id'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'email'),$email);\t\n\t\t$qres=$this->db->get('user_accounts');\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_group_fk'].\"for email=\".$email);\n\t\t\tswitch ($row['uacc_group_fk']) {\n\t\t\t case 1:\n\t\t\t return \"Parent\";\n\t\t\t case 2:\n\t\t\t return \"Student\";\n\t\t\t case 3:\n\t\t\t return \"Admin\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn NULL;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->firephp->log(\"Could not determine user group for user\");\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getAccidentType()\n {\n return $this->accidentType;\n }", "public function getAccidentType()\n {\n return $this->accidentType;\n }", "public function getType()\n {\n return \"user\";\n }", "public function getAuthType()\n {\n return $this->auth_type;\n }", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function getAccountType()\n {\n return $this->account_type;\n }", "public function getLoginProvider(): ?string {\n return $this->_loginProvider;\n }", "public function getLoginCount()\n {\n return $this->getFieldValue('loginCount');\n }", "function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}", "function userType() {\n if (isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'doctor' ) {\n\t\treturn 2;\n\t}else if(isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'patient' ) {\n return 3;\n }else if(isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'guardian' ) {\n return 4;\n }\n}", "public function userDetails()\r\n {\r\n return UserType::find(Auth::user()->type_id);\r\n }", "public function getForLogin()\n\t{\n##if @BUILDER.strLoginTableConnectionID.len##\n\t\treturn $this->byId( \"##@BUILDER.strLoginTableConnectionID s##\" );\n##else##\t\t\n\t\treturn $this->getDefault();\n##endif##\n\t}", "public function getAccType()\n {\n return $this->acc_type;\n }", "public function getUserLoginId()\n {\n if ($this->_hasVar('user_login_id')) {\n return $this->_getVar('user_login_id');\n }\n return 0;\n }", "public function getLogin()\n {\n return $this->email;\n }", "public function get_type_session($username){\r\n\r\n $info = $this->db->get_where('user', array('khojeko_username' => $username));\r\n $row = $info->row();\r\n $id = 'type';\r\n $id = $row->$id;\r\n return $id;\r\n }", "public function user_type($id){\n\t\tglobal $con;\n\t\t$query=\"SELECT * FROM user_admin WHERE id='$id' LIMIT 1\";\n\t\t$result=array();\n\t\t$user_type='';\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$user_type=$value['type'];\n\t\t}\n\t\treturn $user_type;\n\t}", "public function get_type(): string;", "public function getLogin()\n {\n return Mage::getStoreConfig('smsnotifier/main_conf/apilogin');\n\n }", "public function getLogin(): string\n {\n }", "public function getLoginUserId(){\n $auth = Zend_Auth::getInstance();\n if($auth->hasIdentity())\n {\n return $loginUserId = $auth->getStorage()->read()->id;\n }else{\n\t\t\treturn 1;\n\t\t}\n }", "public function getType()\n {\n return $this->getProperty('type');\n }", "public function loginUsername()\n {\n return property_exists($this, 'username') ? $this->username : 'email';\n }", "public function getAccountType()\n {\n return $this->accountType;\n }", "public function getLogin();", "public function getLogin();", "public function getLogin();", "public function getProfileType() {\n\t\treturn ($this->profileType);\n\t}", "public function getUserIdentifier(): string\n {\n return (string) $this->login;\n }", "public function getAuthType()\n {\n return isset($this->authType) ? $this->authType : null;\n }", "public function getPassword_login()\n {\n return $this->password_login;\n }", "public static function getUserTypeIDValue($userType)\n {\n $conn = new MySqlConnect();\n $id;\n\n $userType = $conn -> sqlCleanup($userType);\n // query the db for the value comparison\n\n $result = $conn -> executeQueryResult(\"SELECT userTypeID FROM userTypes WHERE userTypeName = '{$userType}'\");\n // use mysql_fetch_array($result, MYSQL_ASSOC) to access the result object\n while ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n // access the password value in the db\n $id = $row['userTypeID'];\n }\n $conn -> freeConnection();\n return $id;\n }", "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}", "public function get_type();", "public function getDsLogin()\n\t{\n\t\treturn $this->ds_login;\n\t}", "function getUserType(){\r\n\t\t$select = \"SELECT user_types.type FROM user_types \r\n\t\t\tLEFT JOIN users ON user_types.id = users.type\r\n\t\t\tWHERE users.id = $this->user_id\";\r\n\r\n global $pdo;\r\n $stmt = $pdo->query($select);\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\treturn $row['type'];\r\n\t}", "public function getType()\n {\n return parent::getValue('type');\n }", "function ipmiAuthTypes($type = null) {\n\t$types = array(\n\t\tIPMI_AUTHTYPE_DEFAULT => _('Default'),\n\t\tIPMI_AUTHTYPE_NONE => _('None'),\n\t\tIPMI_AUTHTYPE_MD2 => _('MD2'),\n\t\tIPMI_AUTHTYPE_MD5 => _('MD5'),\n\t\tIPMI_AUTHTYPE_STRAIGHT => _('Straight'),\n\t\tIPMI_AUTHTYPE_OEM => _('OEM'),\n\t\tIPMI_AUTHTYPE_RMCP_PLUS => _('RMCP+'),\n\t);\n\n\tif (is_null($type)) {\n\t\treturn $types;\n\t}\n\telseif (isset($types[$type])) {\n\t\treturn $types[$type];\n\t}\n\telse {\n\t\treturn _('Unknown');\n\t}\n}", "public function getLoginTime(): int\n {\n return (int) $this->_getEntity()->getLoginTime();\n }" ]
[ "0.80059314", "0.6793492", "0.6742382", "0.6737393", "0.6735452", "0.6681333", "0.6672208", "0.65750283", "0.65750283", "0.6543746", "0.65138507", "0.6499645", "0.6496774", "0.6486381", "0.6464499", "0.6442073", "0.6442073", "0.64418757", "0.64418757", "0.643004", "0.6429309", "0.6429309", "0.6429309", "0.6429309", "0.6429309", "0.6429309", "0.6429309", "0.6429309", "0.6424786", "0.6386241", "0.6359612", "0.6352773", "0.62697923", "0.62697923", "0.62656367", "0.6250438", "0.62471694", "0.6245666", "0.6194686", "0.6193314", "0.61932087", "0.61818874", "0.6175627", "0.6163049", "0.613005", "0.6126051", "0.60763335", "0.6064731", "0.6061191", "0.60325086", "0.60212", "0.59998584", "0.59898", "0.5974375", "0.59633076", "0.59597456", "0.5944333", "0.59338903", "0.59188354", "0.5903601", "0.5900426", "0.5900426", "0.5891992", "0.5869334", "0.58604014", "0.58604014", "0.58604014", "0.5858096", "0.58256125", "0.58251226", "0.5820776", "0.58203846", "0.5813182", "0.5802796", "0.5798869", "0.57876223", "0.5784251", "0.5758369", "0.5741259", "0.5736521", "0.5716562", "0.57020247", "0.5691784", "0.5680462", "0.56623286", "0.5662132", "0.5662132", "0.5662132", "0.5641795", "0.5637407", "0.5635899", "0.56326157", "0.5623949", "0.56194085", "0.5616683", "0.56149685", "0.56123793", "0.5602762", "0.5598827", "0.55962235" ]
0.85159534
0
Returns true if 'login_type' property is set, false otherwise
public function hasLoginType() { return $this->get(self::LOGIN_TYPE) !== null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isLogin()\n\t{\n\t\t$type = Bn::getValue('user_type');\n\t\treturn (!empty($type));\n\t}", "public static function isLogin() {\r\n\t\treturn (bool) Session::get('login', KumbiaAuthBase::$namespace);\r\n\t}", "function is_login ()\r\n {\r\n if (($this->get_login()) && ($this->get_id() != USER_ID_RESET_VALUE) && ($this->get_name() != USER_NAME_RESET_VALUE) && ($this->get_name() != \"\"))\r\n return TRUE;\r\n return FALSE;\r\n }", "public function isLogin(): bool;", "public function isLogin() : bool\n {\n\n\n return (bool) Session::key()->currentUser;\n\n //return $this->validate();\n\n }", "public function isLogin();", "function is_login()\n {\n }", "public function isLogin() {\n\t\treturn (empty($this->session)) ? false : $this->session->get('login', false);\n\t}", "public function is_login(){\n if (empty($this->user['userid'])){\n return false;\n }\n return true;\n }", "private function IsLoggedIn($type){\n\t\tif (!isset($this->session->userdata['logged_in'])) {\n \treturn false;\n }\n else{\n \tif($this->session->userdata['logged_in']['user_type'] == $type){\n \t\treturn true;\n \t}\n \telse{\n \t\treturn false;\n \t}\n }\n\t}", "public function is_login()\n {\n $name=Session::get(\"username\");\n if($name)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }", "function checkAuth($type, $username, $password)\n {\n if (!$_MIDCOM->authentication->is_user())\n {\n if (!$_MIDCOM->authentication->login($username, $password))\n {\n return false;\n }\n }\n return true;\n }", "protected function isLogin()\n {\n $skey = \\Web\\Config\\Auth::$prefix . $this->sessionId;\n if (\\Web\\Config\\Auth::$username != $this->gdata($skey)) {\n return false;\n }else{\n $this->gexpire($skey, \\Web\\Config\\Auth::$expire);\n return true;\n }\n }", "public function isLogin($pn){//仅用于判断是否登录状态\r\n if(isset($this->IS_LOGINED[$pn])){\r\n return $this->IS_LOGINED[$pn];\r\n }else{\r\n return false;\r\n }\r\n }", "function getLoginFlag()\n\t\t{\n\t\t\treturn $this->loginflag;\n\t\t}", "public function userWantsToLogin(){\n\t\tif(isset($_POST[self::$login]) && trim($_POST[self::$password]) != '' && trim($_POST[self::$name]) != '') {\n\t\t\t$this->username = $_POST[self::$name];\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getLoginType()\n {\n $value = $this->get(self::LOGIN_TYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function hasLogin(){\r\n\r\n $auth = new AuthenticationService();\r\n\r\n if ($auth->hasIdentity()) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "public function hasLogin()\r\n\t{\r\n\t\treturn (!empty($this->username) && !empty($this->password));\r\n\t}", "public function login_status()\n {\n if (isset($_SESSION['user_login_status']) AND $_SESSION['user_login_status'] == 1) {\n return true;\n }\n // default return\n return false;\n }", "private function isLogin()\n {\n return Auth::user() !== null;\n }", "public function loginExists() {\n return (bool) $this->local_account;\n }", "public function checkLogin($type=''){\n\t\tif ($type == 'A'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n\t\t}else if ($type == 'P'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n\t\t}else if ($type == 'U'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n\t\t}else if ($type == 'T'){\n\t\t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\n\t\t}\n }", "private static function isLoginPOST() {\n return isset($_POST[\"LoginView::Login\"]);\n }", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public static function loginEnabled()\n\t{\n\t\treturn FALSE;\n\t}", "public function checkLogin($type=''){\n \tif ($type == 'A'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_id');\n \t}else if ($type == 'P'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_admin_privileges');\n \t}else if ($type == 'U'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_user_id');\n \t}else if ($type == 'T'){\n \t\treturn $this->session->userdata(APPNAMES.'_session_temp_id');\t\t\t\n \t}\n }", "function auth_user($type = 'general')\n\t{\n\t\tif($type != 'general' && isset($_SESSION['uid']))\n\t\t\tswitch($type)\n\t\t\t{\n\t\t\t\tcase 'webpagemanager': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'webpagemanager' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'dataentryoperator': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'dataentryoperator' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'salesmanager': \n\t\t\t\t\t\tif($_SESSION['uType'] == 'salesmanager' || $_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\tbreak;\n\t\t\t\tcase 'super':\n\t\t\t\t\t\tif($_SESSION['uType'] == 'super')\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\n\t\t\t\tdefault: return false;\n\t\t\t}\n\t\t\n\t\tif(isset($_SESSION['uid'])) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static function isLogin()\n\t{\n\t\t$session = Common::getSession();\n\n\t\tif (!$session->has(self::$sessionName)) return false;\n\t\t$sessionInfo = $session->get(self::$sessionName);\n\n\t\t$sessionInfo = self::_cookieEncrypt($sessionInfo, 'DECODE');\n\t\tif (!$sessionInfo || !$sessionInfo[1] || !$sessionInfo[3]) return false;\n\t\tif (!$userInfo = self::getUserByName($sessionInfo[1])) return false;\n\t\tif ($sessionInfo[2] != $userInfo['user_id'] || $sessionInfo[3] != $userInfo['password']) {\n\t\t\treturn false;\n\t\t}\n\t\tself::_cookieUser($userInfo);\n\t\treturn $userInfo;\n\t}", "function hasEmptyLogin()\n {\n return empty($this->login);\n }", "public function checkLogin(): bool{\n\t\treturn isset($_SESSION['user']['role']);\n\t}", "function loggedin() {return $this->login_state!=0;}", "public function is_interim_login() {\n\t\treturn ! empty( $this->data['interim_login'] );\n\t}", "function getLoginUserType()\n {\n if (evo()->isFrontend() && evo()->session('webValidated')) {\n return 'web';\n }\n\n if (evo()->isBackend() && evo()->session('mgrValidated')) {\n return 'manager';\n }\n\n return '';\n }", "static public function is_login( Request $request ){\n return 0;\n }", "public static function isLogin()\n {\n\n if ( !Session::has( 'admin' ) )\n {\n return false;\n }\n $idAdmin = Session::get( 'admin' );\n $AdminExist = Admin::find( $idAdmin );\n\n if ( !$AdminExist )\n {\n return false;\n }\n\n return true;\n }", "function user_login_status() {\n $g = get_session('user_data');\n if (!empty($g)) {\n return true;\n }\n return false;\n}", "public function canLogin()\n {\n $mssg = \"\";\n $type = Extra::COOKIE_MESSAGE_INFO;\n\n if(!$this->isEmailVerified()){\n $mssg = \"Your email is not verified. You need to verify your email to login.<form class='otp-inline-form' method='POST' action='/user/verify-email/'><input type='hidden' name='email' value='{$this->email}' /><input type='hidden' name='resend' value='' /><button class='submit'>VERIFY</button></form>\";\n Extra::setMessageCookie($mssg, $type);\n return false;\n }\n if($this->isTraderRequested()){\n $mssg = \"Your request of becoming trader is not yet reviewed. We will notify you after we have reviewed.\";\n Extra::setMessageCookie($mssg, $type);\n return false;\n }\n\n return true;\n }", "public function isLoginDataFilled()\n {\n $client = $this->Client();\n $credentials = $client->getCredentials();\n\n if (!empty($credentials['bearerToken']) || !empty($credentials['login']) || !empty($credentials['password'])) {\n return true;\n }\n\n return false;\n }", "public function isLogin() {\n\t\t\t$this->login = isset($_SESSION['sess_login']) ? $_SESSION['sess_login'] : false;\n\t\t\t$this->timeout = isset($_SESSION['sess_timeout']) ? strtotime($_SESSION['sess_timeout']) : false;\n\n\t\t\tif(!$this->login) { return false; }\n\t\t\t\n\t\t\tif($this->login && $this->login === true && (time() > $this->timeout)) {\n\t\t\t\t$_SESSION['sess_login'] = false;\n\t\t\t\t$_SESSION['sess_lockscreen'] = true;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "public static function is_login() {\n\t\treturn strpos($_SERVER['PHP_SELF'], 'wp-login.php') !== false;\n\t}", "public function areLoginMessagesEnabled() : bool{\n \treturn $this->login_message;\n }", "private function wantsToLogin() {\n\t\t$wants_to_login = false;\n\t\t// Cover default WordPress behavior\n\t\t$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';\n\t\t// And now the exceptions\n\t\t$action = isset( $_GET['loggedout'] ) ? 'loggedout' : $action;\n\t\tif ( 'login' == $action ) {\n\t\t\t$wants_to_login = true;\n\t\t}\n\t\treturn $wants_to_login;\n\t}", "public function checkUserLogin()\n {\n if (isset($_SESSION[\"user_id\"])) {\n $status = true;\n } else {\n $status = false;\n }\n return $status;\n }", "public function isLoginRequired()\r\n\t{\r\n\t\treturn true;\r\n\t}", "public function isLoginAdmin()\n\t{\n\t\treturn (Bn::getValue('loginAuth') == 'A');\n\t}", "function verify_login($user_type, $index_page){\n\t$user_info = isset($_SESSION['user_info']) ? unserialize($_SESSION['user_info']) : null;\n\t//echo \"info: \".var_dump($user_info);\n\n\t// if the user isn't logged in or it doesn't have the proper rights\n\tif ($user_info == null or \n\t\t$user_info->user_type != strtolower($user_type) or \n\t\t!isset($_SESSION['authorized']) or \n\t\t$_SESSION['authorized'] != 1) {\n\t\treserved_area_message($index_page);\n\t\texit();\n\t}\n\n\t// Ohterwise show the username\n\t$username = $user_info->username; \n\techo \"$user_type username: $username\";\n}", "function islogin()\n\t{\n\t\tif (isset($_SESSION['user']) && !empty($_SESSION['user']))\n\t\t{\n\t\t\treturn true;\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function hasValidateLogin()\n {\n return $this->validate_login !== null;\n }", "public static function isLogin() {\n\t\treturn (strtolower(basename($_SERVER[\"PHP_SELF\"])) == \"wp-login.php\");\n\t}", "public function canLoginHere()\n {\n if (! $this->_hasVar('can_login_here')) {\n $this->_setVar('can_login_here', true);\n if ($orgId = $this->userLoader->getOrganizationIdByUrl()) {\n if (! $this->isAllowedOrganization($orgId)) {\n $this->_setVar('can_login_here', false);;\n }\n }\n }\n return $this->_getVar('can_login_here');\n }", "public function check_login()\n\t{\n\t\tif($this->session->userdata('member_login_status'))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setLoginType($value)\n {\n return $this->set(self::LOGIN_TYPE, $value);\n }", "function isLogin()\n {\n if($this->ci->session->userdata('status')==1)\n {\n return true;\n }\n return false;\n }", "protected function isUserAllowedToLogin() {}", "function isLogin() {\n if( !empty( $_SESSION['is_login'] ) && $_SESSION['is_login'] == true ) {\n return true;\n } else {\n return false;\n }\n}", "private function login(): bool\n {\n $options = [\n \\GuzzleHttp\\RequestOptions::JSON => [\n $this->email,\n $this->password,\n null,\n 'iOS 11.4.1',\n 'Movil',\n 'Aplicación móvil V. 15',\n '0',\n '0',\n '0',\n null,\n 'n',\n ],\n ];\n $response = $this->client->post(self::URI_LOGIN, $options);\n\n $this->isLogged = $response->getStatusCode() === 200 ? true : false;\n return $this->isLogged;\n }", "public function loginValide () {\n $login = $this->donnees[self::LOGIN_REF];\n // Le champ login ne doit pas ?tre vide\n if ($login == null) {\n $this->erreur[self::LOGIN_REF] = \"Veuillez remplir le champ login\";\n return false;\n // Le champ login doit contenir un login pr?sent dans la base de donn?es\n } else if (! $this->utilisateurs->exist($login)) {\n $this->erreur[self::LOGIN_REF] .= \"ce login est inconnu\";\n return false;\n }\n return true;\n }", "public function loginStatus ()\r\n {\r\n return $this->_loginStatus;\r\n }", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "function isUser(){\n\t\tif(isset($_SESSION['type']) && $_SESSION['type']=='user')\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "private function checkLogin() {\n if (isset($_SESSION['login'])) {\n if ($_SESSION['login'] == true) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "public static function is_login_page() {\n\t\t\treturn in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php', ) );\n\t\t}", "public function checkLoginStatus()\n\t{\n\t\tif (isset($_SESSION[$this->sess_auth]) || isset($_SESSION[$this->sess_cookie_auth])) {\n\t\t\treturn true;\n\t\t}\n\t}", "public function showOnLoginForm(): bool {\n\t\treturn $this->show_on_login_form !== 0;\n\t}", "protected function is_logged_in() {\n\t\t\t\n\t\t\t// Get the HTML\n\t\t\t$html = $this->c->get($this->loginTestUrl)->body;\n\t\t\t\n\t\t\t// Check for the logout URL\n\t\t\tif( !strstr($html, $this->loginTestCodePresence) ) {\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}", "public function validateLogin()\n {\n $result = false;\n if (strlen($this->login) >= 5) {\n $result = true;\n }\n return $result;\n }", "public function is_logged_in() {\n\n\t}", "public function hasPersistentLogin();", "protected function needsAuthentication()\n {\n return !empty($this->authType);\n }", "public function logged_in()\n\t{\n\t\treturn $this->_me != NULL;\n\t}", "public function _check_login()\n {\n\n }", "private function compare_with_login()\n {\n }", "function cekLogin() {\n if ($this->session->userdata('login') == FALSE) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "function is_login (){ \n return (($this->CI->session->userdata('id')) ? TRUE : FALSE); //cek session\n }", "function is_login($uname)\n {\n return ($uname && $this->db->get_where('user',\n array('is_logged_in' => 1, 'username' => strtolower($uname)))->num_rows() > 0) ? 'true' : 'false';\n }", "protected function hasLoginBeenProcessed() {}", "public function isLoggedIn()\r\n {\r\n if ($this->session->has('AUTH_NAME') AND $this->session->has('AUTH_EMAIL') AND $this->session->has('AUTH_CREATED') AND $this->session->has('AUTH_UPDATED')) {\r\n return true;\r\n }\r\n return false;\r\n }", "function is_member_login() {\n\t\t$cm_account = $this->get_account_cookie(\"member\");\n\t\tif ( !isset($cm_account['id']) || !isset($cm_account['username']) || !isset($cm_account['password']) || !isset($cm_account['onlinecode']) ) {\n\t\t\treturn false;\n\t\t}\n\t\t// check again in database\n\t\treturn $this->check_account();\n\t}", "abstract protected function isSocialUser($type);", "function _verify_details($auth_type, $username, $password)\n\t{\n\t\t$query = $this->CI->db->query(\"SELECT * FROM `users` WHERE `$auth_type` = '$username' AND `password` = '$password'\");\n\t\t\n\t\tif($query->num_rows != 1)\n\t\t{\n\t\t\t$attempts = $_COOKIE['login_attempts'] + 1;\n\t\t\tsetcookie(\"login_attempts\", $attempts, time()+900, '/');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public static function verifyLogin():bool\n\t{\n\n\t\tif (\n\t\t\t!isset($_SESSION[User::SESSION])\n\t\t\t||\n\t\t\t!$_SESSION[User::SESSION]\n\t\t\t||\n\t\t\t!(int)$_SESSION[User::SESSION]['iduser'] > 0\n\t\t)\n\t\t{\n\t\t\n\t\t\treturn false;\n\t\t\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t} \n\n\t}", "public function getIsUserAttribute()\n {\n return $this->attributes['user_type'] == '3';\n }", "private function if_user_logged_in()\n {\n\n session_start();\n\n if(!empty($_SESSION)){\n\n if(isset($_SESSION[\"user_id\"]) && isset($_SESSION[\"user_type\"])){\n \n return true;\n\n }else{\n\n return false;\n }\n\n }else{\n\n return false;\n }\n }", "public function onLogin()\n {\n return true;\n }", "public function onLogin()\n {\n return true;\n }", "function is_logged_in() \n {\n return (empty($this->userID) || $this->userID == \"\") ? false : true;\n }", "final public function isAuthType($type)\n {\n return in_array($type, $this->authTypes);\n }", "function isAdminL($login) {\n\n\t\tif ($login != '' && isset($this->admin_list['TMLOGIN'])) {\n\t\t\treturn in_array($login, $this->admin_list['TMLOGIN']);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function tryLogin($username, $type, $data) {\n\t\tif ($type === \"key\") {\n\t\t\tif ($this->backup !== null) {\n\t\t\t\treturn $this->backup->tryLogin($username, $type, $data);\n\t\t\t}\n\t\t\t//Cannot currently handle key-based logins\n\t\t\treturn false;\n\t\t}\n\t\tif ($type === \"password\") {\n\t\t\t$user = $this->getUser($username);\n\n\t\t\tif ($user->id === 0) {\n\t\t\t\t//User does not exist\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ($user->guest) {\n\t\t\t\t//Cannot login guests\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ($user->block) {\n\t\t\t\tif ($user->activation !== \"\") {\n\t\t\t\t\t//You're not activated\n\n\t\t\t\t\t//TODO: Automatically activate them\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t//You're banned\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$this->checkPassword($username, $data)) {\n\t\t\t\t//Invalid password\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t//Unsupported login type\n\t\treturn false;\n\t}", "function isLogin() {\n if (isset(Yii::app()->session['adminUser'])) {\n return true;\n } else {\n Yii::app()->user->setFlash(\"error\", \"Username or password required\");\n header(\"Location: \" . Yii::app()->params->base_path . \"admin\");\n exit;\n }\n }", "function dt_is_login_page() {\n\n\treturn in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) );\n}", "public function didLogin() {\n\t\tif (isset($_POST['login'])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isLoggedIn() {\n $cookie = $this->login();\n return $cookie != NULL;\n }", "function verificalogin(){\n if(!isset($this->session->datosusu)){\n return true;\n }\n }", "public function IsLogin()\n {\n //检测是否登录,若没登录则转向登录界面\n session_start();\n if (!isset($_SESSION['permit'])) {\n // header(\"Location:login.html\");\n return 0;\n }\n return 1;\n }", "public static function getLogin($userType)\n {\n if ($userType == self::ID_USER_ADMIN) {\n return \\Yii::$app->params['adminEmail'];\n }\n\n return isset(self::$_logins[$userType]) ?\n self::$_logins[$userType] : false;\n }", "public function login($login){\n\n if($this->getUser($login) != null){\n $_SESSION[\"user\"] = $this->getUser($login);\n return true;\n }\n else{\n return false;\n }\n\n }", "public static function getLoginStatus(): bool\n\t{\n\t\tif (isset(self::$isLoggedIn)) return self::$isLoggedIn;\n\n\t\tsession_start([\n\t\t\t'name' => self::SESSION_NAME,\n\t\t\t'read_and_close' => true\n\t\t]);\n\n\t\tif (isset($_SESSION['tokens']) && count($_SESSION['tokens'])) {\n\t\t\t$token_count = count($_SESSION['tokens']);\n\t\t\t$cookie_count = 0;\n\n\t\t\tforeach ($_SESSION['tokens'] as $id => $token) {\n\t\t\t\tif (isset($_COOKIE[$id]) && $_COOKIE[$id] === $token)\n\t\t\t\t\t$cookie_count++;\n\t\t\t}\n\n\t\t\tif ($token_count === $cookie_count)\n\t\t\t\treturn self::$isLoggedIn = true;\n\n\t\t\t// if invalid credentials, clear cookies and destroy session\n\t\t\tforeach ($_COOKIE as $key => $value)\n\t\t\t\tself::setCookie($key, '');\n\n\t\t\tsession_start();\n\t\t\tsession_destroy();\n\t\t}\n\n\t\treturn self::$isLoggedIn = false;\n\t}" ]
[ "0.8238207", "0.7340925", "0.73175305", "0.725217", "0.71797585", "0.71635807", "0.7144421", "0.71410424", "0.7123025", "0.70554125", "0.6856608", "0.68060654", "0.67815334", "0.6713117", "0.6655728", "0.6654279", "0.665373", "0.66517675", "0.6650071", "0.6605547", "0.65941054", "0.65926003", "0.6591839", "0.65868235", "0.65700126", "0.65700126", "0.65700126", "0.65521276", "0.6543439", "0.6542457", "0.6528936", "0.6522387", "0.65220463", "0.6505088", "0.65028465", "0.64902824", "0.64493376", "0.6435981", "0.6418682", "0.6415757", "0.6402592", "0.63781905", "0.6368657", "0.63668656", "0.63609964", "0.63499737", "0.63353664", "0.6326579", "0.6321113", "0.62985", "0.6293473", "0.62914693", "0.6279514", "0.6261921", "0.62403494", "0.6230155", "0.61962914", "0.61940783", "0.6173707", "0.6172944", "0.61728024", "0.6158376", "0.6141837", "0.6140157", "0.6136581", "0.61260146", "0.611719", "0.6111511", "0.6107488", "0.61053866", "0.6097282", "0.6091759", "0.6086568", "0.60787237", "0.6069852", "0.6050974", "0.6031401", "0.60304815", "0.6028435", "0.60262877", "0.6023155", "0.6015913", "0.6015426", "0.60115576", "0.6010469", "0.59968036", "0.59968036", "0.59915817", "0.598357", "0.5980404", "0.5980218", "0.5979624", "0.59700686", "0.59597355", "0.59576035", "0.5956277", "0.59535885", "0.59463954", "0.5946327", "0.59462327" ]
0.8692918
0
Create a new controller instance.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Get taxonomy list with all tags of the site.
public function get() { if (null === $this->taxonomylist) { $this->taxonomylist = $this->build(Grav::instance()['taxonomy']->taxonomy()); } return $this->taxonomylist; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTaxonomiesList() {\n return $this->_get(1);\n }", "public function get_taxonomies()\n {\n $terms = get_terms(array(\n 'hide_empty' => false\n ));\n\n return $terms;\n }", "public function getTaxonomyTerms();", "public function tags()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'post_tag';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }", "public function getTaxonomies()\n {\n $taxonomies = collect($this->cache->getTaxonomies());\n\n return $taxonomies->sortBy(function ($taxonomy) {\n return $taxonomy->title();\n })->all();\n }", "public function taxonomies()\n {\n return $this->morphedByMany(\n Taxonomy::class,\n 'metable',\n 'metables',\n 'meta_id',\n );\n }", "public function all(): array\n {\n $wpTerms = get_terms(\n $this->getTaxonomy()\n );\n\n if (is_wp_error($wpTerms)) {\n wp_die($wpTerms);\n }\n\n return array_map(function (WP_Term $wpTerm): AbstractTerm {\n return TermFactory::makeByWpTerm($wpTerm);\n }, $wpTerms);\n }", "function tags_terms_list() { // list Tags taxonomy\n\twp_list_categories( array( 'style' => 'list', 'hide_empty' => 0, 'taxonomy' => 'post_tags', 'hierarchical' => true, 'title_li' => __( 'Tags' ) )); return; \n}", "public function generateTaxonomyTermList() {\n $vocab = \"sports\";\n $term_list = [];\n $terms = $this->entityTypeManager\n ->getStorage('taxonomy_term')\n ->loadTree($vocab);\n foreach ($terms as $term) {\n $term_name = $this->t('@name', ['@name' => $term->name]);\n $term_list[\"$term_name\"] = $term_name;\n }\n return $term_list;\n }", "public function getTaxonomies(): array\n {\n return $this->taxonomies;\n }", "public function getList()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$tags = parent::getList();\r\n\t\t} else {\r\n\t\t\t$tags = $this->getGroupTagsList() +\r\n\t\t\t\t$this->getMembersTagsList() +\r\n\t\t\t\t$this->getDocumentsTagsList() +\r\n\t\t\t\t$this->getEventsTagsList() +\r\n\t\t\t\t$this->getPhotosTagsList() +\r\n\t\t\t\t$this->getListsTagsList();\r\n\t\t}\r\n return $tags;\r\n }", "public function showAllTag()\n {\n $tags = $this->repository->allTag();\n return $tags;\n }", "public static function get_tags() {\n return Tag::distinct()->orderBy('name', 'asc')->get();\n }", "function get_post_meta_tags() {\n global $post;\n $list = array();\n $num = 0;\n $termsObjects = get_the_terms('', 'meta_info', '');\n if (!empty($termsObjects)){\n foreach ($termsObjects as $v) {\n $list[$num] = $v->slug;\n $num++;\n }\n }\n return($list);\n}", "public function getAllMetaTags()\n {\n return htcms_get_all_meta_tags();\n }", "protected function get_taxonomies() {\n\t\treturn apply_filters( 'appthemes_html_term_description_taxonomies', $this->taxonomies );\n\t}", "private function get_taxonomies() : array {\n\t\treturn $this->taxonomies;\n\t}", "public function findAll()\n {\n return $this->tagRepository->findAllTags();\n }", "function tc_get_the_tags() {\r\n return the_tags();\r\n}", "public function getTags() {\n\t\treturn Template::getSiteMetaTags();\n\t}", "public static function get_tags() {\n global $wpdb;\n $query = \"SELECT * FROM XTB_TAGS\";\n return $wpdb->get_results($query);\n }", "public function getTaxonomyIds()\n {\n return $this->taxonomy_ids;\n }", "function tc_tag_list() {\r\n $post_terms = apply_filters( 'tc_tag_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = false ) );\r\n $html = false;\r\n\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_tag_list_class', 'btn btn-mini btn-tag' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if\r\n return apply_filters( 'tc_tag_list', $html );\r\n }", "public function terms() {\n\t\treturn $this->terms->terms();\n\t}", "public function all_tags()\n {\n $out = [];\n $out = array_merge($out, $this->extraTags('CATEGORY'));\n\n foreach ($this->tags->find_all() as $tag) {\n $out[] = $tag;\n }\n\n return array_unique($out);\n\n }", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "function fa_get_registered_taxonomies(){\t\n\t$args = array(\n\t\t'public' => true\n\t);\n\t$taxonomies = get_taxonomies( $args );\n\t$result = array();\n\tforeach( $taxonomies as $tax => $name ){\n\t\t$tax_obj = get_taxonomy( $tax );\n\t\t// allow only categories for builtin tax\n\t\tif( $tax_obj->_builtin && ( 'category' != $tax && 'post_tag' != $tax ) ){\n\t\t\tcontinue;\n\t\t}\t\t\n\t\t$result[ $tax_obj->object_type[0] ][] = array(\n\t\t\t'taxonomy' \t=> $tax,\n\t\t\t'name'\t\t=> $tax_obj->labels->name\n\t\t);\n\t}\n\t\n\treturn $result;\t\n}", "public function getChildPagesTags()\n {\n /** @var PageInterface $current */\n $current = Grav::instance()['page'];\n $taxonomies = [];\n foreach ($current->children()->published() as $child) {\n if (!$child->isPage()) {\n continue;\n }\n foreach($this->build($child->taxonomy()) as $taxonomyName => $taxonomyValue) {\n if (!isset($taxonomies[$taxonomyName])) {\n $taxonomies[$taxonomyName] = $taxonomyValue;\n } else {\n foreach ($taxonomyValue as $value => $count) {\n if (!isset($taxonomies[$taxonomyName][$value])) {\n $taxonomies[$taxonomyName][$value] = $count;\n } else {\n $taxonomies[$taxonomyName][$value] += $count;\n }\n }\n }\n }\n }\n\n return $taxonomies;\n }", "protected function get_terms() {\n\t\t$terms = get_the_terms( $this->post_ID, $this->taxonomy_name );\n\n\t\tif ( ! is_array( $terms ) ) {\n\t\t\t$terms = [];\n\t\t}\n\n\t\treturn $terms;\n\t}", "public function getTags() {}", "public function tagNames()\n\t{\n\t\treturn $this->tags()->get()->lists('tag');\n\t}", "public function getTermsAttribute()\n {\n return $this->taxonomies->groupBy(function ($taxonomy)\n {\n return $taxonomy->taxonomy;\n\n })->map(function ($group)\n {\n return $group->mapWithKeys(function ($item)\n {\n return array($item->term->slug => $item->term->name);\n });\n\n })->toArray();\n }", "public function getTags() {\r\n\t\tif (!isset($this->tags)) {\r\n\t\t\t$this->tags = $this->tagRepository->getAllTags();\r\n\t\t}\r\n\t\treturn $this->tags;\r\n\t}", "public function UpdateTags() {\n\t\t$tags = TaxonomyTerm::get()\n\t\t\t->innerJoin('BasePage_Terms', '\"TaxonomyTerm\".\"ID\"=\"BasePage_Terms\".\"TaxonomyTermID\"')\n\t\t\t->innerJoin(\n\t\t\t\t'SiteTree',\n\t\t\t\tsprintf('\"SiteTree\".\"ID\" = \"BasePage_Terms\".\"BasePageID\" AND \"SiteTree\".\"ParentID\" = \\'%d\\'', $this->ID)\n\t\t\t)\n\t\t\t->sort('Name');\n\n\t\treturn $tags;\n\t}", "public function getAllTags()\n {\n\n $sql = \"\n\t\t\tSELECT * FROM tags\n\t\t\tORDER BY name ASC\n\t\t\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = $query->fetchAll();\n\n foreach ($result as $tag) {\n\n $this->tags[$tag['id']] = $tag['name'];\n\n }\n\n return $this->tags;\n }", "public function getTags(): Collection;", "public function index()\n {\n return Tag::all();\n }", "public function getAll(): Collection\n {\n return $this->tagRepository->getAll();\n }", "public function includedTaxonomies() {\n\t\t$taxonomies = [];\n\t\tif ( aioseo()->options->sitemap->{aioseo()->sitemap->type}->taxonomies->all ) {\n\t\t\t$taxonomies = get_taxonomies();\n\t\t} else {\n\t\t\t$taxonomies = aioseo()->options->sitemap->{aioseo()->sitemap->type}->taxonomies->included;\n\t\t}\n\n\t\tif ( ! $taxonomies ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t$options = aioseo()->options->noConflict();\n\t\t$dynamicOptions = aioseo()->dynamicOptions->noConflict();\n\t\t$publicTaxonomies = aioseo()->helpers->getPublicTaxonomies( true );\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t// Check if taxonomy is no longer registered.\n\t\t\tif ( ! in_array( $taxonomy, $publicTaxonomies, true ) || ! $dynamicOptions->searchAppearance->taxonomies->has( $taxonomy ) ) {\n\t\t\t\t$taxonomies = aioseo()->helpers->unsetValue( $taxonomies, $taxonomy );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check if taxonomy isn't noindexed.\n\t\t\tif ( aioseo()->helpers->isTaxonomyNoindexed( $taxonomy ) ) {\n\t\t\t\tif ( ! $this->checkForIndexedTerm( $taxonomy ) ) {\n\t\t\t\t\t$taxonomies = aioseo()->helpers->unsetValue( $taxonomies, $taxonomy );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t$dynamicOptions->searchAppearance->taxonomies->$taxonomy->advanced->robotsMeta->default &&\n\t\t\t\t! $options->searchAppearance->advanced->globalRobotsMeta->default &&\n\t\t\t\t$options->searchAppearance->advanced->globalRobotsMeta->noindex\n\t\t\t) {\n\t\t\t\tif ( ! $this->checkForIndexedTerm( $taxonomy ) ) {\n\t\t\t\t\t$taxonomies = aioseo()->helpers->unsetValue( $taxonomies, $taxonomy );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $taxonomies;\n\t}", "public function getTagList();", "public function terms()\n {\n return $this->hasManyThrough(\n 'Darryldecode\\Backend\\Components\\ContentBuilder\\Models\\ContentTypeTaxonomyTerm',\n 'Darryldecode\\Backend\\Components\\ContentBuilder\\Models\\ContentTypeTaxonomy',\n 'content_type_id',\n 'content_type_taxonomy_id'\n );\n }", "function getTagTypes ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/tagTypes.json\");\n return $this->createResponse($result,'get All Tag Types');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "function getTagsToOmitt() {\n\t\t$tagArray = array();\n\n\t\t// if there are tags to exclude: add them to the list\n\t\tif ($this->conf['excludeTags']) {\n\t\t\t$tagArray = GeneralUtility::trimExplode(',', $this->conf['excludeTags'], 1);\n\t\t}\n\n\t\t// if configured: add tags used by the term definitions\n\t\tif ($this->conf['autoExcludeTags'] > 0) {\n\t\t\t;\n\t\t\tforeach ($this->conf['types.'] as $key => $type) {\n\t\t\t\tif (!empty($type['tag']) && !in_array($type['tag'], $tagArray)) {\n\t\t\t\t\t$tagArray[] = $type['tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tagList = implode(',', $tagArray);\n\n\t\treturn $tagList;\n\t}", "public function getAll() {\n $select = $this->select();\n $tags = $this->fetchAll($select);\n return $tags;\n }", "public function terms()\n {\n $related = config('taxonomy.term_model');\n\n return $this->morphToMany($related, 'termable');\n }", "public function taxonomies()\n {\n return $this->hasMany(Taxonomy::class);\n }", "public static function getAll()\n\t{\n\t\t// fetch items\n\t\treturn (array) FrontendModel::getDB()->getRecords('SELECT t.tag AS name, t.url, t.number\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM tags AS t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE t.language = ? AND t.number > 0\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY number DESC, t.tag;', FRONTEND_LANGUAGE);\n\t}", "function voicewp_news_taxonomies() {\n\t$option = get_option( 'voicewp-settings' );\n\n\t$taxonomies = ( empty( $option['latest_taxonomies'] ) ) ? array() : $option['latest_taxonomies'];\n\n\t// Nonexistant taxonomies can shortcircuit get_terms().\n\treturn array_filter( $taxonomies, 'taxonomy_exists' );\n}", "public function getTermsList() {\n return $this->_get(5);\n }", "public function tags() {\n\t\treturn $this->get_tags();\n\t}", "public function get_terms() {\n return $this->terms;\n }", "public function get_terms()\n\t{\n\t\treturn $this->terms;\n\t}", "public function getTags(): array\n {\n return $this->tags;\n }", "public function getTags(): array\n {\n return $this->tags;\n }", "protected function getTags()\n {\n $tags = array_merge(\n $this->options['append_tags'],\n $this->getSubTagValues('tags', array())\n );\n\n return array_unique($tags);\n }", "public function index() {\n $tags = Tag::all();\n \treturn $tags;\n }", "public function getTermsList() {\n return $this->_get(2);\n }", "public function getVocabularyTermsList() {\n return $this->_get(2);\n }", "public function tags()\n {\n return $this->morphedByMany(Tag::class, 'bundleable');\n }", "function get_post_list($conn_ptr, $table_prefix) {\n // Get a list of post_titles and post_names and store them in an array\n $sql=\"SELECT p.ID, p.post_title, p.post_name, p.post_date, p.post_modified FROM \".$table_prefix.\"posts p \n INNER JOIN \".$table_prefix.\"term_relationships r ON r.object_id=p.ID \n INNER JOIN \".$table_prefix.\"term_taxonomy t ON t.term_taxonomy_id = r.term_taxonomy_id \n INNER JOIN \".$table_prefix.\"terms wt on wt.term_id = t.term_id \n WHERE t.taxonomy='category' AND wt.slug='\" . $GLOBALS['site_persona'] . \"' AND p.post_type='page' AND p.post_status='publish' \";\n\n $result = $conn_ptr->query($sql);\n $rows = [];\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) \n array_push($rows, $row);\n }\n\n // Enrich the array with tags\n $erows = [];\n foreach ($rows as $row) {\n $sql=\"SELECT wt.name, t.taxonomy FROM \".$table_prefix.\"posts p \n INNER JOIN \".$table_prefix.\"term_relationships r ON r.object_id=p.ID \n INNER JOIN \".$table_prefix.\"term_taxonomy t ON t.term_taxonomy_id = r.term_taxonomy_id \n INNER JOIN \".$table_prefix.\"terms wt on wt.term_id = t.term_id \n WHERE t.taxonomy='post_tag' AND p.ID='\".$row[\"ID\"].\"'\";\n \n $tags = [];\n $result = $conn_ptr->query($sql);\n if ($result->num_rows > 0) while ($wtrow = $result->fetch_assoc()) array_push($tags, $wtrow[\"name\"]);\n $row[\"post_tags\"]=$tags;\n array_push($erows, $row);\n }\n return $erows;\n}", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "public function getTags()\n {\n return $this->tags;\n }", "function get_trees()\n\t{\n\n\t\tif(!isset($this->cache['trees']))\n\t\t{\n\n\t\t\tee()->db->order_by('label', 'asc');\n\t\t\t$trees = ee()->db->get_where('taxonomy_trees', array('site_id' => $this->site_id) )->result_array();\n\t\t\t// reindex with node ids as keys\n\t\t\t$data = array();\n\t\t\tforeach($trees as $tree)\n\t\t\t{\n\t\t\t\t$data[ $tree['id'] ] = $tree;\n\t\t\t\t$data[ $tree['id'] ]['templates'] = explode('|', $tree['templates']);\n\t\t\t\t$data[ $tree['id'] ]['channels'] = explode('|', $tree['channels']);\n\t\t\t\t$data[ $tree['id'] ]['member_groups'] = explode('|', $tree['member_groups']);\n\t\t\t\t$data[ $tree['id'] ]['fields'] = ($tree['fields']) ? json_decode($tree['fields'], TRUE) : array();\n\t\t\t\t$data[ $tree['id'] ]['taxonomy'] = ($tree['taxonomy']) ? json_decode($tree['taxonomy'], TRUE) : '';\n\t\t\t}\n\n\t\t\t$this->cache['trees'] = $data;\n\n\t\t}\n\n \treturn $this->cache['trees'];\n\t}", "public function index()\n {\n $tags = Tag::paginate(25);\n\n return $tags;\n }", "public function get_term_names(){\n\t\t\n\t\t$term_objs = $this->get_terms();\n\t\t\n\t\t$terms = array();\n\t\t\n\t\tforeach( $term_objs as $term ){\n\t\t\t\n\t\t\t$terms[ $term->term_id ] = $term->name;\n\t\t\t\n\t\t} // end foreach\n\t\t\n\t\treturn $terms;\n\t\t\n\t}", "public function findAll() {\n $sql = \"select * from tags\";\n $results = $this->getDb()->fetchAll($sql);\n\n $tags = array();\n\n foreach ($results as $row) {\n $tags[] = $this->buildDomainObject($row);\n }\n return $tags;\n }", "public function index()\n {\n $resources = $this->repository->scope($this->request)->paginate();\n\n return $this->fractalCollection($resources, new TagTransformer(), 'tags');\n }", "public function getTags()\n {\n return $this->Tags;\n }", "public function getTags()\n {\n return $this->tags = get_the_tags($this->id);\n }", "function create_tag_taxonomies()\n{\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x( 'Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Tags' ),\n 'popular_items' => __( 'Popular Tags' ),\n 'all_items' => __( 'All Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Tag' ),\n 'update_item' => __( 'Update Tag' ),\n 'add_new_item' => __( 'Add New Tag' ),\n 'new_item_name' => __( 'New Tag Name' ),\n 'separate_items_with_commas' => __( 'Separate tags with commas' ),\n 'add_or_remove_items' => __( 'Add or remove tags' ),\n 'choose_from_most_used' => __( 'Choose from the most used tags' ),\n 'menu_name' => __( 'Tags' ),\n );\n\n register_taxonomy('tag','edicoesAnteriores',array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'tag' ),\n ));\n}", "public function taxonomies()\n {\n return $this->hasMany('Darryldecode\\Backend\\Components\\ContentBuilder\\Models\\ContentTypeTaxonomy','content_type_id');\n }", "public function tags(): array\n {\n return $this->tags;\n }", "public function get_tags()\r\n\t{\r\n\t\t$xml = $this->call(PicasaAPI::$QUERY_URLS['picasa'] . \"?kind=tag\");\r\n\t\treturn $xml;\r\n\t}", "public function dashboardTaxonomies()\n {\n $taxonomies = get_taxonomies($args, $output, $operator);\n\n foreach ($taxonomies as $taxonomy) {\n $num_terms = wp_count_terms($taxonomy->name);\n $num = number_format_i18n($num_terms);\n $text = _n($taxonomy->labels->singular_name, $taxonomy->labels->name, intval($num_terms));\n\n if (current_user_can('manage_categories')) {\n $num = \"<a href='edit-tags.php?taxonomy=$taxonomy->name'>$num\";\n $text = \"$text</a>\";\n }\n\n echo '<li class=\"post-count\">' . $num . ' ' . $text . '</li>';\n }\n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public function getTags()\n {\n $resultArray = [];\n $tagConnects = TagConnect::photo($this->id);\n if($tagConnects->isEmpty()) {return [];}\n foreach($tagConnects as $tagConnect) {\n $idsArray[] = $tagConnect->id;\n }\n $tags = Tag::whereIn('id', $idsArray)->get();\n foreach($tags as $tag) {\n $resultArray[] = $tag->word;\n }\n return $resultArray;\n }", "public function getTags():array;", "function strl_services_tags_taxonomy() {\n\t$singular_label = __( 'service tag', 'strl' );\n\t$plural_label = __( 'service tags', 'strl' );\n\t$labels = strl_generate_taxonomy_labels( $singular_label, $plural_label );\n\n\t$args = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t);\n\n\tregister_taxonomy( 'service_tags', 'services', $args );\n}", "public function getTags() {\n return $this->tags;\n }", "public static function getTags(): array\n {\n return static::$tags;\n }", "function acf_get_taxonomy_terms($taxonomies = array())\n{\n}", "public function getTags()\n {\n return $this->_tags;\n }", "public function index()\n {\n $terms = Term::all();\n\n return $terms;\n }" ]
[ "0.7617874", "0.7385423", "0.7351889", "0.71742433", "0.70958185", "0.70068365", "0.700656", "0.69835687", "0.69814444", "0.6963501", "0.694302", "0.694127", "0.6838572", "0.6815043", "0.68050724", "0.67874384", "0.6718938", "0.66819227", "0.6658688", "0.66490954", "0.6634464", "0.66254675", "0.659024", "0.655828", "0.65564066", "0.6548047", "0.6548047", "0.6548047", "0.6548047", "0.6548047", "0.6517238", "0.65161765", "0.6515476", "0.6495053", "0.6459238", "0.6446339", "0.6439974", "0.6426326", "0.6420688", "0.64192903", "0.6419281", "0.6413447", "0.64113176", "0.64048576", "0.63982743", "0.63860166", "0.6373092", "0.63718796", "0.63717264", "0.6367446", "0.6358023", "0.6348798", "0.6337589", "0.63277215", "0.63052946", "0.63004726", "0.6289789", "0.6289789", "0.62860006", "0.6274277", "0.6268696", "0.6256406", "0.625109", "0.6245952", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6205551", "0.6202658", "0.61996204", "0.6195524", "0.6191037", "0.6190507", "0.61886954", "0.6186995", "0.6186618", "0.6181622", "0.61764026", "0.61712235", "0.6170008", "0.61677957", "0.6160859", "0.61500823", "0.61482936", "0.6137317", "0.61365855", "0.6126662", "0.6121177", "0.6116172" ]
0.710471
4
Get taxonomy list with only tags of the child pages.
public function getChildPagesTags() { /** @var PageInterface $current */ $current = Grav::instance()['page']; $taxonomies = []; foreach ($current->children()->published() as $child) { if (!$child->isPage()) { continue; } foreach($this->build($child->taxonomy()) as $taxonomyName => $taxonomyValue) { if (!isset($taxonomies[$taxonomyName])) { $taxonomies[$taxonomyName] = $taxonomyValue; } else { foreach ($taxonomyValue as $value => $count) { if (!isset($taxonomies[$taxonomyName][$value])) { $taxonomies[$taxonomyName][$value] = $count; } else { $taxonomies[$taxonomyName][$value] += $count; } } } } } return $taxonomies; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTaxonomyTerms();", "public function tags()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'post_tag';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }", "function tags_terms_list() { // list Tags taxonomy\n\twp_list_categories( array( 'style' => 'list', 'hide_empty' => 0, 'taxonomy' => 'post_tags', 'hierarchical' => true, 'title_li' => __( 'Tags' ) )); return; \n}", "public function get_taxonomies()\n {\n $terms = get_terms(array(\n 'hide_empty' => false\n ));\n\n return $terms;\n }", "protected function get_taxonomies() {\n\t\treturn apply_filters( 'appthemes_html_term_description_taxonomies', $this->taxonomies );\n\t}", "public function getTaxonomiesList() {\n return $this->_get(1);\n }", "function show_only_direct_childs_on_tax($query) {\n if ($query->is_main_query() && !is_admin()) {\n $tax_query = $query->tax_query;\n foreach ($tax_query->queries as $k => $v) {\n if (is_array($v) && isset($v['include_children']) && $v['include_children']) {\n $tax_query->queries[$k]['include_children'] = false;\n }\n }\n $query->tax_query = $tax_query;\n }\n}", "function get_post_meta_tags() {\n global $post;\n $list = array();\n $num = 0;\n $termsObjects = get_the_terms('', 'meta_info', '');\n if (!empty($termsObjects)){\n foreach ($termsObjects as $v) {\n $list[$num] = $v->slug;\n $num++;\n }\n }\n return($list);\n}", "public function getTaxonomyIds()\n {\n return $this->taxonomy_ids;\n }", "private function get_taxonomies() : array {\n\t\treturn $this->taxonomies;\n\t}", "public function get()\n {\n if (null === $this->taxonomylist) {\n $this->taxonomylist = $this->build(Grav::instance()['taxonomy']->taxonomy());\n }\n\n return $this->taxonomylist;\n }", "function tc_tag_list() {\r\n $post_terms = apply_filters( 'tc_tag_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = false ) );\r\n $html = false;\r\n\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_tag_list_class', 'btn btn-mini btn-tag' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if\r\n return apply_filters( 'tc_tag_list', $html );\r\n }", "public function includedTaxonomies() {\n\t\t$taxonomies = [];\n\t\tif ( aioseo()->options->sitemap->{aioseo()->sitemap->type}->taxonomies->all ) {\n\t\t\t$taxonomies = get_taxonomies();\n\t\t} else {\n\t\t\t$taxonomies = aioseo()->options->sitemap->{aioseo()->sitemap->type}->taxonomies->included;\n\t\t}\n\n\t\tif ( ! $taxonomies ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t$options = aioseo()->options->noConflict();\n\t\t$dynamicOptions = aioseo()->dynamicOptions->noConflict();\n\t\t$publicTaxonomies = aioseo()->helpers->getPublicTaxonomies( true );\n\t\tforeach ( $taxonomies as $taxonomy ) {\n\t\t\t// Check if taxonomy is no longer registered.\n\t\t\tif ( ! in_array( $taxonomy, $publicTaxonomies, true ) || ! $dynamicOptions->searchAppearance->taxonomies->has( $taxonomy ) ) {\n\t\t\t\t$taxonomies = aioseo()->helpers->unsetValue( $taxonomies, $taxonomy );\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check if taxonomy isn't noindexed.\n\t\t\tif ( aioseo()->helpers->isTaxonomyNoindexed( $taxonomy ) ) {\n\t\t\t\tif ( ! $this->checkForIndexedTerm( $taxonomy ) ) {\n\t\t\t\t\t$taxonomies = aioseo()->helpers->unsetValue( $taxonomies, $taxonomy );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t$dynamicOptions->searchAppearance->taxonomies->$taxonomy->advanced->robotsMeta->default &&\n\t\t\t\t! $options->searchAppearance->advanced->globalRobotsMeta->default &&\n\t\t\t\t$options->searchAppearance->advanced->globalRobotsMeta->noindex\n\t\t\t) {\n\t\t\t\tif ( ! $this->checkForIndexedTerm( $taxonomy ) ) {\n\t\t\t\t\t$taxonomies = aioseo()->helpers->unsetValue( $taxonomies, $taxonomy );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $taxonomies;\n\t}", "public function getTaxonomies(): array\n {\n return $this->taxonomies;\n }", "public function taxonomies()\n {\n return $this->morphedByMany(\n Taxonomy::class,\n 'metable',\n 'metables',\n 'meta_id',\n );\n }", "public function tags()\n {\n return $this->morphedByMany(Tag::class, 'bundleable');\n }", "public function getTaxonomies()\n {\n $taxonomies = collect($this->cache->getTaxonomies());\n\n return $taxonomies->sortBy(function ($taxonomy) {\n return $taxonomy->title();\n })->all();\n }", "function cl_woo_get_cat_filter_children( $parent_term_id = null ) {\n\n\t$output = array();\n\t$child_terms = null;\n\n\t//Get children of this term\n\t$child_terms = Prso_Woocom::get_product_terms(\n\t\tarray(\n\t\t\t'parent' => $parent_term_id,\n\t\t)\n\t);\n\n\tif ( isset( $child_terms->terms ) && ! empty( $child_terms->terms ) ) {\n\n\t\tforeach ( $child_terms->terms as $key => $grandchild_term ) {\n\n\t\t\t$child_terms->terms[ $key ]->children = cl_woo_get_cat_filter_children( $grandchild_term->term_id );\n\n\t\t}\n\n\t\t$output = $child_terms->terms;\n\n\t}\n\n\treturn $output;\n}", "function fa_get_registered_taxonomies(){\t\n\t$args = array(\n\t\t'public' => true\n\t);\n\t$taxonomies = get_taxonomies( $args );\n\t$result = array();\n\tforeach( $taxonomies as $tax => $name ){\n\t\t$tax_obj = get_taxonomy( $tax );\n\t\t// allow only categories for builtin tax\n\t\tif( $tax_obj->_builtin && ( 'category' != $tax && 'post_tag' != $tax ) ){\n\t\t\tcontinue;\n\t\t}\t\t\n\t\t$result[ $tax_obj->object_type[0] ][] = array(\n\t\t\t'taxonomy' \t=> $tax,\n\t\t\t'name'\t\t=> $tax_obj->labels->name\n\t\t);\n\t}\n\t\n\treturn $result;\t\n}", "public function UpdateTags() {\n\t\t$tags = TaxonomyTerm::get()\n\t\t\t->innerJoin('BasePage_Terms', '\"TaxonomyTerm\".\"ID\"=\"BasePage_Terms\".\"TaxonomyTermID\"')\n\t\t\t->innerJoin(\n\t\t\t\t'SiteTree',\n\t\t\t\tsprintf('\"SiteTree\".\"ID\" = \"BasePage_Terms\".\"BasePageID\" AND \"SiteTree\".\"ParentID\" = \\'%d\\'', $this->ID)\n\t\t\t)\n\t\t\t->sort('Name');\n\n\t\treturn $tags;\n\t}", "function voicewp_news_taxonomies() {\n\t$option = get_option( 'voicewp-settings' );\n\n\t$taxonomies = ( empty( $option['latest_taxonomies'] ) ) ? array() : $option['latest_taxonomies'];\n\n\t// Nonexistant taxonomies can shortcircuit get_terms().\n\treturn array_filter( $taxonomies, 'taxonomy_exists' );\n}", "public function tags()\n {\n return $this->belongsToMany(Tag::class, 'page_tags', 'subject_id', 'tag_id')->where('page_tags.subject_type', Wiki::class);\n }", "function tags_support_all() {\n register_taxonomy_for_object_type('post_tag', 'page');\n register_taxonomy_for_object_type('category', 'page');\n}", "function get_post_list($conn_ptr, $table_prefix) {\n // Get a list of post_titles and post_names and store them in an array\n $sql=\"SELECT p.ID, p.post_title, p.post_name, p.post_date, p.post_modified FROM \".$table_prefix.\"posts p \n INNER JOIN \".$table_prefix.\"term_relationships r ON r.object_id=p.ID \n INNER JOIN \".$table_prefix.\"term_taxonomy t ON t.term_taxonomy_id = r.term_taxonomy_id \n INNER JOIN \".$table_prefix.\"terms wt on wt.term_id = t.term_id \n WHERE t.taxonomy='category' AND wt.slug='\" . $GLOBALS['site_persona'] . \"' AND p.post_type='page' AND p.post_status='publish' \";\n\n $result = $conn_ptr->query($sql);\n $rows = [];\n if ($result->num_rows > 0) {\n while ($row = $result->fetch_assoc()) \n array_push($rows, $row);\n }\n\n // Enrich the array with tags\n $erows = [];\n foreach ($rows as $row) {\n $sql=\"SELECT wt.name, t.taxonomy FROM \".$table_prefix.\"posts p \n INNER JOIN \".$table_prefix.\"term_relationships r ON r.object_id=p.ID \n INNER JOIN \".$table_prefix.\"term_taxonomy t ON t.term_taxonomy_id = r.term_taxonomy_id \n INNER JOIN \".$table_prefix.\"terms wt on wt.term_id = t.term_id \n WHERE t.taxonomy='post_tag' AND p.ID='\".$row[\"ID\"].\"'\";\n \n $tags = [];\n $result = $conn_ptr->query($sql);\n if ($result->num_rows > 0) while ($wtrow = $result->fetch_assoc()) array_push($tags, $wtrow[\"name\"]);\n $row[\"post_tags\"]=$tags;\n array_push($erows, $row);\n }\n return $erows;\n}", "function iwj_walk_tax_tree($terms, $parent = 0, $terms_request, $limit, $filter_name, $taxonomy) {\n $i = 0;\n foreach ( $terms as $term ) {\n if( isset($term->parent) && $term->parent == $parent ) {\n $style = '';\n if($parent == 0){\n $i++;\n $style = ( $i > $limit ) ? 'style=\"display:none\"' : '';\n }\n $checked = ( iwj_filter_tax_checked( $term->term_id, $terms_request ) != '' ) ? 'open' : '';\n $child_terms = get_term_children( $term->term_id, $taxonomy );\n ?>\n\n <li <?php echo ( $parent == 0 )? $style : '' ?> class=\"iwj-input-checkbox <?php echo $taxonomy;?> tax-tree\" data-order=\"<?php echo $term->total_post; ?>\">\n <a href=\"javascript:void(0)\" class=\"item-tax\">\n <div class=\"filter-name-item\">\n <input type=\"checkbox\" <?php echo iwj_filter_tax_checked( $term->term_id, $terms_request ); ?> name=\"<?php echo $taxonomy;?>[]\"\n id=\"iwjob-filter-<?php echo $filter_name ?>-cbx-<?php echo $term->term_id; ?>\" class=\"iwjob-filter-<?php echo $filter_name ?>-cbx\"\n value=\"<?php echo $term->term_id; ?>\" data-title=\"<?php echo $term->name; ?>\">\n <label for=\"iwjob-filter-<?php echo $filter_name ?>-cbx-<?php echo $term->term_id; ?>\">\n <?php echo $term->name; ?></label>\n <?php if( count($child_terms) > 0 ) {\n echo '<span class=\"iwj-show-sub-cat '. $checked .'\"> <i class=\"fa fa-angle-down\"></i></span>';\n } ?>\n </div>\n <span id=\"iwj-count-<?php echo $term->term_id; ?>\" class=\"iwj-count\">\n <?php echo $term->total_post; ?>\n </span>\n </a>\n <?php\n\n if ( count( $child_terms ) > 0 ) :\n $checked = false;\n foreach ($terms_request as $term_request){\n foreach ($child_terms as $term_id){\n if($term_request == $term_id){\n $checked = true;\n break;\n }\n }\n\n if($checked == true){\n break;\n }\n }\n ?>\n <ul class=\"sub-cat <?php echo $checked ? 'open' : ''; ?>\">\n <?php iwj_walk_tax_tree( $terms, $term->term_id, $terms_request, $limit, $filter_name , $taxonomy); ?>\n </ul>\n <?php endif ?>\n </li>\n <?php\n }\n }\n if ( $i > $limit) : ?>\n <li class=\"show-more\">\n <a class=\"theme-color\" href=\"#\">\n <?php echo __('Show more', 'iwjob'); ?>\n </a>\n </li>\n <li class=\"show-less\" style=\"display: none\">\n <a class=\"theme-color\" href=\"#\">\n <?php echo __('Show less', 'iwjob'); ?>\n </a>\n </li>\n <?php endif;\n}", "public static function get_allowed_taxonomies()\n {\n }", "function tc_get_the_tags() {\r\n return the_tags();\r\n}", "function tags_support_all() {\n\tregister_taxonomy_for_object_type('post_tag', 'page');\n}", "public function taxonomies()\n {\n return $this->hasMany(Taxonomy::class);\n }", "function wpb_list_child_pages() { \n \nglobal $post; \n \nif ( is_page() && $post->post_parent )\n \n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );\nelse\n $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );\n \nif ( $childpages ) {\n \n $string = '<ul>' . $childpages . '</ul>';\n}\n \nreturn $string;\n \n}", "public function taxonomies()\n {\n return $this->hasMany('Darryldecode\\Backend\\Components\\ContentBuilder\\Models\\ContentTypeTaxonomy','content_type_id');\n }", "public function generateTaxonomyTermList() {\n $vocab = \"sports\";\n $term_list = [];\n $terms = $this->entityTypeManager\n ->getStorage('taxonomy_term')\n ->loadTree($vocab);\n foreach ($terms as $term) {\n $term_name = $this->t('@name', ['@name' => $term->name]);\n $term_list[\"$term_name\"] = $term_name;\n }\n return $term_list;\n }", "public function getList()\r\n {\r\n\t\tif (defined(\"WITH_SPHINX_TAGS\") && WITH_SPHINX_TAGS)\r\n\t\t{\r\n\t\t\t$tags = parent::getList();\r\n\t\t} else {\r\n\t\t\t$tags = $this->getGroupTagsList() +\r\n\t\t\t\t$this->getMembersTagsList() +\r\n\t\t\t\t$this->getDocumentsTagsList() +\r\n\t\t\t\t$this->getEventsTagsList() +\r\n\t\t\t\t$this->getPhotosTagsList() +\r\n\t\t\t\t$this->getListsTagsList();\r\n\t\t}\r\n return $tags;\r\n }", "function tagsSelectedChildren($parentID) {\n\t\t$arr = array();\n\t\t$arrTags = $this->tags();\n\t\tforeach ($arrTags as $oneTag) {\n\t\t\tif ($oneTag->parentID==$parentID) {\n\t\t\t\t$arr[] = $oneTag;\n\t\t\t}\n\t\t}\n\t\treturn $arr;\n\t}", "public function categories()\n {\n $new = $this->postterms->filter(function($term)\n {\n return $term->termtaxonomy->taxonomy == 'category';\n });\n\n return $new->map(function($term)\n {\n return $term->termtaxonomy->term; \n });\n }", "function get_category_array() {\n $args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n );\n return get_categories($args);\n}", "public function get_taxonomy_terms(\\Twig\\Environment $env, array $context, $taxonomy_name, array $other_fields = NULL) {\n $query = \\Drupal::entityQuery('taxonomy_term')\n ->condition('vid', $taxonomy_name);\n $tids = $query->execute();\n\n $entity_manager = \\Drupal::entityTypeManager();\n $term_storage = $entity_manager->getStorage('taxonomy_term');\n $taxonomy_terms = $term_storage->loadMultiple($tids);\n\n $taxonomy_array = [];\n\n foreach ($taxonomy_terms as $term) {\n $tid = $term->hasTranslation($this->get_current_lang()) ? $term->getTranslation($this->get_current_lang())->get('tid')[0]->value : $term->getTranslation('en')->get('tid')[0]->value;\n\n $values = [\n 'tid' => $tid,\n 'name' => $term->hasTranslation($this->get_current_lang()) ? $term->getTranslation($this->get_current_lang())->get('name')[0]->value : $term->getTranslation('en')->get('name')[0]->value,\n 'parent' => $term->hasTranslation($this->get_current_lang()) ? $term->getTranslation($this->get_current_lang())->get('parent')->target_id : $term->getTranslation('en')->get('parent')->target_id,\n 'children' => isset($taxonomy_array[$tid]) ? $taxonomy_array[$tid]['children'] : [],\n ];\n\n if ($values['parent'] === \"0\") {\n $taxonomy_array[$tid] = $values;\n }\n else {\n $taxonomy_array[$values['parent']]['children'][$tid] = $values;\n }\n\n // Add extra fields if supplied.\n if (!is_null($other_fields)) {\n foreach ($other_fields as $field) {\n if ($values['parent'] === \"0\") {\n $taxonomy_array[$tid][$field] = $term->get($field)[0]->value;\n }\n else {\n $taxonomy_array[$values['parent']]['children'][$tid][$field] = $term->get($field)[0]->value;\n }\n }\n }\n }\n\n return $taxonomy_array;\n }", "public function all(): array\n {\n $wpTerms = get_terms(\n $this->getTaxonomy()\n );\n\n if (is_wp_error($wpTerms)) {\n wp_die($wpTerms);\n }\n\n return array_map(function (WP_Term $wpTerm): AbstractTerm {\n return TermFactory::makeByWpTerm($wpTerm);\n }, $wpTerms);\n }", "function acf_get_taxonomy_terms($taxonomies = array())\n{\n}", "private function prepareTaxonomy(){\n $taxonomy = null;\n if ( $this->taxonomy->terms() ){\n foreach($this->taxonomy->terms() as $term){\n $taxonomy[] = array( \n \t'id'=>$term->getID(), \n \t'label'=>$term->label->label \n\t\t\t\t);\n }\n }\n return $taxonomy;\n }", "function _syndication_server_taxonomy_get_trees($vid, $parent = 0, $max_depth = NULL) {\n\n $trees = array();\n\n foreach($vid as $k => $id) {\n $trees[$id] = taxonomy_get_tree($id, $parent, $max_depth);\n }\n\n return $trees;\n}", "function build_taxonomies() {\n// custom tax\n register_taxonomy( 'from', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'cpt-tag',array('menu','recipe','sources-resources','tips-quips','style-points'), \n array( \n 'hierarchical' => false, // true = acts like categories false = acts like tags\n 'label' => 'Tags',\n 'query_var' => true,\n 'show_admin_column' => true,\n 'public' => true,\n 'rewrite' => true,\n '_builtin' => true\n ) );\n register_taxonomy( 'from-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-from' ),\n\t\t\t'_builtin' => true\n ) );\n \n register_taxonomy( 'from-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'From',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-from' ),\n\t\t\t'_builtin' => true\n ) );\n register_taxonomy( 'sub', array('menu'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'menu-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-5', array('recipe'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'recipe-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-2', array('sources-resources'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'sources-resources-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-3', array('tips-quips'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'tips-quips-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n register_taxonomy( 'sub-4', array('style-points'),\n\t\tarray(\n\t\t\t'hierarchical' => true, // true = acts like categories false = acts like tags\n\t\t\t'label' => 'Sub',\n\t\t\t'query_var' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'public' => true,\n\t\t\t'rewrite' => array( 'slug' => 'style-points-sub' ),\n\t\t\t'_builtin' => true\n\t\t) );\n}", "function get_taxonomy_rewrite_tags( $taxonomies = null, $post_link = '' )\n{\n $post = null;\n\n if ( null === $taxonomies ) {\n $taxonomies = get_taxonomies();\n } elseif ( $taxonomies instanceof WP_Post ) {\n $post = $taxonomies;\n $taxonomies = get_object_taxonomies( $post->post_type );\n } elseif ( ! is_array( $taxonomies ) ) {\n $taxonomies = [];\n }\n\n $tags = [];\n foreach ( $taxonomies as $taxonomy ) {\n $tax = \"%{$taxonomy}%\";\n $term = '';\n\n $taxonomy_object = get_taxonomy( $taxonomy );\n if ( strpos($post_link, $tax) !== false ) {\n $terms = get_the_terms( $post->ID, $taxonomy );\n\n if ( $terms ) {\n usort($terms, '_usort_terms_by_ID');\n $term = $terms[0]->slug;\n if ( $taxonomy_object->hierarchical && $parent = $terms[0]->parent ) {\n $term = get_term_parents($parent, $taxonomy, false, '/', true) . $term;\n }\n }\n\n /** Show default category in permalinks, without having to assign it explicitly */\n if ( empty( $term ) && $taxonomy === 'category' ) {\n $default_category = get_category( get_option( 'default_category' ) );\n $term = ( is_wp_error( $default_category ) ? '' : $default_category->slug );\n }\n }\n\n $tags[$tax] = $term;\n }\n\n /**\n * Filter taxonomy rewrite tags.\n *\n * @param array $tags The rewrite tags.\n * @param string $post_link A post permalink to resolve from.\n */\n $tags = apply_filters( 'rewrite_tags/taxonomy', $tags, $post_link );\n\n if ( $post instanceof WP_Post ) {\n $post_type = $post->post_type;\n\n /**\n * Filter taxonomy rewrite tags for a specific post type.\n *\n * @param array $tags The rewrite tags.\n * @param string $post_link A post permalink to resolve from.\n * @param WP_Post $post The post to resolve from.\n */\n $tags = apply_filters( \"rewrite_tags_for_{$post_type}/taxonomy\", $tags, $post_link, $post );\n }\n\n return $tags;\n}", "function taxvalue($tax) {\n $args = array(\n 'parent' => 0,\n 'orderby' => 'slug',\n 'hide_empty' => false\n );\n\n $terms = get_terms( $tax, $args);\n if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){\n echo '<ul class=\"listcat listcat-'.$tax.'\">';\n foreach ( $terms as $term ) {\n $subterms1 = get_terms($tax, array('parent' => $term->term_id, 'orderby' => 'slug', 'hide_empty' => false));\n\n if (sizeof($subterms1) > 0) {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a>';\n\n // sub term 1\n echo '<ul class=\"subterm\">';\n foreach ($subterms1 as $term) {\n $subterms2 = get_terms($tax, array('parent' => $term->term_id, 'orderby' => 'slug', 'hide_empty' => false));\n\n if (sizeof($subterms2) > 0) {\n echo '<li class=\"listcat-item has-subterm\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a>';\n\n // sub term 2\n echo '<ul class=\"subterm\">';\n foreach ($subterms2 as $term) {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a></li>';\n }\n echo '</ul></li>';\n } else {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a></li>';\n }\n }\n echo '</ul></li>';\n } else {\n echo '<li class=\"listcat-item\"><a href=\"'.esc_url( get_term_link( $term ) ).'\">' . $term->name . '</a></li>';\n }\n }\n echo '</ul>';\n }\n}", "function create_tag_taxonomies()\n{\n // Add new taxonomy, NOT hierarchical (like tags)\n $labels = array(\n 'name' => _x( 'Tags', 'taxonomy general name' ),\n 'singular_name' => _x( 'Tag', 'taxonomy singular name' ),\n 'search_items' => __( 'Search Tags' ),\n 'popular_items' => __( 'Popular Tags' ),\n 'all_items' => __( 'All Tags' ),\n 'parent_item' => null,\n 'parent_item_colon' => null,\n 'edit_item' => __( 'Edit Tag' ),\n 'update_item' => __( 'Update Tag' ),\n 'add_new_item' => __( 'Add New Tag' ),\n 'new_item_name' => __( 'New Tag Name' ),\n 'separate_items_with_commas' => __( 'Separate tags with commas' ),\n 'add_or_remove_items' => __( 'Add or remove tags' ),\n 'choose_from_most_used' => __( 'Choose from the most used tags' ),\n 'menu_name' => __( 'Tags' ),\n );\n\n register_taxonomy('tag','edicoesAnteriores',array(\n 'hierarchical' => false,\n 'labels' => $labels,\n 'show_ui' => true,\n 'update_count_callback' => '_update_post_term_count',\n 'query_var' => true,\n 'rewrite' => array( 'slug' => 'tag' ),\n ));\n}", "private function _append_children_taxonomies($all_terms_array, $type='name') {\n\n\t\tglobal $wpdb;\n\n\t\t// Just in case this arrives as a string.\n\t\tif (!is_array($all_terms_array)) {\n\t\t\t$all_terms_array = array($all_terms_array);\n\t\t}\n\n\t\t// We start with the parent terms...\n\t\t$parent_terms_array = $all_terms_array;\n\n\t\tfor ( $i= 1; $i <= $this->taxonomy_depth; $i++ ) {\n\t\t\t$terms = '';\n\t\t\tforeach ($parent_terms_array as &$t) {\n\t\t\t\t$t = $wpdb->prepare('%s', $t);\n\t\t\t}\n\n\t\t\t$terms = '('. implode(',', $parent_terms_array) . ')';\n\n\t\t\t$query = $wpdb->prepare(\"SELECT {$wpdb->terms}.$type\n\t\t\t\tFROM\n\t\t\t\t{$wpdb->terms} JOIN {$wpdb->term_taxonomy} ON {$wpdb->terms}.term_id={$wpdb->term_taxonomy}.term_id\n\t\t\t\tWHERE\n\t\t\t\t{$wpdb->term_taxonomy}.parent IN (\n\t\t\t\t\tSELECT {$wpdb->terms}.term_id\n\t\t\t\t\tFROM {$wpdb->terms}\n\t\t\t\t\tJOIN {$wpdb->term_taxonomy} ON {$wpdb->terms}.term_id={$wpdb->term_taxonomy}.term_id\n\t\t\t\t\tWHERE {$wpdb->terms}.$type IN $terms\n\t\t\t\t\tAND {$wpdb->term_taxonomy}.taxonomy=%s\n\t\t\t\t)\", $this->taxonomy);\n\n\t\t\t$results = $wpdb->get_results( $query, ARRAY_A );\n\n\t\t\tif ( empty($results) ) {\n\t\t\t\tbreak; // if there are no results, then we've traced this out.\n\t\t\t}\n\n\t\t\t$parent_terms_array = array(); // <-- reset this thing for the next iteration\n\t\t\tforeach ($results as $r) {\n\t\t\t\t$all_terms_array[] = $r[$type]; // append\n\t\t\t\t$parent_terms_array[] = $r[$type]; // and set this for the next generation\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\treturn array_unique($all_terms_array);\n\n\t}", "function _get_term_hierarchy($taxonomy)\n {\n }", "function get_post_taxonomies($post = 0)\n {\n }", "function get_object_taxonomies($object_type, $output = 'names')\n {\n }", "public function terms()\n {\n return $this->hasManyThrough(\n 'Darryldecode\\Backend\\Components\\ContentBuilder\\Models\\ContentTypeTaxonomyTerm',\n 'Darryldecode\\Backend\\Components\\ContentBuilder\\Models\\ContentTypeTaxonomy',\n 'content_type_id',\n 'content_type_taxonomy_id'\n );\n }", "function get_custom_taxonomies( $post_identity ) {\r\n\r\n // Get the post by ID\r\n $post = get_post( $post_identity );\r\n\r\n // Get the post type\r\n $post_type = $post->post_type;\r\n\r\n // Get taxonomies related to the post type\r\n $taxonomies = get_object_taxonomies( $post_type, 'objects' );\r\n\r\n $out = array();\r\n // Loop through taxonomies and put the terms in an array\r\n foreach ( $taxonomies as $taxonomy_slug => $taxonomy ) {\r\n\r\n $terms = get_the_terms( $post_identity, $taxonomy_slug );\r\n //var_dump($terms); die;\r\n\r\n if ( !empty( $terms ) ) {\r\n \r\n foreach ( $terms as $term ) {\r\n $out[] .= $term->name;\r\n }\r\n }\r\n }\r\n\r\n return $out;\r\n }", "function fa_get_allowed_taxonomies(){\n\t$settings = fa_get_options('settings');\n\n\tif( !isset( $settings['custom_posts'] ) || !$settings['custom_posts'] ){\n\t\t$post_types = array( 'post' );\n\t}\n\n\tif( !isset( $post_types ) ){\n\t\t$post_types = $settings['custom_posts'];\n\t\tforeach ( $post_types as $key => $post_type ){\n\t\t\tif( !post_type_exists( $post_type ) || 'post' == $post_type ){\n\t\t\t\tunset( $post_types[ $key ] );\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif( !isset( $post_types ) ){\n\t\t$post_types = array( 'post' );\n\t}else{\n\t\tarray_unshift($post_types, 'post');\n\t}\n\t\n\t// get the taxonomies\t\n\t$taxonomies = get_object_taxonomies( $post_types );\n\t$result = array();\n\t\n\tforeach( $taxonomies as $taxonomy ){\n\t\t$tax_obj = get_taxonomy( $taxonomy );\t\n\t\t// allow only categories for regular posts\n\t\tif( $tax_obj->_builtin && ( 'category' != $taxonomy && 'post_tag' != $taxonomy ) ){\n\t\t\tcontinue;\n\t\t}\t\t\n\t\t$result[ $tax_obj->object_type[0] ][] = array(\n\t\t\t'taxonomy' \t=> $taxonomy,\n\t\t\t'name'\t\t=> $tax_obj->labels->name\n\t\t);\t\t\n\t}\t\n\treturn $result;\n}", "function custom_taxonomies() {\n }", "public function tags()\n {\n return $this->morphToMany(Tag::class, 'taggable')->withPivot(['meta'])->withTimestamps();\n }", "public function tags() {\n // refer to tag class and the taggable ID\n return $this->morphToMany('App\\Tag', 'taggable');\n\n }", "function get_taxonomies($args = array(), $output = 'names', $operator = 'and')\n {\n }", "public static function get_tags() {\n return Tag::distinct()->orderBy('name', 'asc')->get();\n }", "static function get_second_level_terms( $taxonomy ) {\n\t\t$whole_tax = get_terms( $taxonomy, array( 'hide_empty' => 0 ) );\n\n\t\t$second_level = array_filter(\n\t\t\t$whole_tax,\n\t\t\tfunction( $term ) {\n\t\t\t\treturn $term->parent != 0;\n\t\t\t}\n\t\t);\n\n\t\treturn $second_level;\n\t}", "protected function get_terms() {\n\t\t$terms = get_the_terms( $this->post_ID, $this->taxonomy_name );\n\n\t\tif ( ! is_array( $terms ) ) {\n\t\t\t$terms = [];\n\t\t}\n\n\t\treturn $terms;\n\t}", "public function getTags() {}", "function get_attachment_taxonomies($attachment, $output = 'names')\n {\n }", "function acf_get_pretty_taxonomies($taxonomies = array())\n{\n}", "public function get_post_tags() {\n\t\tglobal $posts;\n\t\t$tags_as_string = '';\n\n\t\t$tags = get_the_tags( $posts[0]->ID );\n\t\tif ( is_array( $tags ) && ! empty( $tags ) ) {\n\t\t\t$tag_names = wp_list_pluck( $tags, 'name' );\n\t\t\t$tags_as_string = implode( ', ', $tag_names );\n\t\t}\n\t\t// MD: This is done to tags but not categories, Should not be done here IMHO.\n\t\t// $tag_list = strtolower( rtrim( $tag_list, ' ,' ) );\n\n\t\t/**\n\t\t * Filter the categories as derived by this function.\n\t\t *\n\t\t * @param string $tags_as_string The derived tag list. Comma-separated list.\n\t\t * @param array $tags The array of post tag objects.\n\t\t */\n\t\treturn apply_filters( 'amt_get_the_tags', $tags_as_string, $tags );\n\t}", "public function custom_taxonomy_filter() {\n\n\t\tglobal $typenow;\n\n\t\tif ( 'ticket' != $typenow ) {\n\t\t\techo '';\n\t\t}\n\n\t\t$post_types = get_post_types( array( '_builtin' => false ) );\n\n\t\tif ( in_array( $typenow, $post_types ) ) {\n\n\t\t\t$filters = get_object_taxonomies( $typenow );\n\n\t\t\t/* Get all custom fields */\n\t\t\t$fields = $this->get_custom_fields();\n\n\t\t\tforeach ( $filters as $tax_slug ) {\n\n\t\t\t\tif ( ! array_key_exists( $tax_slug, $fields ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( true !== $fields[ $tax_slug ]['args']['filterable'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$tax_obj = get_taxonomy( $tax_slug );\n\n\t\t\t\t$args = array(\n\t\t\t\t\t'show_option_all' => __( 'Show All ' . $tax_obj->label ),\n\t\t\t\t\t'taxonomy' => $tax_slug,\n\t\t\t\t\t'name' => $tax_obj->name,\n\t\t\t\t\t'orderby' => 'name',\n\t\t\t\t\t'hierarchical' => $tax_obj->hierarchical,\n\t\t\t\t\t'show_count' => true,\n\t\t\t\t\t'hide_empty' => true,\n\t\t\t\t\t'hide_if_empty' => true,\n\t\t\t\t);\n\n\t\t\t\tif ( isset( $_GET[ $tax_slug ] ) ) {\n\t\t\t\t\t$args['selected'] = filter_input( INPUT_GET, $tax_slug, FILTER_SANITIZE_STRING );\n\t\t\t\t}\n\n\t\t\t\twp_dropdown_categories( $args );\n\n\t\t\t}\n\t\t}\n\n\t}", "function list_terms_custom_taxonomy( $atts ) {\n \n// Inside the function we extract custom taxonomy parameter of our shortcode\n \n extract( shortcode_atts( array(\n 'custom_taxonomy' => '',\n 'child_of' => '',\n 'title' => ''\n ), $atts ) );\n \n// arguments for function wp_list_categories\n$args = array( \ntaxonomy => $custom_taxonomy,\ntitle_li => '',\nchild_of => $child_of\n);\n \n// We wrap it in unordered list \necho '<h2 class=\"sidebar-cat-title\">' . $title . '</h2>';\necho '<ul>'; \necho wp_list_categories($args);\necho '</ul>';\n}", "static public function taxonomies( $post_type ) {\n\t\t$taxonomies = get_object_taxonomies( $post_type, 'objects' );\n\t\t$data\t\t= array();\n\n\t\tforeach ( $taxonomies as $tax_slug => $tax ) {\n\n\t\t\tif ( ! $tax->public || ! $tax->show_ui ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$data[ $tax_slug ] = $tax;\n\t\t}\n\n\t\treturn apply_filters( 'fl_builder_loop_taxonomies', $data, $taxonomies, $post_type );\n\t}", "function get_taxonomies_for_attachments($output = 'names')\n {\n }", "function category_terms_list() { // list Categories taxonomy\n\twp_list_categories( array( 'style' => 'list', 'hide_empty' => 0, 'taxonomy' => 'category', 'hierarchical' => true, 'title_li' => __( 'Categories' ) ) ); return;\n}", "public function all_tags()\n {\n $out = [];\n $out = array_merge($out, $this->extraTags('CATEGORY'));\n\n foreach ($this->tags->find_all() as $tag) {\n $out[] = $tag;\n }\n\n return array_unique($out);\n\n }", "public function tags()\n\t{\n\t\treturn $this->morphToMany('App\\Modules\\Tag\\Tag', 'taggable');\n\t}", "public function getTags(): Collection;", "function acf_get_taxonomies($args = array())\n{\n}", "public function taxonomy();", "public function posts()\n {\n return $this->morphedByMany(Post::class, 'taggable', 'taxonomy_relationships')->withTimestamps();\n }", "public function tags()\n {\n return $this->morphToMany(Tag::class, 'taggable');\n }", "public function tags()\n {\n return $this->morphToMany(Tag::class, 'taggable');\n }", "public function tags()\n {\n return $this->morphToMany(Tag::class, 'taggable');\n }", "public function tags()\n {\n return $this->morphToMany(Tag::class, 'taggable');\n }", "public function tags()\n {\n return $this->morphToMany(Tag::class, 'taggable');\n }", "public function tags()\n {\n return $this->morphToMany(Tag::class, 'taggable');\n }", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function tags() {\n\t\treturn $this->get_tags();\n\t}", "function get_trees()\n\t{\n\n\t\tif(!isset($this->cache['trees']))\n\t\t{\n\n\t\t\tee()->db->order_by('label', 'asc');\n\t\t\t$trees = ee()->db->get_where('taxonomy_trees', array('site_id' => $this->site_id) )->result_array();\n\t\t\t// reindex with node ids as keys\n\t\t\t$data = array();\n\t\t\tforeach($trees as $tree)\n\t\t\t{\n\t\t\t\t$data[ $tree['id'] ] = $tree;\n\t\t\t\t$data[ $tree['id'] ]['templates'] = explode('|', $tree['templates']);\n\t\t\t\t$data[ $tree['id'] ]['channels'] = explode('|', $tree['channels']);\n\t\t\t\t$data[ $tree['id'] ]['member_groups'] = explode('|', $tree['member_groups']);\n\t\t\t\t$data[ $tree['id'] ]['fields'] = ($tree['fields']) ? json_decode($tree['fields'], TRUE) : array();\n\t\t\t\t$data[ $tree['id'] ]['taxonomy'] = ($tree['taxonomy']) ? json_decode($tree['taxonomy'], TRUE) : '';\n\t\t\t}\n\n\t\t\t$this->cache['trees'] = $data;\n\n\t\t}\n\n \treturn $this->cache['trees'];\n\t}", "function add_taxonomies_to_pages() {\n register_taxonomy_for_object_type('post_tag', 'page');\n register_taxonomy_for_object_type('category', 'page');\n}", "function strl_services_tags_taxonomy() {\n\t$singular_label = __( 'service tag', 'strl' );\n\t$plural_label = __( 'service tags', 'strl' );\n\t$labels = strl_generate_taxonomy_labels( $singular_label, $plural_label );\n\n\t$args = array(\n\t\t'hierarchical' => false,\n\t\t'labels' => $labels,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'query_var' => true,\n\t);\n\n\tregister_taxonomy( 'service_tags', 'services', $args );\n}", "public function getTags()\n {\n return $this->tags = get_the_tags($this->id);\n }", "function get_post_categories(){\n $args = array(\n 'type' => 'post',\n 'child_of' => 0,\n 'parent' => '',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n 'hierarchical' => 1,\n 'exclude' => '',\n 'include' => '',\n 'number' => '',\n 'taxonomy' => 'category',\n 'pad_counts' => false\n\n );\n\n $categories = json_encode(get_categories($args));\n echo $categories;\n die();\n\n}", "function gigx_get_the_term_list( $id = 0, $taxonomy, $before = '', $sep = '', $after = '', $exclude = array() ) {\n\t$terms = get_the_terms( $id, $taxonomy );\n\n\tif ( is_wp_error( $terms ) )\n\t\treturn $terms;\n\n\tif ( empty( $terms ) )\n\t\treturn false;\n\n\tforeach ( $terms as $term ) {\n\n\t\tif(!in_array($term->term_id,$exclude)) {\n\t\t\t$link = get_term_link( $term, $taxonomy );\n\t\t\tif ( is_wp_error( $link ) )\n\t\t\t\treturn $link;\n\t\t\t$term_links[] = '<a href=\"' . $link . '\" rel=\"tag\">' . $term->name . '</a>';\n\t\t}\n\t}\n\n\t$term_links = apply_filters( \"term_links-$taxonomy\", $term_links );\n\n\treturn $before . join( $sep, $term_links ) . $after;\n}", "function getTagsToOmitt() {\n\t\t$tagArray = array();\n\n\t\t// if there are tags to exclude: add them to the list\n\t\tif ($this->conf['excludeTags']) {\n\t\t\t$tagArray = GeneralUtility::trimExplode(',', $this->conf['excludeTags'], 1);\n\t\t}\n\n\t\t// if configured: add tags used by the term definitions\n\t\tif ($this->conf['autoExcludeTags'] > 0) {\n\t\t\t;\n\t\t\tforeach ($this->conf['types.'] as $key => $type) {\n\t\t\t\tif (!empty($type['tag']) && !in_array($type['tag'], $tagArray)) {\n\t\t\t\t\t$tagArray[] = $type['tag'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$tagList = implode(',', $tagArray);\n\n\t\treturn $tagList;\n\t}", "public function getAllMetaTags()\n {\n return htcms_get_all_meta_tags();\n }", "function jr_get_custom_taxonomy($post_id, $tax_name, $tax_class) {\r\n $tax_array = get_terms( $tax_name, array( 'hide_empty' => '0' ) );\r\n if ($tax_array && sizeof($tax_array) > 0) {\r\n foreach ($tax_array as $tax_val) {\r\n if ( is_object_in_term( $post_id, $tax_name, array( $tax_val->term_id ) ) ) {\r\n echo '<span class=\"'.$tax_class . ' '. $tax_val->slug.'\">'.$tax_val->name.'</span>';\r\n break;\r\n }\r\n }\r\n }\r\n}", "public function getTermsAttribute()\n {\n return $this->taxonomies->groupBy(function ($taxonomy)\n {\n return $taxonomy->taxonomy;\n\n })->map(function ($group)\n {\n return $group->mapWithKeys(function ($item)\n {\n return array($item->term->slug => $item->term->name);\n });\n\n })->toArray();\n }", "function ph_display_page_children($post)\n{\n\n $html = '';\n if ($post) {\n $args = array(\n 'post_status' => 'publish',\n 'post_type' => 'page',\n 'post_parent' => $post->ID,\n 'orderby' => 'menu_order',\n 'order' => 'ASC',\n 'nopaging' => true,\n );\n\n query_posts($args);\n\n if (have_posts()) {\n $html = '<ul class=\"page-children ph-page-children\">';\n while (have_posts()) {\n the_post();\n $html .= '<li>'.get_the_title().' · '.get_the_excerpt().'</li>';\n }\n $html .= '</ul>';\n }\n\n wp_reset_query();\n }\n\n return $html;\n}", "public function getDisplayableTags()\n {\n return $this->getOwner()->Tags()->filter(['Type.InternalOnly' => false]);\n }", "function my_register_taxonomies() {\r\n\t}", "function acf_get_taxonomy_labels($taxonomies = array())\n{\n}" ]
[ "0.67813724", "0.6739332", "0.6729634", "0.6698302", "0.64633864", "0.642907", "0.6257175", "0.6256697", "0.62391734", "0.61943674", "0.6149934", "0.6148798", "0.6140939", "0.61370957", "0.60822314", "0.6059897", "0.6018438", "0.6011724", "0.60078555", "0.6004591", "0.59819704", "0.59782994", "0.5975019", "0.5971811", "0.59698844", "0.5959998", "0.5945208", "0.59449345", "0.5944514", "0.59417367", "0.59200525", "0.59166515", "0.58969307", "0.5892652", "0.5891485", "0.58744466", "0.586108", "0.58484554", "0.582152", "0.5806995", "0.57927305", "0.57895297", "0.5782901", "0.5782532", "0.5768", "0.57650185", "0.57634294", "0.5762198", "0.5755434", "0.5754187", "0.5753915", "0.57516044", "0.57291335", "0.5712092", "0.56951904", "0.568478", "0.56668633", "0.566625", "0.56592023", "0.56507856", "0.5650408", "0.56461006", "0.564559", "0.563549", "0.56227016", "0.5621773", "0.5621598", "0.5616558", "0.56157684", "0.5613655", "0.56135494", "0.56040424", "0.56028897", "0.5599368", "0.55988634", "0.55988634", "0.55988634", "0.55988634", "0.55988634", "0.55988634", "0.55933005", "0.55933005", "0.55933005", "0.55933005", "0.55933005", "0.55901605", "0.5584381", "0.5583762", "0.55825305", "0.55807847", "0.5580703", "0.55742645", "0.5572452", "0.55651844", "0.5560928", "0.5557081", "0.5556292", "0.55555487", "0.5551851", "0.55471987" ]
0.77187777
0
Insert Coupons. Generate Coupon Codes and insert with other info
public function insertCoupons($count, $amount, $distributiontag, $iscreditable, $promoname, $user, $status, $validfrom, $validto) { $model = new GenerationToolModel(); $connection = Yii::app()->db; $pdo = $connection->beginTransaction(); $firstquery = "INSERT INTO couponbatch (CouponCount, Amount, DistributionTagID, Status, Promoname, DateCreated, CreatedByAID ) VALUES (:couponcount, :amount, :distributiontag, :status, :promoname, NOW(6), :createdbyAID )"; $sql = $connection->createCommand($firstquery); $sql->bindParam(":couponcount", $count); $sql->bindParam(":amount", $amount); $sql->bindParam(":distributiontag", $distributiontag); $sql->bindParam(":promoname", $promoname); $sql->bindParam(":createdbyAID", $user); $sql->bindParam(":status", $status); $firstresult = $sql->execute(); //Get Last Inserted ID $couponbatch = $connection->getLastInsertID(); if ($firstresult > 0) { $ctrunique = 0; //Start generation of coupons for ($i = 0; $count > $i; $i++) { //Generate Coupon Code $code = ""; $code = $model->mt_rand_str(6); $couponcode = "C".$code; // if ($i != 500) // $couponcode = "C".$code; // else // $couponcode = "CSLAA0H"; try { $secondquery = "INSERT INTO coupons (CouponBatchID, CouponCode, Amount, Status, DateCreated, CreatedByAID, ValidFromDate, ValidToDate, IsCreditable ) VALUES(:couponbatch, :couponcode, :amount, :status, NOW(6), :aid, :validfrom, :validto, :iscreditable )"; $sql = $connection->createCommand($secondquery); $sql->bindParam(":couponbatch", $couponbatch); $sql->bindParam(":couponcode", $couponcode); $sql->bindParam(":amount", $amount); $sql->bindParam(":aid", $user); $sql->bindParam(":iscreditable", $iscreditable); $sql->bindParam(":validfrom", $validfrom); $sql->bindParam(":validto", $validto); $sql->bindParam(":status", $status); $secondresult = $sql->execute(); if ($secondresult > 0) { continue; } else { $pdo->rollback(); return array('TransCode' => 0, 'TransMsg' => 'An error occured while generating the coupons [0001]'); } } catch(CDbException $e) { //Check if error is 'Duplicate Key constraints violation' $errcode = $e->getCode(); if ($errcode == 23000) { $ctrunique = 1; try { $pdo->commit(); //get how many coupons have been generated before duplication $querycount = "SELECT COUNT(CouponID) as CouponCount FROM coupons WHERE CouponBatchID = :couponbatch"; $sql = $connection->createCommand($querycount); $sql->bindParam(":couponbatch", $couponbatch); $couponcount = $sql->queryAll(); $remainingcoupon = $count - $couponcount[0]['CouponCount']; return array('TransCode' => 2, 'TransMsg' => 'Coupon already exist. There are '.$remainingcoupon.' remaining coupons to generate. Click Continue.', 'CouponBatchID' => $couponbatch, 'RemainingCoupon' => $remainingcoupon, 'Amount' =>$amount, 'IsCreditable' => $iscreditable, 'Status' => $status, 'ValidFrom' => $validfrom, 'ValidTo' => $validto); } catch(CDbException $e) { $pdo->rollback(); return array('TransCode' => 0, 'TransMsg' => 'An error occured while generating the coupons [0002]'); } } else { $pdo->rollback(); return array('TransCode' => 0, 'TransMsg' => 'An error occured while generating the coupons [0003]'); } } } if($ctrunique == 0){ try { $pdo->commit(); AuditLog::logTransactions(31, " - Batch ID: " . $couponbatch); return array('TransCode' => 1, 'TransMsg' => 'Coupons successfully generated'); } catch(PDOException $e) { $pdo->rollback(); return array('TransCode' => 0, 'TransMsg' => 'An error occured while generating the coupons [0004]'); } } } else { $pdo->rollback(); return array("TransCode" => 0, "TransMsg" => "An error occured while generating the coupons [0005]"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createCoupon()\n {\n //wsw_coupon insert rows\n $entity_Coupon_base = new entity_Coupon_base();\n $entity_Coupon_base->uid = $this->memberInfo->uid;\n $entity_Coupon_base->coupon_money = $this->coupon_value;\n $entity_Coupon_base->coupon_status = service_Coupon_base::coupon_status_unused;\n $entity_Coupon_base->create_time = $this->now;\n\n $dao = dao_factory_base::getCouponDao();\n //$dao->getDb()->startTrans();\n\n for ( $i = 0; $i <= $this->coupon_num; $i++ ) {\n $entity_Coupon_base->coupon_code = $this->getCouponCode();\n $res = $dao->insert( $entity_Coupon_base );\n }\n return $res;\n /**\n * if ( $spec_value_map_dao->getDb()->isSuccess() && $spec_value_map_dao->getDb()->getNumRows() > 0 ) {\n\n if ( $dao->getDb()->isSuccess() ) {\n $dao->getDb()->commit();\n return true;\n } else {\n $dao->getDb()->rollback();\n return false;\n }\n * \n * @return type \n */\n }", "protected function createCodes($coupon)\n {\n if (rand(0, 1)) {\n $this->createNormalCode($coupon);\n } else {\n $this->createUniqueCodes($coupon);\n }\n }", "public function addCoupon($data) \n {\n CI::db()->insert('coupons', $data);\n return CI::db()->insert_id();\n }", "protected function createUniqueCodes($coupon)\n {\n $code = factory(Code::class, rand(10, 100))->make(['type' => ECodeType::UNIQUE]);\n\n $coupon->codes()->createMany($code->toArray());\n }", "public function testCouponGeneration()\n {\n $this->Coupon = new Coupon();\n $this->assertEquals(8, strlen($this->Coupon->generateCouponCode(8)));\n\n }", "public function add_couponAction() {\r\n\t\t$couponCode = (string)$this->getRequest()->getPost('coupon_code', '');\r\n\t\t\t\t\r\n\t\t$quote = $this->getOnepage()->getQuote();\r\n\t\tif ($this->getRequest()->getParam('remove') == '1') {\r\n\t\t\t$couponCode = '';\r\n\t\t}\r\n\t\t\r\n\t\t$oldCouponCode = $quote->getCouponCode();\r\n\t\tif (!strlen($couponCode) && !strlen($oldCouponCode)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t$error = false;\r\n\t\t\t$quote->getShippingAddress()->setCollectShippingRates(true);\r\n\t\t\t$quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\r\n ->collectTotals()\r\n ->save();\r\n\t\t\tif ($couponCode) {\r\n\t\t\t\tif ($couponCode == $quote->getCouponCode()) {\r\n\t\t\t\t\t$message = $this->__('Coupon code \"%s\" was applied.', Mage::helper('core')->htmlEscape($couponCode));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\t$message = $this->__('Coupon code \"%s\" is not valid.', Mage::helper('core')->htmlEscape($couponCode));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$message = $this->__('Coupon code was canceled.');\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Mage_Core_Exception $e) {\r\n\t\t\t$error = true;\r\n\t\t\t$message = $e->getMessage();\r\n\t\t}\r\n\t\tcatch (Exception $e) {\r\n\t\t\t$error = true;\r\n\t\t\t$message = $this->__('Cannot apply the coupon code.');\r\n\t\t}\r\n\t\t//reload HTML for review order section\r\n\t\t$reviewHtml = $this->_getReviewTotalHtml();\t\t\r\n\t\t$result = array(\r\n\t\t\t'error' => $error,\r\n\t\t\t'message' => $message,\r\n\t\t\t'review_html' => $reviewHtml\r\n\t\t);\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}", "public function testCouponCreation()\n {\n $this->Details=array( 'recipient_id' => \"13245245\",\n 'offerType' => \"4534234\",\n 'expringdate' => date(\"Y-m-d H:i:s\")\n );\n $this->Coupon = new Coupon();\n $this->assertContains('success', $this->Coupon->addCoupon($this->Details));\n\n }", "public function create(){\n\t\tglobal $TBL_ecommerce_coupon;\n\n\t\t//Check if the coupon has already been created\n\t\tif($this->id) return FALSE;\n\n\t\t/**\n\t\t * @todo Do complete verifications on the created object coherence.\n\t\t */\n\n\t\t$link = dbConnect();\n\t\t//Create a random coupon code\n\t\t$found=true;\n\t\twhile($found){\n\t\t\t$code = substr(strtoupper(md5(uniqid(rand(), true))),3,8);\n\t\t\t//check if the coupon exists in DB\n\t\t\t$request = request(\"SELECT `id` FROM `$TBL_ecommerce_coupon` WHERE `code`='$code'\",$link);\n\t\t\t//break the loop, the generated code is unique\n\t\t\tif(!mysql_num_rows($request)) $found=false;\n\t\t}\n\t\tmysql_close($link);\n\n\t\t$this->code = $code;\n\n\t\treturn $this->save();\n\t}", "public function generate_coupen_code(){\n\n $randomString = substr(str_shuffle(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 1) . substr(str_shuffle(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\"), 0,5);\n\n $discount_amount = $this->input->post('discount_amount');\n $ProductID = $this->input->post('ProductID');\n $name = $this->db->query(\"select ProductName from Product where ProductID = '$ProductID'\")->row();\n $ProductName = $name->ProductName;\n $Email = $this->input->post('email');\n $coupen_code = $randomString;\n $valid_till = strtotime($this->input->post('newdate'));\n $number_of_uses = $this->input->post('number_of_uses');\n $created_on = time();\n $user_role = $this->session->userdata['logged_in']['userid'];\n $created_by = $user_role;\n \n $CampaignContactID = $this->input->post('CampaignContactID');\n $p_date = date(\"Y-m-d\") ;\n $remark = \"Sent Coupon Code \".$coupen_code;\n $query = $this->db->query(\"insert into Coupons (Code,DiscountAmount,DiscountRate,ValidTill,CreatedBy,CreatedOn,MaxNumberOfUses,Status,NumberOfUses) value ('$coupen_code','$discount_amount','00.00','$valid_till','$created_by','$created_on','$number_of_uses','1','0')\");\n $CoupenID = $this->db->insert_id();\n $sql = $this->db->query(\"insert into ProductCoupons (CouponID,ProductID) values ('$CoupenID','$ProductID')\");\n \n //config for coupons\n $config ['protocol'] = 'smtp';\n $config ['smtp_host'] = 'smtp.sparkpostmail.com';\n $config ['smtp_port'] = 587;\n $config ['mailpath'] = '/usr/sbin/sendmail';\n $config ['smtp_user'] = 'SMTP_Injection'; \n $config ['smtp_pass'] = 'eeba7b59202366ae3cb85bcd4fb9480027f4217f'; \n $config ['mailtype'] = 'html';\n $config ['charset'] = 'iso-8859-1';\n $config ['wordwrap'] = TRUE;\n $config['smtp_crypto'] = 'tls';\n $config ['smtp_auth'] = 'AUTH LOGIN';\n $this->load->library('email');\n $this->email->initialize($config);\n $this->email->set_newline(\"\\r\\n\");\n $data[\"sender_mail\"] = \"[email protected]\";\n $this->email->from('[email protected]', \"Lurningo\");\n $this->email->to($Email);\n $this->email->subject(\"Coupon Code From Lurningo\");\n \n \n $body = '<body>\n <table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-collapse: collapse; max-width: 600px; width: 100%; background-color: #ffffff; margin-left: auto; margin-right: auto;\" align=\"center\">\n <tr>\n <td style=\"background-color: #333333; padding: 5px; width: 32px;\" valign=\"middle\">\n <img src=\"https://www.lurningo.com/images/logo2.png\" width=\"150\" height=\"36\" style=\"margin-top: 10px;\">\n </td>\n </tr>\n <tr>\n <td style=\"color: #333333; font-family: Arial; font-size: 14px; padding: 20px;\">\n Hello,\n <br /><br />\n Here is your special discount coupon for <strong>'.$ProductName.'</strong>.\n <br /><br />\n <div style=\"text-align:center; padding: 10px; border:1px dashed blue; background-color: ffff99;\">\n <strong>'.$coupen_code.'</strong>\n </div>\n <br />\n Use this coupon to get a discount of <strong>Rs. '.$discount_amount.'</strong>.\n <br /><br />\n <a href=\"http://lurningo.com/product/details/'.$ProductID.'\" style=\"font-weight: bold; color: blue\">Place your order now</a>\n <br /><br />\n If you have any queries call us on <strong>08039658008</strong> or write to us at <a href=\"mailto:[email protected]\">[email protected]</a>.\n </td>\n </tr>\n <tr>\n <td style=\"background-color: #e0e0e0; padding: 10px; color: #808080; font-family: Arial; font-size: 11px;\" align=\"center\">\n This email has been sent to you by Lurningo.\n <br /><br />\n B-903, Western Edge II, Borivali East, Mumbai-400066. \n </td>\n </tr>\n </table>\n</body>\n';\n $this->email->message($body);\n try{ \n\t\t\t$status = $this->email->send();\n }catch( Exception $e ){\n\t\t\n\t\t} \n //$status = $this->email->send();\n $sql = $this->db->query(\"insert into crm_followuplog (CampaignContactID,FollowupDate,NewFollowupDate,Remarks) values ('$CampaignContactID','$p_date','$p_date','$remark')\");\n echo $coupen_code;\n }", "public function create(CouponRequest $request)\n {\n try {\n $this->checkForDuplicateCode($request);\n\n $newCoupon = Coupon::create([\n 'code' => $request->input('coupon-code'),\n 'discount_amount' => (is_null($request->input('coupon-amount')) || $request->input('coupon-amount') == 0) ? NULL : $request->input('coupon-amount'),\n 'discount_type' => $request->input('coupon-type')\n\n ]);\n\n $newCoupon->save();\n } catch (\\Exception $e) {\n return back()->withErrors($e->getMessage())->withInput();\n }\n\n return redirect('/coupon');\n }", "public function run()\n {\n foreach($this->coupons as $coupon){\n Coupon::create([\n 'campaign_id' => $coupon['campaign_id'],\n 'code' => $coupon['code'],\n 'is_activated' => false,\n ]);\n }\n }", "public function couponCallback() {\n\n\t\ttry {\n\t\t\t/* * ********* Check input parameters ******************************* */\n\t\t\tif (!isset($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type'])) {\n\t\t\t\tthrow new Exception(SyC::t('sdk','At least one of the parameters is missing. Received: {data}', array('{data}' => print_r($_POST, true))));\n\t\t\t}\n\n\t\t\t//make sure the coupon is valid\n\t\t\t$this->assertCouponIsValid($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type']);\n\n\t\t\t//save the coupon\n\t\t\t$this->saveCoupon($_POST['token'], $_POST['coupon_code'], $_POST['coupon_value'], $_POST['coupon_type'], (isset($_POST['product_unique_ids']) && is_array($_POST['product_unique_ids']) ? $_POST['product_unique_ids'] : array()));\n\n\t\t\t//check if the coupon is intended to be applied to the current cart\n\t\t\tif (empty($_POST['save_only'])) {\n\t\t\t\t$this->applyCoupon($_POST['coupon_code']);\n\t\t\t}\n\t\t} catch (Exception $e) {\n\n\t\t\theader(\"HTTP/1.0 403\");\n\t\t\techo $e->getMessage();\n\t\t\t\n\t\t\tif($this->isDebugMode()){\n\t\t\t\techo $e->getTraceAsString();\n\t\t\t}\n\t\t}\n\t}", "public function saveCoupon($data){\r\n $ValidTill = strtotime($data['validTill']);\r\n $stmt = $this->pdoConn->prepare(\"\r\n INSERT INTO \".CommonTables::COUPON.\" SET\r\n CouponCode = '\".$data['coupon'].\"',\r\n ItemType = '\".$data['item-type'].\"',\r\n ItemId = '\".$data['item'].\"',\r\n ValidTill = '\".$ValidTill.\"',\r\n DiscountType = '\".$data['discountType'].\"',\r\n DiscountValue = '\".$data['discountValue'].\"'\r\n\r\n \");\r\n\r\n if($stmt->execute()){\r\n return 1;\r\n }else{\r\n return 0;\r\n }\r\n }", "public function wpm_ca_woocommerce_coupon_code( $err, $err_code, $coupon ) {\n\n\t\t// 1. Check if this coupon already exists in WC - if yes, do nothing,\n\t\t// no need to call API\n\t\tif ( $err_code != \\WC_Coupon::E_WC_COUPON_NOT_EXIST ) {\n\t\t\treturn $err;\n\t\t}\n\n\t\t$code_coupon = $coupon->get_code();\n\n\t\t// 2. Now - call API and get response from coupon supplier\n\t\t$result = $this->validateCouponWithAPI($code_coupon, 'Validate');\n\n\t\tif(isset($result['TokenDetailsList'][0]) && isset( $result['TokenDetailsList'][0]['TokenValue'] ) &&\n isset( $result['TokenDetailsList'][0]['TokenStatus'] ) && $result['TokenDetailsList'][0]['TokenStatus'] == 'Active' ) {\n\n\t\t\t$amount = $result['TokenDetailsList'][0]['TokenValue']; // Amount\n\t\t\t$discount_type = 'fixed_cart'; // Type: fixed_cart, percent, fixed_product, percent_product\n\n\t\t\t$new_coupon = array(\n\t\t\t\t'post_title' => $code_coupon,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_author' => 1,\n\t\t\t\t'post_type' => 'shop_coupon',\n\t\t\t\t'post_excerpt' => __( 'Generated automatically using api-ppe.tesco.com API response (' . date( 'd.m.Y H:i:s' ) . ')', WPM_COUPONS_API_TEXT_DOMAIN )\n\t\t\t);\n\n\t\t\t$new_coupon_id = wp_insert_post( $new_coupon );\n\t\t\tupdate_post_meta( $new_coupon_id, 'is_wpm_generated_coupon', '1');\n\t\t\tupdate_post_meta( $new_coupon_id, 'discount_type', $discount_type );\n\t\t\tupdate_post_meta( $new_coupon_id, 'coupon_amount', $amount );\n\t\t\tupdate_post_meta( $new_coupon_id, 'individual_use', 'no' );\n\t\t\tupdate_post_meta( $new_coupon_id, 'product_ids', '' );\n\t\t\tupdate_post_meta( $new_coupon_id, 'exclude_product_ids', '');\n\t\t\tupdate_post_meta( $new_coupon_id, 'usage_limit', '1');\n\t\t\tupdate_post_meta( $new_coupon_id, 'expiry_date', date('Y-m-d', strtotime($result['TokenDetailsList'][0]['TokenExpiryDate'])));\n\t\t\tupdate_post_meta( $new_coupon_id, 'apply_before_tax', 'yes' );\n\t\t\tupdate_post_meta( $new_coupon_id, 'excerpt', __( 'Generated automatically (' . date( 'd.m.Y H:i:s' ) . ')', WPM_COUPONS_API_TEXT_DOMAIN ) );\n\t\t\tupdate_post_meta( $new_coupon_id, 'free_shipping', 'no' );\n\n\t\t\tWC()->cart->add_discount( sanitize_text_field($code_coupon) );\n\n return null;\n\t\t} elseif(isset($result['TokenDetailsList'][0]) && isset( $result['TokenDetailsList'][0]['TokenValue'] ) &&\n isset( $result['TokenDetailsList'][0]['TokenStatus'] ) && $result['TokenDetailsList'][0]['TokenStatus'] == 'Redeemed')\n {\n $coupon_code = $coupon->get_code();\n\n return \"Coupon '$coupon_code' is already Redeemed\";\n }\n\n return $err;\n\t}", "public function coupons()\n {\n return new Coupon($this);\n }", "protected function _createCoupons($ruleId,array $couponData)\n\t{\n\t\t$rawCoupons = explode(\",\",$couponData[11]);\n\t\t$coupons = array_filter($rawCoupons);\n\t\t$couponExpiry = date('Y-m-d',strtotime($couponData[8]));\t\t\n\t\tforeach($coupons as $couponCode):\n\t\t\t$couponCode = trim($couponCode);\n\t\t\tif($couponCode!=''):\n\t\t\t\t$coupon = $this->_coupon->create();\n\t\t\t\t$coupon->setId(null);\n\t\t\t\t$coupon->setRuleId($ruleId);\n\t\t\t\t$coupon->setUsageLimit(intval($couponData[6]));\n\t\t\t\t//$coupon->setUsagePerCustomer(1);\n\t\t\t\t//$coupon->setTimesUsed($timesUsed);\n\t\t\t\t$coupon->setExpirationDate($couponExpiry);\n\t\t\t\t$coupon->setCreatedAt(time());\n\t\t\t\t$coupon->setType(\\Magento\\SalesRule\\Helper\\Coupon::COUPON_TYPE_SPECIFIC_AUTOGENERATED);\n\t\t\t\t$coupon->setCode($couponCode);\n\t\t\t\t$coupon->save();\n\t\t\tendif;\n\t\tendforeach;\t\t\n\t}", "public function create()\n { \n if ($this->validate([\n 'name' => 'required|min_length[3]|max_length[255]',\n ])) {\n $data = [\n 'name' => $this->request->getVar('name'),\n 'type' => url_title($this->request->getVar('type')),\n 'code' => $this->request->getVar('code'),\n 'offer' => $this->request->getVar('offer'),\n 'apply_to' => $this->request->getVar('apply_to'),\n 'buy_x_get_y' => $this->request->getVar('buy_x_get_y')[0]!=0 ? implode(\",\",$this->request->getVar('buy_x_get_y')):null,\n 'apply_value' => $this->request->getVar('apply_value')!=0 ? implode(\",\",$this->request->getVar('apply_value')):null,\n 'user_id' => $this->user_data['id'],\n 'valid_from' => $this->request->getVar('valid_from'),\n 'valid_to' => $this->request->getVar('valid_to')\n ];\n $this->coupons->save($data);\n return $this->response->setJSON(['status_code'=> 201,'message'=>'coupon created succesfully','data'=>$data]);\n }\n $data = [\n 'folder_name' => 'coupons',\n 'page_name' => 'create_coupon',\n 'page_title' => 'Create Coupon',\n 'collection' => $this->collection->findAll(),\n 'errors' => $this->validation->getErrors(),\n ];\n return view('admin/view', $data);\n }", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "public function insert_coupon()\n {\n $name= $this->input->post('name');\n $no_of_cartons= $this->input->post('no_of_cartons');\n $start_date= date('Y-m-d',strtotime($this->input->post('start_date')));\n $end_date= date('Y-m-d',strtotime($this->input->post('end_date')));\n $count=$this->Coupon_model->check_coupon_dates($start_date,$end_date);\n //echo $count;exit;\n //echo $no_of_cartons;exit;\n if($count<=0)\n {\n $data = array(\n 'name' => $name,\n 'no_of_cartons' => $no_of_cartons,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'amount' => $this->input->post('amount',TRUE),\n 'created_by' => $this->session->userdata('user_id'),\n 'created_time' => date('Y-m-d H:i:s'),\n 'status' => 1\n );\n $coupon_id = $this->Common_model->insert_data('coupon',$data);\n if($coupon_id>0)\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-success alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Success!</strong> Coupon has been added successfully! </div>');\n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong> Something went wrong. Please check. </div>'); \n } \n }\n else\n {\n $this->session->set_flashdata('response','<div class=\"alert alert-danger alert-dismissable\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\"></button>\n <strong>Error!</strong>Start Date and End Date Already Exist! Please check </div>'); \n }\n redirect(SITE_URL.'coupon'); \n }", "public function index()\n {\n // Coupon::truncate();\n $client = new \\GuzzleHttp\\Client();\n $url = config('app.add_coupon');\n $response = $client->get($url);\n $data = $response->getBody();\n $data = json_decode($data, true);\n // dd($data->data);\n // var_dump($data['data'][0]['id']);\n foreach ($data['data'] as $i) {\n unset($i['expiry_date']);\n unset($i['status']);\n $i = change_key($i, 'coupon_code', 'code');\n $i = change_key($i, 'amount_type', 'type');\n\n Coupon::insert($i);\n var_dump($i);\n echo '<br/>';\n }\n }", "public function run()\n {\n $defaultCoupon = [1];\n $coupons = [\n ['discount' => 10, 'description' => 'リリース記念10%Off!'],\n ];\n foreach($coupons as $coupon) {\n \\App\\Coupon::create($coupon);\n }\n }", "function add_couponCode(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function couponPostAction()\n {\n /** @var Divante_OpenLoyalty_Model_Quote $quote */\n $quote = $this->_getQuote();\n\n $this->resetLoyaltyInUse();\n\n /** @var Mage_Core_Helper_Data $helperCore */\n $helperCore = Mage::helper('core');\n \n /**\n * No reason continue with empty shopping cart\n */\n if (!$quote->getItemsCount()\n || !$this->_validateFormKey()) {\n $this->_goBack();\n\n return;\n }\n\n /** @var string $couponCode */\n $couponCode = (string) $this->getRequest()->getParam('coupon_code');\n \n if ($this->getRequest()->getParam(self::REMOVE_PARAM) == 1) {\n $couponCode = '';\n }\n \n $oldCouponCode = $quote->getCouponCode();\n\n if (!strlen($couponCode) && !strlen($oldCouponCode)) {\n $this->_goBack();\n \n return;\n }\n\n try {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n $quote->setCouponCode(strlen($couponCode) ? $couponCode : '')\n ->unsetLoyaltyDiscount()\n ->collectTotals()\n ->save();\n\n if (strlen($couponCode)) {\n if ($couponCode == $quote->getCouponCode()) {\n $this\n ->_getSession()\n ->addSuccess(\n $this->__(\n 'Coupon code \"%s\" was applied.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n } else {\n $this\n ->_getSession()\n ->addError(\n $this->__(\n 'Coupon code \"%s\" is not valid.',\n $helperCore->htmlEscape($couponCode)\n )\n );\n }\n } else {\n $this\n ->_getSession()\n ->addSuccess($this->__('Coupon code was canceled.'));\n }\n\n } catch (Mage_Core_Exception $e) {\n $this\n ->_getSession()\n ->addError($e->getMessage());\n } catch (Exception $e) {\n $this\n ->_getSession()\n ->addError($this->__('Cannot apply the coupon code.'));\n Mage::logException($e);\n }\n\n $this->_goBack();\n }", "public function getAddCouponInfo()\n {\n $sql = \"SELECT * FROM casino_coupon_add \";\n return $this->_rdb->fetchAll($sql);\n }", "public function store(Request $request)\n {\n // if(count(Coupon::where('code', $request->coupon_code)->get()) > 0){\n // flash(translate('Coupon already exist for this coupon code'))->error();\n // return back();\n // }\n // $coupon = new Coupon;\n // if ($request->coupon_type == \"product_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $cupon_details = array();\n // foreach($request->product_ids as $product_id) {\n // $data['product_id'] = $product_id;\n // array_push($cupon_details, $data);\n // }\n // $coupon->details = json_encode($cupon_details);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n // elseif ($request->coupon_type == \"cart_base\") {\n // $coupon->type = $request->coupon_type;\n // $coupon->code = $request->coupon_code;\n // $coupon->discount = $request->discount;\n // $coupon->discount_type = $request->discount_type;\n // $date_var = explode(\" - \", $request->date_range);\n // $coupon->start_date = strtotime($date_var[0]);\n // $coupon->end_date = strtotime( $date_var[1]);\n // $data = array();\n // $data['min_buy'] = $request->min_buy;\n // $data['max_discount'] = $request->max_discount;\n // $coupon->details = json_encode($data);\n // if ($coupon->save()) {\n // flash(translate('Coupon has been saved successfully'))->success();\n // return redirect()->route('coupon.index');\n // }\n // else{\n // flash(translate('Something went wrong'))->danger();\n // return back();\n // }\n // }\n }", "public function applyCouponAction()\n {\n if (!$this->_isActive()) {\n $this->norouteAction();\n return;\n }\n\n $isRemove = (bool)$this->getRequest()->getParam('remove', false);\n $coupon = $this->getRequest()->getParam('coupon');\n if ($isRemove) {\n $coupon = null;\n }\n\n $result = $this->getOnepage()->saveCouponCode($coupon);\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "protected abstract function applyCoupon($coupon_code);", "public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }", "protected function createNormalCode($coupon)\n {\n $code = factory(Code::class)->make(['type' => ECodeType::NORMAL]);\n\n $coupon->codes()->create($code->toArray());\n }", "public function insertClient($data) {\n $this->db->query(\"INSERT INTO `clients`(`email`, `phone`, `gender`, `occasion`) VALUES (:email, :phone, :gender, :occasion)\");\n $this->db->bind(':email', $data['email']);\n $this->db->bind(':phone', $data['phone']);\n // ocassion and gender values\n $oca_string = '';\n $gen_string = '';\n // concatinating gender if not null\n foreach ($data['gender'] as $gender) {\n if ($gender != 0) {\n $gen_string .= $gender .',';\n }\n }\n \n // concatinating all the occasions that the user choose\n\n foreach ($data['occasion'] as $occasion) {\n if ($occasion != 0) {\n\n $oca_string .= $occasion .',';\n }\n }\n $this->db->bind(':gender', $gen_string);\n $this->db->bind(':occasion', $oca_string);\n \n\n $push = $this->db->execute();\n\n return $push;\n }", "static function couponNumbers($n)\n { \n //array to save the coupon\n $arr = array();\n //$i = 0;\n //count to count the number of thime rendom number generated\n $count = 0;\n //index to change the index of array\n $index = 0;\n //while loop until use get n number of coupon\n while(sizeof($arr) != $n)\n {\n $count++;\n $num = random_int(10,($n+100));\n //if condition to check the coupon use unique or not\n if(!array_search(\"cou\".$num.\"pon\",$arr))\n {\n $arr[$index++] = (\"cou\".$num.\"pon\");\n }\n }\n \n //no of time coupon generated\n echo \"count \".$count.\"\\n\";\n //unique coupon\n foreach ($arr as $print) {\n echo $print.\"\\n\";\n }\n }", "public function insert($cbtSoalSiswa);", "protected function _importCoupon(array $couponData)\n { \n\t\t$customerGroupIds = $this->_customerGroups();//Customer Groups\n\t\t$couponId = $couponData[0];//Coupon Id\n\t\t$couponName = $couponData[1];//Coupon Name\n\t\t$couponDescription = $couponData[2];//Coupon Description\n\t\t$couponDiscount = $couponData[3];//Discount Amount\n\t\t$couponDiscountType = $couponData[4];//Discount Type\n\t\t$couponMaxUse = $couponData[6];//Coupon max usage\n\t\t$couponStartDate = date('Y-m-d',strtotime($couponData[7]));//Coupon start date\n\t\t$couponEndDate = date('Y-m-d',strtotime($couponData[8]));//Coupon End date\n\t\t$couponMinOrderTotal = $couponData[9];//Min order total for coupon\n\t\t$couponApplyType = $couponData[10];//Check applicable for device or subscriptions\n\t\t$couponCodes = $couponData[11];//Coupon Codes\n\t\t$couponDiscountTo = $couponData[12];//Apply discount To\n\t\t$couponMinOrderQty = $couponData[13];//Min order Qty\n\t\t$couponProductType = $couponData[14];//Applicable to product types\n\t\t$couponSkus = $couponData[15];//Applicable product sku\n\t\t$isCouponApplicableToProducts = $couponData[16];// Is Given Products Applicable\n\t\t$couponProducts = $couponData[17];//Products\n\t\t//$isCouponApplicableToTerms = $couponData[18];//Is Given Terms Applicable\n\t\t//$couponTerms = $couponData[19];//Terms\n\t\t\n\t\tif($couponDiscountType == 'percentage'):\n\t\t\t$discountType = \\Magento\\SalesRule\\Model\\Rule::BY_PERCENT_ACTION;\n\t\telse:\n\t\t\t$discountType = \\Magento\\SalesRule\\Model\\Rule::BY_FIXED_ACTION;\n\t\tendif;\n\t\t/** Percentage discount only applicable for Cheapeset and Expensive **/\n\t\tif($couponDiscountTo == 'cheapest'):\n\t\t\t$discountType = \\Amasty\\Rules\\Helper\\Data::TYPE_CHEAPEST;\n\t\telseif($couponDiscountTo == 'expensive'):\n\t\t\t$discountType = \\Amasty\\Rules\\Helper\\Data::TYPE_EXPENCIVE;\n\t\tendif;\n\t\t$fixedDiscount = 0;\n\t\tif(($couponDiscountTo == 'cheapest' || $couponDiscountTo == 'expensive') && $couponDiscountType != 'percentage'):\n\t\t\t$fixedDiscount = $couponDiscount;\n\t\t\t$couponDiscount = 100;\n\t\tendif;\n\t\t$discountQty = 0;\n\t\t\n\t\t$this->_logger->addDebug('--------------------------------------------------');\n\t\t$this->_logger->addDebug('Coupon Id:'.$couponId);\n\t\t$this->_logger->addDebug('Coupon Name:'.$couponName);\n\t\t$this->_logger->addDebug('Coupon Description:'.$couponDescription);\n\t\t$this->_logger->addDebug('Coupon Discount:'.$couponDiscount);\n\t\t$this->_logger->addDebug('Coupon Type:'.$couponDiscountType);\n\t\t$this->_logger->addDebug('Max Uses:'.$couponMaxUse);\n\t\t$this->_logger->addDebug('Start Date:'.$couponStartDate);\n\t\t$this->_logger->addDebug('End Date:'.$couponEndDate);\n\t\t$this->_logger->addDebug('Min Order Total:'.$couponMinOrderTotal);\n\t\t$this->_logger->addDebug('CouponApplyType:'.$couponApplyType);\n\t\t$this->_logger->addDebug('CouponCodes:'.$couponCodes);\n\t\t$this->_logger->addDebug('CouponDiscounTo:'.$couponDiscountTo);\n\t\t$this->_logger->addDebug('Min Order Qty:'.$couponMinOrderQty);\n\t\t$this->_logger->addDebug('Product Types:'.$couponProductType);\n\t\t$this->_logger->addDebug('SKUs:'.$couponSkus);\n\t\t$this->_logger->addDebug('CouponProducts:'.$couponProducts);\n\t\t//$this->_logger->addDebug('Terms:'.$couponTerms);\n\t\t$this->_logger->addDebug('--------------------------------------------------');\n\t\t\n\t\t \n\t\t$conditions = $this->_getRuleConditions($couponData);//Format Rule Conditions\n\t\t$actions = $this->_getRuleActions($couponData);//Format Rule Actions\n\t\t\n\t\t$rule = $this->_rule->create();\n\t\t$rule->setName($couponName)\n\t\t\t->setDescription($couponDescription)\n\t\t\t->setFromDate($couponStartDate)//Core Issue Persists\n\t\t\t->setToDate($couponEndDate)//Core Issue Persists\n\t\t\t->setCouponType(\\Magento\\SalesRule\\Model\\Rule::COUPON_TYPE_SPECIFIC)\n\t\t\t//->setCouponCode('my-coupon-code')\n\t\t\t->setUseAutoGeneration(true)\n\t\t\t->setUsesPerCustomer(1)\n\t\t\t->setUsesPerCoupon($couponMaxUse)\n\t\t\t->setCustomerGroupIds($customerGroupIds)\n\t\t\t->setIsActive(1)\n\t\t\t->setConditionsSerialized('')\n\t\t\t->setActionsSerialized('')\n\t\t\t->setStopRulesProcessing(0)\n\t\t\t->setIsAdvanced(1)\n\t\t\t->setProductIds('')\n\t\t\t->setSortOrder(0)\n\t\t\t->setSimpleAction($discountType)\n\t\t\t->setDiscountAmount($couponDiscount)\n\t\t\t->setDiscountQty($discountQty)\n\t\t\t->setDiscountStep(0)\n\t\t\t->setSimpleFreeShipping('0')\n\t\t\t->setApplyToShipping('0')\n\t\t\t->setIsRss(0)\n\t\t\t->setWebsiteIds(array(1))\n\t\t\t->setStoreLabels(array($couponName));\t\t\n\t\t$rule->setData(\"conditions\",$conditions);\n\t\t$rule->setData(\"actions\",$actions);\n\t\t$rule->loadPost($rule->getData());\n\t\t$rule->save();\n\n\t\tif($rule->getId()) {\n\t\t\t$ruleId = $rule->getId();\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\n\t\t\t$connection = $resource->getConnection();\n\t\t\t$sql = \"UPDATE `salesrule` SET `to_date` = '$couponEndDate', `from_date` = '$couponStartDate' WHERE `salesrule`.`rule_id` = '$ruleId'\";\n\t\t\t$connection->query($sql);\n\t\t}\n\t\t\n\t\t/** Set Max discount amount for cheapest and expensive rule with fixed discount **/\n\t\tif ($rule->getId() && $couponDiscountType != 'percentage') {\n\t\t\t//Only for Cheapest and Expensive with fixed discount\n $amrulesRule = $this->_amastyRuleFactory->create();\n\n $amrulesRule\n ->load($rule->getId(), 'salesrule_id')\n ->setData('max_discount',$fixedDiscount)\n ->setData('salesrule_id', $rule->getId())\n ->save()\n ;\n }\t\t\n\t\t$this->_createCoupons($rule->getRuleId(),$couponData);//Create and assign coupons to the created rule\n return $couponData;\n }", "public function run()\n {\n \n\n \\DB::table('coupons')->delete();\n \n \\DB::table('coupons')->insert(array (\n 0 => \n array (\n 'code' => 'ABC123',\n 'created_at' => '2021-03-12 16:34:10',\n 'expire_at' => NULL,\n 'id' => 1,\n 'percent_off' => NULL,\n 'start_at' => NULL,\n 'type' => 'fixed',\n 'updated_at' => '2021-03-12 16:34:10',\n 'value' => 3000,\n ),\n 1 => \n array (\n 'code' => 'DEF456',\n 'created_at' => '2021-03-12 16:34:10',\n 'expire_at' => NULL,\n 'id' => 2,\n 'percent_off' => 50,\n 'start_at' => NULL,\n 'type' => 'percent',\n 'updated_at' => '2021-03-12 16:34:10',\n 'value' => NULL,\n ),\n 2 => \n array (\n 'code' => 'dddd',\n 'created_at' => '2021-03-13 16:45:17',\n 'expire_at' => '2021-03-12 19:43:00',\n 'id' => 3,\n 'percent_off' => NULL,\n 'start_at' => '2021-03-10 19:43:00',\n 'type' => 'fixed',\n 'updated_at' => '2021-03-13 16:45:17',\n 'value' => 13,\n ),\n 3 => \n array (\n 'code' => 'start',\n 'created_at' => '2021-03-13 16:57:52',\n 'expire_at' => '2021-03-16 19:57:00',\n 'id' => 4,\n 'percent_off' => NULL,\n 'start_at' => '2021-03-14 19:57:00',\n 'type' => 'fixed',\n 'updated_at' => '2021-03-13 16:58:46',\n 'value' => 25,\n ),\n 4 => \n array (\n 'code' => 'valid',\n 'created_at' => '2021-03-13 16:58:13',\n 'expire_at' => '2021-03-18 19:58:00',\n 'id' => 5,\n 'percent_off' => NULL,\n 'start_at' => '2021-03-12 19:58:00',\n 'type' => 'fixed',\n 'updated_at' => '2021-03-13 16:58:34',\n 'value' => 25,\n ),\n 5 => \n array (\n 'code' => 'new',\n 'created_at' => '2021-03-13 17:02:11',\n 'expire_at' => '2021-03-15 20:02:00',\n 'id' => 6,\n 'percent_off' => NULL,\n 'start_at' => '2021-03-13 20:02:00',\n 'type' => 'fixed',\n 'updated_at' => '2021-03-13 17:02:11',\n 'value' => 2500,\n ),\n 6 => \n array (\n 'code' => 'fixed10',\n 'created_at' => '2021-03-24 03:08:43',\n 'expire_at' => '2021-09-30 06:08:00',\n 'id' => 7,\n 'percent_off' => NULL,\n 'start_at' => '2021-03-22 06:08:00',\n 'type' => 'fixed',\n 'updated_at' => '2021-03-24 03:09:20',\n 'value' => 100000,\n ),\n ));\n \n \n }", "public function applyCoupon($coupon)\n {\n $this->assertCustomerExists();\n\n $customer = $this->asStripeCustomer();\n\n $customer->coupon = $coupon;\n\n $customer->save();\n }", "public function getCouponCode();", "public function insertCusClick($info)\n {\n $this->_wdb->insert($this->table_user, $info);\n }", "public function insert($cbtRekapNilai);", "public function store(Request $request)\n {\n $data = $request->all();\n //echo \"<pre>\"; print_r($data);die();\n\n\n $coupon = new Coupon;\n $coupon->coupon_code = $data['coupon_code'];\n $coupon->amount = $data['amount'];\n $coupon->amount_type = $data['amount_type'];\n\n\n if(!empty($data['status'])){\n $coupon->status = $data['status'];\n }\n\n\n\n $coupon->expiry_date = date($data['expiry_date']);\n\n\n\n $couponsCode = DB::table('coupons')->where(['coupon_code' => $data['coupon_code']])->count();\n //print_r($countProducts);\n //die();\n\n if($couponsCode>0){\n Toastr::error('Coupons already exist in Cart!','Errors');\n return redirect()->back();\n }\n\n\n $coupon->save();\n\n //Toastr::success('Coupon code update attributes successfully','Success');\n Toastr::success('Create Coupon code successfully !','Success');\n return redirect()->route('admin.coupons.index');\n\n }", "public function woocommerce_modern_coupon_cart() {\n\n\t\t\tif ( wc_coupons_enabled() ) {\n\t\t\t\t?>\n\t\t\t<div id=\"ast-checkout-coupon\">\n\t\t\t\t<p id=\"ast-coupon-trigger\"><?php esc_attr_e( 'Have a coupon?', 'astra-addon' ); ?></p>\n\t\t\t\t<div class=\"coupon\">\n\t\t\t\t<label class=\"ast-coupon-label\" for=\"ast-coupon-code\" ><?php esc_attr_e( 'coupon:', 'astra-addon' ); ?></label>\n\t\t\t\t\t<input type=\"text\" name=\"ast-coupon-code\" id=\"ast-coupon-code\" value=\"\" placeholder=\"<?php esc_attr_e( 'Coupon code', 'astra-addon' ); ?>\" />\n\t\t\t\t\t<a class=\"button\" id=\"ast-apply-coupon\" name=\"ast-apply-coupon\" value=\"<?php esc_attr_e( 'Apply', 'astra-addon' ); ?>\">\n\t\t\t\t\t\t\t<?php esc_attr_e( 'Apply', 'astra-addon' ); ?>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}", "protected function _get_coupons( $coupons ) {\n\t\treturn implode( ', ', wp_list_pluck( $coupons, 'code' ) );\n\t}", "public function coupon()\n\t{\n\t\t$session = JFactory::getSession();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call coupon method of model to apply coupon\n\t\t$valid = $model->coupon();\n\t\t$cart = $session->get('cart');\n\t\t$this->modifyCalculation($cart);\n\t\t$this->_carthelper->cartFinalCalculation(false);\n\n\t\t// Store cart entry in db\n\t\t$this->_carthelper->carttodb();\n\n\t\t// If coupon code is valid than apply to cart else raise error\n\t\tif ($valid)\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = JText::_('COM_REDSHOP_COUPON_CODE_IS_NOT_VALID');\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t$this->setRedirect($link, $msg);\n\t\t}\n\t}", "public function setCouponCode($code);", "public function run()\n {\n \n \t$couponsRecords = [\n \t[\n \t\t'id' => 1,\n \t\t'coupon_option' => 'Manual',\n \t\t'coupon_code' => 'test10',\n \t\t'categories' => '1,2',\n \t\t'users' => '[email protected],[email protected]',\n \t\t'coupon_type' => 'Single',\n \t\t'amount_type' => 'Percentage',\n \t\t'amount' => '10',\n \t\t'expiry_date' => '2021-01-27',\n \t\t'status' => 1\n \t]\n ];\n\n Coupon::insert($couponsRecords);\n\n }", "public function doCreateCoupon(Request $request){\n\n foreach($request->input('wallet_detail') as $item){\n if($item['transactionAmmount'] != '0'){\n $wallet_master = wallet_master::find($request->input('clientId'));\n\n $model = new wallet_detail([\n 'transactionAmmount'=>$item['transactionAmmount'],\n 'transactionDescription'=>$item['transactionDescription'],\n 'transactionType'=>$item['transactionType'],\n 'walletId'=>$wallet_master->clientId,\n 'walletOldBalance'=>$wallet_master->actualBalance,\n 'walletNewBalance'=>$wallet_master->actualBalance - $item['transactionAmmount']\n ]);\n $wallet_master->actualBalance = $wallet_master->actualBalance - $item['transactionAmmount']; //Save the new balance on the wallet\n $wallet_master->redeemedBalance = $wallet_master->redeemedBalance + $item['transactionAmmount']; //Save the total redeemedBalance for the historic shown to the user\n $wallet_master->save(); //save the wallet master\n $model->save(); //save the wallet detail\n }\n }\n $msg = array('type'=>'success','title'=>'Proceso realizado','contents'=>'Se han generado los cupones!');\n return redirect()->route('client.coupon.getActiveCoupons')->with('msg', $msg);\n\n }", "private function insertBrownies() {\n //$snacks = system('curl -s http://www.defconyum.com/askedrelic.php');\n //if (empty($snacks) || strripos($snacks, \"closed\") !== false) {\n // return \"\";\n //}\n\n $ret = \"\\n\";\n /* $ret .= \"HEY p[MULTISYNC]p buy some delicious \"; */\n $ret .= \"Rest In Crumbles Defcon YUM :(\\n\";\n $ret .+ \"http://www.defconyum.com/goodbye.php\\n\";\n\n /* $ret .= \", today only at http://www.defconyum.com/\\n\"; */\n\n //if ($day == \"2012-10-17\") {\n // $ret .= \"Today only, r{Chocolate Overload Espresso Brownies}r\";\n //} elseif ($day == \"2012-10-25\") {\n // $ret .= \"r{Apple Cider Caramel Cookies}r\";\n //} else {\n // return \"\";\n //}\n\n return $ret;\n }", "private function _doCoupon($coupon, $action)\n\t{\n\t\t$allowedActions = array('add', 'update');\n\n\t\t$couponCode = $coupon->getCode();\n\n\t\t$cnId = $this->couponExists($couponCode);\n\n\t\t// Check everything\n\n\t\t$coupon->verify();\n\n\t\tif (!in_array($action, $allowedActions))\n\t\t{\n\t\t\tthrow new \\Exception(Lang::txt('Bad action. Why would you try to do something like that anyway?'));\n\t\t}\n\n\t\t// check if this is a coupon\n\t\tif (!($coupon instanceof Coupon))\n\t\t{\n\t\t\tthrow new \\Exception(Lang::txt('Bad coupon. Unable to continue.'));\n\t\t}\n\n\t\tif ($action == 'update')\n\t\t{\n\t\t\t// check if product exists\n\t\t\tif (!$cnId)\n\t\t\t{\n\t\t\t\tthrow new \\Exception(Lang::txt('Cannot update coupon: coupon does not exixt.'));\n\t\t\t}\n\t\t}\n\t\telseif ($action == 'add')\n\t\t{\n\t\t\tif ($cnId)\n\t\t\t{\n\t\t\t\tthrow new \\Exception(Lang::txt('Cannot add coupon: coupon already exists.'));\n\t\t\t}\n\t\t}\n\n\n\t\t// ### Do the coupon\n\n\t\tif ($action == 'update')\n\t\t{\n\t\t\t$sql = \"UPDATE `#__storefront_coupons` SET \";\n\t\t}\n\t\telseif ($action == 'add')\n\t\t{\n\t\t\t$sql = \"INSERT INTO `#__storefront_coupons` SET \";\n\t\t}\n\n\t\t\t$sql .= \"\n\t\t\t\t`cnDescription` = \" . $this->_db->quote($coupon->getDescription()) . \",\n\t\t\t\t`cnUseLimit` = \" . $coupon->getUseLimit() . \",\n\t\t\t\t`cnExpires` = FROM_UNIXTIME(\" . $this->_db->quote($coupon->getExpiration()) . \"),\n\t\t\t\t`cnObject` = \" . $this->_db->quote($coupon->getobjectType()) . \",\n\t\t\t\t`cnActive` = \" . $coupon->getActiveStatus();\n\n\n\t\t// Set code if adding new coupon\n\t\tif ($action == 'add')\n\t\t{\n\t\t\t$sql .= \", `cnCode` = \" . $this->_db->quote($couponCode);\n\t\t}\n\n\t\t// Add WHERE if updating coupon\n\t\tif ($action == 'update')\n\t\t{\n\t\t\t$sql .= \" WHERE `cnCode` = \" . $this->_db->quote($couponCode);\n\t\t}\n\n\t\t$this->_db->setQuery($sql);\n\t\t$this->_db->query();\n\t\tif (empty($cnId))\n\t\t{\n\t\t\t$cnId = $this->_db->insertid();\n\t\t}\n\n\n\t\t// ### Do objects\n\t\t$objects = $coupon->getObjects();\n\n\t\t// Remember all obejct IDs used\n\t\t$activeObjectIds = array();\n\n\t\tforeach ($objects as $obj)\n\t\t{\n\t\t\t$sql = \"INSERT INTO `#__storefront_coupon_objects`\n\t\t\t\t\tSET `cnId` = \" . $this->_db->quote($cnId) . \",\n\t\t\t\t\t`cnoObjectId` = \" . $this->_db->quote($obj->id) . \",\n\t\t\t\t\t`cnoObjectsLimit` = \" . $obj->objectLimit . \"\n\t\t\t\t\tON DUPLICATE KEY UPDATE `cnoObjectsLimit` = \" . $this->_db->quote($obj->objectLimit);\n\n\t\t\t$this->_db->setQuery($sql);\n\t\t\t//echo '<br>'; echo $this->_db->_sql;\n\t\t\t$this->_db->query();\n\n\t\t\t$activeObjectIds[] = $obj->id;\n\t\t}\n\n\t\t// Delete unused object IDs\n\t\t$deleteSql = '(0';\n\t\tforeach ($activeObjectIds as $activeObjectId)\n\t\t{\n\t\t\t$deleteSql .= \", \" . $this->_db->quote($activeObjectId);\n\t\t}\n\t\t$deleteSql .= ')';\n\t\t$sql = \"DELETE FROM `#__storefront_coupon_objects` WHERE `cnId` = \" . $this->_db->quote($cnId) . \" AND `cnoObjectId` NOT IN {$deleteSql}\";\n\t\t$this->_db->setQuery($sql);\n\t\t$this->_db->query();\n\n\n\t\t// ### Do action\n\t\t$action = $coupon->getAction();\n\n\t\t// Delete old action\n\t\t$sql = \"DELETE FROM `#__storefront_coupon_actions` WHERE `cnId` = \" . $this->_db->quote($cnId);\n\t\t$this->_db->setQuery($sql);\n\t\t$this->_db->query();\n\n\t\t$sql = \"INSERT INTO `#__storefront_coupon_actions`\n\t\t\t\tSET\n\t\t\t\t`cnId` = \" . $this->_db->quote($cnId) . \",\n\t\t\t\t`cnaAction` = \" . $this->_db->quote($action->action) . \",\n\t\t\t\t`cnaVal` = \" . $this->_db->quote($action->value);\n\n\t\t$this->_db->setQuery($sql);\n\t\t//echo '<br>'; echo $this->_db->_sql;\n\t\t$this->_db->query();\n\n\t\t$return = new \\stdClass();\n\t\t$return->cnId = $cnId;\n\t\treturn $return;\n\t}", "public function store(CouponRequest $request)\n {\n // Retrieve the validated input data...\n $data = $request->validated();\n Log::debug('input:', $data);\n $coupon = new Coupon();\n $coupon->name = $data['name'];\n $coupon->code = $data['code'];\n $coupon->description = $data['description'];\n $coupon->discount = $data['discount'];\n\n $coupon->start_time = Carbon::createFromFormat('Y-m-d H:i', $data['start_time']);\n $coupon->end_time = Carbon::createFromFormat('Y-m-d H:i', $data['end_time']);\n\n $coupon->total_usage = $data['total_usage'];\n\n DB::transaction(function () use ($coupon, $data) {\n $coupon->save();\n\n // discountType\n $coupon_discountType = Category::find($data['discountType']);\n $coupon->discountType()->associate($coupon_discountType)->save();\n\n // discountType\n $coupon_business = Category::find($data['business']);\n $coupon->business()->associate($coupon_business)->save();\n\n Log::info(\"create coupon \" . $coupon->id);\n });\n\n $request->session()->flash('alert-success', 'Coupon added successfully.');\n\n return redirect()->route('admin.coupons.index');\n }", "function createJoomshoppingCoupon($coupon_value = 10, $user_id, $day_expire, $coupon_month_expire) {\n $item = new stdClass();\n $item->coupon_type = 0;\n $item->coupon_code = $this->generateNumberCouponCode();\n $item->coupon_value = $coupon_value;\n $item->tax_id = 0;\n $item->used = 0;\n $item->for_user_id = 0;\n $item->coupon_start_date = date('Y-m-d', time());\n $item->coupon_expire_date = date('Y-m-d', $day_expire); // истекает поcле заданного периода\n $item->finished_after_used = 1; // 1 - означает, что купон можно использовать 1 раз\n $item->coupon_publish = 1;\n\n $result = JFactory::getDbo()->insertObject('#__jshopping_coupons', $item);\n\n if ($result) {\n $item_u = new stdClass();\n $item_u->user_id = $user_id;\n $item_u->created = time();\n $item_u->coupon_code = $item->coupon_code;\n $item_u->coupon_value = $item->coupon_value;\n $item_u->coupon_month_expire = $coupon_month_expire;\n JFactory::getDbo()->insertObject('unique_coupons', $item_u);\n }\n }", "public function run()\n {\n DB::table('coupons')->truncate();\n $couponRecords = [\n 'coupon_option'=>'Manual','coupon_code'=>'test10','categories'=>'1,2',\n 'users'=>'[email protected],[email protected]','coupon_type'=>'Single Times',\n 'amount_type'=>'Percentage','amount'=>'10','expiry_date'=>'2021-05-15','status'=>1\n ];\n\n Coupon::insert($couponRecords);\n }", "function CreateNewOrder($dom_response_obj)\n{\n global $insert_id, $customer_id, $cart, $sendto, $billto, $payment, $shipping, $order, $cc_id, $shipping_to_class, $languages_id, $currencies;\n $payment = 'googlecheckout';\n // Init all data\n $dom_data_root = $dom_response_obj->document_element();\n $gift_adjustment = $dom_data_root->get_elements_by_tagname(\"gift-certificate-adjustment\");\n $coupon_adjustment = $dom_data_root->get_elements_by_tagname(\"coupon-adjustment\");\n if ( count($coupon_adjustment)==0 ) $coupon_adjustment = $gift_adjustment;\n // coupons type \"free shipping\" pass as gift-certificate - GC feature - coupons apply before shipping & tax, gift - after\n // 2007.03.26 - coupons have type gift-certificate in any case. Module not allow enter gv used only coupons\n if ( count($coupon_adjustment)>0 ) {\n $code_node = $coupon_adjustment[0]->get_elements_by_tagname(\"code\");\n $coupon_code = $code_node[0]->get_content();\n $coupon_query=tep_db_query(\"select coupon_id from \" . TABLE_COUPONS . \" where coupon_type<>'G' AND coupon_code='\".tep_db_input($coupon_code).\"' and coupon_active='Y'\");\n if ( tep_db_num_rows($coupon_query) ) {\n $coupon_result=tep_db_fetch_array($coupon_query);\n if (!tep_session_is_registered('cc_id')) tep_session_register('cc_id');\n $cc_id = $coupon_result['coupon_id'];\n }\n }\n //\n $shipping_data = $dom_data_root->get_elements_by_tagname(\"shipping-name\");\n $xml_shipping = $shipping['title'] = $shipping_data[0]->get_content();\n $shipping_data = $dom_data_root->get_elements_by_tagname(\"shipping-cost\");\n $shipping['cost'] = $shipping_data[0]->get_content();\n $totaltax_data = $dom_data_root->get_elements_by_tagname(\"total-tax\");\n $xml_tax = $totaltax_data[0]->get_content();\n/*\n$shipping['title'] $shipping['cost'] for correct new order creation\n*/\n\n // get customers data and check them\n $ship = array();\n $customer_data = $dom_data_root->get_elements_by_tagname(\"buyer-shipping-address\");\n $shipping_root = $customer_data[0];\n\n $data = $customer_data[0]->get_elements_by_tagname(\"email\");\n $ship['email'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address1\");\n $ship['address1'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address2\");\n $ship['address2'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"company-name\");\n $ship['company-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"contact-name\");\n $ship['contact-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"phone\");\n $ship['phone'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"fax\");\n $ship['fax'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"country-code\");\n $ship['country-code'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"city\");\n $ship['city'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"region\");\n $ship['region'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"postal-code\");\n $ship['postal-code'] = $data[0]->get_content();\n $billing = array();\n unset($customer_data);\n $customer_data = $dom_data_root->get_elements_by_tagname(\"buyer-billing-address\");\n $billing_root = $customer_data[0];\n\n $data = $customer_data[0]->get_elements_by_tagname(\"email\");\n $billing['email'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address1\");\n $billing['address1'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"address2\");\n $billing['address2'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"company-name\");\n $billing['company-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"contact-name\");\n $billing['contact-name'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"phone\");\n $billing['phone'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"fax\");\n $billing['fax'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"country-code\");\n $billing['country-code'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"city\");\n $billing['city'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"region\");\n $billing['region'] = $data[0]->get_content();\n $data = $customer_data[0]->get_elements_by_tagname(\"postal-code\");\n $billing['postal-code'] = $data[0]->get_content();\n // check customer\nif (defined('GOOGLE_FORCE_TO_USA')) {\n $ship['country-code'] = 'GB';\n $billing['country-code'] = 'GB';\n}\n $check = tep_db_query(\"select customers_id from \" . TABLE_CUSTOMERS . \" where customers_email_address='\" . $ship['email'] . \"' or customers_email_address='\" . $billing['email'] . \"'\");\n list($firstname_ship, $lastname_ship) = split(' ', $ship['contact-name'], 2);\n // get country id and state id for shipping\n $country = tep_db_fetch_array(tep_db_query(\"select countries_id from \" . TABLE_COUNTRIES . \" where countries_iso_code_2='\" . $ship['country-code'] . \"'\"));\n $state = tep_db_fetch_array(tep_db_query(\"select zone_id from \" . TABLE_ZONES . \" where zone_country_id='\" . $country['countries_id'] . \"' and zone_code='\" . $ship['region'] . \"'\"));\n $ship['countries_id'] = $country['countries_id'];\n $ship['zone_id'] = (int)$state['zone_id'];\n // get country id and state id for billing\n $country = tep_db_fetch_array(tep_db_query(\"select countries_id from \" . TABLE_COUNTRIES . \" where countries_iso_code_2='\" . $billing['country-code'] . \"'\"));\n $state = tep_db_fetch_array(tep_db_query(\"select zone_id from \" . TABLE_ZONES . \" where zone_country_id='\" . $country['countries_id'] . \"' and zone_code='\" . $billing['region'] . \"'\"));\n $billing['countries_id'] = $country['countries_id'];\n $billing['zone_id'] = (int)$state['zone_id'];\n\n list($firstname_bill, $lastname_bill) = split(' ', $billing['contact-name'], 2);\n if(tep_db_num_rows($check) > 0) {\n $customer_id = tep_db_fetch_array($check);\n $customer_id = $customer_id['customers_id'];\n // check addresses and init $billto and $sendto\n $check_sendto = tep_db_query(\"select address_book_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id='\" . (int)$customer_id . \"' and entry_company='\" . tep_db_input($ship['company-name']) . \"' and entry_firstname='\" . tep_db_input($firstname_ship) . \"' and entry_lastname='\" . tep_db_input($lastname_ship) . \"' and entry_street_address='\" . tep_db_input($ship['address1']) . ' ' . tep_db_input($ship['address2']) . \"' and entry_postcode='\" . tep_db_input($ship['postal-code']) . \"' and entry_city='\" . tep_db_input($ship['city']) . \"' and entry_state='\" . tep_db_input($ship['region']) . \"' and entry_zone_id='\" . intval($ship['zone_id']) . \"' and entry_country_id='\" . intval($ship['countries_id']) . \"'\");\n if(tep_db_num_rows($check_sendto) > 0) {\n $sendto = tep_db_fetch_array($check_sendto);\n $sendto = $sendto['address_book_id'];\n } else {\n // insert new shipping address\n $sql_data_array = array('customers_id' => (int)$customer_id,\n 'entry_firstname' => $firstname_ship,\n 'entry_lastname' => $lastname_ship,\n 'entry_street_address' => $ship['address1'] . ' ' . $ship['address2'],\n 'entry_city' => $ship['city'],\n 'entry_postcode' => $ship['postal-code'],\n 'entry_company' => $ship['company-name'],\n 'entry_state' => $ship['region'],\n 'entry_zone_id' => (int)$ship['zone_id'],\n 'entry_country_id' => (int)$ship['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $sendto = tep_db_insert_id();\n }\n $check_billto = tep_db_query(\"select address_book_id from \" . TABLE_ADDRESS_BOOK . \" where customers_id='\" . (int)$customer_id . \"' and entry_company='\" . tep_db_input($billing['company-name']) . \"' and entry_firstname='\" . tep_db_input($firstname_bill) . \"' and entry_lastname='\" . tep_db_input($lastname_bill) . \"' and entry_street_address='\" . tep_db_input($billing['address1']) . ' ' . tep_db_input($billing['address2']) . \"' and entry_postcode='\" . tep_db_input($billing['postal-code']) . \"' and entry_city='\" . tep_db_input($billing['city']) . \"' and entry_state='\" . tep_db_input($billing['region']) . \"' and entry_zone_id='\" . (int)$billing['zone_id'] . \"' and entry_country_id='\" . (int)$billing['countries_id'] . \"'\");\n if(tep_db_num_rows($check_billto) > 0) {\n $billto = tep_db_fetch_array($check_billto);\n $billto = $billto['address_book_id'];\n } else {\n $sql_data_array = array('customers_id' => (int)$customer_id,\n 'entry_firstname' => $firstname_bill,\n 'entry_lastname' => $lastname_bill,\n 'entry_street_address' => $billing['address1'] . ' ' . $billing['address2'],\n 'entry_city' => $billing['city'],\n 'entry_postcode' => $billing['postal-code'],\n 'entry_company' => $billing['company-name'],\n 'entry_state' => $billing['region'],\n 'entry_zone_id' => (int)$billing['zone_id'],\n 'entry_country_id' => (int)$billing['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $billto = tep_db_insert_id();\n }\n } else { // create new customer\n $sql_data_array = array('customers_firstname' => $firstname_ship,\n 'customers_lastname' => $lastname_ship,\n 'customers_email_address' => $ship['email'],\n 'customers_telephone' => $ship['phone'],\n 'customers_fax' => $ship['fax']);\n tep_db_perform(TABLE_CUSTOMERS, $sql_data_array);\n $customer_id = tep_db_insert_id();\n // insert new shipping address\n $sql_data_array = array('customers_id' => $customer_id,\n 'entry_firstname' => $firstname_ship,\n 'entry_lastname' => $lastname_ship,\n 'entry_street_address' => $ship['address1'] . ' ' . $ship['address2'],\n 'entry_city' => $ship['city'],\n 'entry_postcode' => $ship['postal-code'],\n 'entry_company' => $ship['company-name'],\n 'entry_state' => $ship['region'],\n 'entry_zone_id' => $ship['zone_id'],\n 'entry_country_id' => $ship['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $address_id = tep_db_insert_id();\n $sendto = $address_id;\n tep_db_query(\"update \" . TABLE_CUSTOMERS . \" set customers_default_address_id = '\" . $address_id . \"' where customers_id = '\" . $customer_id . \"'\");\n tep_db_query(\"insert into \" . TABLE_CUSTOMERS_INFO . \" (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('\" . (int)$customer_id . \"', '0', now())\");\n // insert new billing address\n $sql_data_array = array('customers_id' => $customer_id,\n 'entry_firstname' => $firstname_bill,\n 'entry_lastname' => $lastname_bill,\n 'entry_street_address' => $billing['address1'] . ' ' . $billing['address2'],\n 'entry_city' => $billing['city'],\n 'entry_postcode' => $billing['postal-code'],\n 'entry_company' => $billing['company-name'],\n 'entry_state' => $billing['region'],\n 'entry_zone_id' => $billing['zone_id'],\n 'entry_country_id' => $billing['countries_id']);\n tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);\n $address_id = tep_db_insert_id();\n $billto = $address_id;\n }\n/* start search engines statistics */\n $search_engines_id = 0;\n $search_words_id = 0;\n $affiliate_ref = 0;\n $search_engines_id_dom = $dom_data_root->get_elements_by_tagname(\"search_engines_id\");\n if ( is_array($search_engines_id_dom) && isset($search_engines_id_dom[0]) && is_object($search_engines_id_dom[0]) ) $search_engines_id = intval($search_engines_id_dom[0]->get_content());\n \n $search_words_id_dom = $dom_data_root->get_elements_by_tagname(\"search_words_id\");\n if ( is_array($search_words_id_dom) && isset($search_words_id_dom[0]) && is_object($search_words_id_dom[0]) ) $search_words_id = intval($search_words_id_dom[0]->get_content());\n\n $affiliate_ref_dom = $dom_data_root->get_elements_by_tagname(\"affiliate_ref\");\n if ( is_array($affiliate_ref_dom) && isset($affiliate_ref_dom[0]) && is_object($affiliate_ref_dom[0]) ) $affiliate_ref = intval($affiliate_ref_dom[0]->get_content());\n\n/* end search engines statistics*/\n\n // create order\n $google_order_number = $dom_data_root->get_elements_by_tagname(\"google-order-number\");\n $number = $google_order_number[0]->get_content();\n // recreate shopping cart\n $sess_cart = $dom_data_root->get_elements_by_tagname(\"sess_cart\");\n $sess_cart = $sess_cart[0]->get_content();\n $saved_cart = unserialize( base64_decode($sess_cart) );\n if ( $saved_cart!==false ) {\n $cart = new shoppingCart;\n $cart = $saved_cart;\n }else{\n $items_list = $dom_data_root->get_elements_by_tagname(\"osc-item\");\n $currencies = new currencies();\n $cart = new shoppingCart;\n $post_process = array();\n foreach($items_list as $item)\n {\n $uprid = $item->get_attribute('item_id');\n $qty = $item->get_content();\n if ( preg_match('/^ga/',$uprid) ) {\n $post_process[] = $uprid;\n }elseif(preg_match('/^(\\d+)\\{used_(\\d+)\\}/',$uprid,$usedm)) {\n $u_pid = $usedm[1];\n $u_uid = $usedm[2];\n $cart->add_used($u_uid, $qty);\n }else{\n $attr = get_attributes($uprid);\n $cart->add_cart($uprid, $qty, $attr);\n }\n }\n foreach($post_process as $give_away) {\n $give = explode('|',$give_away);\n if ( count($give)==3 ) {\n $attr = get_attributes($give[1]);\n $cart->add_giveaway( $give[2], (int)$give[1], $attr );\n }\n }\n }\n $cart->calculate();\n\n//\nglobal $country_code, $state_code;\n\n$country_code = $ship['country-code'];\n$state_code = $ship['region'];\n$shipping_ = $shipping;\nunset($shipping);\nInitOscShippings();\nif (isset($shipping_to_class[$xml_shipping])){\n $shipping = $shipping_to_class[$xml_shipping];\n $GLOBALS['shipping']['id'] = $shipping['id'];\n}else{\n $shipping = $shipping_;\n}\n//\n\n require_once(DIR_WS_CLASSES . 'order.php');\n $order = new order;\n require_once(DIR_WS_CLASSES . 'order_total.php');\n\n $order_total_modules = new order_total;\n $order_totals = $order_total_modules->process();\n// fake tax or warmup shipping from shipping name & recalc all corect\n//mydump(var_export($order,true));\n//mydump(var_export($order_totals,true));\n/*\nforeach( $order_totals as $idx=>$ot_module ) {\n if ( $ot_module['code']=='ot_tax' ) {\n $order_totals[$idx]['value'] = $xml_tax;\n $order_totals[$idx]['text'] = $currencies->format($xml_tax, true, $order->info['currency'], $order->info['currency_value']);\n break;\n }\n}*/\n//\\fake tax\n //print_r($order);\n //print_r($order_totals);\n if (defined('MODULE_PAYMENT_GOOGLECHECKOUT_STATUS')) $order->info['order_status'] = MODULE_PAYMENT_GOOGLECHECKOUT_STATUS;\n\n $sql_data_array = array('customers_id' => $customer_id,\n 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],\n //{{ BEGIN FISTNAME\n 'customers_firstname' => $order->customer['firstname'],\n 'customers_lastname' => $order->customer['lastname'],\n //}} END FIRSTNAME\n 'customers_company' => $order->customer['company'],\n 'customers_street_address' => $order->customer['street_address'],\n 'customers_suburb' => $order->customer['suburb'],\n 'customers_city' => $order->customer['city'],\n 'customers_postcode' => $order->customer['postcode'],\n 'customers_state' => $order->customer['state'],\n 'customers_country' => $order->customer['country']['title'],\n 'customers_telephone' => $order->customer['telephone'],\n 'customers_email_address' => $order->customer['email_address'],\n 'customers_address_format_id' => $order->customer['format_id'],\n 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],\n //{{ BEGIN FISTNAME\n 'delivery_firstname' => $order->delivery['firstname'],\n 'delivery_lastname' => $order->delivery['lastname'],\n //}} END FIRSTNAME\n 'delivery_company' => $order->delivery['company'],\n 'delivery_street_address' => $order->delivery['street_address'],\n 'delivery_suburb' => $order->delivery['suburb'],\n 'delivery_city' => $order->delivery['city'],\n 'delivery_postcode' => $order->delivery['postcode'],\n 'delivery_state' => $order->delivery['state'],\n 'delivery_country' => $order->delivery['country']['title'],\n 'delivery_address_format_id' => $order->delivery['format_id'],\n 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],\n //{{ BEGIN FISTNAME\n 'billing_firstname' => $order->billing['firstname'],\n 'billing_lastname' => $order->billing['lastname'],\n //}} END FIRSTNAME\n 'billing_company' => $order->billing['company'],\n 'billing_street_address' => $order->billing['street_address'],\n 'billing_suburb' => $order->billing['suburb'],\n 'billing_city' => $order->billing['city'],\n 'billing_postcode' => $order->billing['postcode'],\n 'billing_state' => $order->billing['state'],\n 'billing_country' => $order->billing['country']['title'],\n 'billing_address_format_id' => $order->billing['format_id'],\n 'payment_method' => $order->info['payment_method'],\n 'payment_class' => 'googlecheckout',\n 'payment_info' => $GLOBALS['payment_info'], //???\n 'google_orders_id' => $number,\n 'shipping_method' => $order->info['shipping_method'],\n 'cc_type' => $order->info['cc_type'],\n 'cc_owner' => $order->info['cc_owner'],\n 'cc_number' => $order->info['cc_number'],\n 'cc_expires' => $order->info['cc_expires'],\n 'keep_date' => 'now()',\n 'language_id' => (int)$languages_id,\n 'payment_class' => $order->info['payment_class'],\n 'shipping_class' => $order->info['shipping_class'],\n 'date_purchased' => 'now()',\n 'last_modified' => 'now()',\n/* start search engines statistics */\n 'search_engines_id' => $search_engines_id,\n 'search_words_id' => $search_words_id,\n/* end search engines statistics*/\n\n /// 'affiliate_id' => (int)$affiliate_ref,\n // 'comments' => 'AFF_DOM' . var_export($affiliate_ref_dom[0]->get_content(), true),\n\n // 'how_did_you_find' => $order->info['how_did_you_find'],\n //'how_did_you_find_text' => $order->info['how_did_you_find_text'],\n \n 'orders_status' => $order->info['order_status'],\n 'currency' => $order->info['currency'],\n 'currency_value' => $order->info['currency_value']);\n tep_db_perform(TABLE_ORDERS, $sql_data_array);\n $insert_id = tep_db_insert_id();\n for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'title' => $order_totals[$i]['title'],\n 'text' => $order_totals[$i]['text'],\n 'value' => $order_totals[$i]['value'],\n 'class' => $order_totals[$i]['code'],\n 'sort_order' => $order_totals[$i]['sort_order']);\n tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);\n }\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_status_id' => $order->info['order_status'],\n 'date_added' => 'now()',\n 'customer_notified' => '0',\n 'comments' => 'Order created by Google Checkout');\n tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);\n for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {\n /*\n if (STOCK_LIMITED == 'true') {\n if (DOWNLOAD_ENABLED == 'true') {\n $stock_query_raw = \"SELECT products_quantity, products_attributes_filename\n FROM \" . TABLE_PRODUCTS . \" p\n LEFT JOIN \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\n ON p.products_id=pa.products_id\n WHERE p.products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\";\n// Will work with only one option for downloadable products\n// otherwise, we have to build the query dynamically with a loop\n $products_attributes = $order->products[$i]['attributes'];\n if (is_array($products_attributes)) {\n $stock_query_raw .= \" AND pa.options_id = '\" . $products_attributes[0]['option_id'] . \"' AND pa.options_values_id = '\" . $products_attributes[0]['value_id'] . \"'\";\n }\n $stock_query = tep_db_query($stock_query_raw);\n } else {\n $stock_query = tep_db_query(\"select products_quantity from \" . TABLE_PRODUCTS . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n }\n if (tep_db_num_rows($stock_query) > 0) {\n $stock_values = tep_db_fetch_array($stock_query);\n // do not decrement quantities if products_attributes_filename exists\n if ((DOWNLOAD_ENABLED != 'true') || ((!$stock_values['products_attributes_filename']) && $order->products[$i]['products_file'])) {\n $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];\n } else {\n $stock_left = $stock_values['products_quantity'];\n }\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_quantity = '\" . $stock_left . \"' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_status = '0' where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n }\n }\n */\n // Update products_ordered (for bestsellers list)\n tep_db_query(\"update \" . TABLE_PRODUCTS . \" set products_ordered = products_ordered + \" . sprintf('%d', $order->products[$i]['qty']) . \" where products_id = '\" . tep_get_prid($order->products[$i]['id']) . \"'\");\n $sql_data_array = array('orders_id' => $insert_id,\n 'products_id' => tep_get_prid($order->products[$i]['id']),\n 'products_model' => $order->products[$i]['model'],\n 'products_name' => $order->products[$i]['name'],\n 'products_price' => $order->products[$i]['price'],\n 'final_price' => $order->products[$i]['final_price'],\n 'products_purchase_price' => tep_get_products_purchase_price(normalize_id($order->products[$i]['id']), $order->products[$i]['final_price']),\n 'products_tax' => $order->products[$i]['tax'],\n 'used' => $order->products[$i]['used'],\n\n\n 'is_give_away'=>((isset($order->products[$i]['is_give_away']) && $order->products[$i]['is_give_away']==1)?'1':'0'),\n // addon - gives as products 'gives' => (is_array($order->products[$i]['gives'])?serialize($order->products[$i]['gives']):''),\n 'products_quantity' => $order->products[$i]['qty'],\n 'products_status' => ((tep_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty'])>-1?1:0),\n 'uprid' => normalize_id($order->products[$i]['id']));\n tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);\n $order_products_id = tep_db_insert_id();\n $order_total_modules->update_credit_account($i);//ICW ADDED FOR CREDIT CLASS SYSTEM\n //------insert customer choosen option to order--------\n $attributes_exist = '0';\n $products_ordered_attributes = '';\n\n if ((DOWNLOAD_ENABLED == 'true') && tep_not_null($order->products[$i]['products_file'])) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'orders_products_name' => $order->products[$i]['name'],\n 'orders_products_filename' => $order->products[$i]['products_file'],\n 'download_maxdays' => DOWNLOAD_MAX_DAYS,\n 'download_count' => DOWNLOAD_MAX_COUNT);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);\n }\n\n\n //// GiveAway multiplay by senia 2007-02-23 <[email protected]> ////\n /*\n $ordered_gives = '';\n\n if (is_array($order->products[$i]['gives']) && sizeof($order->products[$i]['gives'])>0) {\n $ordered_gives .= \"\\n\\t\" . TEXT_GIVEAWAY . ':';\n foreach($order->products[$i]['gives'] as $gdata) {\n $ordered_gives .= \"\\n\\t\" . ' - ' . $gdata['fullname'];\n update_stock($gdata['uprid'], 0, $order->products[$i]['qty']);\n }\n }\n */\n\n $ordered_gives = '';\n\n if (is_array($order->products[$i]['gives']) && sizeof($order->products[$i]['gives'])>0) {\n $ordered_gives .= \"\\n\\t\" . TEXT_GIVEAWAY . ':';\n $dec_price = 0;\n foreach($order->products[$i]['gives'] as $gdata) {\n $ordered_gives .= \"\\n\\t\" . ' - ' . $gdata['fullname'] . ' (+' . $currencies->display_price($gdata['price'], $gdata['tax']) . ')';\n $dec_price += $gdata['price'];\n $sql_data_array = array('orders_id' => $insert_id,\n 'products_id' => tep_get_prid($gdata['id']),\n 'parent_giv_id' => normalize_id($order->products[$i]['id']),\n 'products_model' => $gdata['model'],\n 'products_name' => $gdata['name'] . ' (Giveaway '.$order->products[$i]['model'].')',\n 'products_price' => $gdata['price'],\n 'final_price' => $gdata['price'],\n 'products_tax' => $gdata['tax'],\n\n \n\n 'products_quantity' => $order->products[$i]['qty'],\n 'products_status' => ((tep_get_products_stock($gdata['uprid']) - $order->products[$i]['qty'])>-1?1:0),\n 'uprid' => normalize_id($gdata['uprid']));\n tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);\n $order_gives_id = tep_db_insert_id();\n\n if (is_array($gdata['attributes']) && sizeof($gdata['attributes'])>0) {\n foreach ($gdata['attributes'] as $gdata_attr) {\n\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_gives_id,\n 'products_options_id' => $gdata_attr['opt_id'],\n 'products_options' => $gdata_attr['opt_name'],\n 'products_options_values_id' => $gdata_attr['opt_val_id'],\n 'products_options_values' => $gdata_attr['tep_values_name'],\n 'options_values_price' => '0',\n 'price_prefix' => '+');\n tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);\n\n }\n }\n\n update_stock($gdata['uprid'], 0, $order->products[$i]['qty']);\n }\n\n tep_db_query(\"update \".TABLE_ORDERS_PRODUCTS.\" set products_price=(products_price-'\".floatval($dec_price).\"'), final_price=(final_price-'\".floatval($dec_price).\"') where orders_products_id='\".intval($order_products_id).\"'\");\n }\n //// GiveAway multiplay by senia 2007-02-23 <[email protected]> off ////\n\n\n\n\n if (isset($order->products[$i]['attributes'])) {\n $attributes_exist = '1';\n for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {\n if (DOWNLOAD_ENABLED == 'true') {\n $attributes_query = \"select pa.products_attributes_id, popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_maxdays, pa.products_attributes_maxcount , pa.products_attributes_filename\n from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa\n where pa.products_id = '\" . $order->products[$i]['id'] . \"'\n and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"'\n and pa.options_id = popt.products_options_id\n and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"'\n and pa.options_values_id = poval.products_options_values_id\n and popt.language_id = '\" . $languages_id . \"'\n and poval.language_id = '\" . $languages_id . \"'\";\n $attributes = tep_db_query($attributes_query);\n } else {\n $attributes = tep_db_query(\"select pa.products_attributes_id, popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from \" . TABLE_PRODUCTS_OPTIONS . \" popt, \" . TABLE_PRODUCTS_OPTIONS_VALUES . \" poval, \" . TABLE_PRODUCTS_ATTRIBUTES . \" pa where pa.products_id = '\" . $order->products[$i]['id'] . \"' and pa.options_id = '\" . $order->products[$i]['attributes'][$j]['option_id'] . \"' and pa.options_id = popt.products_options_id and pa.options_values_id = '\" . $order->products[$i]['attributes'][$j]['value_id'] . \"' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '\" . $languages_id . \"' and poval.language_id = '\" . $languages_id . \"'\");\n }\n\n $attributes_values = tep_db_fetch_array($attributes);\n $attributes_values['options_values_price'] = tep_get_options_values_price($attributes_values['products_attributes_id']);\n\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'products_options' => $attributes_values['products_options_name'],\n 'products_options_values' => $attributes_values['products_options_values_name'],\n 'options_values_price' => $attributes_values['options_values_price'],\n 'price_prefix' => $attributes_values['price_prefix']);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);\n\n if ((DOWNLOAD_ENABLED == 'true') && isset($attributes_values['products_attributes_filename']) && tep_not_null($attributes_values['products_attributes_filename'])) {\n $sql_data_array = array('orders_id' => $insert_id,\n 'orders_products_id' => $order_products_id,\n 'orders_products_name' => $order->products[$i]['name'],\n 'orders_products_filename' => $attributes_values['products_attributes_filename'],\n 'download_maxdays' => $attributes_values['products_attributes_maxdays'],\n 'download_count' => $attributes_values['products_attributes_maxcount']);\n tep_db_perform(TABLE_ORDERS_PRODUCTS_DOWNLOAD, $sql_data_array);\n }\n $products_ordered_attributes .= \"\\n\\t\" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name'];\n }\n\n\n\n }\n\n // update inventory\nif (PRODUCTS_INVENTORY == 'True'){\n update_stock($order->products[$i]['id'], 0, $order->products[$i]['qty']);\n}\n//\n\n }\n\n //$insert_id, $customer_id, $REMOTE_ADDR, $cc_id;\n $order_total_modules->apply_credit();//ICW ADDED FOR CREDIT CLASS SYSTEM\n\n \n tep_calculate_order_revenue($insert_id); \n \n}", "public function woo_sc_import_coupons_from_csv() {\n\n\t\t\t$is_send_email = $this->is_email_template_enabled();\n\t\t\t$combine_emails = $this->is_email_template_enabled( 'combine' );\n\t\t\t$is_email_imported_coupons = get_site_option( 'woo_sc_is_email_imported_coupons' );\n\t\t\t$posted_data = get_site_option( 'woo_sc_generate_coupon_posted_data', true );\n\t\t\t$no_of_coupons_to_generate = $posted_data['no_of_coupons_to_generate'];\n\n\t\t\trequire 'class-wc-sc-coupon-import.php';\n\t\t\trequire 'class-wc-sc-coupon-parser.php';\n\n\t\t\t$wc_csv_coupon_import = new WC_SC_Coupon_Import();\n\t\t\t$wc_csv_coupon_import->parser = new WC_SC_Coupon_Parser( 'shop_coupon' );\n\t\t\t$woocommerce_smart_coupon = WC_Smart_Coupons::get_instance();\n\n\t\t\tif ( isset( $posted_data['export_file'] ) && is_array( $posted_data['export_file'] ) ) {\n\n\t\t\t\t$export_file = $posted_data['export_file'];\n\t\t\t\t$csv_folder = $export_file['wp_upload_dir'];\n\t\t\t\t$filename = str_replace( array( '\\'', '\"', ',', ';', '<', '>', '/', ':' ), '', $export_file['file_name'] );\n\t\t\t\t$csvfilename = $csv_folder . $filename;\n\t\t\t\t$file_position = isset( $posted_data['file_position'] ) && is_numeric( $posted_data['file_position'] ) ? $posted_data['file_position'] : 0;\n\n\t\t\t\t// Set locale.\n\t\t\t\t$encoding = mb_detect_encoding( $csvfilename, 'UTF-8, ISO-8859-1', true );\n\t\t\t\tif ( $encoding ) {\n\t\t\t\t\tsetlocale( LC_ALL, 'en_US.' . $encoding );\n\t\t\t\t}\n\t\t\t\tini_set( 'auto_detect_line_endings', true ); // phpcs:ignore\n\t\t\t\t$csv_file_handler = fopen( $csvfilename, 'r' ); // phpcs:ignore\n\t\t\t\tif ( false !== $csv_file_handler ) {\n\t\t\t\t\t$csv_header = fgetcsv( $csv_file_handler, 0 );\n\t\t\t\t\t$counter = 0;\n\n\t\t\t\t\t$batch_start_time = time();\n\t\t\t\t\t$start_time = get_site_option( 'start_time_woo_sc', false );\n\t\t\t\t\tif ( false === $start_time ) {\n\t\t\t\t\t\tupdate_site_option( 'start_time_woo_sc', $batch_start_time );\n\t\t\t\t\t}\n\n\t\t\t\t\t$reading_completed = false;\n\t\t\t\t\t$no_of_remaining_coupons = -1;\n\t\t\t\t\t$combined_receiver_details = array();\n\t\t\t\t\tfor ( $no_of_coupons_created = 1; $no_of_coupons_created <= $no_of_coupons_to_generate; $no_of_coupons_created++ ) {\n\n\t\t\t\t\t\t$result = $wc_csv_coupon_import->parser->parse_data_by_row( $csv_file_handler, $csv_header, $file_position, $encoding );\n\t\t\t\t\t\t$file_position = $result['file_position'];\n\t\t\t\t\t\t$parsed_csv_data = $result['parsed_csv_data'];\n\t\t\t\t\t\t$reading_completed = $result['reading_completed'];\n\t\t\t\t\t\tif ( ! $reading_completed ) {\n\t\t\t\t\t\t\t$coupon = $wc_csv_coupon_import->parser->parse_coupon( $parsed_csv_data );\n\t\t\t\t\t\t\t$coupon_parsed_data = array(\n\t\t\t\t\t\t\t\t'filter' => array(\n\t\t\t\t\t\t\t\t\t'class' => 'WC_SC_Coupon_Import',\n\t\t\t\t\t\t\t\t\t'function' => 'process_coupon',\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t'args' => array( $coupon ),\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t$coupon_id = $this->create_coupon( $coupon_parsed_data );\n\n\t\t\t\t\t\t\tif ( ! empty( $parsed_csv_data['customer_email'] ) && 'yes' === $is_send_email && 'yes' === $combine_emails && 'yes' === $is_email_imported_coupons ) {\n\t\t\t\t\t\t\t\t$receiver_emails = explode( ',', $parsed_csv_data['customer_email'] );\n\t\t\t\t\t\t\t\tforeach ( $receiver_emails as $receiver_email ) {\n\t\t\t\t\t\t\t\t\tif ( ! isset( $combined_receiver_details[ $receiver_email ] ) || ! is_array( $combined_receiver_details[ $receiver_email ] ) ) {\n\t\t\t\t\t\t\t\t\t\t$combined_receiver_details[ $receiver_email ] = array();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$combined_receiver_details[ $receiver_email ][] = array(\n\t\t\t\t\t\t\t\t\t\t'code' => $parsed_csv_data['post_title'],\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\t$counter++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$no_of_remaining_coupons = $no_of_coupons_to_generate - $no_of_coupons_created;\n\t\t\t\t\t\tupdate_site_option( 'current_time_woo_sc', time() );\n\t\t\t\t\t\tupdate_site_option( 'remaining_tasks_count_woo_sc', $no_of_remaining_coupons );\n\n\t\t\t\t\t\tif ( 0 === $no_of_remaining_coupons ) {\n\n\t\t\t\t\t\t\t$bulk_coupon_action = get_site_option( 'bulk_coupon_action_woo_sc' );\n\t\t\t\t\t\t\t$all_tasks_count = get_site_option( 'all_tasks_count_woo_sc' );\n\t\t\t\t\t\t\t$remaining_tasks_count = get_site_option( 'remaining_tasks_count_woo_sc' );\n\t\t\t\t\t\t\t$success_count = $all_tasks_count - $remaining_tasks_count;\n\n\t\t\t\t\t\t\t$coupon_background_process_result = array(\n\t\t\t\t\t\t\t\t'action' => $bulk_coupon_action,\n\t\t\t\t\t\t\t\t'successful' => $success_count,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tfclose( $csv_file_handler ); // phpcs:ignore\n\t\t\t\t\t\t\tunlink( $csvfilename );\n\t\t\t\t\t\t\tupdate_option( 'woo_sc_is_email_imported_coupons', 'no', 'no' );\n\t\t\t\t\t\t\tdelete_site_option( 'bulk_coupon_action_woo_sc' );\n\n\t\t\t\t\t\t\tupdate_option( 'wc_sc_background_coupon_process_result', $coupon_background_process_result, 'no' );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$posted_data['no_of_coupons_to_generate'] = $no_of_remaining_coupons;\n\t\t\t\t\t\tif ( $this->time_exceeded( $batch_start_time ) || $this->memory_exceeded() ) {\n\t\t\t\t\t\t\tfclose( $csv_file_handler ); // phpcs:ignore\n\t\t\t\t\t\t\t$posted_data['file_position'] = $file_position;\n\t\t\t\t\t\t\tupdate_site_option( 'woo_sc_generate_coupon_posted_data', $posted_data );\n\t\t\t\t\t\t\tif ( function_exists( 'as_schedule_single_action' ) ) {\n\t\t\t\t\t\t\t\tas_schedule_single_action( time(), 'woo_sc_import_coupons_from_csv' );\n\t\t\t\t\t\t\t}\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\tif ( is_array( $combined_receiver_details ) && ! empty( $combined_receiver_details ) ) {\n\n\t\t\t\t\t\tforeach ( $combined_receiver_details as $receiver_email => $coupon_codes ) {\n\t\t\t\t\t\t\t$coupon_ids = array();\n\t\t\t\t\t\t\tforeach ( $coupon_codes as $coupon_data ) {\n\t\t\t\t\t\t\t\t$coupon_code = $coupon_data['code'];\n\t\t\t\t\t\t\t\t$coupon = new WC_Coupon( $coupon_code );\n\t\t\t\t\t\t\t\tif ( is_a( $coupon, 'WC_Coupon' ) ) {\n\t\t\t\t\t\t\t\t\tif ( $this->is_wc_gte_30() ) {\n\t\t\t\t\t\t\t\t\t\t$coupon_id = $coupon->get_id();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$coupon_id = ( ! empty( $coupon->id ) ) ? $coupon->id : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$coupon_ids[] = $coupon_id;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( ! empty( $receiver_email ) && ! empty( $coupon_ids ) ) {\n\t\t\t\t\t\t\t\t$action_args = array(\n\t\t\t\t\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t\t\t\t\t'receiver_email' => $receiver_email,\n\t\t\t\t\t\t\t\t\t\t'coupon_ids' => $coupon_ids,\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif ( function_exists( 'as_schedule_single_action' ) ) {\n\t\t\t\t\t\t\t\t\tas_schedule_single_action( time(), 'woocommerce_smart_coupons_send_combined_coupon_email', $action_args );\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}", "public function insertGift($info)\n {\n $this->_wdb->insert($this->table_user_gift, $info);\n return $this->_wdb->lastInsertId();\n }", "public function run()\n {\n $path = storage_path('data/coupons.csv');\n $handle = fopen($path, 'r');\n $row = -1;\n\n while ($line = fgetcsv($handle)) {\n $row++;\n\n if ($row == 0) {\n continue;\n }\n\n $entry = [\n 'id' => (string) Uuid::generate(),\n 'code' => $line[0],\n 'description' => $line[1],\n 'discount_type' => $line[2],\n 'discount_price' => $line[3],\n 'discount_percentage' => $line[4],\n 'discount_floor_price' => $line[5],\n 'discount_ceiling_price' => $line[6],\n 'validity_start' => $line[7],\n 'validity_end' => $line[8],\n 'quantity' => 50\n ];\n\n $model = Coupon::create($entry);\n \n $categories = [];\n $inventories = [];\n $suppliers = [];\n $products = [];\n\n foreach (explode(' ', $line[9]) as $productUpc) {\n if ($id = $this->getProductId($productUpc)) {\n $products[] = $id;\n }\n }\n\n foreach (explode(' ', $line[10]) as $supplierCode) {\n if ($id = $this->getSupplierId($supplierCode)) {\n $suppliers[] = $id;\n }\n }\n\n $model->products()->attach($products);\n $model->suppliers()->attach($suppliers);\n }\n }", "public function syncCoupon(): void\n {\n $stripeCoupon = $this->asStripeCoupon();\n\n $this->valid = $stripeCoupon->valid;\n\n $this->times_redeemed = $stripeCoupon->times_redeemed;\n\n $this->save();\n }", "public function store(Request $request)\n {\n if (Auth::user()->cant('create', Coupon::class)) {\n return redirect()->route('admin.home')->with(['message'=>'You don\\'t have permissions']);\n }\n $rules = [\n 'code' => 'required|unique:coupons',\n 'value' => 'required|numeric|min:0.01',\n 'expire' => 'date_format:\"d.m.Y\"|nullable',\n 'min_order_price' => 'numeric|nullable|min:0.01',\n 'max_usages' => 'integer|nullable|min:0',\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return redirect()->route('coupons.create')->withErrors($validator)->withInput();\n }\n\n $coupon = new Coupon();\n $coupon->code = $request->get('code');\n $coupon->value = $request->get('value');\n $coupon->type = $request->get('type');\n $coupon->expire = $request->get('expire');\n $coupon->min_order_price = $request->get('min_order_price');\n $coupon->max_usages = $request->get('max_usages');\n $coupon->save();\n return redirect()->route('coupons.edit', ['id'=>$coupon->id]);\n }", "function insertCoach ($tab)\n{\n\t$con = connexion ();\n\tif($con != null)\n\t{\n\t\t$requete = \"insert into coach values (null,'\".$tab['nom'].\"','\".$tab['prenom'].\"','\".$tab['adresse'].\"','\".$tab['email'].\"','\".$tab['tel'].\"');\";\n\t\tmysqli_query($con, $requete);\n\t\tdeconnexion($con);\n\t}\n}", "function addCongressToCongresses($user, $connection)\n{\n $congress = 0;\n $errors = 0;\n \n $name = urlencode($_POST['newCongressName']);\n if (strlen($name) > 32)\n {\n substr($name, 0, 32);\n }\n \n $shortName = urlencode($_POST['newCongressShortName']);\n if (strlen($shortName) > 24)\n {\n substr($shortName, 0, 24);\n }\n \n $footprintData = array(\n \"name\" => urldecode($name),\n \"shortName\" => urldecode($shortName)\n );\n \n $duplicate = checkForDuplicateCongress($footprintData, $connection);\n if (!$duplicate)\n {\n $congressURL = urlencode($_POST['newCongressURL']);\n $registrationURL = urlencode($_POST['newRegistrationURL']);\n if (strlen($congressURL) > 512)\n {\n if (!$errors){ $errors = []; }\n $error = array(\n \"code\" => 2,\n \"data\" => $congressURL\n );\n array_push($errors, $error);\n }\n else if (strlen($registrationURL) > 512)\n {\n if (!$errors){ $errors = []; }\n $error = array(\n \"code\" => 3,\n \"data\" => $registrationURL\n );\n array_push($errors, $error);\n }\n else\n {\n $startDate = convertToSqlDateTime($_POST['newCongressStartDate'], $_POST['newCongressStartTime'] . $_POST['newCongressStartMeridian']);\n $endDate = convertToSqlDateTime($_POST['newCongressEndDate'], $_POST['newCongressEndTime'] . $_POST['newCongressEndMeridian']);\n $hotelStartDate = convertToSqlDateTime($_POST['newCongressHotelStartDate'], \"15:00:00\");\n $hotelEndDate = convertToSqlDateTime($_POST['newCongressHotelEndDate'], \"11:00:00\");\n $venueName = urlencode($_POST['newCongressVenueName']);\n $venueName = strlen($venueName) > 32 ? substr($venueName, 0, 32) : $venueName;\n $venueHall = urlencode($_POST['newCongressVenueHall']);\n $venueHall = strlen($venueHall) > 16 ? substr($venueHall, 0, 16) : $venueHall;\n $venueBooth = urlencode($_POST['newCongressVenueBooth']);\n $venueBooth = strlen($venueBooth) > 16 ? substr($venueBooth, 0, 16) : $venueBooth;\n $venueAddress1 = urlencode($_POST['newCongressVenueAddress1']);\n $venueAddress1 = strlen($venueAddress1) > 32 ? substr($venueAddress1, 0, 32) : $venueAddress1;\n $venueAddress2 = urlencode($_POST['newCongressVenueAddress2']);\n $venueAddress2 = strlen($venueAddress2) > 16 ? substr($venueAddress2, 0, 16) : $venueAddress2;\n $venueCity = urlencode($_POST['newCongressVenueCity']);\n $venueCity = strlen($venueCity) > 16 ? substr($venueCity, 0, 16) : $venueCity;\n $venueState = urlencode($_POST['newCongressVenueState']);\n $venueState = strlen($venueState) > 16 ? substr($venueState, 0, 16) : $venueState;\n $venueCountry = urlencode($_POST['newCongressVenueCountry']);\n $venueCountry = strlen($venueCountry) > 16 ? substr($venueCountry, 0, 16) : $venueCountry;\n $venueZip = urlencode($_POST['newCongressVenueZip']);\n $venueZip = strlen($venueZip) > 16 ? substr($venueZip, 0, 16) : $venueZip;\n $hotels = '';\n $bios = '';\n $author = $user['id'];\n $imageUploadReturn = uploadCongressImage();\n $imageURL = $imageUploadReturn['code'] < 0 ? rawurlencode($imageUploadReturn['saveName']) : '';\n\n $query = \"INSERT INTO congresses (id, \";\n $query .= \"name, \";\n $query .= \"shortName, \";\n $query .= \"congressURL, \";\n $query .= \"registrationURL, \";\n $query .= \"startDate, \";\n $query .= \"endDate, \";\n $query .= \"hotelStartDate, \";\n $query .= \"hotelEndDate, \";\n $query .= \"showHours, \";\n $query .= \"venueName, \";\n $query .= \"venueHall, \";\n $query .= \"venueBooth, \";\n $query .= \"venueAddress1, \";\n $query .= \"venueAddress2, \";\n $query .= \"venueCity, \";\n $query .= \"venueState, \";\n $query .= \"venueCountry, \";\n $query .= \"venueZip, \";\n $query .= \"hotels, \";\n $query .= \"bios, \";\n $query .= \"author, \";\n $query .= \"imageURL) VALUES (NULL, '\";\n $query .= $name .\"', '\";\n $query .= $shortName .\"', '\";\n $query .= $congressURL .\"', '\";\n $query .= $registrationURL .\"', '\";\n $query .= $startDate .\"', '\";\n $query .= $endDate .\"', '\";\n $query .= $hotelStartDate .\"', '\";\n $query .= $hotelEndDate .\"', '\";\n $query .= \"', '\";\n $query .= $venueName .\"', '\";\n $query .= $venueHall .\"', '\";\n $query .= $venueBooth .\"', '\";\n $query .= $venueAddress1 .\"', '\";\n $query .= $venueAddress2 .\"', '\";\n $query .= $venueCity .\"', '\";\n $query .= $venueState .\"', '\";\n $query .= $venueCountry .\"', '\";\n $query .= $venueZip .\"', '\";\n $query .= $hotels .\"', '\";\n $query .= $bios .\"', '\";\n $query .= $author .\"', '\";\n $query .= $imageURL .\"')\";\n\n $result = $connection->query($query);\n\n if ($result)\n {\n $congress = getCongressByName($name, $connection);\n }\n else\n {\n if (!$errors){ $errors = []; }\n $error = array(\n \"code\" => 4,\n \"data\" => $congress\n );\n array_push($errors, $error);\n }\n }\n }\n else\n {\n if (!$errors){ $errors = []; }\n foreach ($duplicate['errors'] as $error)\n {\n array_push($errors, $error);\n }\n }\n return getCongressReturn($errors, $congress);\n}", "public function run()\n {\n DB::table('coupons')->insert([\n 'uuid' => Str::uuid(),\n 'seller_id' => '001',\n 'title' => 'CouponTEST_'.Str::random(5),\n 'detail' => Str::random(10),\n 'carrier' => '/1ZXCASD',\n 'used' => false,\n 'expired_date' => Carbon::now()->format('Y-m-d H:i:s'),\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 }", "function post_log_ecoupon($tableName,$data) {\n $this->db->insert($tableName, $data);\n }", "protected function create(array $data)\n {\n $user = User::create([\n 'name' => $data['surname'].' '.$data['name'],\n 'email' => $data['email'],\n 'password' => bcrypt($data['password']),\n 'token' => $this->userRepository->createToken(),\n 'active' => 1,\n ]);\n $user->assignRole('customer');\n\n $customer = new Customer;\n $customer->user_id = $user->id;\n $customer->surname = $data['surname'];\n $customer->name = $data['name'];\n $customer->email = $data['email'];\n $dob = false;\n if( array_key_exists('day', $data) && !is_null($data['day']) && !is_null($data['month']) && !is_null($data['year']) ) {\n $customer->dob = $data['year'].'-'.$data['month'].'-'.$data['day'];\n $dob = true;\n } else {\n $customer->dob = null;\n }\n $customer->tel = null;\n $json = [];\n $json['loyalty_points'] = 0;\n if( array_key_exists('promo_acceptance', $data) ) {\n $json['promo'] = true;\n } else {\n $json['promo'] = false;\n }\n $json['ean'] = $this->generateEanForCustomer();\n\n $customer->json = $json;\n $customer->save();\n\n $register_coupon = new Coupon;\n $register_coupon->user_id = $user->id;\n $register_coupon->number = $this->generateCouponNumber();\n $register_coupon->status = Coupon::STATUS_AWAITING;\n $json = [];\n $json['reward'] = 'original-donut';\n $register_coupon->json = $json;\n $register_coupon->save();\n\n if($dob) {\n $dob_coupon = new Coupon;\n $dob_coupon->user_id = $user->id;\n $dob_coupon->number = $this->generateCouponNumber();\n $dob_coupon->status = Coupon::STATUS_AWAITING;\n $json = [];\n $json['reward'] = 'original-donut';\n $dob_coupon->json = $json;\n $dob_coupon->save();\n }\n\n return $user;\n }", "function insert_insurance($data)\n\t{\n\t\tglobal $cid, $db;\n\n\t\t$sql = \"INSERT INTO \". GARAGE_INSURANCE_TABLE .\"\n\t\t\tSET garage_id = '$cid', premium = '\".$data['premium'].\"', cover_type = '\".$data['cover_type'].\"', comments = '\".$data['comments'].\"', business_id = '\".$data['business_id'].\"'\";\n\n\t\tif(!$result = $db->sql_query($sql))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Insert Insurance Premium', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}", "public function run(Faker $faker)\n {\n DB::table('coupons')->insert([\n [\n 'uuid' => $faker->uuid,\n 'name' => 'HELLO123',\n 'price' => 100,\n 'start' => '2020-05-01',\n 'end' => '2020-05-05',\n 'active' => 1 \n ],\n [\n 'uuid' => $faker->uuid,\n 'name' => 'TEST123',\n 'price' => 150,\n 'start' => '2020-05-01',\n 'end' => '2020-05-04',\n 'active' => 0 \n ]\n ]);\n }", "public function apply_coupon(){\n $customer_id = $_REQUEST['customer_id'];\n $coupon_code = $_REQUEST['coupon_code'];\n $cart_total = $_REQUEST['order_total_amount'];\n $today = date('d-m-Y');\n\n $coupon_info = $this->User_Model->get_info_arr('coupon_code', $coupon_code, 'coupon');\n if($coupon_info){\n $coupon_used_count = $this->User_Model->get_count('coupon_used_id','coupon_id',$coupon_info[0]['coupon_id'],'customer_id',$customer_id,'coupon_used_status','1','coupon_used');\n if($coupon_info[0]['coupon_status'] == 0 ){\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Invalid Coupon Code';\n } elseif ( strtotime($coupon_info[0]['coupon_exp_date']) < strtotime($today)) {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'This Coupon Code is Expired';\n } elseif ($cart_total > $coupon_info[0]['coupon_max_spend'] || $cart_total < $coupon_info[0]['coupon_min_spend']) {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Cart Amount is Out of Range';\n } elseif ($coupon_used_count >= $coupon_info[0]['limit_per_user']) {\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'This Coupon Usage is Expired';\n } else{\n $response[\"status\"] = TRUE;\n $response['msg'] = 'Coupon Applied Successfully';\n $response['coupon_id'] = $coupon_info[0]['coupon_id'];\n $response['coupon_code'] = $coupon_info[0]['coupon_code'];\n $response['coupon_amt'] = $coupon_info[0]['coupon_amt'];\n }\n } else{\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Invalid Coupon Code';\n }\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "private function insertNewAffiliate() {\n\t\t\t$queryVals = array(\n\t\t\t\t'~company' => prepDB($this->registrationForm['company']),\n\t\t\t\t'~first' => prepDB($this->registrationForm['first']),\n\t\t\t\t'~last' => prepDB($this->registrationForm['last']),\n\t\t\t\t'~phone' => prepDB($this->registrationForm['phone']),\n\t\t\t\t'~fax' => prepDB($this->registrationForm['fax']),\n\t\t\t\t'~email' => prepDB($this->registrationForm['email']),\n\t\t\t\t'~website' => prepDB($this->registrationForm['website']),\n\t\t\t\t'~password' => prepDB($this->registrationForm['password']),\n\t\t\t\t'~address1' => prepDB($this->registrationForm['address1']),\n\t\t\t\t'~address2' => prepDB($this->registrationForm['address2']),\n\t\t\t\t'~city' => prepDB($this->registrationForm['city']),\n\t\t\t\t'~state' => prepDB($this->registrationForm['state']),\n\t\t\t\t'~postal' => prepDB($this->registrationForm['postal']),\n\t\t\t\t'~country' => prepDB($this->registrationForm['country']),\n\t\t\t\t'agreeTerms' => prepDB($this->registrationForm['agreeTerms']),\n\t\t\t\t'agreePolicy' => prepDB($this->registrationForm['agreePolicy']),\n\t\t\t\t'isOverAge' => prepDB($this->registrationForm['isOverAge']),\n\t\t\t\t'entryDate' => 'NOW()'\n\t\t\t\t\n\t\t\t);\n\t\t\t$this->dbh->perform('affiliates', $queryVals);\n\t\t}", "public function setCoupons($coupons)\n {\n $this->values['Coupons'] = $coupons;\n return $this;\n }", "public static function coupon_save_after($object,$post)\n { //echo '<pre>'; print_r($post);echo '</pre>';die;\n if(isset($post['coupon_title']) && isset($post['coupon_description']) && isset($post['terms_condition']))\n {\n $coupon_title = $post['coupon_title'];\n $coupon_description = $post['coupon_description'];\n $terms_condition = $post['terms_condition'];\n try{\n //~ $data = Coupons_infos::find($object->id);\n //~ if(count($data)>0)\n //~ {\n //~ $data->delete();\n //~ }\n $affected = DB::table('coupons_infos')->where('id', '=', $object->id)->delete();\n $languages = DB::table('languages')->where('status', 1)->get();\n foreach($languages as $key => $lang)\n {\n if(isset($coupon_title[$lang->id]) && $coupon_title[$lang->id] != '')\n {\n $infomodel = new Coupons_infos;\n $infomodel->lang_id = $lang->id;\n $infomodel->id = $object->id; \n $infomodel->coupon_title = $coupon_title[$lang->id];\n $infomodel->coupon_info = $coupon_description[$lang->id];\n $infomodel->terms_condition = $terms_condition[$lang->id];\n $infomodel->save();\n }\n }\n }\n catch(Exception $e) {\n Log::Instance()->add(Log::ERROR, $e);\n }\n }\n }", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "public function crearCorreoInstitucional(){\n $nom0 = $this->attributes['nombre'];\n //tomo el/los apellido/s del preinscripto\n $ape0 = $this->attributes['apellido'];\n //defino el dominio que tendrá cada mail creado\n $dominio = \"@udc.edu.ar\";\n \n $nom = $this->inicialesDeNombres($nom0);\n $nom1 = $this->sanear_string($nom);\n \n $ape = $this->apellidosCompletos($ape0);\n $ape1 = $this->sanear_string($ape);\n \n \n $correo_institucional = $nom1.$ape1.$dominio; \n $this->attributes['email_institucional'] = $correo_institucional;\n $this->save();\n }", "public function __construct(Coupon $coupon)\n {\n $this->coupon = $coupon;\n }", "public function run()\n {\n $data = array(\n \t['id'=>1,\n \t 'name' => 'Food Coupon',\n \t 'amount' => 150.00\n \t],\n \t['id'=>2,\n \t 'name' => 'Hashhacks',\n \t 'amount' => 300.00\n \t]\n );\n DB::table('food_coupons')->insert($data);\n }", "public function generateDynamicCoupon($productOptions,$orderId,$couponValue){\n try{\n $orderCustomOptionCollection = $productOptions;\n $couponCode = $this->_helper->generateCouponCode(12);\n $time = $this->_helper->getFormattedTime();\n $date = $this->_helper->getFormattedDate();\n //checking if optional message set or not\n if(count($orderCustomOptionCollection) == 6){\n $data = array(\"sender_name\",\"sender_email\",\"receiver_name\",\"receiver_email\",\"optional_message\",\"date\");\n $first_chunck = array_combine($data,$orderCustomOptionCollection);\n }else{\n $data = array(\"sender_name\",\"sender_email\",\"receiver_name\",\"receiver_email\",\"date\");\n $first_chunck = array_combine($data,$orderCustomOptionCollection);\n }\n $second_chunck = array(\n \"time\" => $time,\n \"coupon_code\" => $couponCode,\n \"card_value\" => $couponValue,\n \"order_id\" => $orderId\n );\n $final_array = array_merge($first_chunck,$second_chunck);\n $giftModel = $this->_giftCard->create();\n $giftModel->setData($final_array);\n $giftModel->save();\n }catch(\\Exception $e){\n \n }\n }", "public function store(StoreCouponsRequest $request)\n {\n //\n $coupon = new Coupon();\n $coupon->code = $request->code;\n $coupon->expirationdate = $request->expirationdate;\n $coupon->discount = $request->discount;\n $coupon->save();\n\n return redirect()->route('coupons.index')->with('message', 'Coupon aangemaakt');\n }", "public function store(CouponRequest $request)\n {\n try {\n $coupon = new Coupon();\n $coupon->title = $request->title;\n $coupon->code = $request->code;\n $coupon->price = $request->price;\n $coupon->status = $request->status;\n $coupon->save();\n Session::flash('coupon_success', 'کد تخفیف با موفقیت ثبت شد');\n return redirect('/admin/coupons');\n }\n catch (\\Exception $m) {\n Session::flash('coupon_error', 'خطایی در ثب به وجود آمده لطفا مجددا تلاش کنید');\n return redirect('/admin/coupons');\n }\n }", "public function save_bonification_ie($data)\n {\n $this->db->insert('bonificaciones_ie', $data);\n }", "private function addEasyCreditConfirmationButtonTranslation()\n {\n $sql = \"INSERT INTO s_core_snippets (namespace, shopID, localeID, name, value) VALUES \"\n .\"('confirm', 1,2, 'FRONTEND_EASYCREDIT_CONFIRM_BUTTON', 'Continue to Ratenkauf by easyCredit'),\n ('confirm', 1,1, 'FRONTEND_EASYCREDIT_CONFIRM_BUTTON', 'Weiter zu Ratenkauf by easyCredit')\";\n\n Shopware()->Db()->query($sql);\n }", "public function generateCoupon()\n {\n $params = $this->getRequest()->getParams();\n if (! isset($params['id']) || !isset($params['code'])) {\n Mage::helper('ddg')->log('Coupon no id or code is set');\n\n return false;\n }\n\n //coupon rule id\n $couponCodeId = $params['id'];\n\n if ($couponCodeId) {\n $rule = Mage::getModel('salesrule/rule')->load($couponCodeId);\n //coupon code id not found\n if (! $rule->getId()) {\n Mage::helper('ddg')->log(\n 'Rule with couponId model not found : ' . $couponCodeId\n );\n\n return false;\n }\n\n $generator = Mage::getModel('salesrule/coupon_massgenerator');\n $generator->setFormat(\n Mage_SalesRule_Helper_Coupon::COUPON_FORMAT_ALPHANUMERIC\n );\n $generator->setRuleId($couponCodeId);\n $generator->setUsesPerCoupon(1);\n $generator->setDash(3);\n $generator->setLength(9);\n $generator->setPrefix('DOT-');\n $generator->setSuffix('');\n //set the generation settings\n $rule->setCouponCodeGenerator($generator);\n $rule->setCouponType(Mage_SalesRule_Model_Rule::COUPON_TYPE_AUTO);\n //generate the coupon\n $coupon = $rule->acquireCoupon();\n $couponCode = $coupon->getCode();\n //save the type of coupon\n $couponModel = Mage::getModel('salesrule/coupon')\n ->loadByCode($couponCode);\n\n $couponModel->setType(Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON)\n ->setGeneratedByDotmailer(1);\n\n if (isset($params['expire_days']) && is_numeric($params['expire_days']) && $params['expire_days'] > 0) {\n $days = (int) $params['expire_days'];\n $locale = Mage::app()->getLocale()->getLocale();\n //@codingStandardsIgnoreStart\n $expirationDate = Zend_Date::now($locale)->addDay($days);\n //@codingStandardsIgnoreEnd\n $couponModel->setExpirationDate($expirationDate->toString('yyyy-MM-dd HH:mm'));\n } elseif ($rule->getToDate()) {\n $couponModel->setExpirationDate($rule->getToDate());\n }\n\n $couponModel->save();\n\n return $couponCode;\n }\n\n return false;\n }", "function regenerateCouponArticle() {\r\n\r\n\t\t$coupons = $this->getSessionCoupons();\r\n\r\n\t\t$behind = $this->getSessionCoupons_discountOnly();\r\n\t\tif(is_array($behind)){\r\n\t\t $coupons2 = array();\r\n\t\t while(list($k,$v) = each($behind)){\r\n\t\t\t unset($coupons[$k]);\r\n\t\t \t if($v['record']['type']<>'percent'){\r\n\t\t\t $coupons[$k] = $v;\r\n\t\t\t }else{\r\n\t\t\t\t$coupons2[$k] = $v;\r\n\t\t\t }\r\n\t\t }\r\n\t\t while(list($k,$v) = each($coupons2)){\r\n\t\t $coupons[$k] = $v;\r\n\t\t }\r\n\t\t}\r\n\t\t// we have 2 article types: 1) having a related article (e.g. trial article) and only moneydiscount\r\n\t\t$couponArticleUids_type1 = $this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponNormalType']);\t// was 4\r\n\t $couponArticleUids_type2 = $this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponRelatedType']);\t// was 5\r\n\t\t$couponArticleUids = array_merge($couponArticleUids_type1,$couponArticleUids_type2);\r\n\t\t\t// erstmal alle coupon artikel l�schen:\r\n\t\tforeach($couponArticleUids as $couponArticleUid) {\r\n\t\t\tif($this->basket->basket_items[$couponArticleUid]) {\r\n\r\n\t\t\t\t$this->basket->delete_article($couponArticleUid);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(!count($coupons)) return false;\r\n\r\n\t\treset($coupons);\r\n\r\n\t\t$b = &$this->basket->basket_items;\r\n\t\t\t// dann alle neu generieren\r\n\t\tforeach($coupons as $coupon) {\r\n\r\n\t\t\tif($coupon['record']['type']=='percent'){\r\n\t\t\t\t$coupon = $this->getCouponData($coupon['uid'],true);\r\n\t\t\t}\r\n\r\n\t\t\t\t// add coupon article to the basket or add quantity to existing article\r\n\t\t\tif($b[$coupon['articleId']]->quantity) {\r\n\r\n\t\t\t\t$previous_price_net = $b[$coupon['articleId']]->get_price_net();\r\n\t\t\t\t$previous_price_gross = $b[$coupon['articleId']]->get_price_gross();\r\n\t\t\t\t$b[$coupon['articleId']]->tx_commercecoupons_addedbycouponid[] = $coupon['uid'];\r\n\t\t\t\t$b[$coupon['articleId']]->related_coupon = $coupon['uid'];\r\n\t\t\t\t$b[$coupon['articleId']]->setPriceNet($previous_price_net+$coupon['price_net']);\r\n\t\t\t\t$b[$coupon['articleId']]->setPriceGross($previous_price_gross+$coupon['price_gross']);\r\n\t\t\t} else {\r\n\r\n\t\t\t\t$this->basket->add_article($coupon['articleId']);\r\n\t\t\t\t$b[$coupon['articleId']]->tx_commercecoupons_addedbycouponid = array($coupon['uid']);\r\n\t\t\t\t$b[$coupon['articleId']]->related_coupon = array($coupon['uid']);\r\n\t\t\t\t$this->basket->changePrices($coupon['articleId'],$coupon['price_gross'],$coupon['price_net']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$this->basket->store_data();\r\n\t}", "public function addCoupon(Coupon $coupon): void\n {\n $this->coupons->put($coupon->id, $coupon);\n\n $this->save();\n }", "function pmprowoo_add_gift_code_from_order($order_id)\r\n{\r\n global $wpdb, $pmprowoo_gift_codes;\r\n\r\n //don't bother if array is empty\r\n if(empty($pmprowoo_gift_codes))\r\n return;\r\n\r\n /*\r\n does this order contain a gift membership code?\r\n */\r\n //gift membership code product ids\r\n $product_ids = array_keys($pmprowoo_gift_codes);\r\n\r\n //get order\r\n $order = new WC_Order($order_id);\r\n $items = $order->get_items();\r\n\t\r\n //does the order have some products?\r\n if(sizeof($items) > 0)\r\n {\r\n foreach($items as $item_id => $item)\r\n {\r\n if($item['product_id'] > 0) \t//not sure when a product has id 0, but the Woo code checks this\r\n {\r\n //is there a gift membership code for this product?\r\n if(in_array($item['product_id'], $product_ids))\r\n {\r\n\r\n\t /*\r\n\t\t Create Gift Code\r\n\t */\t\r\n\r\n\t //get selected gifted discount code id\r\n\t $gift_code_id = $pmprowoo_gift_codes[$item['product_id']];\r\n\r\n // get discount code level to copy\r\n $gift_level = $wpdb->get_row(\"SELECT * FROM $wpdb->pmpro_discount_codes_levels WHERE code_id = '\" . $gift_code_id . \"' LIMIT 1\");\r\n if(!$gift_level){ \r\n //possibly add an error if coupon code doesn't exist\r\n return; \r\n }\r\n \r\n\r\n\t //create new gift code\r\n\t $code = \"GIFT\" . rand(1, 99) . pmpro_getDiscountCode(); //added rand to code to make it unique for multiple gift orders\r\n\t $starts = current_time( 'Y-m-d', 0 );\r\n\t $expires = date(\"Y-m-d\", strtotime(\"+1 year\"));\t\t\r\n\t $sqlQuery = \"INSERT INTO $wpdb->pmpro_discount_codes (code, starts, expires, uses) VALUES('\" . esc_sql($code) . \"', '\" . $starts . \"', '\" . $expires . \"', '1')\";\r\n\t\r\n \t if($wpdb->query($sqlQuery) !== false){\r\n\t\t //get id of new code\r\n\t\t $code_id = $wpdb->insert_id;\r\n\t\t\r\n\t\t //add code to level\r\n\t\t $sqlQuery = \"INSERT INTO $wpdb->pmpro_discount_codes_levels (code_id, level_id, initial_payment, billing_amount, cycle_number, cycle_period, billing_limit, trial_amount, trial_limit, expiration_number, expiration_period) VALUES(\r\n '\" . esc_sql($code_id) . \"',\r\n '\" . esc_sql($gift_level->level_id) . \"',\r\n '\" . esc_sql($gift_level->initial_payment) . \"',\r\n '\" . esc_sql($gift_level->billing_amount) . \"',\r\n '\" . esc_sql($gift_level->cycle_number) . \"',\r\n '\" . esc_sql($gift_level->cycle_period) . \"',\r\n '\" . esc_sql($gift_level->billing_limit) . \"',\r\n '\" . esc_sql($gift_level->trial_amount) . \"',\r\n '\" . esc_sql($gift_level->trial_limit) . \"',\r\n '\" . esc_sql($gift_level->expiration_number) . \"',\r\n '\" . esc_sql($gift_level->expiration_period) . \"')\";\r\n\t\t$wpdb->query($sqlQuery);\r\n\t\t\t \r\n /* Add Code to Order Meta */\r\n wc_add_order_item_meta( $item_id, \"Gift Code\", $code );\r\n\t\t\r\n\t /*\r\n\t\t //Email Gift Code\r\n // Tag: !!gift_product!! => Title of the Product\r\n // Tag: !!membership_gift_code!! => Generated Gift Code\r\n\t */\t\r\n $recipient_name = wp_strip_all_tags($item['Recipient Name']);\r\n $recipient_email = wp_strip_all_tags($item['Recipient Email']);\r\n\r\n if(!empty($recipient_email)){\r\n\r\n // Send Email to Recipient\r\n $pmproemail = new PMProEmail();\r\n $pmproemail->email = $recipient_email;\r\n\t $pmproemail->subject = sprintf(__(\"A Gift from %s\", 'pmpro-woocommerce'), get_option('blogname'));\r\n $pmproemail->template = 'gift_membership_code';\r\n \r\n $pmproemail->data = array(\"subject\" => $pmproemail->subject, \"name\" => $recipient_name, \"user_login\" => '', \"sitename\" => get_option(\"blogname\"), \"membership_id\" => '', \"membership_level_name\" => '', \"siteemail\" => pmpro_getOption(\"from_email\"), \"login_link\" => '', \"enddate\" => '', \"display_name\" => $recipient_name, \"user_email\" => $recipient_email, \"gift_product\" => $item['name'], \"membership_gift_code\" => $code, \"body\" => pmpro_loadTemplate('gift_membership_code','local','email','html'));\t\t\r\n\t\t\t\r\n\t if($pmproemail->sendEmail() == false){\r\n $message = \"Gift Email FAILED To Recipient \". $recipient_email .\". Contact Site Admin. \";\r\n global $phpmailer;\r\n if (isset($phpmailer)) {\r\n $message .= $phpmailer->ErrorInfo;\r\n }\r\n } else {\r\n $message = \"Gift Email Sent To Recipient \". $recipient_email;\r\n }\r\n\r\n if ( function_exists('wc_add_notice') ) {\r\n wc_add_notice( $message, $notice_type = 'success' );\r\n }\r\n\r\n } else {\r\n\r\n // If no Recipient Send Email to Customer\r\n $pmproemail = new PMProEmail();\r\n $pmproemail->email = $order->get_billing_email();\r\n $pmproemail->subject = sprintf(__(\"A Gift from %s\", 'pmpro-woocommerce'), get_option(\"blogname\"));\r\n $pmproemail->template = 'gift_membership_code';\r\n \r\n $pmproemail->data = array(\"subject\" => $pmproemail->subject, \"name\" => $order->get_billing_first_name(), \"user_login\" => '', \"sitename\" => get_option(\"blogname\"), \"membership_id\" => '', \"membership_level_name\" => '', \"siteemail\" => pmpro_getOption(\"from_email\"), \"login_link\" => '', \"enddate\" => '', \"display_name\" => $order->get_billing_first_name(), \"user_email\" => $order->get_billing_email(), \"gift_product\" => $item['name'], \"membership_gift_code\" => $code, \"body\" => pmpro_loadTemplate('gift_membership_code','local','email','html'));\t\t\r\n\t\t\t\r\n\t if($pmproemail->sendEmail() == false){\r\n $message = \"Gift Email FAILED To \". $order->get_billing_email() .\". Contact Site Admin. \";\r\n global $phpmailer;\r\n if (isset($phpmailer)) {\r\n $message .= $phpmailer->ErrorInfo;\r\n }\r\n } else {\r\n $message = \"Gift Email Sent To \". $order->get_billing_email();\r\n }\r\n \r\n if ( function_exists('wc_add_notice') ) {\r\n wc_add_notice( $message, $notice_type = 'success' );\r\n }\r\n \r\n }\r\n\r\n \t }\r\n\r\n }\r\n }\r\n }\r\n }\r\n}", "public function generateRandomCouponCode()\n {\n $length = 12;\n $code = '';\n $chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ0123456789';\n $maxlength = strlen($chars);\n if ($length > $maxlength) {\n $length = $maxlength;\n }\n\n $i = 0;\n while ($i < $length) {\n $char = substr($chars, mt_rand(0, $maxlength - 1), 1);\n if (!strstr($code, $char)) {\n $code .= $char;\n $i++;\n }\n }\n\n $code = strtoupper($code);\n return $code;\n }", "private function seedCountries()\n {\n DB::insert('INSERT INTO `countries` (`num_code`, `alpha_2_code`, `alpha_3_code`, `en_short_name`, `nationality`, `created_at`, `updated_at`) VALUES\n(\"4\", \"AF\", \"AFG\", \"Afghanistan\", \"Afghan\", NOW(), NOW()),\n(\"248\", \"AX\", \"ALA\", \"Åland Islands\", \"Åland Island\", NOW(), NOW()),\n(\"8\", \"AL\", \"ALB\", \"Albania\", \"Albanian\", NOW(), NOW()),\n(\"12\", \"DZ\", \"DZA\", \"Algeria\", \"Algerian\", NOW(), NOW()),\n(\"16\", \"AS\", \"ASM\", \"American Samoa\", \"American Samoan\", NOW(), NOW()),\n(\"20\", \"AD\", \"AND\", \"Andorra\", \"Andorran\", NOW(), NOW()),\n(\"24\", \"AO\", \"AGO\", \"Angola\", \"Angolan\", NOW(), NOW()),\n(\"660\", \"AI\", \"AIA\", \"Anguilla\", \"Anguillan\", NOW(), NOW()),\n(\"10\", \"AQ\", \"ATA\", \"Antarctica\", \"Antarctic\", NOW(), NOW()),\n(\"28\", \"AG\", \"ATG\", \"Antigua and Barbuda\", \"Antiguan or Barbudan\", NOW(), NOW()),\n(\"32\", \"AR\", \"ARG\", \"Argentina\", \"Argentine\", NOW(), NOW()),\n(\"51\", \"AM\", \"ARM\", \"Armenia\", \"Armenian\", NOW(), NOW()),\n(\"533\", \"AW\", \"ABW\", \"Aruba\", \"Aruban\", NOW(), NOW()),\n(\"36\", \"AU\", \"AUS\", \"Australia\", \"Australian\", NOW(), NOW()),\n(\"40\", \"AT\", \"AUT\", \"Austria\", \"Austrian\", NOW(), NOW()),\n(\"31\", \"AZ\", \"AZE\", \"Azerbaijan\", \"Azerbaijani, Azeri\", NOW(), NOW()),\n(\"44\", \"BS\", \"BHS\", \"Bahamas\", \"Bahamian\", NOW(), NOW()),\n(\"48\", \"BH\", \"BHR\", \"Bahrain\", \"Bahraini\", NOW(), NOW()),\n(\"50\", \"BD\", \"BGD\", \"Bangladesh\", \"Bangladeshi\", NOW(), NOW()),\n(\"52\", \"BB\", \"BRB\", \"Barbados\", \"Barbadian\", NOW(), NOW()),\n(\"112\", \"BY\", \"BLR\", \"Belarus\", \"Belarusian\", NOW(), NOW()),\n(\"56\", \"BE\", \"BEL\", \"Belgium\", \"Belgian\", NOW(), NOW()),\n(\"84\", \"BZ\", \"BLZ\", \"Belize\", \"Belizean\", NOW(), NOW()),\n(\"204\", \"BJ\", \"BEN\", \"Benin\", \"Beninese, Beninois\", NOW(), NOW()),\n(\"60\", \"BM\", \"BMU\", \"Bermuda\", \"Bermudian, Bermudan\", NOW(), NOW()),\n(\"64\", \"BT\", \"BTN\", \"Bhutan\", \"Bhutanese\", NOW(), NOW()),\n(\"68\", \"BO\", \"BOL\", \"Bolivia (Plurinational State of)\", \"Bolivian\", NOW(), NOW()),\n(\"535\", \"BQ\", \"BES\", \"Bonaire, Sint Eustatius and Saba\", \"Bonaire\", NOW(), NOW()),\n(\"70\", \"BA\", \"BIH\", \"Bosnia and Herzegovina\", \"Bosnian or Herzegovinian\", NOW(), NOW()),\n(\"72\", \"BW\", \"BWA\", \"Botswana\", \"Motswana, Botswanan\", NOW(), NOW()),\n(\"74\", \"BV\", \"BVT\", \"Bouvet Island\", \"Bouvet Island\", NOW(), NOW()),\n(\"76\", \"BR\", \"BRA\", \"Brazil\", \"Brazilian\", NOW(), NOW()),\n(\"86\", \"IO\", \"IOT\", \"British Indian Ocean Territory\", \"BIOT\", NOW(), NOW()),\n(\"96\", \"BN\", \"BRN\", \"Brunei Darussalam\", \"Bruneian\", NOW(), NOW()),\n(\"100\", \"BG\", \"BGR\", \"Bulgaria\", \"Bulgarian\", NOW(), NOW()),\n(\"854\", \"BF\", \"BFA\", \"Burkina Faso\", \"Burkinabé\", NOW(), NOW()),\n(\"108\", \"BI\", \"BDI\", \"Burundi\", \"Burundian\", NOW(), NOW()),\n(\"132\", \"CV\", \"CPV\", \"Cabo Verde\", \"Cabo Verdean\", NOW(), NOW()),\n(\"116\", \"KH\", \"KHM\", \"Cambodia\", \"Cambodian\", NOW(), NOW()),\n(\"120\", \"CM\", \"CMR\", \"Cameroon\", \"Cameroonian\", NOW(), NOW()),\n(\"124\", \"CA\", \"CAN\", \"Canada\", \"Canadian\", NOW(), NOW()),\n(\"136\", \"KY\", \"CYM\", \"Cayman Islands\", \"Caymanian\", NOW(), NOW()),\n(\"140\", \"CF\", \"CAF\", \"Central African Republic\", \"Central African\", NOW(), NOW()),\n(\"148\", \"TD\", \"TCD\", \"Chad\", \"Chadian\", NOW(), NOW()),\n(\"152\", \"CL\", \"CHL\", \"Chile\", \"Chilean\", NOW(), NOW()),\n(\"156\", \"CN\", \"CHN\", \"China\", \"Chinese\", NOW(), NOW()),\n(\"162\", \"CX\", \"CXR\", \"Christmas Island\", \"Christmas Island\", NOW(), NOW()),\n(\"166\", \"CC\", \"CCK\", \"Cocos (Keeling) Islands\", \"Cocos Island\", NOW(), NOW()),\n(\"170\", \"CO\", \"COL\", \"Colombia\", \"Colombian\", NOW(), NOW()),\n(\"174\", \"KM\", \"COM\", \"Comoros\", \"Comoran, Comorian\", NOW(), NOW()),\n(\"178\", \"CG\", \"COG\", \"Congo (Republic of the)\", \"Congolese\", NOW(), NOW()),\n(\"180\", \"CD\", \"COD\", \"Congo (Democratic Republic of the)\", \"Congolese\", NOW(), NOW()),\n(\"184\", \"CK\", \"COK\", \"Cook Islands\", \"Cook Island\", NOW(), NOW()),\n(\"188\", \"CR\", \"CRI\", \"Costa Rica\", \"Costa Rican\", NOW(), NOW()),\n(\"384\", \"CI\", \"CIV\", \"Côte d\\'Ivoire\", \"Ivorian\", NOW(), NOW()),\n(\"191\", \"HR\", \"HRV\", \"Croatia\", \"Croatian\", NOW(), NOW()),\n(\"192\", \"CU\", \"CUB\", \"Cuba\", \"Cuban\", NOW(), NOW()),\n(\"531\", \"CW\", \"CUW\", \"Curaçao\", \"Curaçaoan\", NOW(), NOW()),\n(\"196\", \"CY\", \"CYP\", \"Cyprus\", \"Cypriot\", NOW(), NOW()),\n(\"203\", \"CZ\", \"CZE\", \"Czech Republic\", \"Czech\", NOW(), NOW()),\n(\"208\", \"DK\", \"DNK\", \"Denmark\", \"Danish\", NOW(), NOW()),\n(\"262\", \"DJ\", \"DJI\", \"Djibouti\", \"Djiboutian\", NOW(), NOW()),\n(\"212\", \"DM\", \"DMA\", \"Dominica\", \"Dominican\", NOW(), NOW()),\n(\"214\", \"DO\", \"DOM\", \"Dominican Republic\", \"Dominican\", NOW(), NOW()),\n(\"218\", \"EC\", \"ECU\", \"Ecuador\", \"Ecuadorian\", NOW(), NOW()),\n(\"818\", \"EG\", \"EGY\", \"Egypt\", \"Egyptian\", NOW(), NOW()),\n(\"222\", \"SV\", \"SLV\", \"El Salvador\", \"Salvadoran\", NOW(), NOW()),\n(\"226\", \"GQ\", \"GNQ\", \"Equatorial Guinea\", \"Equatorial Guinean, Equatoguinean\", NOW(), NOW()),\n(\"232\", \"ER\", \"ERI\", \"Eritrea\", \"Eritrean\", NOW(), NOW()),\n(\"233\", \"EE\", \"EST\", \"Estonia\", \"Estonian\", NOW(), NOW()),\n(\"231\", \"ET\", \"ETH\", \"Ethiopia\", \"Ethiopian\", NOW(), NOW()),\n(\"238\", \"FK\", \"FLK\", \"Falkland Islands (Malvinas)\", \"Falkland Island\", NOW(), NOW()),\n(\"234\", \"FO\", \"FRO\", \"Faroe Islands\", \"Faroese\", NOW(), NOW()),\n(\"242\", \"FJ\", \"FJI\", \"Fiji\", \"Fijian\", NOW(), NOW()),\n(\"246\", \"FI\", \"FIN\", \"Finland\", \"Finnish\", NOW(), NOW()),\n(\"250\", \"FR\", \"FRA\", \"France\", \"French\", NOW(), NOW()),\n(\"254\", \"GF\", \"GUF\", \"French Guiana\", \"French Guianese\", NOW(), NOW()),\n(\"258\", \"PF\", \"PYF\", \"French Polynesia\", \"French Polynesian\", NOW(), NOW()),\n(\"260\", \"TF\", \"ATF\", \"French Southern Territories\", \"French Southern Territories\", NOW(), NOW()),\n(\"266\", \"GA\", \"GAB\", \"Gabon\", \"Gabonese\", NOW(), NOW()),\n(\"270\", \"GM\", \"GMB\", \"Gambia\", \"Gambian\", NOW(), NOW()),\n(\"268\", \"GE\", \"GEO\", \"Georgia\", \"Georgian\", NOW(), NOW()),\n(\"276\", \"DE\", \"DEU\", \"Germany\", \"German\", NOW(), NOW()),\n(\"288\", \"GH\", \"GHA\", \"Ghana\", \"Ghanaian\", NOW(), NOW()),\n(\"292\", \"GI\", \"GIB\", \"Gibraltar\", \"Gibraltar\", NOW(), NOW()),\n(\"300\", \"GR\", \"GRC\", \"Greece\", \"Greek, Hellenic\", NOW(), NOW()),\n(\"304\", \"GL\", \"GRL\", \"Greenland\", \"Greenlandic\", NOW(), NOW()),\n(\"308\", \"GD\", \"GRD\", \"Grenada\", \"Grenadian\", NOW(), NOW()),\n(\"312\", \"GP\", \"GLP\", \"Guadeloupe\", \"Guadeloupe\", NOW(), NOW()),\n(\"316\", \"GU\", \"GUM\", \"Guam\", \"Guamanian, Guambat\", NOW(), NOW()),\n(\"320\", \"GT\", \"GTM\", \"Guatemala\", \"Guatemalan\", NOW(), NOW()),\n(\"831\", \"GG\", \"GGY\", \"Guernsey\", \"Channel Island\", NOW(), NOW()),\n(\"324\", \"GN\", \"GIN\", \"Guinea\", \"Guinean\", NOW(), NOW()),\n(\"624\", \"GW\", \"GNB\", \"Guinea-Bissau\", \"Bissau-Guinean\", NOW(), NOW()),\n(\"328\", \"GY\", \"GUY\", \"Guyana\", \"Guyanese\", NOW(), NOW()),\n(\"332\", \"HT\", \"HTI\", \"Haiti\", \"Haitian\", NOW(), NOW()),\n(\"334\", \"HM\", \"HMD\", \"Heard Island and McDonald Islands\", \"Heard Island or McDonald Islands\", NOW(), NOW()),\n(\"336\", \"VA\", \"VAT\", \"Vatican City State\", \"Vatican\", NOW(), NOW()),\n(\"340\", \"HN\", \"HND\", \"Honduras\", \"Honduran\", NOW(), NOW()),\n(\"344\", \"HK\", \"HKG\", \"Hong Kong\", \"Hong Kong, Hong Kongese\", NOW(), NOW()),\n(\"348\", \"HU\", \"HUN\", \"Hungary\", \"Hungarian, Magyar\", NOW(), NOW()),\n(\"352\", \"IS\", \"ISL\", \"Iceland\", \"Icelandic\", NOW(), NOW()),\n(\"356\", \"IN\", \"IND\", \"India\", \"Indian\", NOW(), NOW()),\n(\"360\", \"ID\", \"IDN\", \"Indonesia\", \"Indonesian\", NOW(), NOW()),\n(\"364\", \"IR\", \"IRN\", \"Iran\", \"Iranian, Persian\", NOW(), NOW()),\n(\"368\", \"IQ\", \"IRQ\", \"Iraq\", \"Iraqi\", NOW(), NOW()),\n(\"372\", \"IE\", \"IRL\", \"Ireland\", \"Irish\", NOW(), NOW()),\n(\"833\", \"IM\", \"IMN\", \"Isle of Man\", \"Manx\", NOW(), NOW()),\n(\"376\", \"IL\", \"ISR\", \"Israel\", \"Israeli\", NOW(), NOW()),\n(\"380\", \"IT\", \"ITA\", \"Italy\", \"Italian\", NOW(), NOW()),\n(\"388\", \"JM\", \"JAM\", \"Jamaica\", \"Jamaican\", NOW(), NOW()),\n(\"392\", \"JP\", \"JPN\", \"Japan\", \"Japanese\", NOW(), NOW()),\n(\"832\", \"JE\", \"JEY\", \"Jersey\", \"Channel Island\", NOW(), NOW()),\n(\"400\", \"JO\", \"JOR\", \"Jordan\", \"Jordanian\", NOW(), NOW()),\n(\"398\", \"KZ\", \"KAZ\", \"Kazakhstan\", \"Kazakhstani, Kazakh\", NOW(), NOW()),\n(\"404\", \"KE\", \"KEN\", \"Kenya\", \"Kenyan\", NOW(), NOW()),\n(\"296\", \"KI\", \"KIR\", \"Kiribati\", \"I-Kiribati\", NOW(), NOW()),\n(\"0\", \"XK\", \"UNK\", \"Kosovo\", \"Kosovar\", NOW(), NOW()),\n(\"408\", \"KP\", \"PRK\", \"Korea (Democratic People\\'s Republic of)\", \"North Korean\", NOW(), NOW()),\n(\"410\", \"KR\", \"KOR\", \"Korea (Republic of)\", \"South Korean\", NOW(), NOW()),\n(\"414\", \"KW\", \"KWT\", \"Kuwait\", \"Kuwaiti\", NOW(), NOW()),\n(\"417\", \"KG\", \"KGZ\", \"Kyrgyzstan\", \"Kyrgyzstani, Kyrgyz, Kirgiz, Kirghiz\", NOW(), NOW()),\n(\"418\", \"LA\", \"LAO\", \"Lao People\\'s Democratic Republic\", \"Lao, Laotian\", NOW(), NOW()),\n(\"428\", \"LV\", \"LVA\", \"Latvia\", \"Latvian\", NOW(), NOW()),\n(\"422\", \"LB\", \"LBN\", \"Lebanon\", \"Lebanese\", NOW(), NOW()),\n(\"426\", \"LS\", \"LSO\", \"Lesotho\", \"Basotho\", NOW(), NOW()),\n(\"430\", \"LR\", \"LBR\", \"Liberia\", \"Liberian\", NOW(), NOW()),\n(\"434\", \"LY\", \"LBY\", \"Libya\", \"Libyan\", NOW(), NOW()),\n(\"438\", \"LI\", \"LIE\", \"Liechtenstein\", \"Liechtenstein\", NOW(), NOW()),\n(\"440\", \"LT\", \"LTU\", \"Lithuania\", \"Lithuanian\", NOW(), NOW()),\n(\"442\", \"LU\", \"LUX\", \"Luxembourg\", \"Luxembourg, Luxembourgish\", NOW(), NOW()),\n(\"446\", \"MO\", \"MAC\", \"Macao\", \"Macanese, Chinese\", NOW(), NOW()),\n(\"807\", \"MK\", \"MKD\", \"Macedonia (the former Yugoslav Republic of)\", \"Macedonian\", NOW(), NOW()),\n(\"450\", \"MG\", \"MDG\", \"Madagascar\", \"Malagasy\", NOW(), NOW()),\n(\"454\", \"MW\", \"MWI\", \"Malawi\", \"Malawian\", NOW(), NOW()),\n(\"458\", \"MY\", \"MYS\", \"Malaysia\", \"Malaysian\", NOW(), NOW()),\n(\"462\", \"MV\", \"MDV\", \"Maldives\", \"Maldivian\", NOW(), NOW()),\n(\"466\", \"ML\", \"MLI\", \"Mali\", \"Malian, Malinese\", NOW(), NOW()),\n(\"470\", \"MT\", \"MLT\", \"Malta\", \"Maltese\", NOW(), NOW()),\n(\"584\", \"MH\", \"MHL\", \"Marshall Islands\", \"Marshallese\", NOW(), NOW()),\n(\"474\", \"MQ\", \"MTQ\", \"Martinique\", \"Martiniquais, Martinican\", NOW(), NOW()),\n(\"478\", \"MR\", \"MRT\", \"Mauritania\", \"Mauritanian\", NOW(), NOW()),\n(\"480\", \"MU\", \"MUS\", \"Mauritius\", \"Mauritian\", NOW(), NOW()),\n(\"175\", \"YT\", \"MYT\", \"Mayotte\", \"Mahoran\", NOW(), NOW()),\n(\"484\", \"MX\", \"MEX\", \"Mexico\", \"Mexican\", NOW(), NOW()),\n(\"583\", \"FM\", \"FSM\", \"Micronesia (Federated States of)\", \"Micronesian\", NOW(), NOW()),\n(\"498\", \"MD\", \"MDA\", \"Moldova (Republic of)\", \"Moldovan\", NOW(), NOW()),\n(\"492\", \"MC\", \"MCO\", \"Monaco\", \"Monégasque, Monacan\", NOW(), NOW()),\n(\"496\", \"MN\", \"MNG\", \"Mongolia\", \"Mongolian\", NOW(), NOW()),\n(\"499\", \"ME\", \"MNE\", \"Montenegro\", \"Montenegrin\", NOW(), NOW()),\n(\"500\", \"MS\", \"MSR\", \"Montserrat\", \"Montserratian\", NOW(), NOW()),\n(\"504\", \"MA\", \"MAR\", \"Morocco\", \"Moroccan\", NOW(), NOW()),\n(\"508\", \"MZ\", \"MOZ\", \"Mozambique\", \"Mozambican\", NOW(), NOW()),\n(\"104\", \"MM\", \"MMR\", \"Myanmar\", \"Burmese\", NOW(), NOW()),\n(\"516\", \"NA\", \"NAM\", \"Namibia\", \"Namibian\", NOW(), NOW()),\n(\"520\", \"NR\", \"NRU\", \"Nauru\", \"Nauruan\", NOW(), NOW()),\n(\"524\", \"NP\", \"NPL\", \"Nepal\", \"Nepali, Nepalese\", NOW(), NOW()),\n(\"528\", \"NL\", \"NLD\", \"Netherlands\", \"Dutch, Netherlandic\", NOW(), NOW()),\n(\"540\", \"NC\", \"NCL\", \"New Caledonia\", \"New Caledonian\", NOW(), NOW()),\n(\"554\", \"NZ\", \"NZL\", \"New Zealand\", \"New Zealand, NZ\", NOW(), NOW()),\n(\"558\", \"NI\", \"NIC\", \"Nicaragua\", \"Nicaraguan\", NOW(), NOW()),\n(\"562\", \"NE\", \"NER\", \"Niger\", \"Nigerien\", NOW(), NOW()),\n(\"566\", \"NG\", \"NGA\", \"Nigeria\", \"Nigerian\", NOW(), NOW()),\n(\"570\", \"NU\", \"NIU\", \"Niue\", \"Niuean\", NOW(), NOW()),\n(\"574\", \"NF\", \"NFK\", \"Norfolk Island\", \"Norfolk Island\", NOW(), NOW()),\n(\"580\", \"MP\", \"MNP\", \"Northern Mariana Islands\", \"Northern Marianan\", NOW(), NOW()),\n(\"578\", \"NO\", \"NOR\", \"Norway\", \"Norwegian\", NOW(), NOW()),\n(\"512\", \"OM\", \"OMN\", \"Oman\", \"Omani\", NOW(), NOW()),\n(\"586\", \"PK\", \"PAK\", \"Pakistan\", \"Pakistani\", NOW(), NOW()),\n(\"585\", \"PW\", \"PLW\", \"Palau\", \"Palauan\", NOW(), NOW()),\n(\"275\", \"PS\", \"PSE\", \"Palestine, State of\", \"Palestinian\", NOW(), NOW()),\n(\"591\", \"PA\", \"PAN\", \"Panama\", \"Panamanian\", NOW(), NOW()),\n(\"598\", \"PG\", \"PNG\", \"Papua New Guinea\", \"Papua New Guinean, Papuan\", NOW(), NOW()),\n(\"600\", \"PY\", \"PRY\", \"Paraguay\", \"Paraguayan\", NOW(), NOW()),\n(\"604\", \"PE\", \"PER\", \"Peru\", \"Peruvian\", NOW(), NOW()),\n(\"608\", \"PH\", \"PHL\", \"Philippines\", \"Philippine, Filipino\", NOW(), NOW()),\n(\"612\", \"PN\", \"PCN\", \"Pitcairn\", \"Pitcairn Island\", NOW(), NOW()),\n(\"616\", \"PL\", \"POL\", \"Poland\", \"Polish\", NOW(), NOW()),\n(\"620\", \"PT\", \"PRT\", \"Portugal\", \"Portuguese\", NOW(), NOW()),\n(\"630\", \"PR\", \"PRI\", \"Puerto Rico\", \"Puerto Rican\", NOW(), NOW()),\n(\"634\", \"QA\", \"QAT\", \"Qatar\", \"Qatari\", NOW(), NOW()),\n(\"638\", \"RE\", \"REU\", \"Réunion\", \"Réunionese, Réunionnais\", NOW(), NOW()),\n(\"642\", \"RO\", \"ROU\", \"Romania\", \"Romanian\", NOW(), NOW()),\n(\"643\", \"RU\", \"RUS\", \"Russian Federation\", \"Russian\", NOW(), NOW()),\n(\"646\", \"RW\", \"RWA\", \"Rwanda\", \"Rwandan\", NOW(), NOW()),\n(\"652\", \"BL\", \"BLM\", \"Saint Barthélemy\", \"Barthélemois\", NOW(), NOW()),\n(\"654\", \"SH\", \"SHN\", \"Saint Helena, Ascension and Tristan da Cunha\", \"Saint Helenian\", NOW(), NOW()),\n(\"659\", \"KN\", \"KNA\", \"Saint Kitts and Nevis\", \"Kittitian or Nevisian\", NOW(), NOW()),\n(\"662\", \"LC\", \"LCA\", \"Saint Lucia\", \"Saint Lucian\", NOW(), NOW()),\n(\"663\", \"MF\", \"MAF\", \"Saint Martin (French part)\", \"Saint-Martinoise\", NOW(), NOW()),\n(\"666\", \"PM\", \"SPM\", \"Saint Pierre and Miquelon\", \"Saint-Pierrais or Miquelonnais\", NOW(), NOW()),\n(\"670\", \"VC\", \"VCT\", \"Saint Vincent and the Grenadines\", \"Saint Vincentian, Vincentian\", NOW(), NOW()),\n(\"882\", \"WS\", \"WSM\", \"Samoa\", \"Samoan\", NOW(), NOW()),\n(\"674\", \"SM\", \"SMR\", \"San Marino\", \"Sammarinese\", NOW(), NOW()),\n(\"678\", \"ST\", \"STP\", \"Sao Tome and Principe\", \"São Toméan\", NOW(), NOW()),\n(\"682\", \"SA\", \"SAU\", \"Saudi Arabia\", \"Saudi, Saudi Arabian\", NOW(), NOW()),\n(\"686\", \"SN\", \"SEN\", \"Senegal\", \"Senegalese\", NOW(), NOW()),\n(\"688\", \"RS\", \"SRB\", \"Serbia\", \"Serbian\", NOW(), NOW()),\n(\"690\", \"SC\", \"SYC\", \"Seychelles\", \"Seychellois\", NOW(), NOW()),\n(\"694\", \"SL\", \"SLE\", \"Sierra Leone\", \"Sierra Leonean\", NOW(), NOW()),\n(\"702\", \"SG\", \"SGP\", \"Singapore\", \"Singaporean\", NOW(), NOW()),\n(\"534\", \"SX\", \"SXM\", \"Sint Maarten (Dutch part)\", \"Sint Maarten\", NOW(), NOW()),\n(\"703\", \"SK\", \"SVK\", \"Slovakia\", \"Slovak\", NOW(), NOW()),\n(\"705\", \"SI\", \"SVN\", \"Slovenia\", \"Slovenian, Slovene\", NOW(), NOW()),\n(\"90\", \"SB\", \"SLB\", \"Solomon Islands\", \"Solomon Island\", NOW(), NOW()),\n(\"706\", \"SO\", \"SOM\", \"Somalia\", \"Somali, Somalian\", NOW(), NOW()),\n(\"710\", \"ZA\", \"ZAF\", \"South Africa\", \"South African\", NOW(), NOW()),\n(\"239\", \"GS\", \"SGS\", \"South Georgia and the South Sandwich Islands\", \"South Georgia or South Sandwich Islands\", NOW(), NOW()),\n(\"728\", \"SS\", \"SSD\", \"South Sudan\", \"South Sudanese\", NOW(), NOW()),\n(\"724\", \"ES\", \"ESP\", \"Spain\", \"Spanish\", NOW(), NOW()),\n(\"144\", \"LK\", \"LKA\", \"Sri Lanka\", \"Sri Lankan\", NOW(), NOW()),\n(\"729\", \"SD\", \"SDN\", \"Sudan\", \"Sudanese\", NOW(), NOW()),\n(\"740\", \"SR\", \"SUR\", \"Suriname\", \"Surinamese\", NOW(), NOW()),\n(\"744\", \"SJ\", \"SJM\", \"Svalbard and Jan Mayen\", \"Svalbard\", NOW(), NOW()),\n(\"748\", \"SZ\", \"SWZ\", \"Swaziland\", \"Swazi\", NOW(), NOW()),\n(\"752\", \"SE\", \"SWE\", \"Sweden\", \"Swedish\", NOW(), NOW()),\n(\"756\", \"CH\", \"CHE\", \"Switzerland\", \"Swiss\", NOW(), NOW()),\n(\"760\", \"SY\", \"SYR\", \"Syrian Arab Republic\", \"Syrian\", NOW(), NOW()),\n(\"158\", \"TW\", \"TWN\", \"Taiwan, Province of China\", \"Chinese, Taiwanese\", NOW(), NOW()),\n(\"762\", \"TJ\", \"TJK\", \"Tajikistan\", \"Tajikistani\", NOW(), NOW()),\n(\"834\", \"TZ\", \"TZA\", \"Tanzania, United Republic of\", \"Tanzanian\", NOW(), NOW()),\n(\"764\", \"TH\", \"THA\", \"Thailand\", \"Thai\", NOW(), NOW()),\n(\"626\", \"TL\", \"TLS\", \"Timor-Leste\", \"Timorese\", NOW(), NOW()),\n(\"768\", \"TG\", \"TGO\", \"Togo\", \"Togolese\", NOW(), NOW()),\n(\"772\", \"TK\", \"TKL\", \"Tokelau\", \"Tokelauan\", NOW(), NOW()),\n(\"776\", \"TO\", \"TON\", \"Tonga\", \"Tongan\", NOW(), NOW()),\n(\"780\", \"TT\", \"TTO\", \"Trinidad and Tobago\", \"Trinidadian or Tobagonian\", NOW(), NOW()),\n(\"788\", \"TN\", \"TUN\", \"Tunisia\", \"Tunisian\", NOW(), NOW()),\n(\"792\", \"TR\", \"TUR\", \"Turkey\", \"Turkish\", NOW(), NOW()),\n(\"795\", \"TM\", \"TKM\", \"Turkmenistan\", \"Turkmen\", NOW(), NOW()),\n(\"796\", \"TC\", \"TCA\", \"Turks and Caicos Islands\", \"Turks and Caicos Island\", NOW(), NOW()),\n(\"798\", \"TV\", \"TUV\", \"Tuvalu\", \"Tuvaluan\", NOW(), NOW()),\n(\"800\", \"UG\", \"UGA\", \"Uganda\", \"Ugandan\", NOW(), NOW()),\n(\"804\", \"UA\", \"UKR\", \"Ukraine\", \"Ukrainian\", NOW(), NOW()),\n(\"784\", \"AE\", \"ARE\", \"United Arab Emirates\", \"Emirati, Emirian, Emiri\", NOW(), NOW()),\n(\"826\", \"GB\", \"GBR\", \"United Kingdom of Great Britain and Northern Ireland\", \"British, UK\", NOW(), NOW()),\n(\"581\", \"UM\", \"UMI\", \"United States Minor Outlying Islands\", \"American\", NOW(), NOW()),\n(\"840\", \"US\", \"USA\", \"United States of America\", \"American\", NOW(), NOW()),\n(\"858\", \"UY\", \"URY\", \"Uruguay\", \"Uruguayan\", NOW(), NOW()),\n(\"860\", \"UZ\", \"UZB\", \"Uzbekistan\", \"Uzbekistani, Uzbek\", NOW(), NOW()),\n(\"548\", \"VU\", \"VUT\", \"Vanuatu\", \"Ni-Vanuatu, Vanuatuan\", NOW(), NOW()),\n(\"862\", \"VE\", \"VEN\", \"Venezuela (Bolivarian Republic of)\", \"Venezuelan\", NOW(), NOW()),\n(\"704\", \"VN\", \"VNM\", \"Vietnam\", \"Vietnamese\", NOW(), NOW()),\n(\"92\", \"VG\", \"VGB\", \"Virgin Islands (British)\", \"British Virgin Island\", NOW(), NOW()),\n(\"850\", \"VI\", \"VIR\", \"Virgin Islands (U.S.)\", \"U.S. Virgin Island\", NOW(), NOW()),\n(\"876\", \"WF\", \"WLF\", \"Wallis and Futuna\", \"Wallis and Futuna, Wallisian or Futunan\", NOW(), NOW()),\n(\"732\", \"EH\", \"ESH\", \"Western Sahara\", \"Sahrawi, Sahrawian, Sahraouian\", NOW(), NOW()),\n(\"887\", \"YE\", \"YEM\", \"Yemen\", \"Yemeni\", NOW(), NOW()),\n(\"894\", \"ZM\", \"ZMB\", \"Zambia\", \"Zambian\", NOW(), NOW()),\n(\"716\", \"ZW\", \"ZWE\", \"Zimbabwe\", \"Zimbabwean\", NOW(), NOW());');\n }", "public function add_coupon()\n {\n $data['nestedView']['heading']=\"Add Coupon\";\n $data['nestedView']['pageTitle'] = 'Add Coupon';\n $data['nestedView']['cur_page'] = 'coupon';\n $data['nestedView']['parent_page'] = 'master';\n $data['nestedView']['list_page'] = 'coupon';\n\n # Load JS and CSS Files\n $data['nestedView']['js_includes'] = array();\n $data['nestedView']['js_includes'][] = '<script type=\"text/javascript\" src=\"'.assets_url().'pages/scripts/coupon.js\"></script>';\n $data['nestedView']['css_includes'] = array();\n\n # Breadcrumbs\n $data['nestedView']['breadCrumbOptions'] = array(array('label' => 'Home', 'class' => '', 'url' => SITE_URL));\n $data['nestedView']['breadCrumbOptions'][] = array('label' => 'Coupon List', 'class' => 'active', 'url' => 'coupon');\n $data['nestedView']['breadCrumbOptions'][] = array('label' => 'Add Coupon', 'class' => 'active', 'url' => '');\n\n # Additional data\n $data['flg'] = 1;\n $data['form_action'] = SITE_URL.'insert_coupon';\n $data['displayResults'] = 0;\n $this->load->view('coupon/coupon',$data);\n }", "public function insert($nu_pcp_op, $qtd_produzir, $qtd_produto,$dt_emissao, $ds_produto, $co_int_produto, $nu_lote, $nu_comprimento, $nu_largura, $nu_espessura,$corte_espessura, $co_pcp_ac, $tp_produto, $no_cor,$fator)\r\n\t{\r\n\t\t$row = $this->getMedidaCorte($co_pcp_ac, $co_int_produto);\r\n\t\t$sql = \"INSERT INTO tb_pcp_etiqueta (\r\n\t\t\t\t\tnu_pcp_op\r\n\t\t\t\t,\tqtd_produzir\r\n\t\t\t\t,\tqtd_produto\r\n\t\t\t\t,\tdt_emissao\r\n\t\t\t\t,\tds_produto\r\n\t\t\t\t,\tco_int_produto\r\n\t\t\t\t,\tnu_lote\r\n\t\t\t\t,\tnu_comprimento\r\n\t\t\t\t,\tnu_largura\r\n\t\t\t\t,\tcorte_nu_comprimento\r\n\t\t\t\t,\tcorte_nu_largura\r\n\t\t\t\t,\tcorte_nu_espessura\r\n\t\t\t\t,\tnu_espessura\r\n\t\t\t\t,\tco_pcp_ac\r\n\t\t\t\t,\ttp_produto\r\n\t\t\t\t,\tno_cor\r\n\t\t\t\t,\tnu_fator_multiplicador)\r\n\t\t\t\tVALUES (\r\n\t\t\t\t'\".addslashes($nu_pcp_op).\"'\r\n\t\t\t\t, '\".addslashes($qtd_produzir).\"'\r\n\t\t\t\t, '\".addslashes($qtd_produto).\"'\r\n\t\t\t\t, '\".addslashes($dt_emissao).\"'\r\n\t\t\t\t, '\".addslashes($ds_produto).\"'\r\n\t\t\t\t, '\".addslashes($co_int_produto).\"'\r\n\t\t\t\t, '\".addslashes($nu_lote).\"'\r\n\t\t\t\t, '\".addslashes($nu_comprimento).\"'\r\n\t\t\t\t, '\".addslashes($nu_largura).\"'\r\n\t\t\t\t, '\".addslashes($row[0]).\"'\r\n\t\t\t\t, '\".addslashes($row[1]).\"'\r\n\t\t\t\t, '\".addslashes($corte_espessura).\"'\r\n\t\t\t\t, '\".addslashes($nu_espessura).\"'\r\n\t\t\t\t, \".$co_pcp_ac.\"\r\n\t\t\t\t, '\".addslashes($tp_produto).\"'\r\n\t\t\t\t, '\".addslashes($no_cor).\"'\r\n\t\t\t\t, '\".addslashes($fator).\"')\";\r\n\t\tmysql_query($sql,$this->conexaoERP);\r\n\t}", "public function applyCoupon(CouponContract $coupon)\n {\n $this->coupons[$coupon->code] = $coupon;\n\n $this->update();\n }", "public function store_discount_affiliate_new( $coupon_object ) {\n\n\t\t$coupon_id = $coupon_object->getId();\n\n\t\tif ( empty( $_POST['user_name'] ) ) {\n\t\t\tdelete_post_meta( $coupon_id, 'affwp_discount_affiliate' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( empty( $_POST['user_id'] ) && empty( $_POST['user_name'] ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$data = affiliate_wp()->utils->process_request_data( $_POST, 'user_name' );\n\n\t\t$affiliate_id = affwp_get_affiliate_id( $data['user_id'] );\n\n\t\tupdate_post_meta( $coupon_id, 'affwp_discount_affiliate', $affiliate_id );\n\n\t}", "static function storeCode(\n $code, $payment_id=0, $minimum_amount=0,\n $discount_rate=0, $discount_amount=0,\n $start_time=0, $end_time=0,\n $uses=0, $global=true,\n $customer_id=0, $product_id=0, $index=NULL\n ) {\n global $objDatabase, $_ARRAYLANG;\n\n// TODO: Three umlauts in UTF-8 encoding might count as six characters here!\n// Allow arbitrary Coupon codes, even one with an empty name, by commenting this:\n if (empty($code) || strlen($code) < 6) {\n return \\Message::error(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ERROR_ADDING_INVALID_CODE']);\n }\n // These all default to zero if invalid\n $discount_rate = max(0, $discount_rate);\n $discount_amount = max(0, $discount_amount);\n if (empty($discount_rate) && empty($discount_amount)) {\n return \\Message::error(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ERROR_ADDING_MISSING_RATE_OR_AMOUNT']);\n }\n if ($discount_rate && $discount_amount) {\n return \\Message::error(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ERROR_ADDING_EITHER_RATE_OR_AMOUNT']);\n }\n // These must be non-negative integers and default to zero\n $start_time = max(0, intval($start_time));\n $end_time = max(0, intval($end_time));\n if ($end_time && $end_time < time()) {\n return \\Message::error(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ERROR_ADDING_INVALID_END_TIME']);\n }\n $uses = max(0, intval($uses));\n if (empty($uses)) {\n return \\Message::error(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ERROR_ADDING_INVALID_USES']);\n }\n $customer_id = max(0, intval($customer_id));\n if ($global) $customer_id = 0;\n $query = '';\n if (empty($index)) {\n $index = \"$code-$customer_id\";\n }\n $update = false;\n if (self::recordExists($index)) {\n $update = true;\n// Alternatively,\n// return \\Message::error(sprintf(\n// $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ERROR_ADDING_CODE_EXISTS'],\n// $code));\n }\n if (self::recordExists($index)) {\n // Update\n list($code_prev, $customer_id_prev) = explode('-', $index);\n $query = \"\n UPDATE `\".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_discount_coupon`\n SET `code`=?,\n `payment_id`=?,\n `minimum_amount`=?,\n `discount_rate`=?,\n `discount_amount`=?,\n `start_time`=?,\n `end_time`=?,\n `uses`=?,\n `global`=?,\n `customer_id`=?,\n `product_id`=?\n WHERE `code`=?\n AND `customer_id`=?\";\n if ($objDatabase->Execute($query, array(\n $code, $payment_id, $minimum_amount,\n $discount_rate, $discount_amount,\n $start_time, $end_time, $uses, ($global ? 1 : 0),\n $customer_id, $product_id,\n $code_prev, $customer_id_prev))) {\n return \\Message::ok(sprintf(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_UPDATED_SUCCESSFULLY'],\n $code));\n }\n } else {\n // Insert\n $query = \"\n REPLACE INTO `\".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_discount_coupon` (\n `code`, `payment_id`,\n `minimum_amount`, `discount_rate`, `discount_amount`,\n `start_time`, `end_time`, `uses`, `global`,\n `customer_id`, `product_id`\n ) VALUES (\n ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?\n )\";\n if ($objDatabase->Execute($query, array(\n $code, $payment_id, $minimum_amount,\n $discount_rate, $discount_amount,\n $start_time, $end_time, $uses, ($global ? 1 : 0),\n $customer_id, $product_id))) {\n return \\Message::ok(sprintf(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ADDED_SUCCESSFULLY'],\n $code));\n }\n }\n \\Message::error(\n $_ARRAYLANG['TXT_SHOP_DISCOUNT_COUPON_ERROR_ADDING_QUERY_FAILED']);\n return self::errorHandler();\n }", "public function getCoupon()\n\t {\n\t $discount = $this->carObj->addSeasonDiscount();\n\t $discount = $this->carObj->addStockDiscount();\n\t \n\t return $coupon = \"Get {$discount}% off the price of your new car.\";\n\t }", "public function insertClient($nom, $prenom, $dateN, $email, $telephone, $codeCoupon, $adresseFact, $adresse, $adresse2, $raisonSociale, $siret, $nomSociete, $civ, $idville){\n $this->pdoStatement = $this->pdo->prepare(\"INSERT INTO client\n (nom_client, prenom_client, dateN_client, email_client, tel_client, taux_remise, add_facturation, add1_client, add2_client, raisonS_societe, siret_societe, nomC_societe, id_client_civ, id_client_villecp) VALUES (:nom, :prenom, :dateN, :email, :telephone, :codeCoupon, :adresseFact, :adresse, :adresse2, :raisonSociale, :siret, :nomSociete, :civ, :idville)\");\n\n $this->pdoStatement->bindValue(':nom', $nom, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':prenom', $prenom, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':dateN', $dateN, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':email', $email, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':telephone', $telephone, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':codeCoupon', $codeCoupon, PDO::PARAM_INT);\n $this->pdoStatement->bindValue(':adresseFact', $adresseFact, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':adresse', $adresse, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':adresse2', $adresse2, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':raisonSociale', $raisonSociale, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':siret', $siret, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':nomSociete', $nomSociete, PDO::PARAM_STR);\n $this->pdoStatement->bindValue(':civ', $civ, PDO::PARAM_INT);\n $this->pdoStatement->bindValue(':idville', $idville, PDO::PARAM_INT);\n $this->pdoStatement->execute();\n\n $inscription = $this->pdoStatement->rowCount();\n return $inscription; \n }", "function crear_cita($cita) {\n $this->db->insert('citas', $cita);\n }", "public function actionCoupon(){\n // Redirect away if he has billing setup previously.\n // Not allowed if customer already has used billing\n if(count(Yii::$app->user->identity->billings)>0){\n $this->redirect('index');\n }\n\n // Attempt to post coupon\n if($couponCode = Yii::$app->request->post('coupon')){\n $agentEmail = Yii::$app->user->identity->agent_email;\n $coupon = \\common\\models\\Coupon::find()->where(['coupon_name' => $couponCode])->one();\n if(!$coupon){\n Yii::error(\"[Invalid Coupon Attempted ($couponCode)] Agent: $agentEmail\", __METHOD__);\n Yii::$app->getSession()->setFlash('error', \"[Invalid Coupon Code] This coupon code is not valid.\");\n }else{\n $errors = false;\n\n // Check if its at user limit\n if($coupon->isAtUserLimit() && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Invalid Coupon] This coupon is no longer valid.\");\n Yii::error(\"[Attempted to redeem coupon thats already reached limit ($couponCode)] Agent: $agentEmail\", __METHOD__);\n }\n\n // Check if coupon expiry date passed\n if($coupon->isExpired() && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Coupon Expired] This coupon has expired on \".Yii::$app->formatter->asDate($coupon->coupon_expires_at, \"long\").\".\");\n Yii::error(\"[Attempted to redeem expired coupon ($couponCode)] Agent: $agentEmail\", __METHOD__);\n }\n\n //If customer already has used a coupon previously\n if(\\common\\models\\CouponUsed::findOne(['agent_id' => Yii::$app->user->identity->agent_id]) && !$errors){\n $errors = true;\n Yii::$app->getSession()->setFlash('warning', \"[Unable to use coupon] You have already used a coupon\");\n Yii::error(\"[Unable to use coupon ($couponCode)] You've already used a coupon. Agent: $agentEmail\", __METHOD__);\n }\n\n if(!$errors){\n // Redeem coupon for that agent\n $trialDaysToExtend = $coupon->coupon_reward_days;\n\n // Extend Trial for Agent\n $agent = Yii::$app->user->identity;\n $agent->agent_trial_days = $agent->agent_trial_days + $trialDaysToExtend;\n $agent->save(false);\n\n // Enable Agent and his Managed Accounts\n $agent->enableAgentAndManagedAccounts();\n\n // Mark Coupon Usage\n $couponUsage = new \\common\\models\\CouponUsed;\n $couponUsage->agent_id = $agent->agent_id;\n $couponUsage->coupon_id = $coupon->coupon_id;\n $couponUsage->save();\n\n Yii::$app->getSession()->setFlash('success', \"[Coupon Redeemed] Your trial has been extended by $trialDaysToExtend days\");\n Yii::info(\"[Coupon used ($couponCode) by $agentEmail] Trial has been extended by $trialDaysToExtend days.\", __METHOD__);\n }\n\n }\n }\n\n return $this->render('coupon');\n }", "public function insertPenyimpananPendistribusian($data)\n {\n $pendistribusian = new PenyimpananDistribusi();\n $pendistribusian->id_user = $data['id_user'];\n $pendistribusian->status = $data['status'];\n $pendistribusian->transaksi = json_encode($data['transaksi']);\n\n if($pendistribusian->save())\n {\n return \"success\";\n }\n else\n {\n return \"something wrong\";\n }\n }", "function addCouponArticles($coupon = array()){\r\n\t\tif(!$coupon['record']['has_articles']) return false;\r\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_commercecoupons_articles','uid = \\''.$coupon['record']['related_articles'].'\\''.$GLOBALS['TSFE']->cObj->enableFields('tx_commercecoupons_articles'));\r\n\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\r\n\t\t if($row['amount']>0) {\r\n\r\n\t\t \t$returnData[$row['article_id']] = $row;\r\n\r\n\t\t\t\t\t// add article to the basket or add quantity if article is already in basket\r\n\t\t\t\tif($this->basket->basket_items[$row['article_id']]) {\r\n\t\t\t\t\t$item = &$this->basket->basket_items[$row['article_id']];\r\n\t\t\t\t\t$item->change_quantity(1);\r\n\t\t\t\t\t$this->basket->changePrices($row['article_id'],$row['price_gross'],$row['price_net']);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->basket->add_article($row['article_id'],1); // has been: $row['amount']\r\n\t\t\t\t\t$item = &$this->basket->basket_items[$row['article_id']];\r\n\t\t\t\t\t$this->basket->changePrices($row['article_id'],$row['price_gross'],$row['price_net']);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$item->tx_commercecoupons_addedbycouponid[] = $coupon['uid'];\r\n\t\t\t\t$item->tx_commercecoupons_relatedcoupon[] = $coupon['uid'];\r\n\r\n\t\t }\r\n\t\t}\r\n\r\n\t\t$this->basket->store_data();\r\n\t\t\t// store information about articles added by this coupon into coupons session array\r\n\t\t$coupon['_addedArticles'] = $returnData;\r\n\t\t$this->setSessionCoupon($coupon);\r\n\r\n\t\treturn $returnData;\r\n\t}", "public function coupon_background_notice() {\n\t\t\tglobal $pagenow, $post;\n\n\t\t\tif ( ! is_admin() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$page = ( ! empty( $_GET['page'] ) ) ? wc_clean( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore\n\t\t\t$tab = ( ! empty( $_GET['tab'] ) ? ( 'send-smart-coupons' === $_GET['tab'] ? 'send-smart-coupons' : 'import-smart-coupons' ) : 'generate_bulk_coupons' ); // phpcs:ignore\n\n\t\t\tif ( ( ! empty( $post->post_type ) && 'shop_coupon' !== $post->post_type ) || ! in_array( $tab, array( 'generate_bulk_coupons', 'import-smart-coupons', 'send-smart-coupons' ), true ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! wp_script_is( 'jquery' ) ) {\n\t\t\t\twp_enqueue_script( 'jquery' );\n\t\t\t}\n\t\t\tif ( ! wp_script_is( 'heartbeat' ) ) {\n\t\t\t\twp_enqueue_script( 'heartbeat' );\n\t\t\t}\n\n\t\t\t$upload_dir = wp_upload_dir();\n\t\t\t$upload_path = $upload_dir['path'];\n\n\t\t\tif ( 'wc-smart-coupons' === $page && 'generate_bulk_coupons' === $tab && ! empty( $upload_dir['error'] ) ) {\n\t\t\t\tif ( ! wp_script_is( 'jquery-tiptip', 'registered' ) ) {\n\t\t\t\t\t$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';\n\t\t\t\t\twp_register_script( 'jquery-tiptip', WC()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), WC()->version, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! wp_script_is( 'jquery-tiptip' ) ) {\n\t\t\t\t\twp_enqueue_script( 'jquery-tiptip' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<div id=\"wc_sc_folder_permission_warning\" class=\"error\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<span class=\"dashicons dashicons-warning\"></span>&nbsp;\n\t\t\t\t\t\t<?php /* translators: 1. Important 2. Upload path */ ?>\n\t\t\t\t\t\t<?php echo sprintf( esc_html__( '%1$s: To allow bulk generation of coupons, please make sure %2$s directory is writable.', 'woocommerce-smart-coupons' ), '<strong>' . esc_html__( 'Important', 'woocommerce-smart-coupons' ) . '</strong>', '<strong><code>' . esc_html( $upload_path ) . '</code></strong>' ); ?>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\tjQuery('#generate_and_import').addClass('disabled')\n\t\t\t\t\t\t\t.attr( 'data-tip', '<?php echo esc_js( __( 'Bulk generation is disabled since uploads directory is not writable. Please ensure uploads directory is writable before starting bulk generate process.', 'woocommerce-smart-coupons' ) ); ?>' )\n\t\t\t\t\t\t\t.tipTip({\n\t\t\t\t\t\t\t\t'attribute': 'data-tip',\n\t\t\t\t\t\t\t\t'fadeIn': 50,\n\t\t\t\t\t\t\t\t'fadeOut': 50,\n\t\t\t\t\t\t\t\t'delay': 100\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</script>\n\t\t\t\t<?php\n\t\t\t} else {\n\n\t\t\t\tif ( $this->is_process_running() ) {\n\t\t\t\t\t?>\n\t\t\t\t\t<div id=\"wc_sc_coupon_background_progress\" class=\"error\" style=\"display: none;\">\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$bulk_action = get_site_option( 'bulk_coupon_action_woo_sc' );\n\n\t\t\t\t\t\t\tswitch ( $bulk_action ) {\n\n\t\t\t\t\t\t\t\tcase 'import_email':\n\t\t\t\t\t\t\t\tcase 'import':\n\t\t\t\t\t\t\t\t\t$bulk_text = __( 'imported', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 'generate_email':\n\t\t\t\t\t\t\t\tcase 'generate':\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t$bulk_text = __( 'generated', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\techo '<strong>' . esc_html__( 'Important', 'woocommerce-smart-coupons' ) . '</strong>: ' . esc_html__( 'Coupons are being', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\techo '&nbsp;' . esc_html( $bulk_text ) . '&nbsp;';\n\t\t\t\t\t\t\t\techo esc_html__( 'in the background. You will be notified when it is completed.', 'woocommerce-smart-coupons' ) . '&nbsp;';\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<span id=\"wc_sc_remaining_time_label\" style=\"display: none;\">\n\t\t\t\t\t\t\t\t<?php echo esc_html__( 'Progress', 'woocommerce-smart-coupons' ); ?>:&nbsp;\n\t\t\t\t\t\t\t\t<strong><span id=\"wc_sc_remaining_time\"><?php echo esc_html( '--:--:--', 'woocommerce-smart-coupons' ); ?></span></strong>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t<?php echo esc_html__( 'You can continue with other work. But before bulk generating or importing new coupons, you need to wait for this process to complete.', 'woocommerce-smart-coupons' ); ?>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tjQuery(function(){\n\t\t\t\t\t\t\tlet admin_ajax_url = '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>';\n\t\t\t\t\t\t\tlet current_interval = false;\n\t\t\t\t\t\t\tfunction wc_sc_start_coupon_background_progress_timer( total_seconds, target_dom ) {\n\t\t\t\t\t\t\t\tvar timer = total_seconds, hours, minutes, seconds;\n\t\t\t\t\t\t\t\tvar target_element = target_dom.find('#wc_sc_remaining_time');\n\t\t\t\t\t\t\t\tvar target_element_label = target_dom.find('#wc_sc_remaining_time_label');\n\t\t\t\t\t\t\t\tif ( false !== current_interval ) {\n\t\t\t\t\t\t\t\t\tclearInterval( current_interval );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcurrent_interval = setInterval(function(){\n\t\t\t\t\t\t\t\t\thours = Math.floor(timer / 3600);\n\t\t\t\t\t\t\t\t\ttimer %= 3600;\n\t\t\t\t\t\t\t\t\tminutes = Math.floor(timer / 60);\n\t\t\t\t\t\t\t\t\tseconds = timer % 60;\n\n\t\t\t\t\t\t\t\t\thours = hours < 10 ? \"0\" + hours : hours;\n\t\t\t\t\t\t\t\t\tminutes = minutes < 10 ? \"0\" + minutes : minutes;\n\t\t\t\t\t\t\t\t\tseconds = seconds < 10 ? \"0\" + seconds : seconds;\n\n\t\t\t\t\t\t\t\t\ttarget_element_label.show();\n\t\t\t\t\t\t\t\t\ttarget_element.text(hours + \":\" + minutes + \":\" + seconds);\n\n\t\t\t\t\t\t\t\t\tif (--timer < 0) {\n\t\t\t\t\t\t\t\t\t\ttimer = 0;\n\t\t\t\t\t\t\t\t\t\tclearInterval( current_interval );\n\t\t\t\t\t\t\t\t\t\tlocation.reload( true );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfunction wc_sc_start_coupon_background_progress_percentage( progress_data, target_dom ) {\n\t\t\t\t\t\t\t\tlet target_element_label = target_dom.find('#wc_sc_remaining_time_label');\n\t\t\t\t\t\t\t\tlet target_element = target_dom.find('#wc_sc_remaining_time');\n\t\t\t\t\t\t\t\tlet percent_completion = progress_data.percent_completion;\n\t\t\t\t\t\t\t\tlet coupon_action = progress_data.coupon_action;\n\t\t\t\t\t\t\t\tlet action_stage = progress_data.action_stage;\n\t\t\t\t\t\t\t\tlet action_data = progress_data.action_data;\n\n\t\t\t\t\t\t\t\tlet percent_ratio_data = {\n\t\t\t\t\t\t\t\t\t'add_to_store': [20, 80],\n\t\t\t\t\t\t\t\t\t'sc_export_and_import': [100],\n\t\t\t\t\t\t\t\t\t'import_from_csv': [100],\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tlet total_percent_ratio = 0;\n\t\t\t\t\t\t\t\tif( 'add_to_store' == coupon_action ) {\n\t\t\t\t\t\t\t\t\tlet percent_ratio = percent_ratio_data[coupon_action];\n\t\t\t\t\t\t\t\t\tjQuery.each(percent_ratio,function( index, value ){\n\t\t\t\t\t\t\t\t\t\tif( index < action_stage ) {\n\t\t\t\t\t\t\t\t\t\t\ttotal_percent_ratio += value;\n\t\t\t\t\t\t\t\t\t\t} else if( index == action_stage ) {\n\t\t\t\t\t\t\t\t\t\t\tcurrent_ratio = value;\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\tpercent_completion = percent_completion * ( current_ratio / 100 );\n\t\t\t\t\t\t\t\t\tpercent_completion += total_percent_ratio;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttarget_element_label.show();\n\t\t\t\t\t\t\t\tpercent_completion = Math.round( percent_completion * 100 ) / 100;\n\t\t\t\t\t\t\t\ttarget_element.text(percent_completion + '%');\n\t\t\t\t\t\t\t\tjQuery('.woo-sc-importer-progress').val(percent_completion);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfunction wc_sc_hide_coupon_form() {\n\t\t\t\t\t\t\t\tjQuery('.woo-sc-form-wrapper').hide();\n\t\t\t\t\t\t\t\tif( 0 === jQuery('.woo-sc-scheduler-running-message').length ) {\n\t\t\t\t\t\t\t\t\tlet backgroudn_process_message = '<div class=\"woo-sc-scheduler-running-message\"><div class=\"woocommerce-progress-form-wrapper\"><div class=\"wc-progress-form-content woocommerfce-importer woocommerce-importer__importing\">\\\n\t\t\t\t\t\t\t\t\t\t<header>\\\n\t\t\t\t\t\t\t\t\t\t\t<p><?php echo esc_html__( 'We are processing coupons in background. Please wait before starting new process.', 'woocommerce-smart-coupons' ); ?></p>\\\n\t\t\t\t\t\t\t\t\t\t</header>\\\n\t\t\t\t\t\t\t\t\t<section>\\\n\t\t\t\t\t\t\t\t\t\t<progress class=\"woocommerce-importer-progress woo-sc-importer-progress\" max=\"100\" value=\"0\"></progress>\\\n\t\t\t\t\t\t\t\t\t</section></div></div></p>';\n\t\t\t\t\t\t\t\t\tjQuery(backgroudn_process_message).insertAfter('.woo-sc-form-wrapper');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfunction wc_sc_check_coupon_background_progress() {\n\t\t\t\t\t\t\t\tjQuery.ajax({\n\t\t\t\t\t\t\t\t\t\turl: admin_ajax_url,\n\t\t\t\t\t\t\t\t\t\tmethod: 'post',\n\t\t\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\taction: 'wc_sc_coupon_background_progress',\n\t\t\t\t\t\t\t\t\t\t\tsecurity: '<?php echo esc_attr( wp_create_nonce( 'wc-sc-background-coupon-progress' ) ); ?>'\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tsuccess: function( response ) {\n\n\t\t\t\t\t\t\t\t\t\t\tlet percent_completion = response.percent_completion;\n\t\t\t\t\t\t\t\t\t\t\tlet coupon_action = response.coupon_action;\n\t\t\t\t\t\t\t\t\t\t\tlet action_stage = response.action_stage;\n\t\t\t\t\t\t\t\t\t\t\tlet action_data = response.action_data;\n\n\t\t\t\t\t\t\t\t\t\t\tlet progress_data = {\n\t\t\t\t\t\t\t\t\t\t\t\tpercent_completion: response.percent_completion,\n\t\t\t\t\t\t\t\t\t\t\t\tcoupon_action: response.coupon_action,\n\t\t\t\t\t\t\t\t\t\t\t\taction_stage: response.action_stage,\n\t\t\t\t\t\t\t\t\t\t\t\taction_data: response.action_data\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tlet target_dom = jQuery('#wc_sc_coupon_background_progress');\n\n\t\t\t\t\t\t\t\t\t\t\tif ( response.percent_completion !== undefined && response.percent_completion !== '' ) {\n\t\t\t\t\t\t\t\t\t\t\t\tif( 100 == response.percent_completion) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlet should_reload = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( ( 'add_to_store' === response.coupon_action || 'woo_sc_is_email_imported_coupons' === response.coupon_action ) && 1 === response.action_stage ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tshould_reload = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else if ( 'import_from_csv' === response.coupon_action ){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tshould_reload = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else if ( 'sc_export_and_import' === response.coupon_action ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tshould_reload = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tif( should_reload ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\ttarget_dom.show();\n\t\t\t\t\t\t\t\t\t\t\t\twc_sc_hide_coupon_form();\n\t\t\t\t\t\t\t\t\t\t\t\twc_sc_start_coupon_background_progress_percentage( progress_data, target_dom );\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}\n\n\t\t\t\t\t\t\tjQuery(document).on( 'ready', function( event, data, response ){\n\t\t\t\t\t\t\t\twc_sc_check_coupon_background_progress();\n\t\t\t\t\t\t\t\tsetInterval(function(){\n\t\t\t\t\t\t\t\t\twc_sc_check_coupon_background_progress();\n\t\t\t\t\t\t\t\t},5000);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>\n\t\t\t\t\t<?php\n\t\t\t\t} else {\n\t\t\t\t\t$background_coupon_process_result = get_site_option( 'wc_sc_background_coupon_process_result' );\n\t\t\t\t\tif ( false !== $background_coupon_process_result ) {\n\t\t\t\t\t\tswitch ( $background_coupon_process_result['action'] ) {\n\t\t\t\t\t\t\tcase 'import_email':\n\t\t\t\t\t\t\t\t$action_title = __( 'Coupon import', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\t$action_text = __( 'added & emailed', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'generate_email':\n\t\t\t\t\t\t\t\t$action_title = __( 'Coupon bulk generation', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\t$action_text = __( 'added & emailed', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'import':\n\t\t\t\t\t\t\t\t$action_title = __( 'Coupon import', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\t$action_text = __( 'added', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'generate':\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$action_title = __( 'Coupon bulk generation', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\t$action_text = __( 'added', 'woocommerce-smart-coupons' );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<div id=\"wc_sc_coupon_background_progress\" class=\"updated\" style=\"display: none;\">\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<strong><?php echo esc_html( $action_title ); ?></strong>:&nbsp;\n\t\t\t\t\t\t\t\t<?php echo esc_html__( 'Successfully', 'woocommerce-smart-coupons' ) . ' ' . esc_html( $action_text ) . ' ' . esc_html( $background_coupon_process_result['successful'] ) . ' ' . esc_html( _n( 'coupon', 'coupons', $background_coupon_process_result['successful'], 'woocommerce-smart-coupons' ) ) . '.'; ?>\n\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t$woo_sc_action_data = get_site_option( 'woo_sc_action_data', false );\n\t\t\t\t\t\t\tif ( $woo_sc_action_data ) {\n\t\t\t\t\t\t\t\tif ( 'download_csv' === $woo_sc_action_data['name'] ) {\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t<p class=\"download-csv-wrapper\">\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\techo esc_html__( 'CSV file has been generated. You can download it from ', 'woocommerce-smart-coupons' ) . '<a href=\"' . esc_url( admin_url( 'admin-ajax.php' ) ) . '?action=wc_sc_download_csv&download_nonce=' . esc_attr( wp_create_nonce( 'wc_sc_download_csv' ) ) . '\">' . esc_html__( 'here', 'woocommerce-smart-coupons' ) . '</a>.';\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete_site_option( 'wc_sc_background_coupon_process_result' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery(function(){\n\t\t\t\t\tjQuery(document).ready(function(){\n\t\t\t\t\t\tvar border_color = jQuery('#wc_sc_coupon_background_progress').css('border-left-color');\n\t\t\t\t\t\tjQuery('#wc_sc_coupon_background_progress').css('border-top', '1px solid ' + border_color);\n\t\t\t\t\t\tjQuery('#wc_sc_coupon_background_progress').css('border-right', '1px solid ' + border_color);\n\t\t\t\t\t\tjQuery('#wc_sc_coupon_background_progress').css('border-bottom', '1px solid ' + border_color);\n\t\t\t\t\t\tjQuery('#wc_sc_coupon_background_progress').show();\n\t\t\t\t\t\tjQuery('.download-csv-wrapper a').on('click',function(){\n\t\t\t\t\t\t\tjQuery('.download-csv-wrapper').hide('slow');\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t<?php\n\n\t\t}", "public function create(CreateCouponRequest $request)\n {\n return view('backend.coupons.create');\n }", "public function create(CouponAction $couponAction){\n return response()->json(['coupon' => $couponAction->execute($this->user), 'error' => false], 200);\n }", "function coupon_code($coupon_code,$conn)\n {\n unset($_SESSION['coupon_code']);\n $sql=\"select * from coupons where code = '$coupon_code'\"; // check coupon code valid\n $res=$conn->query($sql);\n if ($res->num_rows > 0) \n {\n \n $current_date=date('Y/m/d'); //take date from system\n $row=$res->fetch_assoc();\n \n \n //condition for check coupon dates are valid\n if(strtotime($row['start'])<=strtotime($current_date) && strtotime($row['end'])>=strtotime($current_date) )\n { \n \n $sql=\"select count(*) as per_coupon from coupon_uses where coupon_id = (select id from coupons where code = '$coupon_code') and coupon_status=1\";\n $res=$conn->query($sql);\n if($res->num_rows <= $row['percoupon']) //condition for check coupon per validation\n {\n $discount_product=array(); //create discount product array\n $x=0;\n \n //take product value from product session\n if(isset($_SESSION['products']) && !empty($_SESSION['products']))\n {\n \n foreach($_SESSION['products'] as $product)\n {\n $p_id=$product['product_code'];\n \n // check coupon apply category\n $sql=\"select coupon_id from coupon_categories where coupon_id=(select id from coupons where code = '$coupon_code') and m_id =(select m_id from products where id=$p_id)\";\n $res=$conn->query($sql);\n if ($res->num_rows > 0) \n {\n if(!in_array($p_id,$discount_product))\n {\n $discount_product[$x]=$p_id;\n $x++;\n }\n }\n else\n {\n //check coupon apply products\n $sql=\"select coupon_id from coupon_products where coupon_id=(select id from coupons where code = '$coupon_code') and p_id = $p_id\";\n $res=$conn->query($sql);\n if ($res->num_rows > 0) \n {\n if(!in_array($p_id,$discount_product))\n {\n $discount_product[$x]=$p_id;\n $x++;\n }\n }\n else\n {\n $response['msg']=\"5\"; \n }\n }\n }\n }\n else\n {\n $response['msg']=\"4\"; \n }\n \n }\n else\n {\n $response['msg']=\"3\";\n }\n }\n else\n {\n $response['msg']=\"2\";\n }\n }\n else\n {\n \n $response['msg']=\"Invalid Coupon Code.\";\n \n }\n \n \n if(isset($discount_product))\n {\n $coupan_discount=$row['coupon_discount'];\n $coupon_type=$row['coupon_type'];\n \n $discount=0;\n foreach($discount_product as $ds_product)\n {\n //take product price from product session\n $product_price=$_SESSION['products'][$ds_product]['product_price']*$_SESSION['products'][$ds_product]['quantity'];\n $discount=$discount+$product_price;\n }\n \n //apply coupon _type\n if($coupon_type=='Percentage')\n {\n $total_discount=$discount*$coupan_discount/100;\n }\n else\n {\n $total_discount=$coupan_discount;\n }\n \n //check price is grator then extra\n \n if($total_discount>$row['max_discount'])\n {\n $response['discount']=$row['max_discount'];\n }\n else\n {\n $response['discount']=floor($total_discount);\n }\n if($response['discount']==0)\n {\n $response['msg']=\"This Coupon Code is not for this item\";\n }\n else\n {\n //create coupon code session\n $_SESSION['coupon_code']=$coupon_code;\n $response['msg']='ok';\n }\n }\n else\n {\n $response['msg']=\"Invalid Coupon Code.\";\n }\n \n return $response;\n }", "function insert_bank_account($form = array(), $userid = 0)\n {\n global $ilance, $ilconfig, $phrase, $ilpage;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"bankaccounts\n (bank_id, user_id, beneficiary_account_name, destination_currency_id, beneficiary_bank_name, beneficiary_account_number, beneficiary_bank_routing_number_swift, bank_account_type, beneficiary_bank_address_1, beneficiary_bank_address_2, beneficiary_bank_city, beneficiary_bank_state, beneficiary_bank_zipcode, beneficiary_bank_country_id)\n VALUES(\n NULL,\n '\" . intval($userid) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_account_name']) . \"',\n '\" . intval($form['destination_currency_id']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_bank_name']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_account_number']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_bank_routing_number_swift']) . \"',\n '\" . $ilance->db->escape_string($form['bank_account_type']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_bank_address_1']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_bank_address_2']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_bank_city']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_bank_state']) . \"',\n '\" . $ilance->db->escape_string($form['beneficiary_bank_zipcode']) . \"',\n '\" . intval($form['beneficiary_bank_country_id']) . \"')\n \", 0, null, __FILE__, __LINE__);\n $bank_id = $ilance->db->insert_id();\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->get('member_added_bankaccount');\t\t\n $ilance->email->set(array(\n '{{username}}' => fetch_user('username', intval($userid)),\n ));\n $ilance->email->send(); \n return true;\n }", "public function insertEditPromoCode(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_PATH);\n\t\t}else {\n\t\t\t#echo \"<pre>\"; print_r($_POST); die;\n\t\t\t$promocodes_id = $this->input->post('promocodes_id');\n\t\t\t$status = $this->input->post('status');\n\t\t\t$type = $this->input->post('type');\n\t\t\t$promo_code = $this->input->post('promo_code');\n\t\t\t\n\t\t\tif(isset($type) && $type=='on'){\n\t\t\t\t$newtype='Flat';\n\t\t\t}else{\n\t\t\t\t$newtype='Percent';\n\t\t\t}\n\t\t\tif(isset($status) && $status=='on'){\n\t\t\t\t$newstatus='Active';\n\t\t\t}else{\n\t\t\t\t$newstatus='Inactive';\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tif($promocodes_id==''){\n\t\t\t\t$duplicate_code = $this->promocodes_model->get_all_details(PROMOCODES,array('promo_code'=>$promo_code));\n\t\t\t}else{\n\t\t\t\t$duplicate_code = $this->promocodes_model->get_all_details(PROMOCODES,array('id !='=>$promocodes_id,'promo_code'=>$promo_code));\n\t\t\t}\t\t\t\n\t\t\tif ($duplicate_code->num_rows()>0){\n\t\t\t\t$this->setErrorMessage('error','Promo Code already exist.');\n\t\t\t\tredirect(ADMIN_PATH.'/plans/add_edit_coupon_form/'.$promocodes_id);\n\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t$excludeArr = array(\"promocodes_id\",\"status\",\"type\");\n\t\t\t\n\t\t\t$dataArr = array(\n\t\t\t\t\t'status' => $newstatus,\n\t\t\t\t\t'type'\t=>\t$newtype\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\n\t\t\tif ($promocodes_id == ''){\n\t\t\t\t$dataArr['no_of_usage']=0;\n\t\t\t\t$dataArr['created']=date(\"Y-m-d H:i:s\");\n\t\t\t\t$this->promocodes_model->commonInsertUpdate(PROMOCODES,'insert',$excludeArr,$dataArr,$condition);\n\t\t\t\t$this->setErrorMessage('success','Promocode added successfully');\n\t\t\t}else {\n\t\t\t\t$condition = array('id' => $promocodes_id);\n\t\t\t\t$this->promocodes_model->commonInsertUpdate(PROMOCODES,'update',$excludeArr,$dataArr,$condition);\n\t\t\t\t$this->setErrorMessage('success','Pomocode updated successfully');\n\t\t\t}\n\t\t\tredirect(ADMIN_PATH.'/promocodes/display_promocodes');\n\t\t}\n\t}", "function ihc_submit_coupon($code='', $uid=0, $lid=0){\n\tglobal $wpdb;\n\t//check if this code already exists\n\t$code = str_replace(' ', '', $code);\n\tif (defined('IHC_COUPON_SUBMITED')){\n\t\t\treturn; /// preventing from accidently submit the same coupon twice\n\t} else {\n\t\t\tdefine('IHC_COUPON_SUBMITED', 1);\n\t}\n\t$q = $wpdb->prepare(\"SELECT submited_coupons_count FROM \" . $wpdb->prefix .\"ihc_coupons WHERE code=%s ;\", $code);\n\t$data = $wpdb->get_row($q);\n\tif (isset($data->submited_coupons_count)){\n\t\t$submited_coupons_count = (int)$data->submited_coupons_count;\n\t\t$submited_coupons_count++;\n\t\t$table = $wpdb->prefix .\"ihc_coupons\";\n\t\t$q = $wpdb->prepare(\"UPDATE $table\n\t\t\t\t\t\t\t\tSET submited_coupons_count=%d\n\t\t\t\t\t\t\t\tWHERE code=%s;\", $submited_coupons_count, $code );\n\t\t$wpdb->query($q);\n\t\t///\n\t\tdo_action('ump_coupon_code_submited', $code, $uid, $lid);\n\t\t///\n\n\t\treturn TRUE;\n\t}\n\treturn FALSE;\n}" ]
[ "0.6500255", "0.6481464", "0.64752144", "0.6183799", "0.6021492", "0.5873916", "0.5847799", "0.5796635", "0.572389", "0.57140034", "0.56833386", "0.5629393", "0.56273854", "0.55982476", "0.55906457", "0.5547238", "0.55471885", "0.55090463", "0.5505506", "0.5503125", "0.54339886", "0.5433276", "0.5385347", "0.5384522", "0.538306", "0.5382343", "0.5376623", "0.53759694", "0.5375295", "0.53497726", "0.5347883", "0.5332968", "0.53328437", "0.53118074", "0.53103954", "0.53070295", "0.53063434", "0.53014356", "0.5294", "0.5282714", "0.5278745", "0.5266885", "0.52667564", "0.52562577", "0.5242744", "0.5229354", "0.522384", "0.52149975", "0.5210615", "0.5209029", "0.5208589", "0.5200064", "0.5187335", "0.5180757", "0.517883", "0.51725906", "0.5163818", "0.51622766", "0.5151842", "0.5151171", "0.51415056", "0.51405865", "0.513221", "0.513173", "0.51176876", "0.5108585", "0.5103174", "0.5102468", "0.50969714", "0.50858766", "0.5085681", "0.50800174", "0.5061949", "0.5059073", "0.50574213", "0.50483024", "0.5048193", "0.504817", "0.5046851", "0.50441825", "0.501335", "0.5011661", "0.50078887", "0.5003654", "0.50033313", "0.5000008", "0.4981852", "0.49774593", "0.49742106", "0.49726024", "0.49697447", "0.49666074", "0.49614024", "0.49600202", "0.49589944", "0.4957931", "0.4953947", "0.49507636", "0.49499717", "0.49499086" ]
0.6239052
3
put your code here
public function __construct() { parent::__construct(); $this->load->model('Crud'); $this->load->library('Excel'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n //\n \n }", "public function run()\n\t{\n\t\t//\n\t}", "public function preExecute(){\n\n\t\n\t}", "function script()\n {\n }", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "public function custom()\n\t{\n\t}", "public function run()\n {\n //\n }", "public function run()\n {\n //\n }", "public function run()\r\n {\r\n\r\n }", "public function run(){\n parent::run();\n //Do stuff...\n }", "function run() {\r\n $this->set_demopage();\r\n\r\n $options_def = array(\r\n __class__ => '', // code CSS. ATTENTION [ ] à la place des {}\r\n 'id' => ''\r\n );\r\n\r\n $options = $this->ctrl_options($options_def);\r\n\r\n // il suffit de charger le code dans le head\r\n $this->load_css_head($options[__class__]);\r\n\r\n // -- aucun code en retour\r\n return '';\r\n }", "public function run()\n {\n\n parent::run();\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "function use_codepress()\n {\n }", "public function run()\n {\n // Put your code here;\n }", "function run()\r\n {\r\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run() {\n }", "public static function run() {\n\t}", "public function onRun()\n {\n }", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "public function run() {\n }", "public function render_content() {\n\t}", "public function main()\r\n {\r\n \r\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "function render() ;", "function execute()\n {\n }", "public function run(): void\n {\n //\n }", "protected function main()\n /**/\n {\n parent::run();\n }", "public function execute()\n {\n //echo __('Hello Webkul Team.');\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function render()\n {\n //\n }", "public function run(){\n echo CHtml::closeTag( \"div\" );\n $this->registerScript();\n }", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "function __desctuct(){\r\n\t\t?>\r\n\r\n\t\t</body>\r\n\t\t</html>\r\n\t\t<?php\r\n\t}", "public function run(){}", "public function demo()\n {\n // xu ly logic\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "public function render(){\n\t\t\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function render() {\r\n\t\t\r\n\t}", "public function main()\n\t{\n\t}", "function handle() ;", "public function execute() {\n\t}", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function run() {}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function display_code() {\n\t\techo '<h1>Premise Demo Page</h1>\n\t\t<div class=\"span10\">';\n\n\n\t\t\t// test a form with all possible fields.\n\t\t\t// pass your own arguments if you'd like.\n\t\t\t// new PWP_Demo_Form();\n\n\t\t\t// Premise_test::fields();\n\t\t\t// Premise_test::fields_hooks();\n\t\t\t// Premise_test::fields_demo();\n\t\t\t// Premise_test::videos_embed();\n\t\t\t// Premise_test::fields_duplicate();\n\t\t\t// Premise_test::google_map();\n\t\t\t// Premise_test::grids();\n\n\t\techo '</div>';\n\t}", "function main()\r\n {\r\n $this->setOutput();\r\n }", "public function run()\n\n {\n DB::table('actives')->insert([\n 'script_tag' => 0,\n 'status' =>0\n \n ]);\n //\n }", "protected function _exec()\n {\n }", "public function run() {\n\n\t\t// generate random string md5(uniqid(rand(), true));\n\t\t$this->goneta();\n\t\t$this->pamparam();\n\t\t$this->insideOut();\n\t\t$this->morfoza();\n\t\t$this->basorelief();\n\t\t$this->acajouWasZuSagen();\n\t}", "protected function after_load(){\n\n\n }", "public function work()\n {\n }", "function run();", "function run();", "public function run() {\n\t\t// include other classes\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-render.php';\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-sso.php';\n\t\t\n\t\t// enque styles for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_styles' \n\t\t) );\n\t\t// enque jquery scripts for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_script' \n\t\t) );\n\t\t// add submit action form to redirect and catch from admin.php\n\t\tadd_action ( 'admin_post_tr_action', array (\n\t\t\t\t$this,\n\t\t\t\t'prefix_admin_tr_action' \n\t\t) );\n\t\t\n\t\t// check if plugin tables exist\n\t\t$this->table_check ();\n\t\t\n\t\t// instantiate the render class for shortcodes to work\n\t\t$shortcodes = new Top_Ratter_Render ();\n\t}", "function tap_run_page_handler() \n {\n include(\"/var/www/html/run/tap_run.php\");\n \n $params = cargaArray('Torneo Argentino de Programación', $form, '');\n \n include('body.php'); \n }", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "public function helper()\n\t{\n\t\n\t}", "public function drawContent()\n\t\t{\n\t\t}" ]
[ "0.60586566", "0.59289104", "0.5919654", "0.5899511", "0.5838488", "0.5838488", "0.58356965", "0.5814271", "0.5814271", "0.57796824", "0.5701954", "0.5700516", "0.5685669", "0.5684617", "0.5684617", "0.5684617", "0.5639208", "0.563027", "0.56278986", "0.56231225", "0.5620407", "0.56068903", "0.56068903", "0.56068903", "0.56016845", "0.5597219", "0.5595339", "0.5591545", "0.558057", "0.55636305", "0.55034596", "0.5487096", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.54594034", "0.5446425", "0.5446197", "0.54451364", "0.54319674", "0.5426377", "0.54072845", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.53981763", "0.5394762", "0.5392594", "0.5392164", "0.5391672", "0.5391672", "0.5391672", "0.5386191", "0.53823715", "0.5374112", "0.5373851", "0.5371084", "0.5369742", "0.53666246", "0.5365522", "0.5358571", "0.53542304", "0.5353158", "0.5345768", "0.5339915", "0.53389114", "0.53339213", "0.5332912", "0.5323722", "0.5323722", "0.5321411", "0.5318719", "0.53184503", "0.5300535", "0.5290181", "0.52723837", "0.52723306" ]
0.0
-1
Saves all values of settings
public function saveMultiple(array $settings, array $data, int $domain_id = null, int $language_id = null): bool { $transaction = \Yii::$app->db->beginTransaction(); try{ $success = $this->settingRepository->saveAll($settings, $data, $domain_id, $language_id); $transaction->commit(); }catch(\RuntimeException $e){ $transaction->rollBack(); return false; } return $success; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }", "function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}", "public function saveSettings()\n {\n $this->store->save($this->data);\n }", "public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}", "public function Save() {\n\t\t\n\t\tglobal $sql;\n\t\tforeach( $this->settings as $option => $value ) {\n\t\t\t\n\t\t\t$this->update_option( $option, $value, $this->username );\n\t\t}\n\t}", "public function saveSettings() {\n\t\t\tif ( isset( $_POST['muut_settings_save'] )\n\t\t\t\t&& $_POST['muut_settings_save'] == 'true'\n\t\t\t\t&& check_admin_referer( 'muut_settings_save', 'muut_settings_nonce' )\n\t\t\t) {\n\t\t\t\t$this->submittedSettings = $_POST['setting'];\n\n\t\t\t\t$settings = $this->settingsValidate( $this->getSubmittedSettings() );\n\n\t\t\t\t// Save all the options by passing an array into setOption.\n\t\t\t\tif ( muut()->setOption( $settings ) ) {\n\t\t\t\t\tif ( !empty( $this->errorQueue ) ) {\n\t\t\t\t\t\t// Display partial success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved, other than the errors listed.', 'muut' ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Display success notice if they were updated or matched the previous settings.\n\t\t\t\t\t\tmuut()->queueAdminNotice( 'updated', __( 'Settings successfully saved.', 'muut' ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Display error if the settings failed to save.\n\t\t\t\t\tmuut()->queueAdminNotice( 'error', __( 'Failed to save settings.', 'muut' ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}", "function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}", "public function saveSettings(){\n\n $vars = $this->getAllSubmittedVariablesByName();\n\n $vars['email'] = $this->email;\n $vars['firstname'] = $this->firstname;\n $vars['lastname'] = $this->lastname;\n $vars['real_name'] = $this->firstname .' ' .$this->lastname;\n $vars['phone'] = $this->phone;\n\n $vars['name'] = $this->firstname;\n $vars['surname'] = $this->lastname;\n $vars['screen_name'] = $this->firstname;\n\n\n $vars['about_my_artwork'] = $this->getSubmittedVariableByName('about_my_artwork');\n $vars['what_i_like_to_do'] = $this->getSubmittedVariableByName('what_i_like_to_do');\n $vars['experience'] = $this->getSubmittedVariableByName('experience');\n $vars['instructions'] = $this->getSubmittedVariableByName('instructions');\n $vars['aftercare'] = $this->getSubmittedVariableByName('aftercare');\n $vars['apprenticeship'] = $this->getSubmittedVariableByName('apprenticeship');\n\n $this->saveNamedVariables($vars);\n }", "public function save_settings($settings)\n {\n }", "public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }", "function saveSettings() {\n\t\t//# convert class variables into an array and save using\n\t\t//# Wordpress functions, \"update_option\" or \"add_option\"\n\t\t//#convert class into array...\n\t\t$settings_array = array();\n\t\t$obj = $this;\n\t\tforeach (array_keys(get_class_vars(get_class($obj))) as $k){\n\t\t\tif (is_array($obj->$k)) {\n\t\t\t\t//serialize any arrays within $obj\n\t\t\t\tif (count($obj->$k)>0) {\n\t\t\t\t\t$settings_array[$k] = esc_attr(serialize($obj->$k));\n\t\t\t\t} else {\n\t\t\t\t\t$settings_array[$k] = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$settings_array[$k] = \"{$obj->$k}\";\n\t\t\t}\n\t\t}\n\t\t//#save array to options table...\n\t\t$options_check = get_option('wassup_settings');\n\t\tif (!empty($options_check)) {\n\t\t\tupdate_option('wassup_settings', $settings_array);\n\t\t} else {\n\t\t\tadd_option('wassup_settings', $settings_array, 'Options for WassUp');\n\t\t}\n\t\treturn true;\n\t}", "public function save_settings() {\n\n\t\twoocommerce_update_options( $this->get_settings() );\n\t}", "public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }", "public function save_settings( $settings ) {\n\t\t$settings['_multiwidget'] = 1;\n\t\tupdate_option( $this->option_name, $settings );\n\t}", "public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}", "function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }", "public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}", "public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}", "function save_settings(array $settings)\n {\n //if user is not active do not log changes\n if ($user = user()){\n $logs = [];\n foreach ($settings as $key => $value){\n //changed\n if (!settings($key) || settings($key) != $value){\n $old_val = settings($key);\n $logs[] = \"$user changed setting: '{$key}' from '{$old_val}' to '{$value}'\";\n }\n }\n }\n\n //sync settings and save\n \\Setting::set($settings);\n \\Setting::save();\n\n //log any changes\n if (!empty($logs))\n event(new \\App\\Events\\SettingsChanged($logs, $user));\n\n return $settings;\n }", "public static function save_settings($settings = array())\n\t{\n\t\t//be sure to save all settings possible\n\t\t$_tmp_settings = array_merge(self::_get_default_settings(), $settings);\n\t\t//No way to do INSERT IF NOT EXISTS so...\n\t\tforeach ($_tmp_settings as $setting_name => $setting_value)\n\t\t{\n\t\t\t$query = ee()->db->get_where(self::$_settings_table_name, array('setting_name'=>$setting_name), 1, 0);\n\t\t\tif ($query->num_rows() == 0) {\n\t\t\t // A record does not exist, insert one.\n\t\t\t $query = ee()->db->insert(self::$_settings_table_name, array('setting_name' => $setting_name, 'setting_value' => $setting_value));\n\t\t\t} else {\n\t\t\t // A record does exist, update it.\n\t\t\t $query = ee()->db->update(self::$_settings_table_name, array('setting_value' => $setting_value), array('setting_name'=>$setting_name));\n\t\t\t}\n\t\t}\n\t\tself::$_settings = $_tmp_settings;\n\t}", "public function saveExportSetting($settings)\r\n {\r\n\r\n }", "public static function save_settings(array $settings)\n {\n $whitelisted_settings = array();\n foreach ($settings as $key => $value) {\n if (array_key_exists($key, self::$defaults)) {\n $whitelisted_settings[$key] = array();\n foreach ($value as $k => $v) {\n if (array_key_exists($k, self::$defaults[$key])) {\n $whitelisted_settings[$key][$k] = $v;\n }\n }\n }\n }\n update_option(self::$option_key, $whitelisted_settings);\n self::write_color_css();\n }", "public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}", "public function saveSettings()\n\t{\n\t\t$this->ensureAuthed();\n\t\t$input = Input::getInstance();\n\t\t$settings = $input->getInput('settings');\n\t\t$settingsManager = Settings::getInstance();\n\t\t$settingsManager->setSettings($this->username, $settings);\n\t\treturn true;\n\t}", "function save_settings()\n\t{\n\t\t// --------------------------------------\n\t\t// Get channel and field ids\n\t\t// --------------------------------------\n\n\t\t$channel_id = $this->EE->input->post('channel_id');\n\t\t$field_id = $this->EE->input->post('field_id');\n\n\t\t// no channel or field id -> invalid request\n\t\tif ( ! $channel_id || ! $field_id )\n\t\t{\n\t\t\treturn $this->_show_error('invalid_request');\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Init settings array\n\t\t// --------------------------------------\n\n\t\t$settings = array();\n\n\t\t// --------------------------------------\n\t\t// Do what with categories?\n\t\t// --------------------------------------\n\n\t\tif ( in_array($this->EE->input->post('category_options'), array('all', 'one')) )\n\t\t{\n\t\t\t$settings['categories'] = $this->EE->input->post('category_options');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$settings['categories'] = $this->EE->input->post('categories') ? implode('|', $this->EE->input->post('categories')) : '';\n\t\t}\n\n\t\t// Check input\n\t\t$settings['statuses'] = $this->EE->input->post('statuses') ? implode('|', $this->EE->input->post('statuses')) : '';\n\t\t$settings['show_expired'] = $this->EE->input->post('show_expired') ? 'y' : 'n';\n\t\t$settings['show_future'] = $this->EE->input->post('show_future') ? 'y' : 'n';\n\t\t$settings['sort_order'] = $this->EE->input->post('sort_order');\n\t\t$settings['clear_cache'] = $this->EE->input->post('clear_cache') ? 'y' : 'n';\n\t\t$settings['permissions'] = $this->EE->input->post('permissions');\n\n\t\t// Data to put into the DB\n\t\t$data = array(\n\t\t\t'channel_id' => $channel_id,\n\t\t\t'field_id' => $field_id,\n\t\t\t'settings' => encode_reorder_settings($settings)\n\t\t);\n\n\t\t// I want to use REPLACE INTO, to replace existing settings and insert if not exists\n\t\t// That means no active record!\n\t\t$sql = \"REPLACE INTO exp_low_reorder_settings (\".implode(',', array_keys($data)).\") VALUES ('\".implode(\"','\", $this->EE->db->escape_str(array_values($data))).\"')\";\n\t\t$this->EE->db->query($sql);\n\n\t\t$this->EE->session->set_flashdata('reorder_msg', $this->EE->lang->line('settings_saved'));\n\t\t$this->EE->functions->redirect($this->base_url);\n\t\texit;\n\t}", "public function saveSettings()\n {\n return $this->config->saveFile();\n }", "public static function storeSettings($settings)\n\t{\n\t\t$registry = Registry::singleton();\n\t\t\n\t\tforeach ($settings as $key => $value) {\n\t\t\t$registry->_settings [ $key ] = $value;\n\t\t}\n\t}", "function saveGeneralPageSettingsObject()\n\t{\n\t\tglobal $ilCtrl, $lng, $tpl;\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$aset = new ilSetting(\"adve\");\n\t\t\t$aset->set(\"use_physical\", $_POST[\"use_physical\"]);\n\t\t\tif ($_POST[\"block_mode_act\"])\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", (int) $_POST[\"block_mode_minutes\"]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", 0);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"showGeneralPageEditorSettings\");\n\t\t}\n\t\t\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public static function Save()\r\n {\r\n return update_option(self::OPT_SETTINGS, self::$Data);\r\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 abstract function settingsSave(array &$pluginInfo);", "public function site_settings()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$data['form_submit_message'] = '';\n\t\t\t$this->load->model('settings_model', 'sm');\n\t\t\t\n\t\t\tif(count($_POST) > 0)\n\t\t\t{\n\t\t\t\tforeach($_POST as $key => $value)\n\t\t\t\t{\n\t\t\t\t\t$settings_data['value'] = $value;\n\t\t\t\t\t$this->sm->update($key, $settings_data);\n\t\t\t\t}\n\t\t\t\t$data['form_submit_message'] = '<div style=\"font-weight:bold;color:#0000FF;\">'.lang('msg_settings_saved') .'</div>';\n\t\t\t}\n\t\t\t\n\t\t\t$settings_raw_data = $this->sm->get_all();\n\t\t\t$settings_data = array();\n\t\t\tforeach($settings_raw_data as $raw_settings)\n\t\t\t\t$settings_data[$raw_settings->name] = $raw_settings->value;\n\t\t\t$data['settings'] = $settings_data;\n\t\t\t$this->load->view('settings-admin', $data);\n\t\t}", "function savesettings()\r\n {\r\n\t\t$this->_savesettings();\r\n $this->setRedirect('index.php?option=com_jfusionconnect&view=cpanel');\r\n }", "public function save(array $options = [])\n {\n parent::save($options);\n\n // delete cache\n Cache::forget('Klaravel\\Settings\\Setting');\n }", "public function save_settings($data) {\n\n\t\treturn array(\n\t\t\t'config_settings' => $this->EE->input->post('config_settings'),\n\t\t\t'eeck_image_upload' => $this->EE->input->post('eeck_image_upload'),\n\t\t\t'eeck_file_upload' => $this->EE->input->post('eeck_file_upload'),\n\t\t\t'eeck_flash_upload' => $this->EE->input->post('eeck_flash_upload'),\n\t\t\t'field_fmt' => 'none',\n\t\t\t'field_show_fmt' => 'n'\n\t\t\t\t);\n\t}", "function _savesettings()\r\n {\r\n\t\t$settings = JRequest::getVar('settings');\r\n\r\n\t\tjimport('joomla.registry.registry');\r\n\t\t$reg = new JRegistry();\r\n\t\t$reg->loadArray($settings);\r\n\t\t\t\t\r\n\t\tif(JFusionConnect::isJoomlaVersion('1.6')) {\r\n\t\t\t$component =& JTable::getInstance('extension');\r\n\t\t\t$componentid = $component->find(array('type' => 'component','element' => 'com_jfusionconnect'));\r\n\t\t\t$component->load($componentid);\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('extension');\r\n\t\t\t$pluginid = $plugin->find(array('type' => 'plugin','element' => 'jfusionconnect'));\r\n\t\t\t$plugin->load($pluginid);\r\n\t\t\t$key='enabled';\r\n\t\t} else {\r\n\t\t\t$component =& JTable::getInstance('component');\r\n\t\t\t$component->loadByOption('com_jfusionconnect');\r\n\t\t\t\r\n\t\t\t$plugin =& JTable::getInstance('plugin');\r\n\t\t\t$plugin->_tbl_key = 'element';\r\n\t\t\t$plugin->load('jfusionconnect');\r\n\t\t\t$key='published';\r\n\t\t}\r\n\t\t$component->params = $reg->toString();\r\n\t\t$component->store();\r\n \tif ($settings['enabled']) {\r\n\t\t\t$plugin->$key = 1;\r\n\t\t} else {\r\n\t\t\t$plugin->$key = 0;\r\n\t\t}\r\n\t\t$plugin->store();\r\n }", "private function saveSettings()\n {\n $this->form_validation->set_rules('title', 'lang:bf_site_name', 'required|trim');\n $this->form_validation->set_rules('system_email', 'lang:bf_site_email', 'required|trim|valid_email');\n $this->form_validation->set_rules('offline_reason', 'lang:settings_offline_reason', 'trim');\n $this->form_validation->set_rules('list_limit', 'lang:settings_list_limit', 'required|trim|numeric');\n $this->form_validation->set_rules('password_min_length', 'lang:bf_password_length', 'required|trim|numeric');\n $this->form_validation->set_rules('password_force_numbers', 'lang:bf_password_force_numbers', 'trim|numeric');\n $this->form_validation->set_rules('password_force_symbols', 'lang:bf_password_force_symbols', 'trim|numeric');\n $this->form_validation->set_rules('password_force_mixed_case', 'lang:bf_password_force_mixed_case', 'trim|numeric');\n $this->form_validation->set_rules('password_show_labels', 'lang:bf_password_show_labels', 'trim|numeric');\n $this->form_validation->set_rules('language', 'lang:bf_language', 'required|trim');\n\n if ($this->form_validation->run() === false) {\n return false;\n }\n\n $data = array(\n array('name' => 'site.title', 'value' => $this->input->post('title')),\n array('name' => 'site.system_email', 'value' => $this->input->post('system_email')),\n array('name' => 'site.status', 'value' => $this->input->post('status')),\n array('name' => 'site.offline_reason', 'value' => $this->input->post('offline_reason')),\n array('name' => 'site.list_limit', 'value' => $this->input->post('list_limit')),\n\n array('name' => 'auth.allow_register', 'value' => $this->input->post('allow_register') ? 1 : 0),\n array('name' => 'auth.user_activation_method', 'value' => $this->input->post('user_activation_method') ?: 0),\n array('name' => 'auth.login_type', 'value' => $this->input->post('login_type')),\n array('name' => 'auth.allow_remember', 'value' => $this->input->post('allow_remember') ? 1 : 0),\n array('name' => 'auth.remember_length', 'value' => (int) $this->input->post('remember_length')),\n array('name' => 'auth.password_min_length', 'value' => $this->input->post('password_min_length')),\n array('name' => 'auth.password_force_numbers', 'value' => $this->input->post('password_force_numbers') ? 1 : 0),\n array('name' => 'auth.password_force_symbols', 'value' => $this->input->post('password_force_symbols') ? 1 : 0),\n array('name' => 'auth.password_force_mixed_case', 'value' => $this->input->post('password_force_mixed_case') ? 1 : 0),\n array('name' => 'auth.password_show_labels', 'value' => $this->input->post('password_show_labels') ? 1 : 0),\n array('name' => 'password_iterations', 'value' => $this->input->post('password_iterations')),\n\n\t\t\tarray('name' => 'tips.allow_post', 'value' => $this->input->post('allow_post') ? 1 : 0),\n\t\t\tarray('name' => 'tips.rules', 'value' => $this->input->post('tips_rules')),\n\t\t\t\n array(\n 'name' => 'site.default_language',\n 'value' => $this->input->post('language') ? $this->input->post('language') : ''\n ),\t\t\t\n );\n\n log_activity(\n $this->auth->user_id(),\n lang('bf_act_settings_saved') . ': ' . $this->input->ip_address(),\n 'core'\n );\n\n // Save the settings to the DB.\n $updated = $this->settings_lib->update_batch($data);\n\n return $updated;\n }", "public function save_settings( $settings = array() ) {\n\t\tglobal $socialflow;\n\t\t$socialflow_params = filter_input_array( INPUT_POST );\n\t\t$settings = empty( $settings ) ? array() : $settings;\n\n\t\t// Merge current settings (we need to store account information which is not stored in the fields).\n\t\t$settings = $socialflow->array_merge_recursive( $socialflow->options->options, $settings );\n\n\t\t// Allow plugins/modules to add/modify settings when having post request.\n\t\t$settings = isset( $socialflow_params['socialflow'] ) ? apply_filters( 'sf_save_settings', $settings ) : $settings;\n\n\t\treturn $settings;\n\t}", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }", "private function _saveSettings($type)\n {\n $success = true;\n\n // Get all available settings for this type\n $availableSettings = craft()->amSearch_settings->getSettingsByType($type);\n\n // Save each available setting\n foreach ($availableSettings as $setting) {\n // Find new settings\n $newSettings = craft()->request->getPost($setting->handle, false);\n\n if ($newSettings !== false) {\n $setting->value = $newSettings;\n if(! craft()->amSearch_settings->saveSettings($setting)) {\n $success = false;\n }\n }\n }\n\n if ($success) {\n craft()->userSession->setNotice(Craft::t('Settings saved.'));\n }\n else {\n craft()->userSession->setError(Craft::t('Couldn’t save settings.'));\n }\n }", "function saveExternalSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$props = array();\n\t\t\t$props[PR_EC_OUTOFOFFICE] = $this->settings[\"outofoffice\"][\"set\"] == \"true\";\n\t\t\t$props[PR_EC_OUTOFOFFICE_MSG] = utf8_to_windows1252($this->settings[\"outofoffice\"][\"message\"]);\n\t\t\t$props[PR_EC_OUTOFOFFICE_SUBJECT] = utf8_to_windows1252($this->settings[\"outofoffice\"][\"subject\"]);\n\t\n\t\t\tmapi_setprops($this->store, $props);\n\t\t\tmapi_savechanges($this->store);\n\t\t\t\n\t\t\t// remove external settings so we don't save the external settings to PR_EC_WEBACCESS_SETTINGS\n\t\t\tunset($this->settings[\"outofoffice\"]);\n\t\t}", "public function saveSettings($namespace, Settings $settings);", "public function save()\n {\n return update_option($this->optionName, $this->settings);\n }", "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 }", "private function save(): void\n {\n foreach ($this->dataToSave as $file => $data) {\n $this->langFilesManager->fillKeys($file, $data);\n }\n }", "protected function updateSettings()\n {\n $this->settings = array();\n $raw_settings = $this->db->fetchAll('SELECT name, value FROM settings');\n\n foreach ($raw_settings as $raw_setting) {\n $this->settings[$raw_setting['name']] = $raw_setting['value'];\n }\n }", "function save_settings(){\r\n if(isset($_POST['SKWPSB_IN_SUBMIT'])){\r\n $this->message = '';\r\n foreach($this->settingsList() as $key => $val){\r\n if($_POST['SKWPSB_IN_PLUGIN'] == $key){\r\n if(isset($this->recognizedPlugins[$key])){\r\n // Recognized plugin\r\n $foo = $this->recognizedPlugins[$key]['set_options'];\r\n if(function_exists($foo)){\r\n if($foo(stripslashes($_POST['SKWPSB_IN_CODE']))){\r\n $this->message = 'Settings successfully imported.';\r\n } else {\r\n $this->errorMessage = 'The plugin returned an error, make sure you copied the code correctly.';\r\n }\r\n return;\r\n } else {\r\n $this->errorMessage = 'The selected plugin is not responding correctly.';\r\n } return;\r\n } else {\r\n // Standard\r\n @$data = unserialize(stripslashes($_POST['SKWPSB_IN_CODE']));\r\n if(!$data || empty($data)){\r\n $this->errorMessage = 'Wrong code, make sure you copied it correctly.'.$_POST['SKWPSB_IN_CODE'];\r\n return;\r\n } else {\r\n update_option($key, $data);\r\n $this->message = 'Settings successfully imported.';\r\n return;\r\n }\r\n }\r\n }\r\n }\r\n $this->errorMessage = 'You might not have selected any destination plugin.';\r\n }\r\n else if(isset($_POST['SKWPSB_EX_SUBMIT'])){\r\n foreach($this->settingsList() as $key => $val){\r\n if($_POST['SKWPSB_EX_PLUGIN'] == $key){\r\n if(isset($this->recognizedPlugins[$key])){\r\n // Recognized plugin\r\n $foo = $this->recognizedPlugins[$key]['get_options'];\r\n if(function_exists($foo)){\r\n $this->exportedSettings = $foo();\r\n $this->message = '<p>Use the code to import the settings to another blog.</p><p>Copy the code as it is, don\\'t add spaces or newlines.</p>';\r\n return;\r\n } else {\r\n $this->errorMessage = 'The selected plugin is not responding correctly.';\r\n } return;\r\n } else {\r\n // Standard\r\n $this->exportedSettings = $val;\r\n $this->message = '<p>Use the code to import the settings to another blog.</p><p>Copy the code as it is, don\\'t add spaces or newlines.</p>';\r\n return;\r\n }\r\n }\r\n }\r\n $this->errorMessage = 'You might not have selected any source plugin.';\r\n }\r\n }", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "function SaveSettings()\n\t{\n\t\t$this->GetDb();\n\n\t\t$tempSettings = $this->Db->Quote(serialize($this->settings));\n\t\t$tempUserID = intval($this->userid);\n\n\t\t$query = \"\n\t\t\tUPDATE [|PREFIX|]users\n\t\t\tSET settings='{$tempSettings}'\n\t\t\tWHERE userid={$tempUserID}\n\t\t\";\n\n\t\t$result = $this->Db->Query($query);\n\t\tif (!$result) {\n\t\t\tlist($error, $level) = $this->Db->GetError();\n\t\t\ttrigger_error($error, $level);\n\t\t\treturn false;\n\t\t}\n\n\t\t$currentUser = IEM::userGetCurrent();\n\t\tif ($currentUser && $currentUser->userid == $this->userid) {\n\t\t\tIEM::userFlushCache();\n\t\t}\n\n\t\treturn true;\n\t}", "function save_all() {\n\n // do not save another demo history if we already have one\n if (isset($this->ale_demo_history['demo_settings_date'])) {\n return;\n }\n\n $local_ale_demo_history = array();\n\n $local_ale_demo_history['page_on_front'] = get_option('page_on_front');\n $local_ale_demo_history['show_on_front'] = get_option('show_on_front');\n $local_ale_demo_history['nav_menu_locations'] = get_theme_mod('nav_menu_locations');\n\n $sidebar_widgets = get_option('sidebars_widgets');\n $local_ale_demo_history['sidebars_widgets'] = $sidebar_widgets;\n\n $used_widgets = $this->get_used_widgets($sidebar_widgets);\n\n\n if (is_array($used_widgets)) {\n foreach ($used_widgets as $used_widget) {\n $local_ale_demo_history['used_widgets'][$used_widget] = get_option('widget_' . $used_widget);\n }\n }\n\n $local_ale_demo_history['theme_options'] = get_option(ALETHEME_THEME_OPTIONS_NAME);\n $local_ale_demo_history['ale_social_networks'] = get_option('ale_social_networks');\n $local_ale_demo_history['demo_settings_date'] = time();\n update_option(ALETHEME_SHORTNAME . '_demo_history', $local_ale_demo_history);\n }", "public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}", "function store(){\n update_option( $this->option_name, $this->settings );\n }", "static public function save_settings( $data = array() ) {\n\t\t$roles = self::get_all_roles();\n\t\t$settings = array();\n\t\t$ms_support = FLBuilderAdminSettings::multisite_support();\n\t\t$ms_overrides = $ms_support && isset( $_POST['fl_ua_override_ms'] ) ? $_POST['fl_ua_override_ms'] : array();\n\n\t\tforeach ( self::$registered_settings as $registered_key => $registered_data ) {\n\n\t\t\tif ( ! isset( $data[ $registered_key ] ) ) {\n\t\t\t\t$data[ $registered_key ] = array();\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $data as $data_key => $data_roles ) {\n\n\t\t\tif ( ! is_network_admin() && $ms_support && ! isset( $ms_overrides[ $data_key ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$settings[ $data_key ] = array();\n\n\t\t\tforeach ( $roles as $role_key => $role_data ) {\n\t\t\t\t$settings[ $data_key ][ $role_key ] = in_array( $role_key, $data_roles ) ? true : false;\n\t\t\t}\n\t\t}\n\n\t\tself::$settings = null;\n\n\t\tFLBuilderModel::update_admin_settings_option( '_fl_builder_user_access', $settings, false );\n\t}", "public function save_settings_fields() {\n\n\t\t\tif ( isset( $_POST[ $this->setting_field_prefix ] ) ) {\n\t\t\t\tif ( ( isset( $_POST[ $this->setting_field_prefix ]['nonce'] ) ) && ( wp_verify_nonce( $_POST[ $this->setting_field_prefix ]['nonce'], 'learndash_permalinks_nonce' ) ) ) {\n\n\t\t\t\t\t$post_fields = $_POST[ $this->setting_field_prefix ];\n\n\t\t\t\t\tif ( ( isset( $post_fields['courses'] ) ) && ( ! empty( $post_fields['courses'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['courses'] = $this->esc_url( $post_fields['courses'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['lessons'] ) ) && ( ! empty( $post_fields['lessons'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['lessons'] = $this->esc_url( $post_fields['lessons'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['topics'] ) ) && ( ! empty( $post_fields['topics'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['topics'] = $this->esc_url( $post_fields['topics'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['quizzes'] ) ) && ( ! empty( $post_fields['quizzes'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['quizzes'] = $this->esc_url( $post_fields['quizzes'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['nested_urls'] ) ) && ( ! empty( $post_fields['nested_urls'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = $this->esc_url( $post_fields['nested_urls'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We check the Course Options > Course Builder setting. If this is set to 'yes' then we MUST keep the nested URLs set to true.\n\t\t\t\t\t\tif ( ! isset( $this->setting_option_values['nested_urls'] ) ) {\n\t\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = 'no';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( 'yes' !== $this->setting_option_values['nested_urls'] ) {\n\t\t\t\t\t\t\t$learndash_settings_courses_builder = get_option( 'learndash_settings_courses_management_display', array() );\n\t\t\t\t\t\t\tif ( ! isset( $learndash_settings_courses_builder['course_builder_shared_steps'] ) ) {\n\t\t\t\t\t\t\t\t$learndash_settings_courses_builder['course_builder_shared_steps'] = 'no';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( 'yes' === $learndash_settings_courses_builder['course_builder_shared_steps'] ) {\n\t\t\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = 'yes';\n\n\t\t\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tupdate_option( $this->settings_section_key, $this->setting_option_values );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function notification_user_settings_save() {\n\tglobal $CONFIG;\n\t//@todo Wha??\n\tinclude($CONFIG->path . \"actions/notifications/settings/usersettings/save.php\");\n}", "function save_settings( $setting, $value ){\n //global $disp_body;\n\n //ensure paths use forward slashes\n if( $setting === 'CIFS_SHARE' || $setting === 'CIFS_MOUNT' ){\n $value = str_replace('\\\\', '/', $value);\n }\n\n //only store the password if it is not empty\n $setting_part = substr( $setting, -9);\n if( $setting_part === '_PASSWORD' && $value == '' ){\n //write old password to $value to keep the old one\n $value = $_SESSION['settings.conf'][$setting];\n }\n\n //escape slashes for 'sed' in pia-settings\n $value = str_replace(array('\\\\','/'), array('\\\\\\\\','\\\\/'), $value);\n\n $k = escapeshellarg($setting);\n $v = escapeshellarg($value);\n exec(\"/usr/local/pia/pia-settings $k $v\");\n //$disp_body .= \"$k is now $v<br>\\n\"; //dev stuff\n\n //clear to force a reload\n unset($_SESSION['settings.conf']);\n }", "public function save_settings($settings) {\n\t\n\t\tglobal $updraftplus;\n\t\t\n\t\t// Make sure that settings filters are registered\n\t\tUpdraftPlus_Options::admin_init();\n\t\t\n\t\t$more_files_path_updated = false;\n\n\t\tif (isset($settings['updraftplus_version']) && $updraftplus->version == $settings['updraftplus_version']) {\n\n\t\t\t$return_array = array('saved' => true);\n\t\t\t\n\t\t\t$add_to_post_keys = array('updraft_interval', 'updraft_interval_database', 'updraft_interval_increments', 'updraft_starttime_files', 'updraft_starttime_db', 'updraft_startday_files', 'updraft_startday_db');\n\t\t\t\n\t\t\t// If database and files are on same schedule, override the db day/time settings\n\t\t\tif (isset($settings['updraft_interval_database']) && isset($settings['updraft_interval_database']) && $settings['updraft_interval_database'] == $settings['updraft_interval'] && isset($settings['updraft_starttime_files'])) {\n\t\t\t\t$settings['updraft_starttime_db'] = $settings['updraft_starttime_files'];\n\t\t\t\t$settings['updraft_startday_db'] = $settings['updraft_startday_files'];\n\t\t\t}\n\t\t\tforeach ($add_to_post_keys as $key) {\n\t\t\t\t// For add-ons that look at $_POST to find saved settings, add the relevant keys to $_POST so that they find them there\n\t\t\t\tif (isset($settings[$key])) {\n\t\t\t\t\t$_POST[$key] = $settings[$key];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Check if updraft_include_more_path is set, if it is then we need to update the page, if it's not set but there's content already in the database that is cleared down below so again we should update the page.\n\t\t\t$more_files_path_updated = false;\n\n\t\t\t// i.e. If an option has been set, or if it was currently active in the settings\n\t\t\tif (isset($settings['updraft_include_more_path']) || UpdraftPlus_Options::get_updraft_option('updraft_include_more_path')) {\n\t\t\t\t$more_files_path_updated = true;\n\t\t\t}\n\t\t\t\n\t\t\t// Wipe the extra retention rules, as they are not saved correctly if the last one is deleted\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_retain_extrarules', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_email', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_report_warningsonly', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_report_wholebackup', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_extradbs', array());\n\t\t\tUpdraftPlus_Options::update_updraft_option('updraft_include_more_path', array());\n\t\t\t\n\t\t\t$relevant_keys = $updraftplus->get_settings_keys();\n\n\t\t\tif (isset($settings['updraft_auto_updates']) && in_array('updraft_auto_updates', $relevant_keys)) {\n\t\t\t\t$updraftplus->set_automatic_updates($settings['updraft_auto_updates']);\n\t\t\t\tunset($settings['updraft_auto_updates']); // unset the key and its value to prevent being processed the second time\n\t\t\t}\n\n\t\t\tif (method_exists('UpdraftPlus_Options', 'mass_options_update')) {\n\t\t\t\t$original_settings = $settings;\n\t\t\t\t$settings = UpdraftPlus_Options::mass_options_update($settings);\n\t\t\t\t$mass_updated = true;\n\t\t\t}\n\n\t\t\tforeach ($settings as $key => $value) {\n\n\t\t\t\tif (in_array($key, $relevant_keys)) {\n\t\t\t\t\tif ('updraft_service' == $key && is_array($value)) {\n\t\t\t\t\t\tforeach ($value as $subkey => $subvalue) {\n\t\t\t\t\t\t\tif ('0' == $subvalue) unset($value[$subkey]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// This flag indicates that either the stored database option was changed, or that the supplied option was changed before being stored. It isn't comprehensive - it's only used to update some UI elements with invalid input.\n\t\t\t\t\t$updated = empty($mass_updated) ? (is_string($value) && UpdraftPlus_Options::get_updraft_option($key) != $value) : (is_string($value) && (!isset($original_settings[$key]) || $original_settings[$key] != $value));\n\n\t\t\t\t\tif (empty($mass_updated)) UpdraftPlus_Options::update_updraft_option($key, $value);\n\t\t\t\t\t\n\t\t\t\t\t// Add information on what has changed to array to loop through to update links etc.\n\t\t\t\t\t// Restricting to strings for now, to prevent any unintended leakage (since this is just used for UI updating)\n\t\t\t\t\tif ($updated) {\n\t\t\t\t\t\t$value = UpdraftPlus_Options::get_updraft_option($key);\n\t\t\t\t\t\tif (is_string($value)) $return_array['changed'][$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t// @codingStandardsIgnoreLine\n\t\t\t\t} else {\n\t\t\t\t\t// This section is ignored by CI otherwise it will complain the ELSE is empty.\n\t\t\t\t\t\n\t\t\t\t\t// When last active, it was catching: option_page, action, _wpnonce, _wp_http_referer, updraft_s3_endpoint, updraft_dreamobjects_endpoint. The latter two are empty; probably don't need to be in the page at all.\n\t\t\t\t\t// error_log(\"Non-UD key when saving from POSTed data: \".$key);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$return_array = array('saved' => false, 'error_message' => sprintf(__('UpdraftPlus seems to have been updated to version (%s), which is different to the version running when this settings page was loaded. Please reload the settings page before trying to save settings.', 'updraftplus'), $updraftplus->version));\n\t\t}\n\t\t\n\t\t// Checking for various possible messages\n\t\t$updraft_dir = $updraftplus->backups_dir_location(false);\n\t\t$really_is_writable = UpdraftPlus_Filesystem_Functions::really_is_writable($updraft_dir);\n\t\t$dir_info = $this->really_writable_message($really_is_writable, $updraft_dir);\n\t\t$button_title = esc_attr(__('This button is disabled because your backup directory is not writable (see the settings).', 'updraftplus'));\n\t\t\n\t\t$return_array['backup_now_message'] = $this->backup_now_remote_message();\n\t\t\n\t\t$return_array['backup_dir'] = array('writable' => $really_is_writable, 'message' => $dir_info, 'button_title' => $button_title);\n\n\t\t// Check if $more_files_path_updated is true, is so then there's a change and we should update the backup modal\n\t\tif ($more_files_path_updated) {\n\t\t\t$return_array['updraft_include_more_path'] = $this->files_selector_widgetry('backupnow_files_', false, 'sometimes');\n\t\t}\n\t\t\n\t\t// Because of the single AJAX call, we need to remove the existing UD messages from the 'all_admin_notices' action\n\t\tremove_all_actions('all_admin_notices');\n\t\t\n\t\t// Moving from 2 to 1 ajax call\n\t\tob_start();\n\n\t\t$service = UpdraftPlus_Options::get_updraft_option('updraft_service');\n\t\t\n\t\t$this->setup_all_admin_notices_global($service);\n\t\t$this->setup_all_admin_notices_udonly($service);\n\t\t\n\t\tdo_action('all_admin_notices');\n\t\t\n\t\tif (!$really_is_writable) { // Check if writable\n\t\t\t$this->show_admin_warning_unwritable();\n\t\t}\n\t\t\n\t\tif ($return_array['saved']) { //\n\t\t\t$this->show_admin_warning(__('Your settings have been saved.', 'updraftplus'), 'updated fade');\n\t\t} else {\n\t\t\tif (isset($return_array['error_message'])) {\n\t\t\t\t$this->show_admin_warning($return_array['error_message'], 'error');\n\t\t\t} else {\n\t\t\t\t$this->show_admin_warning(__('Your settings failed to save. Please refresh the settings page and try again', 'updraftplus'), 'error');\n\t\t\t}\n\t\t}\n\t\t\n\t\t$messages_output = ob_get_contents();\n\t\t\n\t\tob_clean();\n\t\t\n\t\t// Backup schedule output\n\t\t$this->next_scheduled_backups_output('line');\n\t\t\n\t\t$scheduled_output = ob_get_clean();\n\t\t\n\t\t$return_array['messages'] = $messages_output;\n\t\t$return_array['scheduled'] = $scheduled_output;\n\t\t$return_array['files_scheduled'] = $this->next_scheduled_files_backups_output(true);\n\t\t$return_array['database_scheduled'] = $this->next_scheduled_database_backups_output(true);\n\t\t\n\t\t\n\t\t// Add the updated options to the return message, so we can update on screen\n\t\treturn $return_array;\n\t\t\n\t}", "public function save()\n {\n update_option($this->optionKey, $this->fields);\n }", "public function system_save_preference()\n {\n System_helper::save_preference();\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function save_widget_state() {\n\n\t\tcheck_ajax_referer( 'mi-admin-nonce', 'nonce' );\n\n\t\t$default = self::$default_options;\n\t\t$current_options = $this->get_options();\n\n\t\t$reports = $default['reports'];\n\t\tif ( isset( $_POST['reports'] ) ) {\n\t\t\t$reports = json_decode( sanitize_text_field( wp_unslash( $_POST['reports'] ) ), true );\n\t\t\tforeach ( $reports as $report => $reports_sections ) {\n\t\t\t\t$reports[ $report ] = array_map( 'boolval', $reports_sections );\n\t\t\t}\n\t\t}\n\n\t\t$options = array(\n\t\t\t'width' => ! empty( $_POST['width'] ) ? sanitize_text_field( wp_unslash( $_POST['width'] ) ) : $default['width'],\n\t\t\t'interval' => ! empty( $_POST['interval'] ) ? absint( wp_unslash( $_POST['interval'] ) ) : $default['interval'],\n\t\t\t'compact' => ! empty( $_POST['compact'] ) ? 'true' === sanitize_text_field( wp_unslash( $_POST['compact'] ) ) : $default['compact'],\n\t\t\t'reports' => $reports,\n\t\t\t'notice30day' => $current_options['notice30day'],\n\t\t);\n\n\t\tarray_walk( $options, 'sanitize_text_field' );\n\t\tupdate_user_meta( get_current_user_id(), 'monsterinsights_user_preferences', $options );\n\n\t\twp_send_json_success();\n\n\t}", "public static function save()\n\t{\n\t\tConfigManager::save('discord', self::load(), 'config');\n\t}", "function save_settings($data)\n {\n try {\n $sql = \"UPDATE settings SET val = ? WHERE param = ?\";\n // Connect to DB, set charset\n $db = Database::getInstance();\n $_dbh = $db->getConnection();\n $_dbh->exec('SET NAMES utf8');\n $query = $_dbh->prepare($sql);\n\n foreach ($data as $param => $val) {\n // Execute query\n $query->execute(array($val, $param));\n }\n\n $_dbh = null;\n } catch (PDOException $e) {\n throw new CustomException(\"Query error\");\n }\n }", "public function afterSave()\n {\n // forget current data\n Cache::forget('julius_multidomain_settings');\n\n // get all records available now\n $cacheableRecords = Setting::generateCacheableRecords();\n\n //save them in cache\n Cache::forever('julius_multidomain_settings', $cacheableRecords);\n }", "public function save( $values, $wizard ) {\n\t\t$settings = wp_parse_args(\n\t\t\trank_math()->settings->all_raw(),\n\t\t\t[ 'general' => '' ]\n\t\t);\n\n\t\t$settings['general']['setup_mode'] = ! empty( $values['setup_mode'] ) ? $values['setup_mode'] : 'easy';\n\n\t\tif ( 'custom' === $settings['general']['setup_mode'] ) {\n\t\t\t// Don't change, use custom imported value.\n\t\t\treturn true;\n\t\t}\n\n\t\tHelper::update_all_settings( $settings['general'], null, null );\n\n\t\treturn true;\n\t}", "private function saveConfig(){\n\t\tif(!isset($_POST['services_ipsec_settings_enabled'])){\n\t\t\t$this->data['enable'] = 'false';\n\t\t}\n\t\telseif($_POST['services_ipsec_settings_enabled'] == 'true'){\n\t\t\t$this->data['enable'] = 'true';\n\t\t}\n\t\t\n\t\t$this->config->saveConfig();\n\t\t$this->returnConfig();\n\t}", "public function saveSettings($settings)\n {\n\n $db = $this->getDb();\n $user = $this->getUser();\n $cache = $this->getL1Cache();\n\n $settingsLoader = new LibUserSettings($db, $user, $cache);\n $settingsLoader->saveUserSetting(EUserSettingType::MESSAGES, $settings);\n\n }", "function settingsupdate() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $wl_data = $this->m_white_label->getById($wl_id);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_settings->update($wl_id, $data)){\n $this->m_settings->createSettingsFile($wl_id, $wl_data);\n $this->advsettings(2); \n }else{\n echo 'error';\n }\n }", "public function save()\n {\n $this->save_meta_value('_sim_city_main_info', $this->city_main_info);\n\n $this->save_meta_value('_sim_city_shops', $this->city_shops);\n }", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_post_meta( $this->post_id, APP_REPORTS_P_TOTAL_KEY, $this->total_reports );\n\t}", "private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }", "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "public function save()\n {\n $values = array('company_name', 'website_name', 'website_description');\n foreach ($values as $value) \n ConfigHelper::save($value, Input::get($value));\n ConfigHelper::save_file('favicon');\n ConfigHelper::save_file('logo');\n ConfigHelper::save_file('login-logo');\n\n return Redirect::route('view_config')->with('message_title', 'Successful!')->with('message', 'Successfully updated the config!');\n }", "function saveConfiguration() {\r\n foreach($_POST as $configuration_key=>$configuration_value){\r\n\t\t\t\tif(stripos($configuration_key, \"haendlerbund\")!==false) {\r\n\t\t\t\t\t$sql = xtc_db_query(\"SELECT * FROM configuration WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\tif(xtc_db_num_rows($sql)) {\r\n\t\t\t\t\t\txtc_db_query(\"UPDATE configuration SET configuration_value='\".$configuration_value.\"' WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}", "function settings_screen_save( $group_id = NULL ) {\n $setting = '';\n \n if ( isset( $_POST['group_projects_setting'] ) ) {\n $setting = $_POST['group_projects_setting'];\n }\n \n groups_update_groupmeta( $group_id, 'group_projects_setting', $setting );\n }", "public function saved(Settings $settings)\n {\n Settings::forget();\n }", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\tif(is_array($this->value))\n\t\t\t{\n\t\t\t\tforeach($this->value as $key=>$session)\n\t\t\t\t{\n\t\t\t\t\t$_SESSION[$key] = $session;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(is_string($this->value) and is_string($this->name))\n\t\t\t{\n\t\t\t\t$_SESSION[$this->name] = $this->value;\n\t\t\t}\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "public function save_currency_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $currency_settings_val = $this->input->post(\"currency\");\n $config = '<?php ';\n foreach ($currency_settings_val as $key => $val) {\n $value = addslashes($val);\n $config .= \"\\n\\$config['$key'] = '$value'; \";\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_currency_settings.php';\n file_put_contents($file, $config);\n $this->setErrorMessage('success', 'Currency settings updated successfully','admin_adminlogin_currency_setting_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_currency_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "public function settings()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['save']) && $_POST['save'] == 'Save Settings')\n\t\t\t{\n\t\t\t\tPlugin::setAllSettings($_POST['setting'], 'mbblog');\n\t\t\t\tFlash::setNow('success', __('Settings have been saved!'));\t\t \t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$this->display('mbblog/views/admin/settings', array('settings' => Plugin::getAllSettings('mbblog')));\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}", "public function save_settings()\n\t{\n\t\tif ( $_POST && wp_verify_nonce( $_POST['save-confirm-user-registration-settings-nonce'], 'save-confirm-user-registration-settings' ) ) :\n\t\t\t$options = array(\n\t\t\t\t'error' => $_POST['error'],\n\t\t\t\t'from' => $_POST['from'],\n\t\t\t\t'subject' => $_POST['subject'],\n\t\t\t\t'message' => $_POST['message']\n\t\t\t);\n\n\t\t\t$options = apply_filters( 'confirm-user-registration-save-options', $options );\n\t\t\tupdate_site_option( 'confirm-user-registration', $options);\n\n\t\t\t?>\n\t\t\t<div class=\"updated message\">\n\t\t\t\t<p><?php _e( 'Saved' ); ?></p>\n\t\t\t</div>\n\t\t\t<?php\n\t\tendif;\n\t}", "public function save_settings($data) {\n\t\t//dump_var($_POST['content_element_item']);\n\t\t//dump_var($data, 1);\n\t\t// Not set? set!\n\t\tif (!isset($data['content_element_item']) and isset($_POST['content_element_item'])) {\n\t\t\t$data['content_element_item'] = (array) $_POST['content_element_item'];\n\t\t\t$data['content_element'] = (array) $_POST['content_element'];\n\t\t}\n\n\t\t// Not array? array!\n\t\tif (empty($data['content_element_item']) or !is_array($data['content_element_item'])) {\n\t\t\t$data['content_element_item'] = array();\n\t\t\t$data['content_element'] = array();\n\t\t}\n\n\t\t// Get lists of elements\n\t\t$this->_load_elements_lib();\n\t\t$content_elements = $this->EE->elements->fetch_avaiable_elements($this->get_vars2export());\n\n\t\t$save_settings = array();\n\n\t\t// Loop element types\n\t\t//foreach ($_POST['content_element_item'] as $element_id => $element_type) {\n\t\tforeach ($data['content_element_item'] as $element_id => $element_type) {\n\n\t\t\t//$settings = @$_POST['content_element'][$element_type][$element_id];\n\t\t\t$settings = @$data['content_element'][$element_type][$element_id];\n\t\t\tif (is_array($settings)) {\n\n\t\t\t\t// Separate systems settings (title & eid) // the reason is compatibility with CE 1.4.0.3\n\t\t\t\t$title = '';\n\t\t\t\t$eid = $element_id;\n\n\t\t\t\tif (isset($settings[\"title\"])) {\n\t\t\t\t\t$title = $settings[\"title\"];\n\t\t\t\t}\n\n\t\t\t\tif (isset($settings[\"eid\"])) {\n\t\t\t\t\t$eid = $settings[\"eid\"];\n\t\t\t\t}\n\n\t\t\t\t// Loop params\n\t\t\t\tif (!empty($this->EE->elements->$element_type->handler) and method_exists($this->EE->elements->$element_type->handler, 'save_element_settings')) {\n\t\t\t\t\t$settings = $this->EE->elements->$element_type->handler->save_element_settings($this->_exclude_setting_system_fields($settings));\n\t\t\t\t}\n\n\t\t\t\t$settings[\"eid\"] = $element_id;\n\t\t\t\t$settings[\"title\"] = $title;\n\t\t\t}\n\n\t\t\t$save_settings[] = array(\n\t\t\t\t'type' => $element_type,\n\t\t\t\t'settings' => $settings,\n\t\t\t);\n\t\t}\n\n\t\t//dump_var($save_settings, 1);\n\n\t\treturn array(\n\t\t\t'content_elements' => serialize($save_settings)\n\t\t);\n\t}", "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 insertSettings()\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\tforeach ($this->getSettings() as $s => $set)\r\n\t\t{\r\n\t\t\t$ilDB->manipulate(\"INSERT INTO adm_set_templ_value \".\r\n\t\t\t\t\"(template_id, setting, value, hide) VALUES (\".\r\n\t\t\t\t$ilDB->quote($this->getId(), \"integer\").\",\".\r\n\t\t\t\t$ilDB->quote($s, \"text\").\",\".\r\n\t\t\t\t$ilDB->quote($set[\"value\"], \"text\").\",\".\r\n\t\t\t\t$ilDB->quote($set[\"hide\"], \"integer\").\r\n\t\t\t\t\")\");\r\n\t\t}\r\n\t}", "public function settings_save()\n {\n $method = rcube_utils::get_input_value('_method', rcube_utils::INPUT_POST);\n $data = @json_decode(rcube_utils::get_input_value('_data', rcube_utils::INPUT_POST), true);\n\n $rcmail = rcmail::get_instance();\n $storage = $this->get_storage($rcmail->get_user_name());\n $success = false;\n $errors = 0;\n $save_data = array();\n\n if ($driver = $this->get_driver($method)) {\n if ($data === false) {\n if ($this->check_secure_mode()) {\n // remove method from active factors and clear stored settings\n $success = $driver->clear();\n }\n else {\n $errors++;\n }\n }\n else {\n // verify the submitted code before saving\n $verify_code = rcube_utils::get_input_value('_verify_code', rcube_utils::INPUT_POST);\n $timestamp = intval(rcube_utils::get_input_value('_timestamp', rcube_utils::INPUT_POST));\n if (!empty($verify_code)) {\n if (!$driver->verify($verify_code, $timestamp)) {\n $this->api->output->command('plugin.verify_response', array(\n 'id' => $driver->id,\n 'method' => $driver->method,\n 'success' => false,\n 'message' => str_replace('$method', $this->gettext($driver->method), $this->gettext('codeverificationfailed'))\n ));\n $this->api->output->send();\n }\n }\n\n foreach ($data as $prop => $value) {\n if (!$driver->set($prop, $value)) {\n $errors++;\n }\n }\n\n $driver->set('active', true);\n }\n\n // commit changes to the user properties\n if (!$errors) {\n if ($success = $driver->commit()) {\n $save_data = $data !== false ? $this->format_props($driver->props()) : array();\n }\n else {\n $errors++;\n }\n }\n }\n\n if ($success) {\n $this->api->output->show_message($data === false ? $this->gettext('factorremovesuccess') : $this->gettext('factorsavesuccess'), 'confirmation');\n $this->api->output->command('plugin.save_success', array(\n 'method' => $method,\n 'active' => $data !== false,\n 'id' => $driver->id) + $save_data);\n }\n else if ($errors) {\n $this->api->output->show_message($this->gettext('factorsaveerror'), 'error');\n $this->api->output->command('plugin.reset_form', $method);\n }\n\n $this->api->output->send();\n }", "public function savesettingsview() {\r\n\r\n $this->logger->info(\"Action Save Settings View \");\r\n $this->fields['combotype'] = $_POST[\"combotype\"];\r\n $this->fields['Combovalue'] = $_POST[\"Combovalue\"];\r\n\r\n if(!empty($_POST[\"timedetails\"])){\r\n $this->fields['timedetails'] = $_POST[\"timedetails\"];\r\n }\r\n\r\n if ($_POST[\"isactive\"] == 'on') {\r\n $this->fields['isactive'] = 1;\r\n } else {\r\n $this->fields['isactive'] = 0;\r\n }\r\n\r\n $validResult = $this->settingsModel->savecombovalue($this->fields);\r\n\r\n if ($validResult == 0) {\r\n $this->type = $this->settingsModel->getcombotypevalues($this->fields['combotype']);\r\n foreach ($this->type as $value) {\r\n $this->fields['combotype'] = $value['type'];\r\n }\r\n $this->template->display('viewsetting', $this->fields, 'settings');\r\n } else {\r\n $error = $this->settingsModel->geterror();\r\n $data = $this->settingsModel->populatetypeValues();\r\n $this->template->display_data('listsettings', $data, 'settings', $this->fields, '', $error);\r\n }\r\n }", "public function test_save() {\n global $DB;\n\n $this->resetAfterTest();\n\n // Create data object for default assignment settings.\n $data = new stdClass();\n $data->turnitinenabled = 1;\n $data->reportgenoptions['reportgeneration'] = TURNITINSIM_REPORT_GEN_DUEDATE;\n $data->queuedrafts = 1;\n $data->indexoptions['addtoindex'] = 0;\n $data->excludeoptions['excludequotes'] = 0;\n $data->excludeoptions['excludebiblio'] = 1;\n $data->accessoptions['accessstudents'] = 1;\n\n // Save Module Settings.\n $form = new plagiarism_turnitinsim_defaults_form();\n $form->save($data);\n\n // Check settings have been saved.\n $settings = $DB->get_record('plagiarism_turnitinsim_mod', array('cm' => 0));\n\n $this->assertEquals(1, $settings->turnitinenabled);\n $this->assertEquals(TURNITINSIM_REPORT_GEN_DUEDATE, $settings->reportgeneration);\n $this->assertEquals(1, $settings->queuedrafts);\n $this->assertEquals(0, $settings->addtoindex);\n $this->assertEquals(0, $settings->excludequotes);\n $this->assertEquals(1, $settings->excludebiblio);\n $this->assertEquals(1, $settings->accessstudents);\n }", "function action_save ($group = 'default') {\n $input = $_POST;\n $settings = settings_get($group);\n \n foreach ($input as $key => $value) {\n $input[$key] = array(\n 'exist' => isset($settings[$key]),\n 'value' => strip_tags($value)\n );\n \n if (isset($settings[$key]) && $value === $settings[$key]) {\n unset($input[$key]);\n }\n }\n \n json_result(settings_save($group, $input));\n}", "public function store()\n\t{\n\n\t\t $validator = Validator::make(Input::all(), $this->rules);\n\n\t\t if($validator->fails())\n {\n return Response::json(array('settingsUpdated' => false, 'errorMessages' => $validator->messages()));\n }\n\n\n\t\tforeach (Input::all() as $key => $value) {\n\t\t\tSettings::set($key, $value);\n\t\t}\n\n\t\tif (Input::has('site_offline')) {\n \tSettings::set('site_offline', 1);\n }else{\n \tSettings::set('site_offline', 0);\n }\n\n\t\treturn Response::json(array('settingsUpdated' => true, 'message' => trans('Las opciones se han guardado correctamente'), 'messageType' => 'success'));\n\t}", "public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }", "public function writeAll()\n {\n foreach( $this->values as $name => $value ){\n $this->_write( s($name), s($value) );\n }\n }", "public function saveConfigOptions() {}", "private function sccp_db_save_setting($save_value = array()) {\n global $db;\n global $amp_conf;\n\n $save_settings = array();\n\n if (empty($save_value)) {\n foreach ($this->sccpvalues as $key => $val) {\n if (!trim($val['data']) == '') {\n $save_settings[] = array($key, $db->escapeSimple($val['data']), $val['seq'], $val['type']);\n }\n }\n $this->dbinterface->sccp_save_db('sccpsettings', $save_settings, 'clear');\n } else {\n $this->dbinterface->sccp_save_db('sccpsettings', $save_value, 'update');\n return true;\n }\n return true;\n }", "function save_options(){\n\t\t\n\t\t$nonsavable_types=array('open', 'close','subtitle','title','documentation','block','blockclose');\n\t\n\t\t//insert the default values if the fields are empty\n\t\tforeach ($this->options as $value) {\n\t\t\tif(isset($value['id']) && get_option($value['id'])===false && isset($value['std']) && !in_array($value['type'], $nonsavable_types)){\n\t\t\t\tupdate_option( $value['id'], $value['std']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//save the field's values if the Save action is present\n\t\tif ( $_GET['page'] == HANA_OPTIONS_PAGE ) {\n\t\t\tif ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) {\n\t\t\t\t//verify the nonce\n\t\t\t\tif ( empty($_POST) || !wp_verify_nonce($_POST['hana-theme-options'],'hana-theme-update-options') )\n\t\t\t\t{\n\t\t\t\t\tprint 'Sorry, your nonce did not verify.';\n\t\t\t\t\texit;\n\t\t\t\t}else{\n\t\t\t\t\tif(!get_option(HANA_SHORTNAME.'_first_save')){\n\t\t\t\t\t\tupdate_option(HANA_SHORTNAME.'_first_save','true');\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($this->options as $value) {\n\t\t\t\t\t\tif(isset($value['id']) ) if( isset( $_REQUEST[ $value['id'] ] ) && !in_array($value['type'], $nonsavable_types)) {\n\t\t\t\t\t\t\tupdate_option( $value['id'], $_REQUEST[ $value['id'] ] );\n\t\t\t\t\t\t} elseif(!in_array($value['type'], $nonsavable_types)){\n\t\t\t\t\t\t\tdelete_option( $value['id'] );\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t/* Update the values for the custom options that contain unlimited suboptions - for example when having\n\t\t\t\t\t\t * a slider with fields \"title\" and \"imageurl\", for all the entities the titles will be saved in one field,\n\t\t\t\t\t\t * separated by a separator. In this case, if the field name is slider_title and it contains some data like\n\t\t\t\t\t\t * title 1|*|title2|*|title3 (|*| is the separator), then all this data will be saved into a custom field\n\t\t\t\t\t\t * with id slider_titles.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif($value['type']=='custom'){\n\t\t\t\t\t\t\tforeach($value['fields'] as $field){\n\t\t\t\t\t\t\t\tupdate_option( $field['id'].'s', $_REQUEST[ $field['id'].'s' ] );\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\theader(\"Location: admin.php?page=\".HANA_OPTIONS_PAGE.\"&saved=true\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}", "public function save_var_settings($settings) {\n\t\treturn $this->save_settings($settings);\n\t}", "public function save_smtp_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $smtp_settings_val = $this->input->post(\"smtp\");\n $config = '<?php ';\n foreach ($smtp_settings_val as $key => $val) {\n $value = addslashes($val);\n $config .= \"\\n\\$config['$key'] = '$value'; \";\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_smtp_settings.php';\n\t\t\t\t file_put_contents($file, $config);\n $this->setErrorMessage('success', 'SMTP settings updated successfully','admin_adminlogin_smtp_settings_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_smtp_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "static public function save_setup_settings() {\n\n $data = WPP_F::parse_str( $_REQUEST[ 'data' ] );\n\n $_setup = array(\n 'api' => WPP_API_URL_STANDARDS,\n 'data' => $data,\n 'schema' => self::get_settings_schema()\n );\n\n $_current_settings = get_option('wpp_settings');\n\n $_modified_settings = WPP_F::extend( $_current_settings, $_setup['schema'] );\n\n //die( '<pre>' . print_r( $_modified_settings['field_alias'], true ) . '</pre>' );\n\n if( is_array( $_modified_settings['property_stats_groups'] ) ) {\n // $_modified_settings['property_stats_groups'] = array_unique( $_modified_settings['property_stats_groups'] );\n }\n\n // @note This kills c.rabbit.ci response via Varnish, perhaps some sort of log output somewhere.\n if( is_array( $_modified_settings['searchable_attributes'] ) ) {\n // $_modified_settings[ 'searchable_attributes' ] = array_unique( $_modified_settings[ 'searchable_attributes' ] );\n }\n\n // preserve field aliases\n $_modified_settings['field_alias'] = $_current_settings['field_alias'];\n\n $_modified_settings['_updated'] = time();\n\n update_option( 'wpp_settings', $_modified_settings );\n\n $posts_array = get_posts( array(\n 'posts_per_page' => 1,\n 'orderby' => 'date',\n 'order' => 'DESC',\n 'post_type' => 'property',\n 'post_status' => 'publish',\n 'suppress_filters' => true\n ) );\n\n $return[ 'props_single' ] = get_permalink( $posts_array[ 0 ]->ID );\n\n $return[ '_settings' ] = $data[ 'wpp_settings' ];\n\n self::flush_cache();\n\n wp_send_json( $return );\n\n }", "public function saveSettings($params) {\n\t\tif (!$this->canEdit()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// plugin hook handlers should return true to indicate the settings have\n\t\t// been saved so that default code does not run\n\t\t$hook_params = array(\n\t\t\t'widget' => $this,\n\t\t\t'params' => $params\n\t\t);\n\t\tif (elgg_trigger_plugin_hook('widget_settings', $this->handler, $hook_params, false) == true) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (is_array($params) && count($params) > 0) {\n\t\t\tforeach ($params as $name => $value) {\n\t\t\t\tif (is_array($value)) {\n\t\t\t\t\t// private settings cannot handle arrays\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t$this->$name = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn true;\n\t}", "public function savePageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl, $ilSetting;\n\t\n\t\t$this->initPageEditorForm();\n\t\tif ($this->form->checkInput())\n\t\t{\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageContentGUI.php\");\n\t\t\t$buttons = ilPageContentGUI::_getCommonBBButtons();\n\t\t\tforeach ($buttons as $b => $t)\n\t\t\t{\n\t\t\t\tilPageEditorSettings::writeSetting($_GET[\"grp\"], \"active_\".$b,\n\t\t\t\t\t$this->form->getInput(\"active_\".$b));\n\t\t\t}\n\t\t\t\n\t\t\tif ($_GET[\"grp\"] == \"test\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_tst_page_edit\", (int) $_POST[\"tst_page_edit\"]);\n\t\t\t}\n\t\t\telseif ($_GET[\"grp\"] == \"rep\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_cat_page_edit\", (int) $_POST[\"cat_page_edit\"]);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendInfo($lng->txt(\"msg_obj_modified\"), true);\n\t\t}\n\t\t\n\t\t$ilCtrl->setParameter($this, \"grp\", $_GET[\"grp\"]);\n\t\t$ilCtrl->redirect($this, \"showPageEditorSettings\");\n\t}", "protected function save_meta() {\n\n\t\t// save all data in array\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_DATA_KEY, $this->meta );\n\n\t\t// also save total reports in separate meta for sorting queries\n\t\tupdate_user_meta( $this->user_id, APP_REPORTS_U_TOTAL_KEY, $this->total_reports );\n\t}" ]
[ "0.83556825", "0.82736516", "0.8228633", "0.81030506", "0.7841729", "0.7776874", "0.7728336", "0.77197254", "0.7717389", "0.75562406", "0.7543488", "0.7532312", "0.7467735", "0.7445014", "0.7379964", "0.73704976", "0.7356736", "0.72776884", "0.71897554", "0.71302223", "0.7119267", "0.71023214", "0.7064954", "0.69941014", "0.6983514", "0.69784814", "0.6967043", "0.69085544", "0.69070435", "0.6904365", "0.68743545", "0.6838899", "0.68167675", "0.6810768", "0.67828155", "0.67600435", "0.67574924", "0.6752978", "0.673289", "0.67174923", "0.6697881", "0.6688424", "0.6673362", "0.66691935", "0.66631037", "0.664729", "0.66412634", "0.6573727", "0.65731543", "0.65619385", "0.65582234", "0.6538451", "0.6536405", "0.65342313", "0.6524972", "0.65165013", "0.6512234", "0.65101475", "0.6507825", "0.6502157", "0.6488816", "0.64817864", "0.6474072", "0.6473748", "0.6466263", "0.6450722", "0.6445825", "0.64207447", "0.6400399", "0.63911086", "0.6368426", "0.6360729", "0.6351653", "0.63486505", "0.6346136", "0.6337331", "0.63370717", "0.63306886", "0.63254154", "0.63165396", "0.6303099", "0.6300154", "0.62992704", "0.62971425", "0.6292999", "0.62872183", "0.6286882", "0.6284985", "0.62825155", "0.627951", "0.62748724", "0.62725395", "0.62624574", "0.6260425", "0.625735", "0.6252841", "0.6251232", "0.62408596", "0.6237153", "0.623453", "0.62271786" ]
0.0
-1
Add needed css file includes for some component.
public function addIncludes($param) { if(is_array($param)) { foreach($param as $p) { array_push($this->needed_css_include, $p); } } else { array_push($this->needed_css_include, $param); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCSSFiles()\n\t{\n\t\t$this->getContainer()->AddCSSFile(\"include/zoombox/zoombox.css\");\n\t}", "protected function addCSS() {\n foreach ($this->css_files as $css_file) {\n $this->header.=\"<link rel='stylesheet' href='\" . __ASSETS_PATH . \"/\" . $css_file . \"'/> \\n\";\n }\n }", "public function css_includes()\n {\n }", "private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }", "function head_css()\n\t{\n\t\tqa_html_theme_base::head_css();\n\t\t// if if already added widgets have a css file activated\n\t\t$styles = array();\n\t\tforeach ($this->content['widgets'] as $region_key => $regions) {\n\t\t\tforeach ($regions as $template_key => $widgets) {\n\t\t\t\t$position = strtoupper(substr($region_key,0,1) . substr($template_key,0,1) );\n\t\t\t\tforeach ($widgets as $key => $widget) {\n\t\t\t\t\t$widget_name = get_class ($widget);\n\t\t\t\t\t$widget_key = $widget_name.'_'.$position;\n\t\t\t\t\t$file = get_widget_option($widget_key, 'uw_styles');\n\t\t\t\t\t// if file existed then put it into an array to prevent duplications\n\t\t\t\t\tif($file)\n\t\t\t\t\t\t$styles[$widget_name][$file]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add styling files to theme\n\t\tif($styles)\n\t\t\tforeach ($styles as $widget_name => $files)\n\t\t\t\tforeach ($files as $file => $verified)\n\t\t\t\t\tif( $file != 'none' )\n\t\t\t\t\t\t$this->output('<link rel=\"stylesheet\" href=\"'.UW_URL.'widgets/'.$widget_name.'/styles/'.$file.'\"/>');\n\t}", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "function css( $params ){\n\t\n\t\tglobal $mainframe;\n\t\t\n\t\t$document =& JFactory::getDocument();\n\t\t\n\t\t$cssFile = 'ja_contentslide.css';\n\t\n\t\tif( file_exists(JPATH_SITE.DS.'templates'.DS.$mainframe->getTemplate().DS.'css'.DS.$cssFile) ) {\n\t\t\t$document->addStyleSheet( JURI::base().'templates/'.$mainframe->getTemplate().'/css/'.$cssFile );\n\t\t} else { \n\t\t\t$document->addStyleSheet( JURI::base().'modules/mod_ja_contentslide/assets/css/'.$cssFile );\n\t\t}\n\t}", "protected function doConcatenateCss() {}", "private function addCssInclude($file) {\n $this->cssIncludes[] = $file;\n }", "protected function loadCss() {}", "public function include_css($env) {\n global $CFG;\n $css = '';\n $cssurl = $CFG->dirroot . '/course/format/ludimoodle/motivators/' . $this->get_short_name() . '/styles.css';\n\n // We can't require css like this in format because <head> is already closed\n //$page = $env->get_page();\n //$page->requires->css($cssurl);\n\n // if css is not already in page\n if (file_exists($cssurl) && (!in_array($cssurl, $env->cssinitdata))) {\n // mark that this css is in page\n $env->cssinitdata[] = $cssurl;\n $css = '<style>' . file_get_contents($cssurl) . '</style>';\n }\n return $css;\n }", "public function enableConcatenateCss() {}", "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}", "function loadCSS() {\n\t\t$first = true;\n\t\t$cssPart = '';\n\t\tforeach( $this->conf->css->file as $file ) {\n\t\t\tif( ! $first ) {\n\t\t\t\t$cssPart .= chr( 9 );\n\t\t\t}\n\t\t\t$cssPart .= '<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"';\n\t\t\t$cssPart .= $this->conf->path->baseUrl . $this->conf->path->css . $file;\n\t\t\t$cssPart .= '\" />' . chr( 10 );\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\tif( count( $this->additionalCSS ) >= 1 ) {\n\t\t\tforeach( $this->additionalCSS as $key => $value ) {\n\t\t\t\t$cssPart .= '<style type=\"text/css\">' . chr( 10 );\n\t\t\t\t$cssPart .= $value . chr( 10 );\n\t\t\t\t$cssPart .= '</style>' . chr( 10 );\n\t\t\t}\n\t\t\n\t\t}\n\t\treturn $cssPart;\n\t}", "protected function addCssToBackend() {\n\t\t$this->backendReference->addCssFile('newspaper-role', t3lib_extMgm::extRelPath($this->extkey) . 'mod_role/newspaper_role.css');\n\t}", "function add_css_js()\n\t{\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\tdefine('CSS_JS_PARSED', true);\n\t\t}\n\n\t\t// Include custom CSS from templates/CURRENT_TPL folder\n\t\tif(is_array($this->css_style_include) && !empty($this->css_style_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_style_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_style_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_style_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom CSS from templates/common folder\n\t\tif(is_array($this->css_include) && !empty($this->css_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom JS from templates/common folder\n\t\tif(is_array($this->js_include) && !empty($this->js_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->js_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('js_include', array(\n\t\t\t\t\t'JS_FILE' => $this->js_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "private function _include_css()\n {\n if ( !$this->cache['css'] )\n {\n $this->EE->cp->add_to_head('<style type=\"text/css\">\n .vz_range { padding-bottom:0.5em; }\n .vz_range input { width:97%; padding:4px; }\n .vz_range_min { float:left; width:46%; }\n .vz_range_max { float:right; width:46%; }\n .vz_range_sep { float:left; width:8%; text-align:center; line-height:2; }\n</style>');\n\n $this->cache['css'] = TRUE;\n }\n }", "function include_css( $strfilename, $params=NULL ){ \n\treturn CIncludeFiles :: includefiles( \"CIncludeCSSFiles\", $strfilename, $params );\t\n}", "public function addCSSFiles($css /* array */);", "public function cssFile($params) {\n // This stops styles inadvertently clashing with the main site.\n if (strpos($_SERVER['REQUEST_URI'], $this->getPluginPath()) === 0 ||\n strpos($_SERVER['REQUEST_URI'], '/widgets/') === 0\n ) {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$this->getThemePath().'/css/style.css\" />'.\"\\n\";\n }\n }", "public function loadIncludes() {\n // TODO: better way to skip load includes.\n $this->addCSS($this->env->dir['tmp_files'] . '/css.min.css');\n $this->addJS('/tmp/js.min.js');\n }", "function includeCss($fileName) {\n $data = '<link type=\"text/css\" rel=\"Stylesheet\" href=\"'.BASE_PATH.'/public/css/'.$fileName.'.css\" />';\n return $data;\n }", "public function enqueue_additional_css_file() {\n\t\tif (is_page() || is_single()) {\n\t\t\twhile (have_posts()) {\n\t\t\t\tthe_post();\n\t\t\t\t$additional_css_file = get_post_meta(get_the_ID(), 'im8_additional_css_file', true);\n\t\t\t\t$path = get_stylesheet_directory().'/css/'.$additional_css_file;\n\t\t\t\t$url = get_stylesheet_directory_uri().'/css/'.$additional_css_file;\n\t\t\t\tif ($additional_css_file && file_exists($path))\n\t\t\t\t\twp_enqueue_style('im8_additional_css_file', $url, array(), filemtime($path), 'screen, projection');\n\t\t\t}\n\t\t\trewind_posts();\n\t\t}\n\t}", "function ft_hook_add_css() {}", "public function styles(){\n\n\t\t//wp_enqueue_style('component-header_fixed-style', $this->directory_uri . '/assets/dist/css/headerFixed.css');\n\t}", "private function load_css () {\n $buffer = '';\n if (count($this->css_files)) {\n foreach ($this->css_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<link rel=\"stylesheet\" href=\"'.base_url($file).'\">';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }", "public function INCLUDE_CSS(array $conf) {\n if($conf && count($conf)) {\n foreach ($conf as $key => $CSSfile) {\n $cssFileConfig = &$conf[$key . '.'];\n if (isset($cssFileConfig['if.']) && !$GLOBALS['TSFE']->cObj->checkIf($cssFileConfig['if.'])) {\n continue;\n }\n $ss = $cssFileConfig['external'] ? $CSSfile : $GLOBALS['TSFE']->tmpl->getFileName($CSSfile);\n if ($ss) {\n if ($cssFileConfig['import']) {\n if (!$cssFileConfig['external'] && $ss[0] !== '/') {\n // To fix MSIE 6 that cannot handle these as relative paths (according to Ben v Ende)\n $ss = TYPO3\\CMS\\Core\\Utility\\GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/' . $ss;\n }\n $this->pageRenderer->addCssInlineBlock('import_' . $key, '@import url(\"' . htmlspecialchars($ss) . '\") ' . htmlspecialchars($cssFileConfig['media']) . ';', empty($cssFileConfig['disableCompression']), $cssFileConfig['forceOnTop'] ? TRUE : FALSE, '');\n } else {\n $this->pageRenderer->addCssFile(\n $ss,\n $cssFileConfig['alternate'] ? 'alternate stylesheet' : 'stylesheet',\n $cssFileConfig['media'] ?: 'all',\n $cssFileConfig['title'] ?: '',\n empty($cssFileConfig['disableCompression']),\n $cssFileConfig['forceOnTop'] ? TRUE : FALSE,\n $cssFileConfig['allWrap'],\n $cssFileConfig['excludeFromConcatenation'] ? TRUE : FALSE,\n $cssFileConfig['allWrap.']['splitChar']\n );\n unset($cssFileConfig);\n }\n }\n }\n }\n }", "function add_css($acss=array()) {\n\t\tforeach ($acss as $css) {\n\t\t\tif (isset($css[\"path\"]) && $css[\"path\"]!=\"\") {\n\t\t\t\t$priority = 0;\n\t\t\t\tif (isset($css[\"priority\"])) {\n\t\t\t\t\t$priority = $css[\"priority\"];\n\t\t\t\t}\n\t\t\t\t$condition = \"\";\n\t\t\t\tif (isset($css[\"condition\"])) {\n\t\t\t\t\t$condition = $css[\"condition\"];\n\t\t\t\t}\n\t\t\t\t$is_local = true;\n\t\t\t\tif (isset($css[\"is_local\"])) {\n\t\t\t\t\t$is_local = $css[\"is_local\"];\n\t\t\t\t}\n\t\t\t\t$this->custom_css[] = array(\"css\" => $css[\"path\"], \"priority\" => $priority, \"condition\" => $condition, \"is_local\" => $is_local);\n\t\t\t}\n\t\t}\n\t}", "private function decideIncludeCSS(){\n //if user don´t want to use our css\n $noCSS = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_libconnect.']['settings.']['ezbNoCSS'];\n\n if($noCSS == 1){\n return;\n }\n\n //get UID of PlugIn\n $this->contentObj = $this->configurationManager->getContentObject();\n $uid = $this->contentObj->data['uid'];\n unset($this->contentObj);\n\n //only the first PlugIn needs to include the css\n if(IsfirstPlugInUserFunction('ezb', $uid)){\n $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"' . t3lib_extMgm::siteRelPath('libconnect') . 'Resources/Public/Styles/ezb.css\" />'); \n }\n }", "protected function generateCSS() {}", "public function styles() {\n $this->addStyle(CORE_WWW_ROOT.\"ressources/css/externals/bootstrap.core.min.css\", true);\n\n\n $this->addStyle($this->directory().\"css/reset.less\");\n $this->addStyle($this->directory().\"css/animations.less\");\n $this->addStyle($this->directory().\"css/main.less\");\n $this->addStyle($this->directory().\"css/overlay.less\");\n $this->addStyle($this->directory().\"css/header.less\");\n $this->addStyle($this->directory().\"css/footer.less\");\n\n // externals\n $this->addStyle(\"//fonts.googleapis.com/css?family=Lora:400,400i,700,700i\", true);\n $this->addStyle('//fonts.googleapis.com/css?family=Roboto:700', true);\n\n // blocks\n $this->addStyle($this->directory().\"css/blocks/rd_arrow.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_button.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_bigteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_smallteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_longtext.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_forms.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_listings.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_collection.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_components.less\");\n\n $this->addStyle($this->directory().\"css/responsive.less\");\n }", "protected function renderCssLibraries() {}", "protected function addAssets(): void\n {\n $this->enqueue('assets/dashifen-2022.js');\n $font1 = $this->enqueue('//fonts.googleapis.com/css2?family=El+Messiri&display=swap');\n $font2 = $this->enqueue('//fonts.googleapis.com/css2?family=Roboto&display=swap');\n $css = $this->enqueue('assets/dashifen-2022.css', [$font1, $font2]);\n \n $dir = trailingslashit($this->getStylesheetDir());\n if (file_exists($dir . 'assets/dashifen-2022-components.css')) {\n $this->enqueue('assets/dashifen-2022-components.css', [$css]);\n }\n }", "private function includeCss( $css ) {\n if( Director::fileExists($file = project() . '/themes/' . SSViewer::current_theme() . '/css/' . $css) ) {\n Requirements::css($file);\n\n }\n elseif( Director::fileExists($file = project() . '/css/' . $css) ) {\n Requirements::css($file);\n }\n else {\n Requirements::css(ssdropdownmenu . '/css/' . $css);\n }\n }", "public function addCss($file)\n\t{\n\t\t$this->_themeExtras['css'][] = array('file' => $file);\n\t}", "function App_CSS_Add()\n {\n array_push($this->MyApp_Interface_Head_CSS_OnLine,\"CSS/sivent2.css\");\n }", "function loadFiles($params, $module)\n {\n //if( $params->get('load_css_file') ) {\r\n JHTML::stylesheet('modules/' . $module . '/assets/style.css');\n if (is_file(JPATH_SITE . DS . 'templates' . DS . JFactory::getApplication()->getTemplate() . DS . 'css' . DS . $module . \".css\"))\n JHTML::stylesheet('templates/' . JFactory::getApplication()->getTemplate() . '/css/' . $module . \".css\");\n\n //}\r\n }", "public function build_css() {\n\t\t\t\n\t\t}", "public function add_css ( $filename )\n {\n\n \n if(substr($filename,0,1) != \"/\"){\n $path = basedir . $this->templatePath . 'css' . DS . $filename;\n $fileLoc = DS . $this->templatePath . 'css' . DS . $filename;\n } else {\n $path = basedir . $filename;\n $fileLoc = $filename;\n }\n if( in_array( $fileLoc, $this->css_files ) == true )\n {\n return null;\n }\n \n if( file_exists($path) == false )\n {\n /*------------ERROR------------*/\n // $this->reg->debug->error('Error','Function add_css()', 'Css file not found. File: '.$path, DateTime, $this);\n \n //log::write(\"Css file not found. File: `$path`\", $this, 'add_css()');\n return false;\n }\n $this->css_files[] = str_replace(\"\\\\\",\"/\", $fileLoc);\n $this->includeLibs();\n }", "function _creative_include_layout_additional_assets($file_name) {\n foreach (array('css', 'js') as $type) {\n $file_relative_path = CREATIVE_THEME_PATH . \"/$type/includes/$file_name.$type\";\n\n if (file_exists(DRUPAL_ROOT . '/' . $file_relative_path)) {\n call_user_func(\"drupal_add_$type\", $file_relative_path, array(\n 'group' => constant(strtoupper($type) . '_THEME'),\n ));\n }\n }\n}", "public function addCss($script) {\n\t\tLibraries::enqueueCss($script);\n\t}", "function additional_styles() {\n\t\tJetpack_Admin_Page::load_wrapper_styles();\n\t}", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }", "function findCssFiles();", "private function _include_css($file) {\n\t\treturn $this->EE->elements->_include_css($file);\n\t}", "protected function loadStylesheets()\n {\n if (!empty($GLOBALS['TBE_STYLES']['stylesheet'])) {\n $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet']);\n }\n if (!empty($GLOBALS['TBE_STYLES']['stylesheet2'])) {\n $this->pageRenderer->addCssFile($GLOBALS['TBE_STYLES']['stylesheet2']);\n }\n }", "function add_css($css, $append_path = TRUE)\r\n\t{\r\n\t $css = $this->append_ext($css, 'css', $append_path);\r\n\t \r\n\t if ( ! is_array($css)) \r\n\t {\r\n\t /* Assume its a string */\r\n\t $this->css_includes[] = $css;\r\n\t }\r\n\t else \r\n\t {\r\n\t $this->css_includes += $css;\r\n\t }\r\n\t \r\n\t return $this;\r\n\t}", "public function CSS($file,$hook=''){\n \n $file=$this->getFileName($file);\n $incl=pinCSSLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "public function addCssFile($name)\n {\n $this->fileStyles[] = $name;\n }", "public function add_css($css) {\n $current = $this->dwoo_data->css_files;\n $current[] = $css;\n $this->dwoo_data->css_files = $current;\n }", "public function attachCssFiles(&$args)\n {\n if ($this->isAppropriatePage($args['request'])) {\n $args['css'][] = str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath()) . '/css/styles.css';\n }\n }", "public function DefineCssResources()\n {\n $this->carabiner->css(array(\n array('assets/css/libs/bootstrap.css'),\n array('assets/css/views/normalize.css'),\n array('assets/css/libs/Chart.min.css')\n ));\n }", "function add_css() {\n // È possibile aggiungere un file css presente nella cartella del tema\n wp_register_style('normalize', get_template_directory_uri() . '/vendor/normalize/normalize.css', array(), null, 'all');\n wp_enqueue_style('normalize');\n wp_register_style('main', get_template_directory_uri() . '/css/main.css', array('normalize'), null, 'all');\n wp_enqueue_style('main');\n\n // È possibile anche aggiungere un url remoto (es. Google Fonts)\n // wp_register_style('webfont', 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,500,600,700,800,900', array(), null, 'all');\n // wp_enqueue_style('webfont');\n\n // Inoltre è possibile aggiungere un css solo se una determinata condizione è vera\n // In questo esempio aggiungiamo il file home.css solo se ci troviamo sulla pagina di home\n // if(is_home()) {\n // wp_register_style('home', get_template_directory_uri() . '/css/home.css', array(), null, 'all');\n // wp_enqueue_style('home');\n // }\n}", "public function addCSS($css) {\r\n\t\t\t$this->css.= \"<link rel='stylesheet' type='text/css' href='$css.css' >\";\r\n\t\t}", "function addExtraAssets()\n\t{\n\t\t$base = JURI::base(true);\n\t\t$regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';\n\n\t\tforeach (array(T3_PATH, T3_TEMPLATE_PATH) as $bpath) {\n\t\t\t//full path\n\t\t\t$afile = $bpath . '/etc/assets.xml';\n\t\t\tif (is_file($afile)) {\n\n\t\t\t\t//load xml\n\t\t\t\t$axml = JFactory::getXML($afile);\n\n\t\t\t\t//process if exist\n\t\t\t\tif ($axml) {\n\t\t\t\t\tforeach ($axml as $node => $nodevalue) {\n\t\t\t\t\t\t//ignore others node\n\t\t\t\t\t\tif ($node == 'stylesheets' || $node == 'scripts') {\n\t\t\t\t\t\t\tforeach ($nodevalue->file as $file) {\n\t\t\t\t\t\t\t\t$compatible = $file['compatible'];\n\t\t\t\t\t\t\t\tif ($compatible) {\n\t\t\t\t\t\t\t\t\t$parts = explode(' ', $compatible);\n\t\t\t\t\t\t\t\t\t$operator = '='; //exact equal to\n\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\tif (count($parts) == 2) {\n\t\t\t\t\t\t\t\t\t\t$operator = $parts[0];\n\t\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t//compare with Joomla version\n\t\t\t\t\t\t\t\t\tif (!version_compare(JVERSION, $operand, $operator)) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$url = (string)$file;\n\t\t\t\t\t\t\t\tif (substr($url, 0, 2) == '//') { //external link\n\n\t\t\t\t\t\t\t\t} else if ($url[0] == '/') { //absolute link from based folder\n\t\t\t\t\t\t\t\t\t$url = is_file(JPATH_ROOT . $url) ? $base . $url : false;\n\t\t\t\t\t\t\t\t} else if (!preg_match($regurl, $url)) { //not match a full url -> sure internal link\n\t\t\t\t\t\t\t\t\t$url = T3Path::getUrl($url); // so get it\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($url) {\n\t\t\t\t\t\t\t\t\tif ($node == 'stylesheets') {\n\t\t\t\t\t\t\t\t\t\t$this->addStylesheet($url);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->addScript($url);\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\n\t\t// template extended styles\n\t\t$aparams = $this->_tpl->params->toArray();\n\t\t$extras = array();\n\t\t$itemid = JFactory::getApplication()->input->get ('Itemid');\n\t\tforeach ($aparams as $name => $value) {\n\t\t\tif (preg_match ('/^theme_extras_(.+)$/', $name, $m)) {\n\t\t\t\t$extras[$m[1]] = $value;\n\t\t\t}\n\t\t}\n\t\tif (count ($extras)) {\n\t\t\tforeach ($extras as $extra => $pages) {\n\t\t\t\tif (!is_array($pages) || !count($pages) || in_array (0, $pages)) {\n\t\t\t\t\tcontinue; // disabled\n\t\t\t\t}\n\t\t\t\tif (in_array (-1, $pages) || in_array($itemid, $pages)) {\n\t\t\t\t\t// load this style\n\t\t\t\t\t$this->addCss ('extras/'.$extra);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addCssInclude($cssfiles)\n\t{\n\t\tif(!is_array($cssfiles))\n\t\t\t$cssfiles = array($cssfiles);\n\n\t\tforeach($cssfiles as $file)\n\t\t{\n\t\t\tif(!in_array($file, $this->cssIncludes))\n\t\t\t\t$this->cssIncludes[] = '<link href=\"' . $file . '\" rel=\"stylesheet\" type=\"text/css\"/>';\n \t\t}\n\t}", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN GLOBAL MANDATORY STYLES -->');\n foreach($this->assets_css['global'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n if (isset($this->assets_css['page_style']) && count($this->assets_css['page_style']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN PAGE STYLES -->');\n foreach($this->assets_css['page_style'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n\n // Webkit based browsers\n //$this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/webkit.css\" media=\"screen\" />');\n\n // Internet Explorer styles\n $this->template->append_metadata('<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie6.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie7.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie8.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 9]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie9.css\" media=\"screen\" /><![endif]-->');\n }", "public function getConcatenateCss() {}", "public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }", "protected function buildCssAndRegisterIcons() {}", "public function includeLibs()\n {\n $string = '';\n\n if($this->css_files)\n {\n foreach( $this->css_files as &$css_file )\n {\n $string .= '<link rel=\"stylesheet\" href=\"' . $css_file . '\" type=\"text/css\" />';\n }\n }\n \n if($this->js_files)\n {\n foreach( $this->js_files as &$js_file )\n {\n $string .= PHP_EOL . '<script src=\"' . $js_file . '\" type=\"text/javascript\"></script>';\n }\n }\n $this->tpl->assign(\"libs\", $string . PHP_EOL);\n }", "public function acfedu_add_css() {\n\t\t\t\twp_enqueue_style( 'acf-faculty-selector', plugins_url( 'assets/css/acf-faculty-selector.css', __FILE__ ) );\n\t\t\t}", "public function add_css($file)\n {\n $this->add(\"css\", $file);\n }", "public static function enteteCSS() {\r\n foreach (Page::getInstance()->css as $link) {\r\n ?>\r\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo $link; ?>\" />\r\n <?php\r\n }\r\n }", "function css_files() {\n\t\twp_enqueue_style('escalate_network-admin-global', $this->plugin_url .'/css/styles-admin-global.css');\n\t}", "public function hookHeader()\n {\n $this->context->controller->addCSS($this->_path.'/views/css/front.css');\n }", "static function emAddCssFile($cssPath, $media=\"all\", $levelStr=\"\") {\n\t$timestamp = filemtime( __DIR__ . \"/\" . $cssPath );\n self::$emHeader_line[] = \"<link rel='stylesheet' type='text/css' media='{$media}' href='{$levelStr}{$cssPath}?v={$timestamp}'>\";\n}", "public function includes() {\n \n include_once( 'widgets/carousel.php' );\n include_once( 'widgets/fancy-text.php' );\n include_once( 'widgets/grid.php' );\n include_once( 'widgets/maps.php' );\n include_once( 'widgets/pricing-table.php' );\n include_once( 'widgets/progress-bar.php' );\n include_once( 'widgets/vertical-scroll.php' );\n \n }", "static public function includeKekuleCssFiles($page = null)\n {\n global $PAGE;\n $p = $page;\n if (!isset($p))\n $p = $PAGE;\n\n $scriptDir = kekulejs_configs::getScriptDir();\n\t\t$kekuleScriptDir = kekulejs_configs::getKekuleScriptDir();\n try {\n $p->requires->css($kekuleScriptDir . 'themes/default/kekule.css');\n }\n catch(Exception $e)\n {\n // do nothing, just avoid exception\n }\n }", "protected function compileCss() {\r\n\t\tif(count($this->source_files) == 0) {\r\n\t\t\tfile_put_contents($this->result_file, \"\", FILE_APPEND);\r\n\t\t} else {\r\n\t\t\tforeach($this->source_files as $src_file) {\r\n\t\t\t\tfile_put_contents($this->result_file, file_get_contents($src_file) . PHP_EOL, FILE_APPEND);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function get_custom_css()\n {\n }", "function cookiebar_insert_head_css($flux){\n $flux .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.find_in_path(\"css/jquery.cookiebar.css\").'\" />';\n return $flux;\n}", "function sZThemeCustomCssSettings() {\n\t$customCssGroup = 'sZTheme-customCss-group';\n\t$page = 'sZThemeCustomCss';\n\taddSectionWithFields('customCssSection', 'Add your custom css', 'sZThemeCustomCssSection',\n\t $page, $customCssGroup,\n\t ['customCss'],\n\t ['customCss'],\n\t ['Insert your custom css here'],\n\t ['sZThemeCustomCss']);\n}", "private function _handleStyleBased()\n {\n if (Theme::getComponent()) {\n $css = $this->styleBasedCss[Theme::getComponent()->style];\n $this->css = ArrayHelper::merge($css, $this->css);\n }\n }", "function thememount_hook_dynamic_css(){\n\tob_start(); // begin collecting output\n\tinclude get_template_directory().'/css/dynamic-style.php';\n\t$css = ob_get_clean(); // retrieve output from myfile.php, stop buffering\n\t\n\t/* Now add the dynamic-style.php style in header */\n\t$output = \"<style> $css </style>\";\n\techo $output;\n}", "public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }", "private function _include_jscss()\n {\n if (!$this->cache['jscss'])\n {\n $styles = '<style type=\"text/css\">' . file_get_contents(PATH_THIRD . '/vz_regulator/assets/styles.min.css') . '</style>' . NL;\n $scripts = '<script type=\"text/javascript\">// <![CDATA[ ' . file_get_contents(PATH_THIRD . '/vz_regulator/assets/scripts.min.js') . ' // ]]></script>';\n $this->EE->cp->add_to_head($styles . $scripts);\n\n $this->cache['jscss'] = TRUE;\n }\n }", "static public function includeAdapterCssFiles($page = null)\n {\n global $PAGE;\n\n $p = $page;\n if (!isset($p))\n $p = $PAGE;\n $dir = kekulejs_configs::getAdapterDir();\n try {\n $p->requires->css($dir . 'kekuleMoodle.css');\n }\n catch(Exception $e)\n {\n // do nothing, just avoid exception\n }\n }", "function addcss()\n{\nwp_register_style('ahmed_css', plugin_dir_url(__file__).'/styles-ahmed.css');\nwp_enqueue_style('ahmed_css');\n}", "private function _getCSSIncludes () {\n $ret = array();\n foreach ($this->_styles as $stylesheet => $included) {\n if (!$included) {\n $this->_styles[$stylesheet] = true;\n array_push($ret, self::CSS_PATH . $stylesheet);\n }\n }\n\n return $ret;\n }", "protected function getContentCssFileNames() {}", "function incluirCSS($arquivo){ ?>\n\t\t<link href=\"css/<?=$arquivo?>.css\" rel=\"stylesheet\" type=\"text/css\"/>\n\t<?php }", "protected function loadStylesheets() {}", "public function registerStylesCommon() {\n $v = Wpjb_Project::VERSION;\n $p = plugins_url().'/wpjobboard/public/css/';\n $x = plugins_url().'/wpjobboard/application/vendor/';\n \n wp_register_style(\"wpjb-vendor-datepicker\", $x.\"date-picker/css/datepicker.css\");\n wp_register_style('wpjb-glyphs', $p.\"wpjb-glyphs.css\", array(), $v );\n wp_register_style('wpjb-stripe-elements', $p.\"wpjb-stripe-elements.css\", array(), $v );\n }", "function add_css($css, $tabs = 2)\n{\n /**\n * Add a css file into the html file.\n *\n * Args:\n * $css (str): the css file to add\n * $tabs (int): number of tabs for indentation, default is 2\n */\n Tab($tabs) ;\n echo \"<link rel='stylesheet' href='\" . $css . \"' />\" ;\n NL();\n}", "private function addToTheme()\n {\n static $addedResource = false;\n\n if ($this->activated && !$addedResource) {\n if (isset($GLOBALS['xoTheme'])) {\n /*\n $xoops = Xoops::getInstance();\n $head = '</style>' . $this->renderer->renderHead()\n . '<style>.icon-tags:before { content: \"\"; width: 16px; background-position: -25px -48px;}';\n $xoops->theme()->addStylesheet(null, null, $head);\n */\n $addedResource = true;\n }\n }\n }", "public function addStyling()\n {\n \\wp_enqueue_style(self::REACT_WP_THEME, \\get_template_directory_uri() . '/frontend/dist/style.css', [], '0.1');\n }", "protected function regStyles() {\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/bbcode/bbcode.css');\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/styles.css');\n }", "public function control_panel__add_to_head()\n\t{\n\t\tif ( URL::getCurrent(false) == '/publish' ) {\n\t\t\treturn $this->css->link('fileclerk.css');\n\t\t}\n\t}", "private function coreCss() {\n $corecss = '';\n $corecss .= ' <!-- CSS Files -->\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"assets/css/normalize.css\") . ' \">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/bootstrap.min.css\") . '\"/>\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/material-kit.css\") . '\"/>\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/animate.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/link-effects.css\") . '\">\n \n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/mdb/css/mdb.min62d0.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/Simple-Background-Carousel-Plugin-with-jQuery-and-Animate-css-Crosscover/dist/css/crosscover.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/x-hipster-as-f-cards-v1.1/assets/css/hipster_cards.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/Waves-master/dist/waves.min.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/odometer-master/odometer-theme-default.css\") . '\"> \n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/bootstrap-select-1.10.0/dist/css/bootstrap-select.css\") . '\"> \n \n ';\n\n return $corecss;\n }", "protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo( \"buttonBar.css\", dirname(__FILE__) . \"/assets\" );\n $this->addGradientAssets(array(\n $this->gradient, $this->hoverGradient,\n $this->activeGradient, $this->selectedGradient,\n $this->separatorGradient, $this->selectedColor\n ));\n }", "private static function addCSS(Zend_View $view, $css){\n\t\t\n\t\t// Custom XML file inclusion of the css files\r\n\t\tif (! empty ( $css )) {\r\n\t\t\tforeach ( $css as $item ) {\r\n\t\t\t\t$view->headLink ()->appendStylesheet ( $item );\r\n\t\t\t}\r\n\t\t}\n\t}", "function css_add(){\n\t\t\tif($_GET['csv']==true) : \t\t\t\n\t\t\t\t$url = dirname(__FILE__) ;\n\t\t\t\tpreg_match('/\\/wp-content.+$/',$url,$c);\n\t\t\t\t$link = get_option('home').$c[0].'/css/style.css';\t\t\t\t\t\n\t\t\t\techo \"<link rel='stylesheet' href='$link' media='all' type='text/css' />\" ;\n\t\t\tendif;\n\t\t\t\n\t\t}", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "function add_external_css($css_files, $path = NULL)\n {\n // make sure that $this->includes has array value\n if ( ! is_array( $this->includes ) )\n $this->includes = array();\n\n // if $css_files is string, then convert into array\n $css_files = is_array( $css_files ) ? $css_files : explode( \",\", $css_files );\n\n foreach( $css_files as $css )\n {\n // remove white space if any\n $css = trim( $css );\n\n // go to next when passing empty space\n if ( empty( $css ) ) continue;\n\n // using sha1( $css ) as a key to prevent duplicate css to be included\n $this->includes[ 'css_files' ][ sha1( $css ) ] = is_null( $path ) ? $css : $path . $css;\n }\n\n return $this;\n }", "public function addStyleSheet($filePath) {\n $this->addToHead(\"<link rel=\\\"stylesheet\\\" href=\\\"\" . $filePath . \"\\\">\",\n Page::BOTTOM);\n }" ]
[ "0.7482562", "0.73911756", "0.737888", "0.717975", "0.6895742", "0.68904936", "0.67401874", "0.6705795", "0.6695434", "0.6636185", "0.66056615", "0.6574081", "0.65594566", "0.65518844", "0.65243447", "0.651873", "0.6508076", "0.6494618", "0.64936703", "0.64838713", "0.64815813", "0.6450583", "0.6425174", "0.6406314", "0.63926905", "0.6384143", "0.6380748", "0.63625145", "0.6357146", "0.63356954", "0.6324086", "0.6305077", "0.6298485", "0.62878263", "0.6265741", "0.6261707", "0.62109494", "0.62012273", "0.61884737", "0.6154589", "0.6142876", "0.61267906", "0.61166686", "0.6091942", "0.6088426", "0.60660666", "0.6062104", "0.6056265", "0.60545415", "0.6047957", "0.6041304", "0.60361165", "0.60282695", "0.60161495", "0.6010652", "0.599484", "0.59844255", "0.5978735", "0.5969487", "0.5959408", "0.5953671", "0.5928624", "0.59286237", "0.59226286", "0.59216225", "0.5916053", "0.5906519", "0.5888067", "0.5874349", "0.58614916", "0.58553857", "0.585209", "0.58520484", "0.5848551", "0.5845817", "0.5845232", "0.5840758", "0.5829063", "0.5814434", "0.5803961", "0.5802099", "0.58019125", "0.58011025", "0.57990557", "0.579377", "0.5791979", "0.57865006", "0.57773757", "0.57443655", "0.57418936", "0.57367647", "0.5735718", "0.5733957", "0.57319164", "0.57266176", "0.57224435", "0.57202196", "0.5715649", "0.5710567", "0.5708983" ]
0.63872313
25
Render and return all includes of CSS.
public function renderIncludes($media = 'all') { $_ret = "\n"; $already_used = array(); foreach($this->needed_css_include as $i) { if (!in_array($i, $already_used)) { $_ret .= '<link rel="stylesheet" type="text/css" media="'.$media.'" href="'.$i.'" />'."\n"; array_push($already_used, $i); } } return $_ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_css () {\n $buffer = '';\n if (count($this->css_files)) {\n foreach ($this->css_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<link rel=\"stylesheet\" href=\"'.base_url($file).'\">';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }", "public function css_includes()\n {\n }", "private function _print_html_head_css()\n\t{\n\t\t$output = \"\";\n\t\t\n\t\t//Check if theme defined\n\t\t$theme = ($this->theme) ? $this->theme : '';\n\t\t\n\t\tforeach($this->css as $style) {\n\t\t\t$skip = FALSE;\n\t\t\t\n\t\t\t$partpath = (strpos($style, '.css') === FALSE) ? \"{$theme}css/{$style}.css\" : \"/{$style}\";\n\t\t\t$fullpath = Ashtree_Common::get_real_path($partpath, TRUE);\n\t\t\t$this->_debug->log(\"INFO\", \"Including stylesheet '{$fullpath}'\");\n\t\t\t\n\t\t\tif (!file_exists($fullpath)) {\n\t\t\t\t$this->_debug->status('ABORT');\n\t\t\t\t\n\t\t\t\t$partpath = \"css/{$style}.css\";\n\t\t\t\t$fullpath = ASH_BASEPATH . $partpath;\n\t\t\t\t$this->_debug->log(\"INFO\", \"Including stylesheet '{$fullpath}'\");\n\t\t\t\n\t\t\t\tif (!file_exists($partpath)) {\n\t\t\t\t $skip = TRUE;\n\t\t\t\t} else {\n\t\t\t\t $this->_debug->clear();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($skip) {\n\t\t\t\t$this->_debug->status('ABORT');\n\t\t\t} else {\n\t\t\t\t$this->_debug->status('OK');\n\t\t\t\t$fullpath = Ashtree_Common::get_real_path($fullpath);\n\t\t\t\t$output .= \"<link type=\\\"text/css\\\" media=\\\"screen\\\" rel=\\\"stylesheet\\\" href=\\\"{$fullpath}\\\" />\\n\";\n\t\t\t}\n\t\t\t\n\t\t}//foreach\n\t\t\n\t\t$output .= \"<style type=\\\"text/css\\\">\\n\";\n\t\t\n\t\tforeach($this->style as $style) {\n\t\t\t$output .= \"\\t{$style}\\n\";\n\t\t}//foreach\n\t\t\n\t\t$output .= \"</style>\\n\";\n\t\t\n\t\treturn $output;\n\t}", "public function renderCSS()\n {\n }", "function loadCSS() {\n\t\t$first = true;\n\t\t$cssPart = '';\n\t\tforeach( $this->conf->css->file as $file ) {\n\t\t\tif( ! $first ) {\n\t\t\t\t$cssPart .= chr( 9 );\n\t\t\t}\n\t\t\t$cssPart .= '<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"';\n\t\t\t$cssPart .= $this->conf->path->baseUrl . $this->conf->path->css . $file;\n\t\t\t$cssPart .= '\" />' . chr( 10 );\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\tif( count( $this->additionalCSS ) >= 1 ) {\n\t\t\tforeach( $this->additionalCSS as $key => $value ) {\n\t\t\t\t$cssPart .= '<style type=\"text/css\">' . chr( 10 );\n\t\t\t\t$cssPart .= $value . chr( 10 );\n\t\t\t\t$cssPart .= '</style>' . chr( 10 );\n\t\t\t}\n\t\t\n\t\t}\n\t\treturn $cssPart;\n\t}", "function output_css() {\n\t\t\techo $this->get_css();\n\t\t}", "public static function mergeCSS()\n {\n if ((class_exists('Kohana') AND Kohana::$environment !== Kohana::PRODUCTION) OR\n (!file_exists('cache'.DIRECTORY_SEPARATOR.'css')))\n {\n return static::renderCSS();\n }\n\n $content = '';\n $files = '';\n\n sort(static::$_css);\n\n foreach (static::$_css as $src)\n {\n if (in_array($src, static::$_cssNoMerge)) continue;\n\n $files .= $src.PHP_EOL;\n }\n\n $fileName = 'style'.md5($files).'.css';\n $path = 'cache'.DIRECTORY_SEPARATOR.'css'.DIRECTORY_SEPARATOR.$fileName;\n\n if (!file_exists($path))\n {\n foreach (static::$_css as $src)\n {\n if (in_array($src, static::$_cssNoMerge)) continue;\n\n try\n {\n $content .= file_get_contents($src).PHP_EOL.PHP_EOL.'/* --- */'.PHP_EOL.PHP_EOL;\n }\n catch (Exception $e) {}\n }\n\n file_put_contents($path, $content);\n }\n\n //return PHP_EOL.HTML::style(URL::site('cache/css/'.$fileName)).static::_renderCSS(static::$_cssNoMerge);\n //return PHP_EOL.HTML::style(URL::site('cache/css/'.$fileName.'?'.date('Y-m-d'))).static::_renderCSS(static::$_cssNoMerge);\n return PHP_EOL.HTML::style(URL::site('cache/css/'.$fileName.'?'.static::$buildVersion)).static::_renderCSS(static::$_cssNoMerge);\n }", "public function css()\n {\n $dir = new \\Ninja\\Directory(NINJA_DOCROOT . 'public/');\n /**\n * @var $files \\Ninja\\File[]\n */\n $files = $dir->scanRecursive(\"*.css\");\n\n echo \"\\nMinifying Css Files...\\n\";\n foreach($files as $sourceFile)\n {\n // Skip all foo.#.js (e.g foo.52.js) which are files from a previous build\n if (is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)))\n continue;\n\n /**\n * @var $destFile \\Ninja\\File\n */\n $destFile = $sourceFile->getParent()->ensureFile($sourceFile->getName(true) . '.' . self::REVISION . '.' . $sourceFile->getExtension());\n\n $destFile->write(\\Minify_Css::process($sourceFile->read()));\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n\n unset($sourceFile);\n }\n }", "private function _getCSSIncludes () {\n $ret = array();\n foreach ($this->_styles as $stylesheet => $included) {\n if (!$included) {\n $this->_styles[$stylesheet] = true;\n array_push($ret, self::CSS_PATH . $stylesheet);\n }\n }\n\n return $ret;\n }", "protected function renderCssLibraries() {}", "protected function generateCSS() {}", "public static function enteteCSS() {\r\n foreach (Page::getInstance()->css as $link) {\r\n ?>\r\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo $link; ?>\" />\r\n <?php\r\n }\r\n }", "protected function renderStylesheets()\n {\n $output = '';\n foreach ($this->stylesheets as $id => $stylesheet) {\n $output .= '<link rel=\"stylesheet\"';\n $output .= ' id=\"' . $id . '\"';\n $output .= ' href=\"' . $stylesheet['url'] . '\"';\n $output .= ' type=\"text/css\"';\n $output .= ' media=\"' . $stylesheet['media'] . '\"';\n $output .= '/>' . \"\\n\";\n }\n\n return $output;\n }", "public function getCssIncludes() {\n return $this->cssIncludes;\n }", "protected function doConcatenateCss() {}", "private function _include_css()\n {\n if ( !$this->cache['css'] )\n {\n $this->EE->cp->add_to_head('<style type=\"text/css\">\n .vz_range { padding-bottom:0.5em; }\n .vz_range input { width:97%; padding:4px; }\n .vz_range_min { float:left; width:46%; }\n .vz_range_max { float:right; width:46%; }\n .vz_range_sep { float:left; width:8%; text-align:center; line-height:2; }\n</style>');\n\n $this->cache['css'] = TRUE;\n }\n }", "protected function loadCss() {}", "public function css()\n {\n $assets = array();\n foreach (Config::get('ImageUpload::assets.css') as $file) {\n $assets[] = new FileAsset(public_path($this->assetPath.'css/'.$file));\n }\n $css = new AssetCollection($assets, array(\n new CssMinFilter(),\n ));\n\n $response = Response::make($css->dump(), 200);\n $response->header('Content-Type', 'text/css');\n return $response;\n }", "public function include_css($env) {\n global $CFG;\n $css = '';\n $cssurl = $CFG->dirroot . '/course/format/ludimoodle/motivators/' . $this->get_short_name() . '/styles.css';\n\n // We can't require css like this in format because <head> is already closed\n //$page = $env->get_page();\n //$page->requires->css($cssurl);\n\n // if css is not already in page\n if (file_exists($cssurl) && (!in_array($cssurl, $env->cssinitdata))) {\n // mark that this css is in page\n $env->cssinitdata[] = $cssurl;\n $css = '<style>' . file_get_contents($cssurl) . '</style>';\n }\n return $css;\n }", "public static function css();", "protected function _css()\n\t{\n\t\tif ( !self::$_firstRun ) return '';\n\t\tself::$_firstRun = FALSE;\n\n\t\t$dir = KINT_DIR . 'view/' . ( self::$devel ? 'src/' : '' ); // load uncompressed sources if in devel mode\n\n\t\treturn '<script>' . file_get_contents( $dir . 'kint.js' ) . '</script>'\n\t\t\t. '<style>' . file_get_contents( $dir . 'kint.css' ) . '</style>';\n\t}", "protected function addCSS() {\n foreach ($this->css_files as $css_file) {\n $this->header.=\"<link rel='stylesheet' href='\" . __ASSETS_PATH . \"/\" . $css_file . \"'/> \\n\";\n }\n }", "private function _compile_css(){\n\t\t$compiled_css = \"\";\n\t\tforeach($this->css as $css_file){\n\t\t\t$compiled_css .= \"\\t<link rel=\\\"stylesheet\\\" href=\\\"\".$this->assets_url('css').\"/{$css_file}.css\\\" />\\n\";\n\t\t}\n\t\t\n\t\tif ($compiled_css == \"\") return \"\";\n\n\t\treturn \"<!-- START Compiled CSS -->\\n\".$compiled_css.\"\\t<!-- END Compiled CSS -->\\n\";\n\t}", "function stylesheets() {\n $sheets = func_get_args();\n foreach($this->included_stylesheets as $name) $sheets[] = $name;\n return $this->context->stylesheet_links($sheets, $this->base_url().\"/stylesheets\");\n }", "public function build_css() {\n\t\t\t\n\t\t}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "function head_css()\n\t{\n\t\tqa_html_theme_base::head_css();\n\t\t// if if already added widgets have a css file activated\n\t\t$styles = array();\n\t\tforeach ($this->content['widgets'] as $region_key => $regions) {\n\t\t\tforeach ($regions as $template_key => $widgets) {\n\t\t\t\t$position = strtoupper(substr($region_key,0,1) . substr($template_key,0,1) );\n\t\t\t\tforeach ($widgets as $key => $widget) {\n\t\t\t\t\t$widget_name = get_class ($widget);\n\t\t\t\t\t$widget_key = $widget_name.'_'.$position;\n\t\t\t\t\t$file = get_widget_option($widget_key, 'uw_styles');\n\t\t\t\t\t// if file existed then put it into an array to prevent duplications\n\t\t\t\t\tif($file)\n\t\t\t\t\t\t$styles[$widget_name][$file]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add styling files to theme\n\t\tif($styles)\n\t\t\tforeach ($styles as $widget_name => $files)\n\t\t\t\tforeach ($files as $file => $verified)\n\t\t\t\t\tif( $file != 'none' )\n\t\t\t\t\t\t$this->output('<link rel=\"stylesheet\" href=\"'.UW_URL.'widgets/'.$widget_name.'/styles/'.$file.'\"/>');\n\t}", "public function css() {\r\r\n\r\r\n // $scss = new scssc();\r\r\n // $scss->setImportPaths(\"css/\");\r\r\n // $scss->setFormatter(\"scss_formatter_compressed\");\r\r\n // $dir = $_SERVER['DOCUMENT_ROOT'].\"/css/\";\r\r\n // $server = new scss_server($dir, $this->config->config['cache_path'].'resources', $scss);\r\r\n // $server->serve('', $name);\r\r\n\r\r\n $scss = new scssc();\r\r\n $scss->setFormatter(\"scss_formatter_compressed\");\r\r\n\r\r\n $source = '';\r\r\n $cache_path = $this->config->config['cache_path'].'resources';\r\r\n $file_cache = $cache_path.'/styles.css';\r\r\n\r\r\n $mtime_cache = (file_exists($file_cache)) ? filemtime($file_cache) : 0;\r\r\n $mtime_files = 0;\r\r\n\r\r\n foreach($this->config->config['css_site'] as $file) {\r\r\n if(pathinfo($file, PATHINFO_EXTENSION) === 'scss') {\r\r\n\r\r\n $scss->last_modified = filemtime($file);\r\r\n $scss->compile('@import \"'.$file.'\"');\r\r\n if($mtime_files < $scss->last_modified) {\r\r\n $mtime_files =$scss->last_modified;\r\r\n }\r\r\n\r\r\n } else {\r\r\n if($mtime_files < filemtime($file)) {\r\r\n $mtime_files = filemtime($file);\r\r\n }\r\r\n }\r\r\n }\r\r\n\r\r\n if($mtime_cache > $mtime_files) {\r\r\n header(\"Content-Type: text/css\");\r\r\n $lastModified = gmdate('D, d M Y H:i:s', $mtime_cache) . ' GMT';\r\r\n header('Last-Modified: ' . $lastModified);\r\r\n echo file_get_contents($file_cache);\r\r\n\r\r\n return;\r\r\n }\r\r\n\r\r\n $t = @date('r');\r\r\n\r\r\n foreach($this->config->config['css_site'] as $file) {\r\r\n if(pathinfo($file, PATHINFO_EXTENSION) === 'scss') {\r\r\n $source .= $scss->compile('@import \"'.$file.'\"');\r\r\n } else {\r\r\n $source .= $scss->compile(file_get_contents($file));\r\r\n }\r\r\n }\r\r\n\r\r\n $source = \"/* generated by trivy on \".@date('r').\" */\\n\\n\" . $source;\r\r\n\r\r\n $file = fopen($file_cache, 'w+');\r\r\n fwrite($file, $source);\r\r\n fclose($file);\r\r\n $mtime_cache = filemtime($file_cache);\r\r\n\r\r\n header(\"Content-Type: text/css\");\r\r\n $lastModified = gmdate('D, d M Y H:i:s', $mtime_cache) . ' GMT';\r\r\n header('Last-Modified: ' . $lastModified);\r\r\n echo $source;\r\r\n }", "public function getCompiled()\n {\n $output = '';\n $host = $this->config->getItem('website', 'host', '');\n if ($host != '') {\n $host = 'http://' . $host;\n if (substr($host, -1) !== '/') {\n $host .= '/';\n }\n }\n foreach ($this->files as $file) {\n $output .= '<link rel=\"stylesheet\" href=\"' . $host . $file . '\" />';\n }\n return $output;\n }", "function includeCss($fileName) {\n $data = '<link type=\"text/css\" rel=\"Stylesheet\" href=\"'.BASE_PATH.'/public/css/'.$fileName.'.css\" />';\n return $data;\n }", "public function getConcatenateCss() {}", "function show_all_styles() {\n\tglobal $wp_styles;\n\t\n\t// arrange the queue based on its dependency\n\t$wp_styles->all_deps($wp_styles->queue);\t\n\t\n\t// The result\n\t$handles = $wp_styles->to_do;\n\t\n\t$css_code = '';\n\n\t// New file location: E:xampp\\htdocs\\wordpress\\wp-content\\theme\\wdc\\merged-style.css\n\t$merged_file_location = get_stylesheet_directory() .'/_/css/merged-style.css';\n\t$merged_file = file_get_contents($merged_file_location);\n\t//echo '<pre>';print_r($wp_styles->queue);echo '</pre>';\n\t// loop all styles\n\tforeach ($handles as $handle)\n\t{\n\t\t/*\n\t\t\tClean up the url, for example: wp-content/themes/wdc/style.min.css?v=4.6\n\t\t\tbecome wp-content/themes/wdc/style.min.css\n\t\t*/\n\t\t$src = strtok($wp_styles->registered[$handle]->src, '?');\n\t\t\n\t\t// #1. Combine CSS File.\n\t\t// If the src is url\t\t\n\t\tif (strpos($src, 'http') !== false || strpos($src, 'https') !== false) {\n\t\t\t// Get thr site url, e.g. http://webdevzoom.com/wordpress\n\t\t\t$site_url = site_url();\n\t\t\n\t\t\t/*\n\t\t\t\tIf the css file come from local server, change the full url into relative path\n\t\t\t\tFor example: http://webdevzoom.com/wordpress/wp-content/plugins/wpnewsman/css/menuicon.css\n\t\t\t\tBecome: /wp-content/plugins/wpnewsman/css/menuicon.css\n\t\t\t\t\n\t\t\t\tOtherwise, leave it as is, e.g: https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\n\t\t\t*/\n\t\t\tif (strpos($src, $site_url) !== false)\n\t\t\t\t$css_file_path = str_replace($site_url, '', $src);\n\t\t\telse\n\t\t\t\t$css_file_path = $src;\n\t\t\t\n\t\t\t/*\n\t\t\t\tIn order to be able to use file_get_contents function, we need to remove preceding slash,\n\t\t\t\tFor example: /wp-content/plugins/wpnewsman/css/menuicon.css\n\t\t\t\tBecome: wp-content/plugins/wpnewsman/css/menuicon.css\n\t\t\t*/\n\t\t\t$css_file_path = ltrim($css_file_path, '/');\n\t\t} else {\t\t\t\n\t\t\t$css_file_path = ltrim($src, '/');\n\t\t}\n\t\t\n\t\t// Check wether file exists then merge\n\t\tif (file_exists($css_file_path)) {\n\t\t\t$css_code .= file_get_contents($css_file_path);\n\t\t}\n\t}\n\n\t// write the merged styles into current theme directory\n\tif ($merged_file != $css_code) {\n\tfile_put_contents ($merged_file_location , $css_code);\n\t}\n\t\n\t// #2. Load the URL of merged file\n\twp_enqueue_style('merged-style', get_stylesheet_directory_uri() . '/_/css/merged-style.css');\n\t\n\t// #3. Deregister all handles\n\tforeach ($handles as $handle)\n\t{\n\t\twp_deregister_style($handle);\n\t}\n\n\t\n}", "public function showCss()\n {\n $addon_css = $this->css->url('pagelinks.css');\n $output = '<link rel=\"stylesheet\" href=\"' . $addon_css . '\">';\n $output .= '<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css\">';\n\n return $output;\n\n }", "public function css();", "public function getCss();", "public function getCss();", "public function styles() {\n $styles = array();\n if (\\File::isDirectory(public_path('assets/fontello/css'))) {\n foreach (glob(public_path('assets/fontello/css/') . '*', GLOB_BRACE) as $path) {\n $file = explode('/', $path);\n $styles[] = \\HTML::style('public/assets/fontello/css/' . end($file));\n }\n\n return join(\"\\n\", $styles);\n }\n }", "function css($args) {\n\t\t//Determine the current theme location\n\t\t$theme_location = $this->theme_location;\n\t\t$file_location = $theme_location . '/static/css/' . implode('/', $args);\n\t\t// Maybe check for a less file to compile and compile it\n\t\t$this->less_check($file_location);\n\n\n\t\tif (file_exists($file_location)) {\n\t\t\theader(\"Content-Type: text/css\");\n\t\t\theader(\"X-Content-Type-Options: nosniff\");\n\t\t\theader(\"Access-Control-Allow-Origin:*\");\n\t\t\theader('Cache-Control:public, max-age=30672000');\n\n\t\t\techo file_get_contents($file_location);\n\t\t\tdie();\n\t\t} else {\n\t\t\t$this->_404();\n\t\t\tdie();\n\t\t}\n\t}", "function print_css_includes($extras = array())\r\n\t{\r\n\t foreach ($extras as $key => $extra)\r\n\t {\r\n\t $extras[$key] = $this->append_ext($extra, 'css');\r\n\t }\r\n\t \r\n\t $string = \"\";\r\n\t foreach ($extras as $css) \r\n\t {\r\n\t $string .= '<link href=\"' . $css . '\" rel=\"stylesheet\" type=\"text/css\" />' . \"\\n\";\r\n\t }\r\n\t \r\n\t foreach ($this->css_includes as $css) \r\n\t {\r\n\t $string .= '<link href=\"' . $css . '\" rel=\"stylesheet\" type=\"text/css\" />' . \"\\n\";\r\n\t }\r\n\t \r\n\t return $string;\r\n\t}", "function allLoadCss($path){\n \n $diretorio = dir($path);\n\n while($arquivo = $diretorio -> read()){\n //verifica apenas as extenções do css \n if(strpos($arquivo, '.css')!==FALSE)\n echo (\"<link rel='stylesheet' href='\".BARRA.url_base.BARRA.$path.$arquivo.\"' type='text/css' />\\n\");\n }\n $diretorio -> close();\n\n }", "protected function renderJavaScriptAndCss() {}", "function generate_css() {\r\n global $config;\r\n\r\n $res = '';\r\n foreach ($config['css']as $v) {\r\n $res .= \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"$v\\\"/>\";\r\n }\r\n return $res;\r\n}", "public function css() {\n\t\theader(\"Content-Type: text/css\");\n\t\techo file_get_contents(APPPATH.'third_party/blog/css/mojoblog.css');\n\t}", "public function formatCSS() {\n echo $this->head;\n echo \"<link rel='stylesheet' href='desktop.css'>\";\n }", "public function automaticCss()\n \t{\n \t\t$css = array();\n \t\tif (isset($this->pluginPath)) {\n\t \t\t\n\t \t\t# CSS Plugin Path\n\t\t\t$css_path_plugin = $this->pluginPath . $this->constant['webroot'] . DS . $this->constant['cssBaseUrl'];\n\t\t\tif (is_file($css_path_plugin . $this->controller . '.css')) {\n\t\t \t$css[] = $this->plugin.'.'.$this->controller;\n\t\t \t}\n\n\t\t \tif (is_file($css_path_plugin . $this->controller . DS . $this->action . '.css')) {\n\t\t \t$css[] = $this->plugin.'.'.$this->controller . '/' . $this->action;\n\t\t \t}\n \t\t}\n \t\t\n \t\t$css_path = $this->constant['www_root'] . $this->constant['cssBaseUrl'];\n \t\tif (is_file($css_path . $this->controller . '.css')) {\n\t \t$css[] = $this->controller;\n\t\t}\n\n\t \tif (is_file($css_path . $this->controller . DS . $this->action . '.css')) {\n\t \t$css[] = $this->controller . DS . $this->action;\n\t\t}\n\t\treturn $this->css($css);\n \t}", "public static function css() {\r\n\t\t\t$s = '';\r\n\t\t\tforeach(func_get_args() as $css) {\r\n\t\t\t\t$file = WEB_ROOT . '/' . $css;\r\n\t\t\t\tif(!file_exists($file)) {\r\n\t\t\t\t\tABPF::logger()->error(\"CSS file $file doesn't exist!\");\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t$v = filemtime($file);\r\n\t\t\t\t$s .= sprintf('<link rel=\"stylesheet\" type=\"text/css\" href=\"%s/%s?v=%d\" />', BASE_URL, $css, $v);\r\n\t\t\t}\r\n\t\t\treturn $s;\r\n\t\t}", "function include_css( $strfilename, $params=NULL ){ \n\treturn CIncludeFiles :: includefiles( \"CIncludeCSSFiles\", $strfilename, $params );\t\n}", "public function styles() {\n $this->addStyle(CORE_WWW_ROOT.\"ressources/css/externals/bootstrap.core.min.css\", true);\n\n\n $this->addStyle($this->directory().\"css/reset.less\");\n $this->addStyle($this->directory().\"css/animations.less\");\n $this->addStyle($this->directory().\"css/main.less\");\n $this->addStyle($this->directory().\"css/overlay.less\");\n $this->addStyle($this->directory().\"css/header.less\");\n $this->addStyle($this->directory().\"css/footer.less\");\n\n // externals\n $this->addStyle(\"//fonts.googleapis.com/css?family=Lora:400,400i,700,700i\", true);\n $this->addStyle('//fonts.googleapis.com/css?family=Roboto:700', true);\n\n // blocks\n $this->addStyle($this->directory().\"css/blocks/rd_arrow.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_button.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_bigteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_smallteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_longtext.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_forms.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_listings.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_collection.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_components.less\");\n\n $this->addStyle($this->directory().\"css/responsive.less\");\n }", "function findCssFiles();", "protected function renderStylesheet(){\n \n return sprintf(\n '<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\" media=\"%s\">',\n $this->getField('url'),\n $this->getField('media','screen, projection')\n );\n \n }", "function _asset_css_all(string $pack = '') {\n\t\treturn Asset::setThemePack($pack)->getCssAll();\n\t}", "protected function compileCss() {\r\n\t\tif(count($this->source_files) == 0) {\r\n\t\t\tfile_put_contents($this->result_file, \"\", FILE_APPEND);\r\n\t\t} else {\r\n\t\t\tforeach($this->source_files as $src_file) {\r\n\t\t\t\tfile_put_contents($this->result_file, file_get_contents($src_file) . PHP_EOL, FILE_APPEND);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function getAllCSS()\n {\n return $this->css;\n }", "public function assets_css() {\n \n $data = '<link rel=\"stylesheet\" type=\"text/css\" href=\"//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.css?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\";\n $data .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . base_url() . 'assets/apps/dashboard/styles/css/dashboard.css?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\";\n \n if ( $this->css_urls_widgets ) {\n \n foreach ( $this->css_urls_widgets as $url ) {\n \n $data .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $url . '?ver=' . MD_VER . '\" media=\"all\"/> ';\n $data .= \"\\n\"; \n \n }\n \n }\n \n return $data;\n \n }", "public function render()\n\t{\n\t\t// get stylehseet base & source\n\t\t$base = (isset($this->params->base)) ? strtolower($this->params->base) : 'uploads';\n\t\t$source = (isset($this->params->source)) ? trim($this->params->source) : null;\n\n\t\t// if we want base to be template,\n\t\t// shortcut to template/assets/css folder\n\t\tif ($base == 'template')\n\t\t{\n\t\t\t$base = 'template' . DS . 'assets' . DS . 'js';\n\t\t}\n\n\t\t// we must have a source\n\t\tif ($source === null)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// get download path for source (serve up file)\n\t\tif ($path = $this->group->downloadLinkForPath($base, $source))\n\t\t{\n\t\t\t// add stylsheet to document\n\t\t\t\\Document::addScript($path);\n\t\t}\n\t}", "public function css(){\n if (func_num_args() > 0){\n for ($i = 0; $i < func_num_args(); $i++){\n $arg = func_get_arg($i); // Fatal error: func_get_arg(): Can't be used as a function parameter\n if (preg_match('/^(.+)\\[(.+)\\]$/', $arg, $matches)){\n $filename = $matches[1];\n $media = $matches[2];\n } else {\n $filename = $arg;\n $media = 'screen,projection';\n }\n \n array_push($this->css, $this->stylesheet_tag($filename, $media));\n }\n }\n \n return join($this->css, \"\\n\");\n }", "public function print_includes() {\r\n $final_includes = '';\r\n\r\n foreach ($this->includes as $include) {\r\n // Check if it's a JS or a CSS file \r\n if (preg_match('/js$/', $include)) {\r\n // It's a JS file \r\n $final_includes .= '<script type=\"text/javascript\" src=\"' . $include . '\"></script>';\r\n } elseif (preg_match('/css$/', $include)) {\r\n // It's a CSS file \r\n $final_includes .= '<link href=\"' . $include . '\" rel=\"stylesheet\" type=\"text/css\" />';\r\n }\r\n\r\n return $final_includes;\r\n }\r\n }", "function css(){\n//\techo \"<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300' rel='stylesheet' type='text/css'>\\n\";\n\techo \"<style>\";\n\techo \"\\n\";\n\techo file_get_contents('./css/style.css');\n\techo \"</style>\";\n\techo \"\\n\";\n}", "static public function getCssContent($file)\n {\n // Don't try to parse empty (or non-existing) files\n if (empty($file)) return null;\n\n // Skip files that have already been included\n static $files = array();\n if (in_array($file, $files)) {\n return null;\n } else {\n $files[] = $file;\n }\n\n // Initialize the buffer\n $buffer = @file_get_contents($file);\n if (empty($buffer)) return null;\n\n // Initialize the basepath\n $basefile = ScriptMergeHelper::getFileUrl($file, false);\n\n // Follow all @import rules\n if (ScriptMergeHelper::getParams()->get('follow_imports', 1) == 1) {\n if (preg_match_all('/@import\\ url\\((.*)\\);/i', $buffer, $matches)) {\n foreach ($matches[1] as $index => $match) {\n\n // Strip quotes\n $match = str_replace('\\'', '', $match);\n $match = str_replace('\"', '', $match);\n\n $importFile = ScriptMergeHelper::getFilePath($match, $file);\n if (empty($importFile) && strstr($importFile, '/') == false) $importFile = dirname($file).'/'.$match;\n $importBuffer = ScriptMergeHelper::getCssContent($importFile);\n\n if (!empty($importBuffer)) {\n $buffer = str_replace($matches[0][$index], \"\\n\".$importBuffer.\"\\n\", $buffer);\n } else {\n $buffer = \"\\n/* ScriptMerge error: CSS import of $importFile returned empty */\\n\\n\".$buffer;\n }\n }\n }\n }\n\n // Replace all relative paths with absolute paths\n if (preg_match_all('/url\\(([^\\(]+)\\)/i', $buffer, $url_matches)) {\n foreach ($url_matches[1] as $url_index => $url_match) {\n\n // Strip quotes\n $url_match = str_replace('\\'', '', $url_match);\n $url_match = str_replace('\"', '', $url_match);\n\n // Skip CSS-stylesheets which need to be followed differently anyway\n if (strstr($url_match, '.css')) continue;\n\n // Skip URLs and data-URIs\n if (preg_match('/^(http|https):\\/\\//', $url_match)) continue;\n if (preg_match('/^\\/\\//', $url_match)) continue;\n if (preg_match('/^data\\:/', $url_match)) continue;\n\n // Normalize this path\n $url_match_path = ScriptMergeHelper::getFilePath($url_match, $file);\n if (empty($url_match_path) && strstr($url_match, '/') == false) $url_match_path = dirname($file).'/'.$url_match;\n if (!empty($url_match_path)) $url_match = ScriptMergeHelper::getFileUrl($url_match_path);\n \n // Include data-URIs in CSS as well\n if (ScriptMergeHelper::getParams()->get('data_uris', 0) == 1) {\n $imageContent = ScriptMergeHelper::getDataUri($url_match_path);\n if (!empty($imageContent)) {\n $url_match = $imageContent;\n }\n }\n\n $buffer = str_replace($url_matches[0][$url_index], 'url('.$url_match.')', $buffer);\n }\n }\n\n // Detect PNG-images and try to replace them with WebP-images\n if (preg_match_all('/([a-zA-Z0-9\\-\\_\\/]+)\\.(png|jpg|jpeg)/i', $buffer, $matches)) {\n foreach ($matches[0] as $index => $image) {\n $webp = ScriptMergeHelper::getWebpImage($image);\n if ($webp != false && !empty($webp)) {\n $buffer = str_replace($image, $webp, $buffer);\n } \n }\n }\n\n // If compression is enabled\n $compress_css = ScriptMergeHelper::getParams()->get('compress_css', 0);\n if ($compress_css > 0) {\n\n switch ($compress_css) {\n\n case 1: \n $buffer = preg_replace('#[\\r\\n\\t\\s]+//[^\\n\\r]+#', ' ', $buffer);\n $buffer = preg_replace('/[\\r\\n\\t\\s]+/s', ' ', $buffer);\n $buffer = preg_replace('#/\\*.*?\\*/#', '', $buffer);\n $buffer = preg_replace('/[\\s]*([\\{\\},;:])[\\s]*/', '\\1', $buffer);\n $buffer = preg_replace('/^\\s+/', '', $buffer);\n $buffer .= \"\\n\";\n break;\n\n case 2:\n // Compress the CSS-code\n $cssMin = JPATH_SITE.'/components/com_scriptmerge/lib/cssmin.php';\n if(file_exists($cssMin)) include_once $cssMin;\n if(class_exists('CssMin')) {\n $buffer = CssMin::minify($buffer);\n }\n break;\n\n case 0:\n default:\n break;\n }\n\n // If compression is disabled\n } else { \n\n // Append the filename to the CSS-code\n if(ScriptMergeHelper::getParams()->get('use_comments', 1)) {\n $start = \"/* [start] ScriptMerge CSS-stylesheet: $basefile */\\n\\n\";\n $end = \"/* [end] ScriptMerge CSS-stylesheet: $basefile */\\n\\n\";\n $buffer = $start.$buffer.\"\\n\".$end;\n }\n }\n\n return $buffer;\n }", "public function loadIncludes() {\n // TODO: better way to skip load includes.\n $this->addCSS($this->env->dir['tmp_files'] . '/css.min.css');\n $this->addJS('/tmp/js.min.js');\n }", "function thememount_hook_dynamic_css(){\n\tob_start(); // begin collecting output\n\tinclude get_template_directory().'/css/dynamic-style.php';\n\t$css = ob_get_clean(); // retrieve output from myfile.php, stop buffering\n\t\n\t/* Now add the dynamic-style.php style in header */\n\t$output = \"<style> $css </style>\";\n\techo $output;\n}", "public static function getStylesheets() {\n\t\t$html = '';\n\t\t$_Stylesheets = Configuration::getStylesheets();\n\t\tforeach($_Stylesheets as $stylesheet) {\n\t\t\t$html .= '<link rel=\"stylesheet\" href=\"'.$stylesheet.'\" />'.PHP_EOL.\"\\t\";\n\t\t}\n\t\treturn $html;\n\t}", "function css()\n {\n # determine the media\n global $TMPL;\n $media = ( $temp = $TMPL->fetch_param('media') ) ? 'media=\"' . $temp . '\"' : '';\n \n return ( '<link rel=\"stylesheet\" type=\"text/css\" ' . $media .\n ' href=\"http://gist.github.com/stylesheets/gist/embed.css\" />' );\n }", "private function set_styles()\n {\n\n if (count($this->assets_css['global']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN GLOBAL MANDATORY STYLES -->');\n foreach($this->assets_css['global'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n if (isset($this->assets_css['page_style']) && count($this->assets_css['page_style']) > 0)\n {\n $this->template->append_metadata('<!-- BEGIN PAGE STYLES -->');\n foreach($this->assets_css['page_style'] as $asset)\n {\n $this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . '../../themes/public/css/' . $asset . '\" media=\"screen\" />');\n }\n }\n\n // Webkit based browsers\n //$this->template->append_metadata('<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/webkit.css\" media=\"screen\" />');\n\n // Internet Explorer styles\n $this->template->append_metadata('<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie6.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie7.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 8]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie8.css\" media=\"screen\" /><![endif]-->');\n $this->template->append_metadata('<!--[if IE 9]><link rel=\"stylesheet\" type=\"text/css\" href=\"' . $this->config->item('base_url') . 'assets/css/cross_browser/ie9.css\" media=\"screen\" /><![endif]-->');\n }", "public function getCss()\n {\n $result = $this->_css;\n foreach ($this->_packages as $package) {\n $config = $this->getConfig($package);\n if (!empty($config['css'])) {\n foreach ($config['css'] as $item) {\n $result[] = $item;\n }\n }\n }\n return $result;\n }", "function GetStyles()\n {\n if ( $this->is_naked_day() )\n {\n return \"<!-- Sorry, no stylesheets - it's annual CSS Naked Day! -->\";\n }\n\n foreach($this->mStyles as $media => $stylesheet)\n {\n $out.= '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$stylesheet.'\" media=\"'.$media.'\" />'.\"\\n\";\n }\n return $out;\n }", "public static function combine_css($files,$outputdir = 'static/generated/')\n {\n if(\\HMC\\Config::SITE_ENVIRONMENT() == 'development') {\n Assets::css($files);\n return;\n }\n $ofiles = (is_array($files) ? $files : array($files));\n $hashFileName = md5(join($ofiles));\n $dirty = false;\n\n if(file_exists($outputdir.$hashFileName.'.css')) {\n $hfntime = filemtime($outputdir.$hashFileName.'.css');\n foreach($ofiles as $vfile) {\n $file = str_replace(\\HMC\\Config::SITE_URL(),\\HMC\\Config::SITE_PATH(),$vfile);\n if(!$dirty){\n $fmtime = filemtime($file);\n if($fmtime > $hfntime) {\n $dirty = true;\n }\n }\n }\n } else {\n $dirty = true;\n }\n if($dirty) {\n $buffer = \"\";\n foreach ($ofiles as $vfile) {\n $cssFile = str_replace(\\HMC\\Config::SITE_URL(),\\HMC\\Config::SITE_PATH(),$vfile);\n $buffer .= \"\\n\".file_get_contents($cssFile);\n }\n\n // Remove comments\n $buffer = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $buffer);\n\n // Remove space after colons\n $buffer = str_replace(': ', ':', $buffer);\n\n // Remove whitespace\n $buffer = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", ' ', ' ', ' '), '', $buffer);\n\n ob_start();\n\n // Write everything out\n echo($buffer);\n\n $fc = ob_get_clean();\n\n file_put_contents(\\HMC\\Config::SITE_PATH().$outputdir.$hashFileName.'.css',$fc);\n\n }\n static::resource(str_replace(':||','://',str_replace('//','/',str_replace('://',':||',\\HMC\\Config::SITE_URL().$outputdir.$hashFileName.'.css'))),'css');\n }", "public function styles()\n\t{\n\t\treturn $this->render('styles');\n\t}", "private function _include_css($file) {\n\t\treturn $this->EE->elements->_include_css($file);\n\t}", "public function show() {\n\t\t$buffer = \"\";\n\n\t\t// Load the files\n\t\tforeach ($this->files as $file) {\n\t\t\t$buffer .= file_get_contents($file);\n\t\t}\n\n\t\t// Compress the files\n\t\t$buffer = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $buffer); // comments\n\t\t$buffer = str_replace(': ', ':', $buffer); // space after colon\n\t\t$buffer = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", ' ', ' ', ' '), '', $buffer); // whitespace\n\n\t\t// Enable zip compression\n\t\tob_start(\"ob_gzhandler\");\n\t\theader('Cache-Control: public');\n\t\theader('Expires: ' . gmdate('D, d M Y H:i:s', time() + 86400) . ' GMT'); // 1 day\n\t\theader(\"Content-type: text/css\");\n\n\t\t// Output to browser\n\t\techo($buffer);\n\t}", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "private function coreCss() {\n $corecss = '';\n $corecss .= ' <!-- CSS Files -->\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"assets/css/normalize.css\") . ' \">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/bootstrap.min.css\") . '\"/>\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/material-kit.css\") . '\"/>\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/animate.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"assets/css/link-effects.css\") . '\">\n \n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/mdb/css/mdb.min62d0.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/Simple-Background-Carousel-Plugin-with-jQuery-and-Animate-css-Crosscover/dist/css/crosscover.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/x-hipster-as-f-cards-v1.1/assets/css/hipster_cards.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/Waves-master/dist/waves.min.css\") . '\">\n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/odometer-master/odometer-theme-default.css\") . '\"> \n <link rel=\"stylesheet\" href=\"' . $this->baseUrl(\"plugins/bootstrap-select-1.10.0/dist/css/bootstrap-select.css\") . '\"> \n \n ';\n\n return $corecss;\n }", "function include_css($files='')\n{\n $css_link = '';\n $css_root = get_stylesheet_directory_uri() . \"/css\";\n if (is_array($files)) {\n for ($i=0; $i < count($files); $i++) { \n $css_link .= \"<link rel='stylesheet'\";\n $css_link .= \" href='${css_root}/\" . $files[$i] . \".css' type='text/css'\";\n $css_link .= \" media='screen' />\\n\";\n }\n } elseif ($files == \"960\" || $files == \"960-24\") {\n $ns_files = array('reset','text');\n $cols_type = $files == \"960-24\" ? \"960_24_col\" : \"960\";\n array_push($ns_files, $cols_type);\n for ($i=0; $i < count($ns_files); $i++) { \n $css_link .= \"<link rel='stylesheet'\";\n $css_link .= \" href='${css_root}/960/code/css/\" . $ns_files[$i] . \".css' type='text/css'\";\n $css_link .= \" media='screen' />\\n\";\n }\n } else {\n $css_link .= \"<link rel='stylesheet'\";\n $css_link .= \" href='${css_root}/\" . $files . \".css' type='text/css' media='screen' />\\n\";\n }\n echo $css_link;\n}", "function stylesheets($dirs)\n{\n echo assets($dirs, '<link rel=\"stylesheet\" href=\"{link}\">');\n}", "public function configAction()\n {\n $styles = array_map(function ($fn) {\n return basename($fn, '.css');\n }, glob(App::locator()->get('highlight:assets/styles').'/*.css'));\n\n return compact('styles');\n }", "protected function doCompressCss() {}", "private function coreCss() {\n $corecss = '';\n $corecss .='<!--Core CSS Files-->\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"assets/css/bootstrap.min.css\") . ' \">\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"assets/css/paper-dashboard.css\") . ' \">\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"../tc-merchant-template/plugins/stepformwizard/assets/css/gsi-step-indicator.min.css\") . ' \">\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"../tc-merchant-template/plugins/stepformwizard/assets/css/tsf-step-form-wizard.min.css\") . ' \">\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"../tc-merchant-template/assets/css/loader.css\") . ' \">\n <link rel=\"stylesheet\" href=\" ' . $this->baseUrl(\"../tc-merchant-template/plugins/dropzone-master/dist/dropzone.css\") . ' \">';\n\n return $corecss;\n }", "public function enableConcatenateCss() {}", "public function INCLUDE_CSS(array $conf) {\n if($conf && count($conf)) {\n foreach ($conf as $key => $CSSfile) {\n $cssFileConfig = &$conf[$key . '.'];\n if (isset($cssFileConfig['if.']) && !$GLOBALS['TSFE']->cObj->checkIf($cssFileConfig['if.'])) {\n continue;\n }\n $ss = $cssFileConfig['external'] ? $CSSfile : $GLOBALS['TSFE']->tmpl->getFileName($CSSfile);\n if ($ss) {\n if ($cssFileConfig['import']) {\n if (!$cssFileConfig['external'] && $ss[0] !== '/') {\n // To fix MSIE 6 that cannot handle these as relative paths (according to Ben v Ende)\n $ss = TYPO3\\CMS\\Core\\Utility\\GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/' . $ss;\n }\n $this->pageRenderer->addCssInlineBlock('import_' . $key, '@import url(\"' . htmlspecialchars($ss) . '\") ' . htmlspecialchars($cssFileConfig['media']) . ';', empty($cssFileConfig['disableCompression']), $cssFileConfig['forceOnTop'] ? TRUE : FALSE, '');\n } else {\n $this->pageRenderer->addCssFile(\n $ss,\n $cssFileConfig['alternate'] ? 'alternate stylesheet' : 'stylesheet',\n $cssFileConfig['media'] ?: 'all',\n $cssFileConfig['title'] ?: '',\n empty($cssFileConfig['disableCompression']),\n $cssFileConfig['forceOnTop'] ? TRUE : FALSE,\n $cssFileConfig['allWrap'],\n $cssFileConfig['excludeFromConcatenation'] ? TRUE : FALSE,\n $cssFileConfig['allWrap.']['splitChar']\n );\n unset($cssFileConfig);\n }\n }\n }\n }\n }", "public function read_css() {\r\n\t\t// 1. wir müssen wissen, welche Thema zZ. aktiv ist.\r\n\t\t$cssfile = $this->get_cssfile_name();\r\n\t\t// 2. den Inhalt der CSS-Datei auslesen\r\n\t\t$csscont = $this->read_cssfile($cssfile);\r\n\t\treturn $csscont;\r\n\t}", "public static function getCss() {\n return self::get('_css', array());\n }", "function get_css() {\n\t\t\t$output = '';\n\t\t\t$this->build_settings_and_styles();\n\n\t\t\t$css = $this->generate_css();\n\t\t\t$css .= $this->generate_responsive_css();\n\t\t\t$css .= $this->global_css;\n\t\t\t$css = apply_filters( 'themify_customizer_css_output', $css, $this );\n\n\t\t\t$custom_css = $this->custom_css();\n\t\t\tif (!empty($css)) {\n\t\t\t\t$output= \"<!--Themify Customize Styling-->\\n<style id=\\\"themify-customize\\\" type=\\\"text/css\\\">\\n$css\\n</style>\\n<!--/Themify Customize Styling-->\";\n\t\t\t}\n\t\t\tif (!empty($custom_css)) {\n\t\t\t\t$output .= \"<!--Themify Custom CSS-->\\n<style id=\\\"themify-customize-customcss\\\" type=\\\"text/css\\\">\\n$custom_css\\n</style>\\n<!--/Themify Custom CSS-->\";\n\t\t\t}\n\n\t\t\treturn $output;\n\t\t}", "protected function getContentCssFileNames() {}", "public function get_stylesheet_css()\n {\n }", "function GetStylesheetes()\n{\n $isMobile = check_user_agent('mobile') === false && @$_GET['screen'] != 'mobile' ? false :true;\n $append = $isMobile ? '.mobile.css':'.css';\n $stylesheets = GetTheDataArray(array('theme','stylesheet'));\n $returnData = '';\n foreach($stylesheets as $key => $style)\n {\n $file = '';\n if($key == 'core') {\n //include core stylesheet and decide if mobile stylesheet should be used\n if(check_user_agent('mobile') === false && @$_GET['screen'] != 'mobile')\n {\n $style = $style['primary'];\n\n } else {\n $style = $style['mobile'];\n\n }\n\n $httpFile = base_url().'theme/'.THEMESELECTED.'/css/'.$style;\n $file = THEMEPATH.THEMESELECTED.'/css/'.$style;\n //including files from project data css folder configured in projectconfig.php\n } elseif($key == 'include'){\n foreach($style as $st)\n {\n $httpFile = base_url().'project/'.PROJECT.'/data/css/'.$st.$append;\n $file = PROJECTROOT.PROJECT.'/data/css/'.$st.$append;\n }\n\n }\n\n if(file_exists($file))\n {\n $returnData .= '<link rel=\"stylesheet\" href=\"'.$httpFile.'\"/>';\n }\n\n }\n //adding include files depending on what device is being used\n foreach($stylesheets['core']['includes'] as $includes)\n {\n $returnData .= '<link rel=\"stylesheet\" href=\"'.base_url().'theme/'.THEMESELECTED.'/css/includes/'.$includes.$append.'\"/>';\n }\n //adding animation files\n if(iteraxcontroller::Instance()->it->data['theme']['animations'] === true)\n {\n foreach($stylesheets['animations'] as $includes)\n {\n $returnData .= '<link rel=\"stylesheet\" href=\"'.base_url().'theme/'.THEMESELECTED.'/css/animation/'.$includes.'\"/>';\n }\n }\n\n\n return $returnData;\n}", "public function getCssSources(): string\n {\n return '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n . $this->uri\n . 'bower_components/jquery-ui/themes/ui-lightness/jquery-ui.min.css\" />'\n . '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n . $this->uri\n . 'bower_components/jquery-ui/themes/ui-lightness/theme.css\" />'\n . '<link rel=\"stylesheet\" type=\"text/css\" href=\"'\n . $this->uri\n . 'themes/default/style.css\" />';\n }", "public function getCompressCss() {}", "function include_styles()\n{\n\tglobal $styles_included;\n\tforeach ($styles_included as $value)\n\t{\n\t\techo $value;\n\t}\n}", "public function cssFileBundler()\n {\n return $this->fileFilter(\n 'scripts.css',\n $this->createPath('public/css'),\n new GlobAsset($this->createPath('assets/css/*')),\n $this->filters['css']\n );\n }", "public function getCssJsHtml()\n {\n $lines = array();\n foreach ($this->_data['items'] as $item) {\n if (!is_null($item['cond']) && !$this->getData($item['cond']) || !isset($item['name'])) {\n continue;\n }\n $if = !empty($item['if']) ? $item['if'] : '';\n $params = !empty($item['params']) ? $item['params'] : '';\n switch ($item['type']) {\n case 'js': // js/*.js\n case 'skin_js': // skin/*/*.js\n case 'js_css': // js/*.css\n case 'skin_css': // skin/*/*.css\n $lines[$if][$item['type']][$params][$item['name']] = $item['name'];\n break;\n default:\n $this->_separateOtherHtmlHeadElements($lines, $if, $item['type'], $params, $item['name'], $item);\n break;\n }\n }\n\n // prepare HTML\n $shouldMergeJs = Mage::getStoreConfigFlag('dev/js/merge_files');\n $shouldMergeCss = Mage::getStoreConfigFlag('dev/css/merge_css_files');\n\n $html = '';\n foreach ($lines as $if => $items) {\n if (empty($items)) {\n continue;\n }\n if (!empty($if)) {\n // open !IE conditional using raw value\n if (strpos($if, \"><!-->\") !== false) {\n $html .= $if . \"\\n\";\n } else {\n $html .= '<!--[if '.$if.']>' . \"\\n\";\n }\n }\n\n if(Mage::getStoreConfigFlag('stylecss/critical_path/enable') && Mage::getStoreConfigFlag('dev/css/merge_css_files') && !Mage::app()->getStore()->isAdmin() && !empty($items['skin_css'])) {\n // after CriticalPathCSS\n $html .= $this->_prepareStaticAndSkinElements(\"<script>var cb = function() {\n var l = document.createElement('link'); l.rel = 'stylesheet';\n l.href = '%s';\n var h = document.getElementsByTagName('head')[0];\n var s = document.getElementById('custom-styles');\n if(s) {h.insertBefore(l, s);} else {h.appendChild(l, h);}\n };\n var raf = requestAnimationFrame || mozRequestAnimationFrame ||\n webkitRequestAnimationFrame || msRequestAnimationFrame;\n if (raf) raf(cb);\n else window.addEventListener('load', cb);</script>\".\"\\n\",\n empty($items['js_css']) ? array() : $items['js_css'],\n empty($items['skin_css']) ? array() : $items['skin_css'],\n $shouldMergeCss ? array(Mage::getDesign(), 'getMergedCssUrl') : null\n );\n } else {\n // static and skin css\n $html .= $this->_prepareStaticAndSkinElements('<link rel=\"stylesheet\" type=\"text/css\" href=\"%s\"%s />'.\"\\n\",\n empty($items['js_css']) ? array() : $items['js_css'],\n empty($items['skin_css']) ? array() : $items['skin_css'],\n $shouldMergeCss ? array(Mage::getDesign(), 'getMergedCssUrl') : null\n ); \n }\n\n // static and skin javascripts\n $html .= $this->_prepareStaticAndSkinElements('<script type=\"text/javascript\" src=\"%s\"%s></script>' . \"\\n\",\n empty($items['js']) ? array() : $items['js'],\n empty($items['skin_js']) ? array() : $items['skin_js'],\n $shouldMergeJs ? array(Mage::getDesign(), 'getMergedJsUrl') : null\n );\n\n // other stuff\n if (!empty($items['other'])) {\n $html .= $this->_prepareOtherHtmlHeadElements($items['other']) . \"\\n\";\n }\n\n if (!empty($if)) {\n // close !IE conditional comments correctly\n if (strpos($if, \"><!-->\") !== false) {\n $html .= '<!--<![endif]-->' . \"\\n\";\n } else {\n $html .= '<![endif]-->' . \"\\n\";\n }\n }\n }\n return $html;\n }", "function LoadStyling(array $styles) : string\n{\n $html = '';\n foreach($styles as $style) {\n $loadStyle = 'view/static/css/'.$style.'.css';\n if (is_file($loadStyle)) {\n $html .= \"<link rel='stylesheet' media='screen' href='$loadStyle' />\";\n // echo $html;\n } else {\n die(\"Stylesheet not found: $loadStyle\");\n // show 404 here\n }\n }\n\n return $html;\n}", "public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }", "public function getCSS()\n\t{\n\t\t$css = array();\n\t\treturn $css;\n\t}", "public function loadAssets(): void\n {\n $this->printStyle('//resource.css', 'print_resource_page_assets');\n }", "public function cssp()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header json data\n header('Content-Type: text/css');\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n // set css data string\n $results = implode(\"\\n\", $this->vars);\n // send\n echo $results;\n }\n }", "private function \t\t\t\tbuild_style_tags() {\n\t\t$load=array(\n\t\t\t\"assets/css/bootstrap/bootstrap-grid.min.css\",\n\t\t\t\"assets/css/bootstrap/bootstrap-reboot.min.css\",\n\t\t\t\"assets/css/bootstrap/bootstrap.min.css\",\n\t\t\t\"assets/css/fontawesome/all.min.css\",\n\t\t\t\"assets/css/style.css\"\n\t\t);\n\n\n\t\treturn array_reduce(array_unique(array_merge($load, $this->section_css)), function($_acum, $_item) {\n\t\t\t$_acum.=<<<R\n\n\t\t<link rel=\"stylesheet\" title=\"estilos\" type=\"text/css\" href=\"{$_item}\" media=\"screen\" />\nR;\n\t\t\treturn $_acum;\n}, '');\n\t}", "public function getCssSnippet() {\n $sResult = '';\n\n foreach ($this->_aCss as $sSrc) {\n $sResult .= '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . $sSrc . '\" />' . PHP_EOL;\n }\n\n return $sResult;\n }", "private static function defCssLoader() {\n\n\t\t$loadedResources = Yii::app()->user->getState('nlsLoadedResources');\n\t\tif (!isset($loadedResources))\n\t\t\t$loadedResources = array();\t\t\n\t\t\n\t\t$hk = '__defCssLoader';\n\t\t$inCache = isset($loadedResources[$hk]);\n\n\t\tif ($inCache)\n\t\t\treturn '';\n\t\n\t\t$loadedResources[$hk] = $hk;\n\t\tYii::app()->user->setState('nlsLoadedResources', $loadedResources);\n\n\t\treturn CHtml::script('\n//css loader\n__loadCss = function(f, media) {\n\tvar a = document.createElement(\"link\");\n\ta.rel=\"stylesheet\";\n\ta.type=\"text/css\";\n\ta.media=media||\"screen\";\n\ta.href=f;\n\t(document.getElementsByTagName(\"head\"))[0].appendChild(a);\n};\n');\n\t\t\t\n\t}", "function head_css()\n{\n return get_view()->headLink() . get_view()->headStyle();\n}", "public static function dumpStylesheets()\n\t{\n\t\treturn self::basePath().'/applications/'.self::getName().'/assets/css/base.css';\n\n\t\t$asset = self::$stylesheets;\n\t\t$asset->setTargetPath(str_replace('*', self::generateAssetName($asset).'.css', self::$assetOutput));\n\t\t$cache = self::getAssetCache($asset);\n\t\tself::getAssetWriter()->writeAsset($cache);\n\t\treturn self::basePath().'/'.$asset->getTargetPath();\n\t}" ]
[ "0.7516488", "0.74296695", "0.72453046", "0.7021138", "0.7006917", "0.6997029", "0.6969767", "0.6952596", "0.69387275", "0.6932587", "0.6893932", "0.68303275", "0.6790006", "0.67844033", "0.67806375", "0.6774634", "0.6768249", "0.67516243", "0.6741047", "0.67305833", "0.67133343", "0.6673186", "0.6639111", "0.6631637", "0.66246885", "0.66071594", "0.6601056", "0.65948904", "0.6594198", "0.65842724", "0.656412", "0.64907545", "0.6475066", "0.64703965", "0.6458227", "0.6458227", "0.64552367", "0.6450533", "0.6445691", "0.6433161", "0.64319307", "0.6427621", "0.642106", "0.64162886", "0.64140326", "0.6385663", "0.6383221", "0.63794696", "0.6376106", "0.6344203", "0.6343435", "0.6335622", "0.63218653", "0.63183075", "0.63005847", "0.62913364", "0.6279053", "0.62679076", "0.62611616", "0.62554765", "0.6237786", "0.623307", "0.6229923", "0.62242526", "0.6208655", "0.61971176", "0.61959", "0.6174248", "0.61742383", "0.6169226", "0.61482567", "0.6145863", "0.61441755", "0.61419845", "0.61208695", "0.6104702", "0.61012095", "0.6099825", "0.6089951", "0.6082587", "0.6058524", "0.60490286", "0.6048505", "0.6042206", "0.6033808", "0.6030745", "0.6022359", "0.60212964", "0.6014876", "0.60140824", "0.6013261", "0.6007634", "0.60018003", "0.59661645", "0.5962217", "0.5952367", "0.5939587", "0.5933767", "0.5929937", "0.59258825" ]
0.6498804
31
Display a listing of the resource.
public function index() { $blogs = Blog::all(); return view('viewblog',compact('blogs')); }
{ "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('addblog'); }
{ "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) { $blog=Blog::create($this->Requestdata()); $this->storeImage($blog); return redirect('/admin/blog/create')->with('message','Blog Added'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Blog $blog) { // }
{ "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 }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function 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 execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function 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\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function display() {\n echo $this->render();\n }", "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 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 abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233183", "0.81894475", "0.6830127", "0.6498529", "0.6496276", "0.6469191", "0.64627224", "0.63619924", "0.6308743", "0.62809277", "0.6218707", "0.61915004", "0.617914", "0.6172935", "0.6137578", "0.6118736", "0.6107122", "0.6106576", "0.60931313", "0.60798067", "0.6046669", "0.60386544", "0.60193497", "0.59882426", "0.5963477", "0.59618807", "0.5952755", "0.5929829", "0.59192723", "0.59065384", "0.59065384", "0.59065384", "0.590592", "0.58923435", "0.5870325", "0.5868533", "0.58685124", "0.5851443", "0.5815833", "0.58149886", "0.58143586", "0.580419", "0.58004224", "0.5793256", "0.57887405", "0.57840455", "0.5782294", "0.5760476", "0.5757928", "0.57578564", "0.57453394", "0.5745187", "0.5741311", "0.5738201", "0.5738201", "0.5730195", "0.5727921", "0.5727622", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5724217", "0.5720258", "0.5714068", "0.57106924", "0.5709095", "0.57058644", "0.57057875", "0.5704414", "0.5704414", "0.57021624", "0.56991994", "0.5692151", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576", "0.5686576" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Blog $blog) { return view('editblog',compact('blog')); }
{ "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, Blog $blog) { $blog->update($this->Requestdata()); $this->storeImage($blog); return redirect('/admin/blog')->with('message','Blog Updated'); }
{ "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(Blog $blog) { $blog->delete(); return redirect('/admin/blog')->with('message','BLog Deleted'); }
{ "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
user defined cluster opduiken
static function getUserDefinedClusterValueObject() { $query = PdpActionQueries::getUserDefinedCluster(); $userDefinedClusterData = mysql_fetch_assoc($query); mysql_free_result($query); $clusterValueObject = PdpActionClusterValueObject::createWithData($userDefinedClusterData); $clusterValueObject->setClusterName( TXT_UCF('USER_DEFINED_CLUSTER_NAME')); return $clusterValueObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClusterId()\n {\n }", "function create_cluster_sample(): void\n{\n // Create a client.\n $clusterManagerClient = new ClusterManagerClient();\n\n // Prepare any non-scalar elements to be passed along with the request.\n $cluster = new Cluster();\n\n // Call the API and handle any network failures.\n try {\n /** @var Operation $response */\n $response = $clusterManagerClient->createCluster($cluster);\n printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());\n } catch (ApiException $ex) {\n printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());\n }\n}", "public function cluster()\n {\n return $this->cluster;\n }", "public function create()\n\t{\n\t\t//\n\t\treturn \"Create New Cluster\";\n\t}", "public function getCluster() {\n return $this->_cluster;\n }", "public function clustering(){\n \n $riwayat = [];\n\n // Validate the request\n if(!empty($this->validate())){\n return ['status' => 'fail', 'messages' => $error_messages];\n }\n \n //generate matriks data\n $matriks = [];\n foreach($this->data as $key => $item){\n $matriks[$key][$this->label] = $item[$this->label];\n for($i = 0 ; $i < sizeof($this->attr); $i++){\n $matriks[$key][$this->attr[$i]] = $item[$this->attr[$i]];\n } \n }\n $riwayat[0]['matriks'] = $matriks;\n\n //set initial centroids\n if($this->custom['centroids'] != null){\n $centroid = [];\n for($i = 0; $i < sizeof($this->custom['centroids']); $i++){\n for($j = 0; $j < sizeof($matriks); $j++){\n if($this->custom['centroids'][$i] == $matriks[$j][$this->label]){\n $centroid[$i] = $matriks[$j];\n break;\n }\n }\n }\n }else{\n // untuk testing\n if(VALIDATION_TESTING){\n $centroid = [\n 0 => [\n 'nim' => '16523035',\n 'ipk_sem_1' => 2.20,\n 'ipk_sem_2' => 2.18,\n 'ipk_sem_3' => 2.06,\n 'ipk_sem_4' => 1.81,\n 'ipk_sem_5' => 2.10\n ],\n 1 => [\n 'nim' => '16523136',\n 'ipk_sem_1' => 3.18,\n 'ipk_sem_2' => 3.40,\n 'ipk_sem_3' => 3.63,\n 'ipk_sem_4' => 3.89,\n 'ipk_sem_5' => 3.72\n ],\n 2 => [\n 'nim' => '16523200',\n 'ipk_sem_1' => 2.93,\n 'ipk_sem_2' => 3.38,\n 'ipk_sem_3' => 3.15,\n 'ipk_sem_4' => 3.57,\n 'ipk_sem_5' => 3.64\n ],\n ];\n }else{\n //randomize centroid based on the amount of cluster\n $centroid_indexes = [];\n $centroid = [];\n for ($i = 0; $i < $this->cluster; $i++) { \n do{\n $rand = rand(0,sizeof($matriks)-1);\n }while(in_array($rand,$centroid_indexes));\n \n $centroid_indexes[$i] = $rand;\n $centroid[$i] = $matriks[$centroid_indexes[$i]];\n }\n $riwayat[0]['first_centroid'] = $centroid;\n }\n }\n\n /* \n ===================================================================================\n Looping through clustering proccess until terminated condition was fulfilled. \n ===================================================================================\n */\n $iteration = 0;\n do{\n // Set previous cluser, if cluster is null then set prev cluster to null\n $prev_cluster = $cluster ?? null;\n $riwayat[$iteration]['prev_centroid'] = $centroid;\n\n // Calculate Distances (euclidean distance)\n $dist = [];\n for($i = 0; $i < sizeof($matriks); $i++){\n $dist[$i][$this->label] = $matriks[$i][$this->label];\n for($j = 0; $j < $this->cluster; $j++){\n $total = 0;\n for($k = 0; $k < sizeof($this->attr); $k++){\n $hasil_kurang = $matriks[$i][$this->attr[$k]] - $centroid[$j][$this->attr[$k]];\n $result = pow($hasil_kurang, 2);\n $total = $total + $result;\n }\n $dist[$i]['distance'][$j] = sqrt($total);\n }\n }\n $riwayat[$iteration]['distance'] = $dist;\n\n // Determine the cluster\n $cluster = [];\n for($i = 0; $i < sizeof($dist); $i++){\n $groups = $this->grouping($dist[$i]['distance']);\n $cluster[$i]['nim'] = $dist[$i]['nim'];\n $cluster[$i]['groups'] = $groups;\n }\n $riwayat[$iteration]['cluster'] = $cluster;\n\n // Determine the member of each centroids\n $anggota_centroid = [];\n \n for($i = 0; $i < $this->cluster; $i++){\n $index_anggota = 0;\n for($j = 0; $j < sizeof($matriks); $j++){\n if($cluster[$j]['groups'][$i] == 1){\n $anggota_centroid[$i][$index_anggota] = $cluster[$j]['nim'];\n $matriks[$j]['cluster'] = ($i + 1);\n $index_anggota++;\n }\n }\n }\n $riwayat[$iteration]['anggota_centroid'] = $anggota_centroid;\n $riwayat[$iteration]['result'] = $matriks;\n\n // Determine the new centroid\n $centroid = [];\n for($i = 0; $i < $this->cluster; $i++){\n $centroid[$i] = $this->generateCentroid($i, $matriks, $anggota_centroid[$i]); \n }\n $riwayat[$iteration]['new_centroid'] = $centroid;\n $riwayat[$iteration]['iteration'] = $iteration+1;\n \n $iteration++;\n\n if($this->custom['iteration'] != null){\n if($iteration == $this->custom['iteration'])\n break;\n }\n if(VALIDATION_TESTING){\n if($iteration == 3) \n break;\n } \n }while(!$this->isEqual($cluster, $prev_cluster));\n \n /* \n ===================================================================================\n Return the last clustering history. \n ===================================================================================\n */\n // return $iteration;\n \n // Sorting result based on cluster\n foreach($riwayat[$iteration-1]['result'] as $key => $row){\n $cluster[$key] = $row['cluster'];\n }\n // Sort result based on cluster\n array_multisort($cluster, SORT_ASC, $riwayat[$iteration-1]['result']);\n \n // Save result to database\n ClusteringResult::truncate();\n foreach($riwayat[$iteration-1]['result'] as $result){\n ClusteringResult::create($result);\n }\n \n\n return $riwayat[$iteration-1];\n \n }", "public function getCluster() {\n $cluster_id = $this->getOption('cluster', '');\n return empty($cluster_id) ? elasticsearch_connector_get_default_connector() : $cluster_id;\n }", "public function getClusterTopology()\n {\n $nbTries = 0;\n $client = false;\n \n $nodes = array_values($this->addedNodes);\n \n while ($nbTries < count($nodes) && $client === false) {\n $randomNode = $nodes[$nbTries];\n // creates the connection to the random node\n $client = phpiredis_connect($randomNode['ip'], $randomNode['port']);\n $nbTries ++;\n }\n \n if (! $client) {\n throw new \\Exception('All nodes of the cluster seem to be down.');\n }\n \n // verify that the cluster is consistent\n $response = phpiredis_command_bs($client, array(\n 'cluster',\n 'info'\n ));\n if (strpos($response, 'cluster_state:ok') < 0) {\n throw new \\Exception('The cluster is inconsistent');\n }\n \n // get the cluster nodes\n $response = phpiredis_command_bs($client, array(\n 'cluster',\n 'nodes'\n ));\n \n // replaces the line concerning this host by a proper syntax\n $response = str_replace(':0 myself,', $randomNode['ip'] . ':' . $randomNode['port'] . ' ', $response);\n \n /*\n * $response = \"4c018a7d3da91858afbb9eb9b376ca81a5e63c11 192.168.1.208:7100 master - 0 1414154054475 41 connected\n * 01939672432f215c58ffd07e60a627560bff866a 192.168.1.105:7000 master - 0 1414154055477 40 connected 4596-8191 4596-8191 4596-8191\n * 42d4c6c023a5584c387902f39a4fdec7c2dc38c0 192.168.1.96:7000 master - 0 1414154056480 36 connected 8692-12287\n * 6cae0b7c0a1ae753553d5949e58099c7e344e2ef 192.168.1.105:7100 slave f5c10b16cbc28bf86c2092ad74b0071fbb1d3a9e 0 1414154055978 6 connected\n * 0e06e0c85d7830a8a40e1d158fc5503d18e2f188 192.168.1.88:7100 slave 5dbf2e6a587982f99528084b059950bbac9d67db 0 1414154055477 42 connected\n * 1f695374f0d0f6721df7b54484d2843cdbd895e6 192.168.1.88:7000 slave 4c018a7d3da91858afbb9eb9b376ca81a5e63c11 0 1414154054976 41 connected\n * f5c10b16cbc28bf86c2092ad74b0071fbb1d3a9e 192.168.1.112:7000 myself,master - 0 0 1 connected 500-4095\n * 5dbf2e6a587982f99528084b059950bbac9d67db 192.168.1.208:7000 master - 0 1414154055978 42 connected 0-499 4096-4595 8192-8691 12288-12787\n * f6afa8eb6a5fe4ef7d9dec007c847acef63a8ef2 192.168.1.178:7000 master - 0 1414154055978 34 connected 12788-16383\n * 0943d94c3053003911423a4fb872dcacd853fdc7 192.168.1.112:7100 slave 01939672432f215c58ffd07e60a627560bff866a 0 1414154054475 40 connected\n * eb76c3e4f3646182b8f0a4e83a8a459af8f17987 192.168.1.96:7100 slave f6afa8eb6a5fe4ef7d9dec007c847acef63a8ef2 0 1414154054475 34 connected\n * 88ef18626abf4a2911e8edde8466f2911314ea45 192.168.1.178:7100 slave 42d4c6c023a5584c387902f39a4fdec7c2dc38c0 0 1414154054976 36 connected\";\n */\n \n // list of the slots\n $slots = array();\n \n // list of the master and slave nodes\n $masterNodes = array();\n $slaveNodes = array();\n \n $alreadySeenSlots = array();\n \n $clusterNodes = explode(\"\\n\", $response);\n $count = count($clusterNodes);\n \n for ($i = 0; $i < $count; $i ++) {\n \n if (strpos($clusterNodes[$i], 'slave') === false) {\n \n $nodeArr = explode(' ', $clusterNodes[$i]);\n \n // we add the master node only if its state is connected\n if (strpos($clusterNodes[$i], ' connected') !== false) {\n \n $host = $nodeArr[1];\n $hostArr = explode(':', $host);\n \n $masterNodes[$nodeArr[0]] = array(\n 'ip' => $hostArr[0],\n 'port' => $hostArr[1]\n );\n \n if (preg_match_all('/(\\d+)\\-(\\d+)/', $clusterNodes[$i], $matches, PREG_SET_ORDER)) {\n foreach ($matches as $match) {\n \n $min = $match[1];\n $max = $match[2];\n \n if (! in_array($min . '-' . $max, $alreadySeenSlots)) {\n \n $slots[] = array(\n 'min' => $min,\n 'max' => $max,\n 'master' => array(\n 'ip' => $hostArr[0],\n 'port' => $hostArr[1],\n 'id' => $nodeArr[0]\n )\n );\n \n $alreadySeenSlots[] = $min . '-' . $max;\n }\n }\n }\n }\n } else {\n \n $nodeArr = explode(' ', $clusterNodes[$i]);\n \n $host = $nodeArr[1];\n $hostArr = explode(':', $host);\n \n if (preg_match('/slave ([a-f0-9]+)/', $clusterNodes[$i], $matches)) {\n $slaveOf = $matches[1];\n \n // it the slave is not connected, we will use the master instead without any warning\n if (strpos($clusterNodes[$i], ' connected') === false) {\n $slaveNodes[$nodeArr[0]] = array(\n 'slaveof' => $slaveOf\n );\n } else {\n $slaveNodes[$nodeArr[0]] = array(\n 'ip' => $hostArr[0],\n 'port' => $hostArr[1],\n 'slaveof' => $slaveOf\n );\n }\n }\n }\n }\n \n foreach ($slaveNodes as $nodeId => $slaveInfos) {\n \n // if it's a slave that is not connected, we add the corresponding master\n if (! isset($slaveInfos['ip'])) {\n $slaveInfos['ip'] = $masterNodes[$slaveInfos['slaveof']]['ip'];\n $slaveInfos['port'] = $masterNodes[$slaveInfos['slaveof']]['port'];\n }\n foreach ($slots as &$slot) {\n if ($slot['master']['id'] == $slaveInfos['slaveof']) {\n $slot['slave'] = array(\n 'id' => $nodeId,\n 'ip' => $slaveInfos['ip'],\n 'port' => $slaveInfos['port']\n );\n }\n }\n reset($slots);\n unset($slot);\n }\n \n return $slots;\n }", "function ppt_resources_get_user_clusters($data)\n{\n\n global $user;\n if ($user->uid == 0) {\n return services_error('Access Denied!', 403);\n }\n if (!isset($data['region'])) {\n return services_error('Missing Region!', 403);\n }\n $region = $data['region'];\n $clusters = array();\n $countries = get_user_countries($user);\n\n // Loop over the countries to get the clusters.\n foreach ($countries as $country) {\n $country_term = taxonomy_term_load($country);\n if (!isset($country_term->field_cluster[LANGUAGE_NONE])) {\n continue;\n }\n $cluster = $country_term->field_cluster[LANGUAGE_NONE][0]['target_id'];\n $cluster_term = taxonomy_term_load($cluster);\n if (!isset($cluster_term->field_region[LANGUAGE_NONE])) {\n continue;\n }\n $region_term = taxonomy_term_load($cluster_term->field_region[LANGUAGE_NONE][0]['target_id']);\n if (!isset($clusters[$cluster]) && $region == $region_term->tid) {\n $clusters[$cluster] = array('id' => $cluster, 'name' => $cluster_term->name);\n }\n }\n return $clusters;\n}", "public function query() {\n if ($this->get_option('geocluster_enabled')) {\n if ($algorithm = geocluster_init_algorithm($this->config)) {\n $algorithm->pre_execute();\n }\n }\n }", "public function actionKPT() {\n//$sid = CUser::model()->findByPk($this->user_id)->sess_id;\n//$kpt = md5($this->user_id . $sid . \"I am robot\");\n echo CUser::kpt($this->user_id);\n exit();\n }", "public function run()\n {\n $groupService = ManageNodeGroupService::getInstance();\n $group = $groupService->updateOrCreate('角色管理', NodeCodeConstants::ROLE_CUSTOM_MANAGE);\n if ($group) {\n $roleService = new AdminRoleService();\n $nodeService = ManageNodeService::getInstance();\n $nodeRead = $nodeService->edit(\n $group,\n '角色管理-讀取',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_READ\n );\n if ($nodeRead) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeRead);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeRead);\n }\n $nodeCreate = $nodeService->edit(\n $group,\n '角色管理-新增',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_CREATE\n );\n if ($nodeCreate) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeCreate);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeCreate);\n }\n $nodeUpdate = $nodeService->edit(\n $group,\n '角色管理-編輯',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_UPDATE\n );\n if ($nodeUpdate) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeUpdate);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeUpdate);\n }\n $nodeDel = $nodeService->edit(\n $group,\n '角色管理-刪除',\n NodeCodeConstants::ROLE_CUSTOM_MANAGE_DELETE\n );\n if ($nodeDel) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodeDel);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodeDel);\n }\n $nodePermission = $nodeService->edit(\n $group,\n '角色管理-權限',\n NodeCodeConstants::ROLE_PUBLIC_AUTHORIZATION\n );\n if ($nodePermission) {\n $roleService->bindNode(RoleInherentConstants::ADMIN, $nodePermission);\n $roleService->bindNode(RoleInherentConstants::SYSTEM_MANAGER, $nodePermission);\n }\n }\n }", "public function verRedThinkClientEnProyectorCentral( ) {\n $this->setComando(self::$PROYECTOR_CENTRAL, \"THINK_CLIENT\");\n }", "function cambiarClaveServSoc()\n {\n }", "public function __construct()\n {\n if (2 == func_num_args()) {\n $this->clusterRole = func_get_arg(0);\n $this->literals = func_get_arg(1);\n }\n }", "public function getNodeService();", "public function SelectCluster() {\n $this->layout = 'ajax';\n $this->loadModel('ShalaCluster');\n $dist_id = $_POST['dist_id'];\n $block_id = $_POST['block_id'];\n $block_id1 = substr($block_id, 5, 6);\n $this->set('cluster_list', $this->ShalaCluster->find('list', array('conditions' => array('substring(ShalaCluster.clucd,1,6)' => array($block_id)),\n 'fields' => array('clucd', 'cluname'),\n 'order' => array('cluname', 'cluname DESC'))));\n }", "public function getClusterId(): ?string\n {\n }", "public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "function handleRndK($data, $str, $clientid){\n\t\t$this->clients[$clientid]->write(\"<msg t='sys'><body action='rndK' r='-1'><k>\" .$this->clients[$clientid]->p['rndK'] . \"</k></body></msg>\");\n\t}", "function amap_ma_get_map_clustering() {\n $cluster = trim(elgg_get_plugin_setting('cluster', AMAP_MA_PLUGIN_ID));\n if ($cluster === AMAP_MA_GENERAL_YES) {\n return true;\n }\n\n return false;\n}", "public function getOperation();", "public function getCasKonec()\n {\n return $this->cas_konec;\n }", "public function CreateCluster($user, $request){\n\t\t$request['editedUser'] = $user;\n\t\t$request['editedDate'] = date('Y-m-d H:i:s', time());\n\t\treturn array(\"results\" => $this->Create('[STAGE CLUSTERS TABLE]', $request));\n\t}", "public function getOGAdminID();", "public function key() {}", "public function key() {}", "public function key() {}", "public function key() {}", "public function key() {}", "public function key() {}", "public function key() {}", "public function key() {}", "public function authClientAdmin(){\n\n\t\t$token = Input::get('token');\n\t\t$tokenExists = TokenModel::where('token = ?', $token)\n\t\t\t\t\t\t\t\t\t->all();\n\t\t//invalid token used/no access token provided\n\t\tif (!$tokenExists->num_rows()) {\t\t \n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!1');\n\t\t}\n\t\t//check for expired token\n\t\telseif ($tokenExists->result_array()[0]['logout'] === true) {\n\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\tdie('Login required!2');\n\t\t}\n\t\t//unathorized user access to admin controller\n\t\telseif ($tokenExists->result_array()[0]['user_role'] != 3) {\n\t\t\theader('HTTP/1.0 401 Unauthorized'); \n\t\t\tdie('Restricted access!');\n\t\t}\n\t\telse {\n\t\t\t//check for expired timestamp\n\t\t\t$token = $tokenExists->result_array()[0];\n\t\t\t$timestamp = strtotime($token['date_modified'] OR $token['date_created']);\n\n\t\t\tif (($timestamp + $token['duration']) > time()) {\n\t\t\t\theader('HTTP/1.0 403 Forbidden');\n\t\t\t\tdie('Login required!3');\n\t\t\t}\n\n\t\t\t//extend token lifespan\n\t\t\tTokenModel::where('id = ?', $token['id'])\n\t\t\t\t\t\t->save(array(\n\t\t\t\t\t\t\t'duration' => 3600\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t//set the value of the client id\n\t\t\t$this->client_id = $token['client_id'];\n\t\t\t$this->client = $token;\n\n\t\t}\n\n\t}", "public function getOpId()\n {\n\n return $this->op_id;\n }", "function ppt_resources_get_user_countries_per_cluster($data)\n{\n global $user;\n if ($user->uid == 0) {\n return services_error('Access Denied!', 403);\n }\n if (!isset($data['clusters'])) {\n return services_error('missing clusters!', 403);\n }\n $clusters = $data['clusters'];\n $countries = get_user_countries($user);\n // Loop over the countries to get the clusters.\n $clusters_countries = [];\n foreach ($countries as $country) {\n $country_term = taxonomy_term_load($country);\n if (!isset($country_term->field_cluster[LANGUAGE_NONE])) {\n continue;\n }\n $cluster_term_id = $country_term->field_cluster[LANGUAGE_NONE][0]['target_id'];\n if (in_array($cluster_term_id, $clusters)) {\n $clusters_countries[$cluster_term_id][] = ['id' => $country_term->tid, 'name' => $country_term->name];\n }\n }\n return $clusters_countries;\n}", "public function key()\n {\n }", "public function key()\n {\n }", "public function key()\n {\n }", "public function key()\n {\n }", "public function key()\n {\n }", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function key();", "public function getToken()\n\t{\n\n\t}", "public function createAdminToken();", "public function getKingdom();", "public function getKingdom();", "public function actionIndex()\n {\n $searchModel = new ClusterSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function key()\n {\n }", "public function index()\n\t{\n\n\t\t// $redisObj->set('JLP', '金立品');\n\n\t\t// dump($redisObj->get('JLP'));\n\t}", "public function getNodeKey(): string\n {\n return $this->nodeKey;\n }", "public function generujKod() {\n\t\t$kod = Narzedzia::stworzWiersz(\n\t\t\t$this->getNazwa(), \n\t\t\t$this->getCenaJedn(),\n\t\t\t$this->getLiczba(),\n\n\t\t\t);\n\t\treturn $kod;\n\t}", "function vm_used_by_myOrg(){\n $reply = array('nordita');\n return $reply;\n}", "function createKubeNode($id) {\r\n\t\t$sql = \"SELECT * FROM kubebuilder_kubes WHERE `id`=\".$id.\"\";\r\n\t\t$query = mysql_query($sql);\r\n\t\t$kube = mysql_fetch_assoc($query);\r\n\t\t$details = getKubeDetails($kube);\r\n\t\t\r\n\t\t$fileName = \"../../kubes/\".$kube['file'].\".kub\";\r\n\t\t$handle = fopen($fileName, \"r\");\r\n\t\t$fileContent = base64_encode(fread($handle, filesize($fileName)));\r\n\t\tfclose($handle);\r\n\t\treturn \"\\t\\t\\t<kube id=\\\"\".$kube['id'].\"\\\" uid=\\\"\".$kube['uid'].\"\\\" name=\\\"\".htmlspecialchars(utf8_encode($kube['name'])).\"\\\" pseudo=\\\"\".htmlspecialchars(utf8_encode($details['user']['name'])).\"\\\" date=\\\"\".strtotime ($kube['date']).\"\\\" voted=\\\"\".$details['voted'].\"\\\" hof=\\\"\".$kube['hof'].\"\\\"><![CDATA[\".$fileContent.\"]]></kube>\\r\\n\";\r\n\r\n\t}", "public function getBasicQuorum() {}", "private function getContextKey(): string\n {\n return sprintf('zookeeper.connection.%s', $this->poolName);\n }", "function K_Means(array $t_args, array $inputs, array $outputs)\n{\n $className = generate_name(\"KMC\");\n\n // Processing of template arguments\n\n $numClusters = $t_args['number.clusters'];\n $debug = $t_args['debug'];\n $normalization = $t_args['normalization'];\n\n // The parameter p for the Minkowski distance metric used.\n $pMinkowski = $t_args['p'];\n grokit_assert($pMinkowski != 0, \"The parameter p cannot be exactly zero.\");\n\n // The parameter m for the fuzzified membership used.\n $mFuzzifier = $t_args['m'];\n grokit_assert($pMinkowski >= 1, \"The parameter m must be at least one.\");\n\n // The dimension of the data, i.e. how many elements are in each item.\n $dimension = count($inputs);\n\n // The max iteration for the algorithm after which it will conclude\n // regardless of convergence with a warning.\n // TODO: Make sure the warning happens.\n $maxIteration = $t_args['max.iteration'];\n\n // The maximum allowed change allowed for convergence; It should be 0 for\n // convergence only when the clusters are stationary.\n $epsilon = $t_args['epsilon'];\n\n // The mode of convergence, absolute or relative.\n $convergence = $t_args['convergence'];\n $relativeConvergence = $convergence == \"relative\";\n grokit_error_if($epsilon < 0, \"Epsilon cannot be negative.\");\n grokit_error_if($epsilon > 1 && $relativeConvergence,\n \"Epsilon must be between 0 and 1 for relative convergence.\");\n\n // The following is used to choose how initial clusters are formed.\n\n // The sample size is used to choose initial centers. This is only necessary\n // as a template argument if kmeans++ was chosen. A warning is thrown\n // beforehand if it needlessly specified.\n if ($kMeansPP = ($t_args['centers'] == 'kMeansPP')) {\n $sampleSize = $t_args['sample.size'];\n $initialCentersCode = '';\n // Or a random sample of size $numClusters is used to pick centers.\n } else if ($standardStart = ($t_args['centers'] == 'standard')) {\n $sampleSize = $numClusters;\n $initialCentersCode = '';\n // Or the centers are explicitly selected.\n } else {\n grokit_assert(is_array($t_args['centers']),\n \"Incorrect specification for centers.\");\n $initialCentersCode = is_array($t_args['centers'][0])\n ? '{' . eval_implode('implode(\", \", $val1)',\n ', ' . PHP_EOL, $t_args['centers']) . '}'\n : '{' . implode(',' . PHP_EOL, $t_args['centers']) . '}';\n }\n\n $numeric = array();\n $factors = array();\n $powers = array();\n foreach ($inputs as $name => $type)\n if ($type->is(\"numeric\")) {\n $numeric[] = $name;\n } else {\n $factors[] = $name;\n $powers[] = $type->get(\"cardinality\");\n }\n $numNumeric = count($numeric);\n $numFactors = count($factors);\n $maxPower = max($powers);\n grokit_error_assert($relativeConvergence || $numFactors == 0,\n \"Relative convergence is required for categorical data.\");\n\n $codeArray1 = array_combine(array_keys($inputs), range(0, $dimension - 1));\n $codeArray2 = array_combine($numeric, range(0, $numNumeric - 1));\n $codeArray3 = array_combine($factors, range(0, $numFactors - 1));\n\n if ($kMeansPP || $standardStart) {\n // The GLA for reservoir sampling is created.\n $samplingClass = lookupGLA(\n \"statistics::Reservoir_Sampling\",\n array('threshold.coefficient' => 22,\n 'sample.size' => $sampleSize),\n $inputs,\n $inputs\n );\n }\n?>\n\nusing namespace arma;\nusing namespace std;\n\nclass <?=$className?>;\n\n<? $constantState = lookupResource(\n \"statistics::K_Means_Constant_State\",\n array(\n 'className' => $className,\n 'dimension' => $dimension,\n 'initialCentersCode' => $initialCentersCode,\n 'numClusters' => $numClusters,\n 'numNumeric' => $numNumeric,\n 'numFactors' => $numFactors,\n 'maxPower' => $maxPower,\n )\n ); ?>\n\nclass <?=$className?> {\n private:\n // The typical constant state for an iterable GLA.\n const <?=$constantState?> & constant_state;\n\n // A vector whose elements will be individually set to contain the current\n // item's data. The data is packaged as a vector due to the reliance on\n // armadillo. This exists as a member variable as opposed to a local variable\n // in order to avoid repeated memory allocation.\n vec::fixed<<?=$numNumeric?>> item;\n\n // A matrix where the k-th column is the sum of the set of points in the k-th\n // cluster. These sums are used to calculate the centroids during iteration.\n mat::fixed<<?=$numNumeric?>, <?=$numClusters?>> sums;\n\n // A cube where the k-th slice is the frequency of that factor for each level\n // and cluster center, where columns correspond to clusters.\n cube::fixed<<?=$maxPower?>, <?=$numClusters?>, <?=$numFactors?>> frequencies;\n\n // A rowvec containing the counts for each cluster. For fuzzy clustering, this\n // is not the number of items in the cluster, but the sum of the weights for\n // that cluster.\n rowvec::fixed<<?=$numClusters?>> counts;\n\n<? if ($normalized) { ?>\n // This contains 3 column - max, min, range - with an entry for each input.\n // Only range and minimum are needed for the linear transformation. Max is\n // stored in case of future additions.\n mat::fixed<<?=$numNumerics?>, 3> transformations;\n\n<? } ?>\n // The sum of the distances between each point and its nearest cluster center.\n // This is a measure of how good the fit of the clusters is.\n // TODO: Implement a better measure, such as explained variance.\n double total_score;\n\n<? if ($startsNeeded = ($kMeansPP || $standardStart)) {\n if ($kMeansPP) { ?>\n // The reservoir sampling GLA that is used to construct the sample which\n // k-means++ will be performed on. k-means++ is performed on a sample because\n // it requires a lot of passes over the data, 2 * ($numClusters - 1).\n<? } else { ?>\n // The reservoir sampling GLA that is used to construct the sample which will\n // be used as the initial cluster centers.\n<? } ?>\n <?=$samplingClass?> sampling_GLA;\n\n // This is used to initialize the frequencies for the factors.\n // The columns correspond to the levels of a factor, with a column per factor.\n mat::fixed<<?=$maxPower?>, <?=$numFactors?>> overall_frequencies;\n\n<? } ?>\n // These four variables are used in AddItem to fully utilize Armadillo:\n\n<? if ($mFuzzifier > 1) { ?>\n // This is used to store the denominator of the sum used for fuzzy clustering.\n // It is the sum of the distances between each center and the current point,\n // each raised to the p / (m - 1) power.\n double distance_sum;\n<? } else { ?>\n // The index of the cluster center which is closest to the point.\n uword index;\n<? } ?>\n\n // Stores the distance from each center to the current point, the sum of\n // shifted centers. The 1/p root isn't taken but this is does not affect the\n // computation of the index of the closest points. It is further used in fuzzy\n // clustering for computing the weights, if applicable.\n rowvec::fixed<<?=$numClusters?>> distances;\n\n // Stores each center in a column after subtracting the current point from\n // each column and later the various powers of itself.\n mat::fixed<<?=$numNumeric?>, <?=$numClusters?>> shifted_centers;\n\n // Stores the distances for the factors. Acts much like shifted centers.\n mat::fixed<<?=$numFactors?>, <?=$numClusters?>> shifted_modes;\n\n public:\n <?=$className?>(const <?=$constantState?> & state)\n : constant_state(state),\n item(),\n sums(zeros<mat>(<?=$dimension?>, <?=$numClusters?>)),\n counts(zeros<rowvec>(<?=$numClusters?>)),\n<? if ($normalized) { ?>\n transformations()\n<? } ?>\n total_score(0),\n<? if ($startsNeeded) { ?>\n sampling_GLA(),\n overall_frequencies(zeros<mat>(<?=$maxPower?>, <?=$numFactors?>)),\n<? } ?>\n<? if ($mFuzzifier > 1) { ?>\n distance_sum(0),\n<? } else { ?>\n index(0),\n<? } ?>\n distances(),\n shifted_centers() {\n<? if ($normalized) { ?>\n transformations.col(0).fill(-numeric_limits<double>::infinity());\n transformations.col(1).fill( numeric_limits<double>::infinity());\n<? } ?>\n }\n\n void AddItem(<?=const_typed_ref_args($inputs)?>) {\n // TODO: Add diagonistic statistics to see how good the fit is.\n<? if ($normalized) { ?>\n if (constant_state.iteration == 0) {\n<? foreach ($codeArray2 as $name => $counter) { ?>\n if (<?=$name?> > extremities(<?=$counter?>, 0))\n extremities(<?=$counter?>, 0) = <?=$name?>;\n if (<?=$name?> < extremities(<?=$counter?>, 1))\n extremities(<?=$counter?>, 1) = <?=$name?>;\n<? } ?>\n }\n\n<? } ?>\n<? if($startsNeeded) { ?>\n if (constant_state.iteration == 0) {\n sampling_GLA.AddItem(<?=args($numeric)?>);\n<? foreach ($codeArray2 as $name => $counter) { ?>\n overall_frequencies[<?=$name?>][<?=$counter?>]++;\n<? } ?>\n return;\n }\n\n<? } ?>\n<? foreach ($codeArray2 as $name => $counter) { ?>\n item[<?=$counter?>] = <?=$name?>;\n<? } ?>\n<? if ($normalized) { ?>\n item -= transformations.col(1);\n item /= transformations.col(2);\n<? } ?>\n shifted_centers = constant_state.centers;\n shifted_centers.each_col() -= item;\n<? foreach ($codeArray2 as $factor => $counter) { ?>\n shifted_modes.row(<?=$counter?>) = constant_state.frequencies\n .slice(<?=$counter?>).row(<?=$factor?>);\n<? } ?>\n<? if ($pMinkowski % 2 != 0) { ?>\n shifted_centers = abs(shifted_centers);\n<? } ?>\n<? if ($pMinkowski % 1 == 0 && -8 <= $pMinkowski && $pMinkowski <= 10) { ?>\n<? if ($pMinkowski < 0) { ?>\n shifted_centers = 1 / shifted_centers;\n shifted_modes = 1 / shifted_modes;\n<? }\n for ($counter = 2; $counter <= $pMinkowski; $counter ++) { ?>\n shifted_centers %= shifted_centers;\n shifted_modes %= shifted_modes;\n<? } ?>\n<? for ($counter = -2; $counter >= $pMinkowski; $counter --) { ?>\n shifted_centers /= shifted_centers;\n shifted_modes /= shifted_modes;\n<? } ?>\n<? } else { ?>\n shifted_centers = pow(shifted_centers, <?=$pMinkowski?>);\n shifted_modes = pow(shifted_modes, <?=$pMinkowski?>);\n<? } ?>\n distances = sum(shifted_centers, 0);\n distances += sum(shifted_modes, 0);\n\n<? if ($mFuzzifier == 1) {\n if ($pMinkowski < 0) { ?>\n total_score += distances.max(index);\n<? } else { ?>\n total_score += distances.min(index);\n<? } ?>\n sums.col(index) += item;\n counts[index] ++;\n<? foreach ($codeArray2 as $factor => $counter) { ?>\n frequencies(<?=$factor?>, index, <?=$counter?>) ++;\n<? } ?>\n<? if ($debug) { ?>\n if (sum(counts) <= 10) {\n cout << \"Item number: \" << sum(counts) << endl;\n cout << \"Item: \" << endl << item << endl;\n cout << \"Added to cluster \" << index << endl;\n cout << \"Current counts:\" << endl << counts << endl;\n cout << \"Current sums:\" << endl << sums << endl;\n cout << \"Current frequencies:\" << endl << frequencies << endl;\n }\n<? }\n } else { ?>\n distances = pow(distances + 0.000000001, <?= -1 / ($mFuzzifier - 1) ?>);\n distances /= sum(distances);\n counts += distances;\n sums += item * distances;\n<? foreach ($codeArray2 as $factor => $counter) { ?>\n frequencies.slice(<?=$counter?>).row(<?=$factor?>) += distances;\n<? } ?>\n<? if ($debug) { ?>\n if (sum(counts) <= 10) {\n cout << \"Item number: \" << sum(counts) << endl;\n cout << \"Item:\" << endl << item << endl;\n cout << \"Weights:\" << endl << distances << endl;\n cout << \"Current counts:\" << endl << counts << endl;\n cout << \"Current sums:\" << endl << sums << endl;\n cout << \"Current frequencies:\" << endl << frequencies << endl;\n }\n<? }\n } ?>\n }\n\n void AddState(<?=$className?> & other) {\n<? if ($startsNeeded) { ?>\n // The other GLA must have the same state as this one, so there is no need\n // to check if it has starts.\n if (constant_state.iteration == 0) {\n sampling_GLA.AddState(other.sampling_GLA);\n overall_frequencies += other.overall_frequencies;\n return;\n }\n<? }\n if ($debug) { ?>\n cout << \"Before Sums:\" << endl << sums << endl;\n cout << \"Before Counts:\" << endl << counts << endl;\n cout << \"Before Frequencies:\" << endl << frequencies << endl;\n<? } ?>\n sums += other.sums;\n counts += other.counts;\n frequencies += other.frequencies\n<? if ($debug) { ?>\n cout << \"After Sums:\" << endl << sums << endl;\n cout << \"After Counts:\" << endl << counts << endl;\n cout << \"After Frequencies:\" << endl << frequencies << endl;\n<? } ?>\n }\n\n bool ShouldIterate(<?=$constantState?> & modible_state) {\n<? if ($debug) { ?>\n cout << \"Iteration: \" << modible_state.iteration + 1 << endl;\n cout << \"Sums:\" << endl << sums << endl;\n cout << \"Counts:\" << endl << counts << endl;\n cout << \"Frequencies:\" << end << frequencies << endl;\n<? } ?>\n<? if ($normalized) { ?>\n if (constant_state.iteration == 0) {\n transformations.col(2) = transformations.col(0) - transformations.col(1);\n modible_state.transformations = transformations;\n }\n<? } ?>\n<? if ($startsNeeded) { ?>\n if (constant_state.iteration == 0) {\n // Processing of the sample into vectors. This is done here, rather than\n // in the sampling GLA, because it is possible for not only doubles to be\n // used for k-means. Therefore, it would not make sense to make a version\n // of the sample GLA use vectors instead of tuples.\n // TODO: Implement factors for k-means.\n\n mat::fixed<<?=$numNumeric?>, <?=$sampleSize?>> sample;\n for (int counter = 0; counter < <?=$sampleSize?>; counter ++) {\n<? foreach ($codeArray2 as $counter) { ?>\n sample.row(<?=$counter?>)[counter]\n = get<<?=$counter?>>(sampling_GLA.GetSample(counter));\n<? } ?>\n }\n<? if ($kMeansPP) { ?>\n // Implementation of k-means++\n\n // A random device used to generate the seed for the generator\n std::random_device random_seed;\n\n // A random engine used to generated random variates for the above.\n std::default_random_engine generator(random_seed());\n\n // A uniform discrete distribution that generates a random variate between\n // 0 and sample size - 1, inclusive. This is used to randomly decide which\n // element of sample should be used as the first cluster center.\n std::uniform_int_distribution<long> random_index(0, <?=$sampleSize?> - 1);\n\n // The first cluster for k-means++ is chosen at random.\n long first_index = random_index(generator);\n modible_state.centers.col(0) = sample.col(first_index);\n\n // The total amount of initial clusters generated so far.\n int num_clusters = 1;\n\n // These are declared here only to avoid re-allocation of memory.\n // Otherwise, they would be declared within the for loop.\n\n // Sum of the distances between each point and its nearest cluster center.\n int total_distance;\n // Stores the distance between each point and its nearest cluster center.\n vec min_distances(<?=$sampleSize?>);\n // The distance between the current point and its nearest cluster center.\n double min_distance;\n // The index of the closest cluster to the current point.\n long min_cluster;\n // Iterates over the sample.\n long s_counter;\n // Iterates over the cluster centers.\n long c_counter;\n // A random double between 0 and the total distance. It is used to select\n // the next cluster center.\n double random_distance;\n\n for (num_clusters; num_clusters < <?=$numClusters?>; num_clusters ++) {\n total_distance = 0;\n // TODO: Improve this part, maybe with a hash table\n for (s_counter = 0; s_counter < <?=$sampleSize?>; s_counter ++) {\n min_distance = norm(\n modible_state.centers.col(0) - sample(s_counter),\n <?=$pMinkowski?>);\n for (c_counter = 1; c_counter < num_clusters; c_counter ++) {\n double distance = norm(\n modible_state.centers.col(c_counter) - sample.col(s_counter),\n <?=$pMinkowski?>);\n if (distance < min_distance) {\n min_cluster = c_counter;\n min_distance = distance;\n }\n }\n total_distance += min_distance;\n min_distances[s_counter] = min_distance;\n }\n random_distance = generate_canonical<double, 40>(generator)\n * total_distance;\n for (--s_counter; s_counter >= 0; s_counter--) {\n total_distance -= min_distances[s_counter];\n if (total_distance <= random_distance)\n break;\n }\n modible_state.centers.col(num_clusters) = sample.col(s_counter);\n }\n<? } else if ($standardStart) { ?>\n for (int counter = 0; counter < <?=$sampleSize?>; counter ++)\n modible_state.centers[counter] = sample[counter];\n<? } ?>\n overall_frequencies /= sum(overall_frequencies.col(0));\n int f_counter = 0, l_counter = 0, c_counter = 0;\n for (f_counter; f_counter < <?=$numFactors?>; f_counter++)\n for (l_counter; l_counter < <?=$numFactors?>; l_counter++)\n for (c_counter; c_counter < <?=$numFactors?>; c_counter++)\n modible_state.modes(l_counter, c_counter, f_counter) =\n overall_frequencies(l_counter, f_counter);\n modible_state.iteration++;\n return true;\n }\n\n<? } ?>\n<? if (!normalized) { ?>\n sums.each_col() *= modible_state.transformations.col(2);\n sums.each_col() += modible_state.transfomrations.col(1);\n<? } ?>\n bool has_converged = true;\n vec::fixed<<?=$numNumeric?>> new_center();\n vec::fixed<<?=$numNumeric?>> new_mode();\n\n for (int c_counter = 0; c_counter < <?=$numClusters?>; c_counter++) {\n if (counts[c_counter] > 0)\n new_center = sums.col(c_counter) / counts[c_counter];\n else\n new_center = modible_state.centers.col(c_counter);\n has_converged = has_converged\n && HasConverged(modible_state.centers.col(c_counter),\n new_center);\n modible_state.centers.col(c_counter) = new_center;\n }\n\n for (int f_counter = 0; f_counter < <?=$numFactors?>)\n for (c_counter = 0; c_counter < <?=$numClusters?>; c_counter ++) {\n if (counts[c_counter] > 0)\n new_mode = 1 - frequencies.slice(f_counter).col(c_counter)\n / sum(frequencies.slice(0).col(0));\n else\n new_mode = modible_state.modes.slice(f_counter).col(c_counter);\n has_converged = has_converged\n && HasConverged(\n modible_state.modes.slice(f_counter).col(c_counter),\n new_mode);\n modible_state.modes.slice(f_counter).col(c_counter) = new_mode;\n }\n\n modible_state.iteration ++;\n return !has_converged\n && modible_state.iteration < <?=$maxIteration?>;\n }\n\n bool HasConverged(vec old_center, vec new_center) {\n<? if ($relativeConvergence) { ?>\n return max(abs((old_center - new_center) / old_center)) <= <?=$epsilon?>;\n<? } else { ?>\n return max(abs(old_center - new_center)) <= <?=$epsilon?>;\n<? } ?>\n }\n\n // TODO: Implement JSON return or something, not just printing\n void GetResult(<?=typed_ref_args($outputs)?>) {\n Json::Value result(Json::objectValue);\n result[\"iteration\"] = (Json::Value::Int64) constant_state.iteration;\n for (int counter = 0; counter < <?=$numClusters?>; counter ++) {\n<? foreach ($codeArray1 as $name => $counter) { ?>\n result[\"centers\"][<?=$counter?>].append(\n constant_state.centers.col(counter)[<?=$counter?>]);\n<? } ?>\n }\n cout << result << endl;\n }\n};\n\n<?\n return array(\n 'kind' => 'GLA',\n 'name' => $className,\n 'system_headers' => array('armadillo', 'string', 'iostream',\n 'limits'),\n 'user_headers' => array(),\n 'iterable' => TRUE,\n 'input' => $inputs,\n 'output' => $outputs,\n 'result_type' => 'single',\n 'generated_states' => array($constantState),\n );\n}", "public function connexionSuperAdminLogin(){\n }", "public function operations();", "public function testUpdateNetworkMerakiAuthUser()\n {\n }", "function amap_ma_get_map_gm_clustering() {\n $cluster = trim(elgg_get_plugin_setting('gm_cluster', AMAP_MA_PLUGIN_ID));\n if ($cluster === AMAP_MA_GENERAL_YES) {\n return true;\n }\n\n return false;\n}", "function new_request_token($consumer) {\n }", "function __construct($tokenkey, $tokensecret, $language, $localUserId, $dbData, $showDebug = false, $accesstoken=null) {\r\n $this->showDebug = $showDebug; //echo debugs within this class\r\n osapiLogger::setEchoLogs($showDebug); //echo logs from php client (handy for seeing detailed requests + responses)\r\n $useFileStorage = false; //else we'll use my custom mysql storage class thingie\r\n\r\n $this->tokenkey = $tokenkey;\r\n $this->tokensecret = $tokensecret;\r\n $this->localUserId = $localUserId; // identifier for the local user's session\r\n $this->language = $language;\r\n\r\n ini_set('error_reporting', E_ALL | E_STRICT); // Report everything, better to have stuff break here than in production\r\n set_include_path(get_include_path() . PATH_SEPARATOR . '..'); // Add the osapi directory to the include path\r\n\r\n $this->appId = '@app'; //'@app';\r\n\r\n $this->provider = new osapiNetlogProvider();\r\n $this->provider->rpcEndpoint = null; //!!! use REST endpoint instead of rpc endpoint (which is default and will lead to error)\r\n\r\n $this->debug(\"Creating 3 legged osapi object ...\");\r\n\r\n //for logging and maintaining session for 3-legged\r\n if ($useFileStorage) {\r\n $folder = '/os/tmp/osapi';\r\n $this->storage = new osapiFileStorage($folder);\r\n } else {\r\n $this->storage = new osapiMySQLStorage(/* $dbData['host'], $dbData['user'], $dbData['pass'], $dbData['db'], $dbData['table'] */);\r\n }\r\n\r\n $this->auth = osapiOAuth3Legged::performOAuthLogin($this->tokenkey, $this->tokensecret, $this->storage, $this->provider, $this->localUserId, null, $accesstoken);\r\n $this->osapi = new osapi($this->provider, $this->auth);\r\n $this->userId = '@me';\r\n\r\n $this->viewer = $this->getViewer();\r\n $initText = \"Init osapi object 3-legged... Userid \" . $this->userId . \" - App ID \" . $this->appId;\r\n $storageInfo = $useFileStorage ? \"Using file storage in folder $folder\" : \"Using MySQL storage with host \" . $dbData['host'] . \" and db \" . $dbData['db'];\r\n if (array_key_exists(\"response\", $this->viewer)) {\r\n echo \"\";\r\n } else {\r\n $viewerInfo = \"Viewer: \" . $this->viewer['nickname'] . \" with userid \" . $this->viewer['id'];\r\n $this->debug($initText . '<br>' . $storageInfo . '<br>' . $viewerInfo);\r\n }\r\n }", "private function getAdminKuserId()\r\n\t{\r\n\t\t$partnerId = KalturaGlobalData::getData(\"@TEST_PARTNER_ID@\");\r\n\t\t$puserId = KalturaGlobalData::getData(\"TEST_PARTNER_USER_ID\");\r\n\t\tKuserPeer::getKuserByPartnerAndUid($partnerId, $puserId);\r\n\t}", "public function getUserOperationsAction()\n {\n $operation = new Workapp_Operation();\n $this->_helper->json($operation->getOperationList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }", "public static function adminKey(){\n \n // Cache ID\n $cid = 'senior_systems_authkey';\n\n $expired = TRUE;\n\n if($cache = \\Drupal::cache()->get($cid)){\n // Was this cached within the last two hours?\n $expired = time() - $cache->created > 7200;\n }\n\n if (!$expired) {\n $key = $cache->data;\n } else {\n // Request a new authorization key\n $config = \\Drupal::config('senior_systems_api.settings');\n $params = array(\n 'username' => $config->get('username'),\n 'password' => $config->get('password'),\n );\n $service = self::service('UserManagementService');\n $result = $service->loginExt($params);\n $key = $result->AuthKey;\n\n // Don't cache a bad key\n $pattern = '/^\\w{8}(-\\w{4}){3}-\\w{12}$/';\n if(preg_match($pattern,$key)){\n \\Drupal::cache()->set($cid, $key);\n } else {\n // Don't return a bad key either\n return;\n }\n }\n\n return $key;\n\n }", "public function ClearCluster()\n {\n\t\tself::$sCluster = false;\n }", "public function getServiceKey() {}", "private function __construct() {\n $cluster = Cassandra::cluster()\n ->withContactPoints($this->_server_id)\n ->build();\n $this->_connection = $cluster->connect($this->_keyspace);\n }", "public function recuperaToken()\n {\n // por eso para propositos de prueba solo se usara el primer cliente\n $this->cliente=Cliente::find(1)->token;\n }", "private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }", "function KravatteOracle($seed, $key)\n \t{\n\tself::k_key($key);\n\tself::reset_state(); \n self::seed_generator($seed);\n\t}", "function set_op_vars()\n{\n global $opname, $action, $basecost;\n\n $action[1] = \"recon\";\n $opname[1] = \"Recon\";\n $basecost[1] = 1;\n\n $action[2] = \"sneak\";\n $opname[2] = \"Sneak\";\n $basecost[2] = 1;\n\n $action[3] = \"intercept\";\n $opname[3] = \"Intercept\";\n $basecost[3] = 1;\n\n $action[4] = \"bribe\";\n $opname[4] = \"Bribe Accountant\";\n $basecost[4] = 1;\n\n $action[5] = \"truth\";\n $opname[5] = \"Truth's Eye\";\n $basecost[5] = 1;\n\n $action[6] = \"farm\";\n $opname[6] = \"Weather's Light\";\n $basecost[6] = 0;\n\n $action[7] = \"poison\";\n $opname[7] = \"Poison Water\";\n $basecost[7] = 14;\n\n $action[8] = \"money\";\n $opname[8] = \"Templu Amplo\";\n $basecost[8] = 0;\n\n $action[9] = \"arson\";\n $opname[9] = \"Arson\";\n $basecost[9] = 20;\n\n $action[10] = \"trap\";\n $opname[10] = \"Thieves Trap (SELF)\";\n $basecost[10] = 4;\n\n $action[11] = \"boze\";\n $opname[11] = \"Boze\";\n $basecost[11] = 20;\n\n $action[12] = \"monitoring\";\n $opname[12] = \"Monitoring\";\n $basecost[12] = 12;\n\n $action[13] = \"tunneling\";\n $opname[13] = \"Tunneling (WAR ONLY)\";\n $basecost[13] = 10;\n\n $action[14] = \"rebellion\";\n $opname[14] = \"Thieves Rebellion\";\n $basecost[14] = 10;\n\n $action[15] = \"raid\";\n $opname[15] = \"Hwighton Raid\";\n $basecost[15] = 20;\n\n $action[16] = \"research\";\n $opname[16] = \"Napanometry\";\n $basecost[16] = 0;\n \n $action[17] = \"ambush\";\n $opname[17] = \"Ambush\";\n $basecost[17] = 280;\n\n}", "public function index()\n {\n $clusters = Cluster::getAllCluster();\n return ClusterResource::collection($clusters);\n }", "protected function setCurrentClusterNode($mode)\n {\n if (!$this->m_current_clusternode || !$this->m_current_clusternode->hasMode($mode))\n {\n if ($mode==='r' && !empty($this->m_readonly_nodes_config)) { $this->setRandomNodeFromNodeConfigs($this->m_readonly_nodes_config,$mode); }\n else if ($mode==='w' && !empty($this->m_writeonly_nodes_config)) { $this->setRandomNodeFromNodeConfigs($this->m_writeonly_nodes_config,$mode); }\n else { $this->setRandomNodeFromNodeConfigs($this->m_nodes_config ,$mode); }\n }\n }", "public function getNodeKey()\n\t{\n\t\treturn $this->_node_key;\n\t}", "abstract public function render_client_token();", "function archimedes_get_token() {\n $keys = module_invoke_all('archimedes_id'); sort($keys);\n return drupal_hmac_base64(implode('|', $keys), drupal_get_private_key() . drupal_get_hash_salt());\n}", "public function getOp()\n {\n return $this->Op;\n }", "public function getOp()\n {\n return $this->Op;\n }", "function mongo_node_operations() {\n $operations = array(\n 'publish' => array(\n 'label' => t('Publish selected content'),\n 'callback' => 'mongo_node_mass_update',\n 'callback arguments' => array('updates' => array('status' => 1)),\n ),\n 'unpublish' => array(\n 'label' => t('Unpublish selected content'),\n 'callback' => 'mongo_node_mass_update',\n 'callback arguments' => array('updates' => array('status' => 0)),\n ),\n 'delete' => array(\n 'label' => t('Delete selected content'),\n 'callback' => 'mongo_node_mass_delete',\n ),\n );\n return $operations;\n}", "function _dataone_admin_online_options() {\n $options = &drupal_static(__FUNCTION__);\n if (empty($options)) {\n $options = array(\n DATAONE_API_STATUS_PRODUCTION => t('!label - This node is tested, ready and available for access.', array('!label' => '<strong>PRODUCTION</strong>')),\n DATAONE_API_STATUS_DEVELOPMENT => t('!label - This node is offline for development.', array('!label' => '<strong>DEVELOPMENT</strong>')),\n DATAONE_API_STATUS_OFF => t('!label - This node is not accessible to anyone.', array('!label' => '<strong>OFF</strong>')),\n );\n }\n\n return $options;\n}", "public function __construct() {\t\t\n\t\t$this->apikey='uYXMOYkzh1bJwKLk8SFb00EiYydmLDvoqskEOtqlk4hSE9NAM9RRV08C';\n\t\t$this->apisec='9FsUJswhQX13nGdahA6YDgkfZdYd05/SPObJKD12GAP5LKq1smT0FAVuMc26PH0fvuYPVlPVECBYXvu8Aqy92Q==';\n\t\t$this->url = 'https://api.kraken.com';\n }", "public function createConnection() {\n // below code is used to create connection usinf Orientdb\n $client = new PhpOrient($this->config['host'],$this->config['port']);\n $client->username = $this->config['username'];\n $client->password = $this->config['password'];\n if(Cache::has('odb_session_token')) {\n $client->setSessionToken(Cache::get('odb_session_token'));\n\n }else {\n $client->setSessionToken(true);\n Cache::forever('odb_session_token',$client->getSessionToken());\n }\n if($client->connect()){\n $this->clusterMap= $client->dbOpen( $this->config['database'], $this->config['username'], $this->config['password']);\n }\n return $client;\n }", "function kmeans($data, $k)\r\n{\r\n $cPositions = assign_initial_positions($data, $k);//positions表示mean,k表示分幾群\r\n $clusters = array();\r\n \r\n while(true)\r\n {\r\n $changes = kmeans_clustering($data, $cPositions, $clusters);//Function傳回$nChanges的值,changes檢查和上一次的分類是否一樣\r\n if($changes)//如果分類穩定沒改變了就return\r\n {\r\n return kmeans_get_cluster_values($clusters, $data);\r\n }\r\n $cPositions = kmeans_recalculate_cpositions($cPositions, $data, $clusters);\r\n }\r\n}", "private function musGetNodeId(){\n }", "public function putLeader(): string;", "function loginRequest( $logintoken ) {\n\tglobal $endPoint;\n\n\t$params2 = [\n\t\t\"action\" => \"clientlogin\",\n\t\t\"username\" => \"username\",\n\t\t\"password\" => \"password\",\n\t\t'loginreturnurl' => 'http://127.0.0.1:5000/',\n\t\t\"logintoken\" => $logintoken,\n\t\t\"format\" => \"json\"\n\t];\n\n\t$ch = curl_init();\n\n\tcurl_setopt( $ch, CURLOPT_URL, $endPoint );\n\tcurl_setopt( $ch, CURLOPT_POST, true );\n\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $params2 ) );\n\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $ch, CURLOPT_COOKIEJAR, \"cookie.txt\" );\n\tcurl_setopt( $ch, CURLOPT_COOKIEFILE, \"cookie.txt\" );\n\n\t$output = curl_exec( $ch );\n\tcurl_close( $ch );\n\n}", "function opdsSearchDescriptor()\n{\n global $app;\n\n $gen = mkOpdsGenerator($app);\n $cat = $gen->searchDescriptor(null, '/opds/searchlist/0/');\n mkOpdsResponse($app, $cat, OpdsGenerator::OPENSEARCH_MIME);\n}", "function join_api_token( $token ) {\n /* format (2) : crypt (1) : ccrypt( create_api_token('glynthom', '100') , 'AES-256-OFB', 'en' ) ) */\n\n $lump = explode(\"-\", $token);\n\n /* six lumps * unshuffle */\n $lump[0];\n $lump[1];\n $lump[2];\n $lump[3];\n $lump[4];\n $lump[5];\n $lump[6];\n\n return $lump[6] .'-'. $lump[0] .'-'. $lump[1] .'-'. $lump[2] .'-'. $lump[3] .'-'. $lump[5] .'-'. $lump[4] ;\n\n}", "public function access();", "public function key() : string\n {\n return 'local';\n }", "public function generujKod(){\n\t\t//\n\t}", "function opdsRoot()\n{\n global $app;\n\n $gen = mkOpdsGenerator($app);\n $cat = $gen->rootCatalog(null);\n mkOpdsResponse($app, $cat, OpdsGenerator::OPDS_MIME_NAV);\n}" ]
[ "0.60760504", "0.57529956", "0.5207993", "0.5190976", "0.5080163", "0.5080134", "0.506632", "0.50360686", "0.5031988", "0.5028304", "0.49714053", "0.49014944", "0.4884136", "0.48678365", "0.48331514", "0.48330092", "0.48324466", "0.48275238", "0.4824771", "0.48185167", "0.4818043", "0.47907504", "0.47882724", "0.47633392", "0.4716684", "0.47152236", "0.47152236", "0.47152236", "0.47152236", "0.47152236", "0.47152236", "0.47151768", "0.47151768", "0.4704985", "0.46822208", "0.46767926", "0.46675488", "0.46675488", "0.46675488", "0.46675488", "0.46585515", "0.46505502", "0.46505502", "0.46505502", "0.46505502", "0.46505502", "0.46505502", "0.46505502", "0.46505502", "0.46505502", "0.4649744", "0.4640649", "0.4638277", "0.4638277", "0.46313033", "0.46292597", "0.46249554", "0.46245527", "0.46156356", "0.46140176", "0.46077728", "0.46047938", "0.4583929", "0.45813662", "0.45795783", "0.4578005", "0.45767358", "0.45731694", "0.45689544", "0.45610493", "0.45535326", "0.45533457", "0.45527995", "0.45517614", "0.45466796", "0.45265722", "0.45251736", "0.45240983", "0.45190224", "0.44908684", "0.44905934", "0.44902086", "0.4480368", "0.44787264", "0.4474903", "0.4471514", "0.4471514", "0.4471358", "0.44676912", "0.44588494", "0.44563392", "0.44502658", "0.44431543", "0.4441751", "0.44413924", "0.4438679", "0.44213602", "0.44144997", "0.44108024", "0.44017154", "0.43982658" ]
0.0
-1
/////////////////////////////////////////////////////////////////////////////////////////////////////// voor code completion:
static function getCluster($clusterId) { $query = PdpActionQueries::getCluster($clusterId); $clusterData = mysql_fetch_assoc($query); $clusterValueObject = PdpActionClusterValueObject::createWithData($clusterData); mysql_free_result($query); return $clusterValueObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getNextCode() {}", "public static function getCode()\n\t{\n\t\tthrow new NotImplementedException;\n\t}", "function runkit_lint($code)\n{\n}", "static function completion(array &$donnees)\r\n {\r\n // ici le code\r\n }", "static function completion(array &$donnees)\r\n {\r\n // ici le code\r\n }", "function non_functional()\n{\n $lots = of_code();\n //goes here\n\n /**\n * this is an example doc block that should be detected. It sits above an action inside a function.\n */\n $defaults = do_action('single_quote_name_no_spaces', $first = array('fake', array(1,2,3)), $second, $last);\n}", "private function _i() {\n }", "function use_codepress()\n {\n }", "function yy_r78(){ $this->_retvalue =['USING', $this->yystack[$this->yyidx + -1]->minor]; }", "final function getCode();", "private function j() {\n }", "function yy_r86(){ $this->_retvalue = new Stmt\\Expr(strtoupper(@$this->yystack[$this->yyidx + 0]->minor), $this->yystack[$this->yyidx + -1]->minor); }", "function code() {\n\t\t$code_issue_replace = false;\n\t\tif (in_array('replace', $this->args)) {\n\t\t\t$code_issue_replace = true;\n\t\t}\n\t\t$files = $this->files();\n\t\tforeach ( $files as $file ) {\n\t\t\t$code = file_get_contents($file);\n\t\t\t$issues = $this->code_issue_find($code);\n\t\t\tif (!empty($issues)) {\n\t\t\t\tif ($code_issue_replace) {\n\t\t\t\t\t$this->code_issue_replace($file, $code);\n\t\t\t\t} else {\n\t\t\t\t\t$this->out($file);\n\t\t\t\t\tprint_r($issues);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function yy_r153(){ return; }", "function yy_r77(){ $this->_retvalue = ['USING', $this->yystack[$this->yyidx + 0]->minor]; }", "function yy_r113()\n {\n return;\n }", "function yy_r83(){return; }", "public function getFirstCode() {}", "public function getFieldAutoCompleteInmueble() {\n\t\t\n\t}", "function end_code(&$code)\n\n{\n\n return str_replace(get_placeholder(8), 'class', ($code = substr($code, 0, -1)));\n\n}", "public function getCodeSample()\n {\n $code = <<< 'CODE'\n namespace KEINOS\\AutoMailReply;\n require_once('./src/constants.php');\n require_once('./src/functions.php');\n echo (isModeDebug() === true) ? 'true' : 'false';\nCODE;\n $code = \\str_replace(PHP_EOL, '', $code);\n\n return $code;\n }", "public static function declarations()\n {\n \n }", "function yy_r55(){ $this->_retvalue = strtoupper(@$this->yystack[$this->yyidx + 0]->minor); }", "function yy_r66(){ $this->_retvalue = str_replace(array('.\"\".','\"\".','.\"\"'),array('.','',''),'\"'.$this->yystack[$this->yyidx + -1]->minor.'\"'); }", "function yy_r74(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.'::$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "private function codeInjectionCheck(){\n foreach($this->blackListCommands['python'] as $command){\n $this->code = str_replace( $command, '', $this->code);\n if ($this->debugLevel > 3){\n echo \"-------------------------\\n\";\n echo \"CODE: \" . $this->code;\n echo \"-------------------------\\n\";\n }\n }\n }", "function yy_r68(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "private function aFunc()\n {\n }", "function lapa_compiler_php_code($act, $parser)\n{\n if ($act == 1) {\n $buff = '';\n if (!isset(LapaEngineParser::$_plugins_property['php_code'])) {\n LapaEngineParser::$_plugins_property['php_code'] = array();\n }\n $attr = $parser->parseDirectiveAttributes();\n $name = isset($attr['name']) ? $attr['name']: 'default';\n $parser->newStackCommand(array('php_code', $name));\n $parser->_outputNew();\n }else {\n if ( (!$stack_commands = $parser->getStackCommand() ) || $stack_commands[0] != 'php_code' ) {\n throw new LapaEngineException('Неверный вызов \"/php_code\" cтрока %s.', $parser->templateLine());\n }\n /* вырезали буффер php кода, его надо еще вернуть */\n $buff = $parser->_outputGet();\n /* создаем переменную с значением */ \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n $buff .= \"\\$_var_php_code['{$stack_commands[1]}'] = '\" . preg_replace(\"/(?!\\\\\\\\)\\\\'/\", '\\\\\\'','<?php ' . str_replace('\\\\', '\\\\\\\\',$buff) . ' ?>') . \"';\"; \n $parser->removeStackCommand(); \n LapaEngineParser::$_plugins_property['php_code'][$stack_commands[1]] = $stack_commands[1];\n }\n return $buff;\n}", "function python_class_scan($code) {\n $classes = array();\n $lines = explode(\"\\n\", $code);\n foreach ($lines as $raw_line) {\n $line = trim($raw_line);\n if (strlen($line) > 0) {\n if ($line[0] === 'c' && substr($line, 0, 6) === 'class ') {\n $token = $this->scanner_pop_token($line, 5);\n if ($token['found']) {\n $classes[$token['token']] = true;\n }\n } else {\n $raise_index = strpos($line, 'raise ');\n if ($raise_index !== false) {\n $token = $this->scanner_pop_token($line, $raise_index + 5);\n if ($token['found']) {\n $class_name = $token['token'];\n $index = $token['index'];\n $index = $this->scanner_skip_whitespace($line, $index);\n if ($this->string_occurs_at($line, '(', $index)) {\n $classes[$class_name] = true;\n }\n }\n }\n }\n }\n }\n\n $output = array();\n foreach ($classes as $class_name => $_) {\n if (strtoupper($class_name[0]) === $class_name[0]) {\n array_push($output, $class_name);\n }\n }\n\n return $output;\n }", "function vb_highlight(&$code)\n\n{\n\n $code = str_replace('\"\"', get_placeholder(10), $code);\n\n $blocks = array(\n\n array(\n\n 'pattern' => '#\".+?\"#',\n\n 'prefix' => '<span class=\"vb_string\">', \n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => \"#'.*#\",\n\n 'prefix' => '<span class=\"vb_comment\">', \n\n 'suffix' => '</span>'\n\n ),\n\n );\n\n \n\n $secondaries = array(\n\n array(\n\n 'pattern' => '!([\\n\\r]|^)\\s*?#.*!',\n\n 'prefix' => '<span class=\"vb_preprocessor\">',\n\n 'suffix' => '</span>'\n\n ),\n\n array(\n\n 'pattern' => '!(\\W|^)(\\.?[0-9][0-9.]*|&[hH][0-9a-fA-F]*)!',\n\n 'replacement' => '<span class=\"vb_number\">$2</span>',\n\n 'keepprefix' => 1\n\n ),\n\n array(\n\n 'pattern' => '~[,=\\+\\-!%\\^&\\*\\(\\)\\<\\>#$|]~',\n\n 'prefix' => '<span class=\"vb_symbol\">',\n\n 'suffix' => '</span>'\n\n )\n\n );\n\n \n\n $kw = array(\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"vb_keyword\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('addhandler','addressof','andalso','alias','and','ansi','as','assembly','attribute','auto','begin','call','case','catch','cbool','cbyte','cchar','cdate','cdec','cdbl','char','cint','class','clng','cobj','compare','const','continue','cshort','csng','cstr','ctype','declare','default','delegate','dim','do','each','else','elseif','end','erase','error','event','exit','explicit','finally','for','friend','function','get','gettype','global','gosub','goto','handles','if','implement','implements','imports','in','inherits','interface','is','let','lib','like','load','loop','lset','me','mid','mod','module','mustinherit','mustoverride','mybase','myclass','namespace','new','next','not','nothing','notinheritable','notoverridable','on','open','option','or','orelse','overloads','overridable','overrides','paramarray','preserve','property','raiseevent','readonly','redim','rem','removehandler','rset','resume','return','select','set','shadows','shared','step','stop','structure','sub','synclock','then','throw','to','try','typeof','unload','unicode','until','wend','when','while','with','withevents','writeonly','xor')\n\n ),\n\n array(\n\n 'prefix' => '<span '.get_placeholder(8).'=\"vb_type\">',\n\n 'suffix' => '</span>',\n\n 'keywords' => array('boolean','byref','byte','byval','currency','date','decimal','double','enum','false','integer','long','object','optional','private','protected','public','short','single','static','string','true','type','variant')\n\n ),\n\n );\n\n $code = generic_highlight($code, $blocks, $secondaries, array(), $kw);\n\n // put escapes back in\n\n return str_replace(get_placeholder(10), '<span class=\"vb_string\">&quot;&quot;</span>', $code);\n\n}", "function yy_r75(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; }", "public function aaa() {\n\t}", "protected function complete($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "protected function _refine() {\n\n\t}", "function _pre() {\n\n\t}", "function name($code) {\n\t\t\treturn $code;\t\n\t\t}", "function yy_r105(){ $this->_retvalue = '->{\\''.$this->yystack[$this->yyidx + -4]->minor.'\\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "public function getCode()\n {\n }", "public function autocomplete_callback();", "public function helper()\n\t{\n\t\n\t}", "function testBug13600() \n {\n //$this->oBeaut->startLog();\n $this->oBeaut->addFilter('Pear');\n $sText = <<<SCRIPT\n<?php\nfunction example(){\n}\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nfunction example()\n{\n}\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "function yy_r111(){ return; }", "function yy_r104(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "public function miniStatement() {\n ... function body ...\n }", "function yy_r72(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r103(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }", "public function prog(){\n\n $this->capture('init;');\n\n try {\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n // runtime/Php/test/Antlr/Tests/grammers/t026actions.g\n {\n $this->match($this->input,$this->getToken('IDENTIFIER'),self::$FOLLOW_IDENTIFIER_in_prog48); \n $this->match($this->input,$this->getToken('EOF'),self::$FOLLOW_EOF_in_prog50); \n\n }\n\n\n $this->capture('after;');\n\n }\n catch ( RecognitionException $exc ) {\n\n $this->capture('catch;');\n throw $exc;\n \n }\n catch(Exception $e) {\n\n $this->capture('finally;');\n \n throw $e;\n }\n\n $this->capture('finally;');\n \n\n return ;\n }", "function yy_r73(){ $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.'::$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "private function method2()\n\t{\n\t}", "function yy_r102(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "public function lint($code);", "public function main()\n\t{\n\t}", "private function __() {\n }", "function protection_code_activation() {\n\t\n\t}", "function shortCodeMagic($att, $content = NULL)\n {\n\n }", "private function onCompletion()\n {\n }", "function yy_r106(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; }", "function yy_r97(){ \n $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor; $this->yystack[$this->yyidx + -3]->minor->values($this->yystack[$this->yyidx + -1]->minor); \n if ($this->yystack[$this->yyidx + 0]->minor) $this->_retvalue->onDuplicate($this->yystack[$this->yyidx + 0]->minor);\n }", "public function bar()\n {\n }", "function yy_r137(){$this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'='.$this->yystack[$this->yyidx + 0]->minor.';?>'; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.$this->prefix_number; }", "abstract public function getLinesOfCode();", "public function prog(){\n array_push($this->prog_stack, $this->prog_scope);\n $ID1 = null;\n\n try {\n // runtime/Php/test/Antlr/Tests/grammers/t023scopes.g\n // runtime/Php/test/Antlr/Tests/grammers/t023scopes.g\n {\n $ID1=$this->match($this->input,$this->getToken('ID'),self::$FOLLOW_ID_in_prog34); \n $this->prog_stack[count($this->prog_stack)-1]['name'] = ($ID1!=null?$ID1->getText():null);\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n array_pop($this->prog_stack);\n throw $e;\n }\n array_pop($this->prog_stack);\n\n return ;\n }", "function yy_r141(){ $this->_retvalue = ['collate', $this->yystack[$this->yyidx + 0]->minor]; }", "public function getCode() {}", "function yy_r70(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.'::'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }", "public function someStuff()\n {\n \n }", "function yy_r163(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '\".$_tmp'.$this->prefix_number.'.\"'; $this->compiler->has_variable_string = true; }", "function yy_r17(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,array_merge(array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)); }", "private function method1()\n\t{\n\t}", "static function completion(array &$donnees, int $recursive_level)\n {\n // ici le code\n }", "public function copyAndPasteMe()\n\t{\n\t\n\t}", "public function f02()\n {\n }", "function complete();", "public function ex4()\n {\n }", "function yy_r116(){ \n $this->_retvalue[implode(\" \", $this->yystack[$this->yyidx + -2]->minor)] = $this->yystack[$this->yyidx + 0]->minor->getMember(0); \n }", "function yy_r154(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; }", "final function velcom(){\n }", "function yy_r109(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor->addTerm($this->yystack[$this->yyidx + 0]->minor); }", "function expand()\n{\n\n}", "function yy_r161(){ \n $this->yystack[$this->yyidx + -3]->minor = array_merge(['CASE'], $this->yystack[$this->yyidx + -3]->minor, [$this->yystack[$this->yyidx + -1]->minor]);\n $this->_retvalue = new Stmt\\Expr($this->yystack[$this->yyidx + -3]->minor);\n }", "function yy_r159(){ $this->_retvalue = 'in'; }", "public function main()\r\n {\r\n \r\n }", "public function pass_5($path)\n\t{\n\t\t$tokens = token_get_all($this->source[$this->last_pass]);\n\t\t$token_count = count($tokens);\n\t\t$tp = 0;\n\t\t$tokens_to_patch = array('T_FUNCTION');\n\t\t$last_class = '';\n\t\twhile($tp < $token_count) {\n\t\t\t$token_name = $this->token_name($tokens[$tp]);\n\t\t\tif($token_name == 'T_NAMESPACE') $current_namespace = $this->token_content($tokens[$this->get_next_non_comment($tokens,$tp+1)]);\n\t\t\tif($token_name == 'T_CLASS') {\n\t\t\t$last_class = $this->token_content($tokens[$this->get_next_non_comment($tokens,$tp+1)]);\n\t\t\tif(isset($current_namespace)) $last_class = $current_namespace.\"\\\\\".$last_class;\n\t\t\t}\n\t\t\tif(in_array($token_name, $tokens_to_patch )) {\n\t\t\t\tif($blockstart = $this->search_token($tokens,$tp,'{',array(';'))) {\n\t\t\t\t\t $function_name_tp = $this->get_next_non_comment($tokens,$tp+1);\n\t\t\t\t\t if(!is_array($tokens[$function_name_tp])) \n\t\t\t\t\t\t $function_name_tp = $this->get_next_non_comment($tokens,$function_name_tp+1);\n\t\t\t\t\t $function_name = $tokens[$function_name_tp][1];\n\t\t\t\t\t if(!Analyzer::shouldpatch($function_name,$last_class)) {\n\t\t\t\t\t \t$tp++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t } \n\t\t\t\t\t Analyzer::$instancenumberfor[$function_name] = 0;\n\t\t\t\t\t $this->add_tokens_to_be_inserted_after($blockstart+1,\"/*0*/\".\"if(isset(\\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__])) \\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__]++; else \\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__]=0;\\\\codespy\\\\Analyzer::\\$executionbranches[__FILE__][__CLASS__][__FUNCTION__][\\\\codespy\\\\Analyzer::\\$instancenumberfor[__FILE__][__CLASS__][__FUNCTION__]][0] = 1;\");\n\t\t\t\t\t $blockend = $this->get_pair($tokens,$blockstart);\n\t\t\t\t\t $children = $this->get_children_from($tokens,$blockstart,$blockend,0);\n\t\t\t\t\t Analyzer::$possiblebranches[$path][$last_class][$function_name] = $children->getPaths();\n\t\t\t\t\t Analyzer::$nodetrees[$path][$last_class][$function_name] = $children;\n\t\t\t\t}\n\t\t\t} \n\t\t\t\t\n\t\t\t$tp++;\n\t\t}\n\t$this->source[$this->current_pass] = $this->change_stuff();\n\t}", "public function make_ccode_question_strToUpperFullMain() {\n question_bank::load_question_definition_classes('ccode');\n $ccode = new qtype_ccode_question();\n test_question_maker::initialise_a_question($ccode);\n $ccode->name = 'Function to convert string to uppercase';\n $ccode->questiontext = 'Write a function void strToUpper(char s[]) that converts s to uppercase';\n $ccode->generalfeedback = 'No feedback available for ccode questions.';\n $ccode->testcases = array(\n (object) array('testcode' => \"\n #include <stdio.h>\n#include <ctype.h>\nint main() {\n char s[] = {'1','@','a','B','c','d','E',';', 0};\n strToUpper(s);\n printf(\\\"%s\\\\n\\\", s);\n return 0;\n}\n\",\n 'stdin' => '',\n 'output' => '1@ABCDE;',\n 'display' => 'SHOW',\n 'useasexample' => 0,\n 'hiderestiffail' => 0),\n (object) array('testcode' => \"\n #include <stdio.h>\n#include <ctype.h>\nint main() {\n char s[] = {'1','@','A','b','C','D','e',';', 0};\n strToUpper(s);\n printf(\\\"%s\\\\n\\\", s);\n return 0;\n}\n\",\n 'stdin' => '',\n 'output' => '1@ABCDE;',\n 'display' => 'SHOW',\n 'useasexample' => 0,\n 'hiderestiffail' => 0)\n );\n $ccode->qtype = question_bank::get_qtype('ccode');\n $ccode->unitgradingtype = 0;\n $ccode->unitpenalty = 0.2;\n return $ccode;\n }", "function testInternal2() \n {\n $this->assertTrue(array_key_exists(T_COMMENT, $this->oBeaut->aTokenFunctions));\n }", "function yy_r148(){$this->_retvalue = '||'; }", "function fix() ;", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}" ]
[ "0.6025495", "0.59206736", "0.59099007", "0.59035414", "0.59035414", "0.5814014", "0.57724404", "0.57593095", "0.56826013", "0.5643885", "0.5628723", "0.5612875", "0.5602389", "0.5575462", "0.55700773", "0.5565622", "0.5541479", "0.5526234", "0.55152476", "0.54744565", "0.5415057", "0.5402696", "0.5384936", "0.5371957", "0.5371259", "0.53692186", "0.53686476", "0.5367403", "0.5354444", "0.53517324", "0.5350582", "0.53497756", "0.53470975", "0.53436536", "0.5332569", "0.5330676", "0.53299683", "0.532637", "0.5326111", "0.53232354", "0.5313569", "0.53086305", "0.5300158", "0.53000146", "0.52817017", "0.526586", "0.52618057", "0.5255617", "0.5248764", "0.52477634", "0.52471507", "0.5236256", "0.52343416", "0.52324516", "0.52277374", "0.5224895", "0.52053845", "0.5201441", "0.5189762", "0.518808", "0.51880217", "0.518588", "0.5184576", "0.51821446", "0.5178727", "0.5157364", "0.5152011", "0.5144913", "0.5135471", "0.5123818", "0.51185346", "0.51173127", "0.50984955", "0.5086538", "0.50848866", "0.50835305", "0.50814176", "0.5080585", "0.50805694", "0.50788116", "0.5076379", "0.5062682", "0.5059282", "0.5059033", "0.50588566", "0.5054684", "0.5052453", "0.5050095", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008", "0.5050008" ]
0.0
-1
START THEME OPTIONS custom theme options for user in admin area Appearance > Theme Options
function pu_theme_menu() { add_theme_page('Theme Option', 'Theme Options', 'manage_options', 'pu_theme_options.php', 'pu_theme_page'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tsc_theme_options() {\n\tadd_theme_page( 'Theme Options', 'Theme Options', 'edit_theme_options', 'theme_options', 'tsc_theme_options_page' );\n}", "function themeoptions_admin_menu() {\n\tadd_theme_page ( \"Theme Options\", \"Theme Options\", 'edit_themes', basename ( __FILE__ ), 'themeoptions_page' );\n}", "function pu_theme_menu()\n{\n add_theme_page( 'Theme Option', 'Edycja danych motywu', 'manage_options', 'pu_theme_options.php', 'pu_theme_page'); \n}", "function pu_theme_menu()\n{\n add_theme_page('Theme Option', 'Theme Options', 'manage_options', 'pu_theme_options.php', 'pu_theme_page');\n}", "function mmpm_register_theme_options() {\n\t\tregister_setting( 'mmpm_options_group', MMPM_OPTIONS_DB_NAME );\n//\t\tregister_setting( 'mmpm_options_group', MMPM_SKIN_DB_NAME );\n\t}", "function theme_options_add_page() {\n\tadd_theme_page( __( 'Theme Options', 'htmlks4wp' ), __( 'Theme Options', 'htmlks4wp' ), 'edit_theme_options', 'theme_options', 'theme_options_do_page' );\n}", "function add_options_page() {\n\t\t\t\tif ( function_exists('add_theme_page') ) {\n\t\t\t\t \tadd_theme_page( 'Cap &amp; Run', 'Cap &amp; Run', 'manage_options', \n\t\t\t\t\t\t\t\t\tbasename(__FILE__), array(&$this, 'options_page') );\n\t\t\t\t}\n\t\t\t}", "function julia_kaya_customizer_settings() \r\n\t{\r\n\t\tadd_theme_page( esc_html__('Customizer Import','julia'), esc_html__('Customizer Import','julia'), 'edit_theme_options', 'import', array( $this,'julia_kaya_customize_import_option_page'));\r\n add_theme_page( esc_html__('Customizer Export','julia'), esc_html__('Customizer Export','julia'), 'edit_theme_options', 'export', array( $this,'julia_kaya_customize_export_option_page'));\r\n }", "function laborator_options() {\n\twp_redirect( admin_url( 'themes.php?page=theme-options' ) );\n}", "function lg_mac_activ_options()\n\t{\n\t\t$theme_opts =get_option('lgmac_opts');\n\t\tif(!$theme_opts) //si le theme est désactivé et réactivé plus tard il ne sera pas nécessaire de reactiver le theme\n\t\t\t{\t\t\t//afin de créer l'option\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t$opts =array(\n\t\t\t\t'image_01_url' => '',\n\t\t\t\t'slider_shortcode' =>'',\n\t\t\t\t'HeaderC' =>'',\n\t\t\t\t'FooterColor'=>'',\n\t\t\t\t'FooterCopyright'=>'',\n\t\t\t\t'lgmac_img_FirstBlock'=>'',\n\t\t\t\t'lgmac_img_firstblock133'=>'',\n\n\n\t\t\t\t);\n\t\t\t\tadd_option('lgmac_opts',$opts);\n\t\t\t}\n\t}", "function theme_options_init(){\n\tregister_setting( 'htmlks4wp_options', 'htmlks4wp_theme_options', 'theme_options_validate' );\n}", "function my_theme_create_options() {\r\n $titan = TitanFramework::getInstance( 'genietheme' );\r\n \r\n // Create my admin panel\r\n $panel = $titan->createAdminPanel( array(\r\n 'name' => 'Theme Options',\r\n ) );\r\n \r\n \r\n $generaltab = $panel->createTab( array(\r\n 'name' => 'General Tab',\r\n ) );\r\n \r\n // Create options for my admin panel\r\n $generaltab->createOption( array(\r\n 'name' => 'LOGO',\r\n 'id' => 'head_logo',\r\n 'type' => 'upload',\r\n 'desc' => 'Upoad logo of site.'\r\n ) );\r\n \r\n $generaltab->createOption( array(\r\n 'name' => 'Header Scripts',\r\n 'id' => 'header_scripts',\r\n 'type' => 'textarea',\r\n 'desc' => 'Enter your header scripts or code like google analytics,webmaster code etc...'\r\n ) );\r\n \r\n \r\n $generaltab->createOption( array(\r\n 'name' => 'Footer Scripts',\r\n 'id' => 'footer_scripts',\r\n 'type' => 'textarea',\r\n 'desc' => 'Enter your footer scripts or code like google analytics,webmaster code etc...'\r\n ) );\r\n \r\n \r\n $generaltab->createOption( array(\r\n 'type' => 'save'\r\n ) );\r\n \r\n \r\n $titan = TitanFramework::getInstance( 'genietheme' );\r\n$productMetaBox = $titan->createMetaBox( array(\r\n 'name' => 'Additinal Job Information',\r\n 'post_type' => 'jobs',\r\n) );\r\n\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Job Link',\r\n 'id' => 'j_link',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Experience Required',\r\n 'id' => 'exp_required',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Education Qualification',\r\n 'id' => 'edu_qual',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Preffered Nationality',\r\n 'id' => 'nationality',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Salary',\r\n 'id' => 'salary',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'No. of vaccancies',\r\n 'id' => 'vaccancies',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Benefits',\r\n 'id' => 'benefits',\r\n 'type' => 'text',\r\n \r\n ) );\r\n $productMetaBox->createOption( array(\r\n 'name' => 'Gender',\r\n 'id' => 'gender',\r\n 'options' => array(\r\n '1' => 'Male',\r\n '2' => 'Female',\r\n '3' => 'Male/Female',\r\n ),\r\n 'type' => 'radio',\r\n 'desc' => 'Select gender',\r\n 'default' => '1',\r\n \r\n ) );\r\n\r\n \r\n}", "function mmpm_add_theme_page(){\n\t\tadd_theme_page(\n\t\t\tMMPM_PLUGIN_NAME ,\n\t\t\t__( MMPM_PLUGIN_NAME, MMPM_TEXTDOMAIN_ADMIN ),\n\t\t\t'edit_theme_options',\n\t\t\tMMPM_THEME_PAGE_SLUG,\n\t\t\t'mmpm_theme_options_form'\n\t\t);\n\t}", "function appthemes_admin_options() {\r\n\tglobal $wpdb, $app_abbr, $app_theme;\r\n\r\n\tif ( !current_user_can('manage_options') ) return;\r\n\r\n\tadd_menu_page($app_theme, $app_theme, 'manage_options', basename(__FILE__), 'cp_dashboard', FAVICON, THE_POSITION );\r\n\tadd_submenu_page( basename(__FILE__), __('Dashboard','appthemes'), __('Dashboard','appthemes'), 'manage_options', basename(__FILE__), 'cp_dashboard' );\r\n\tadd_submenu_page( basename(__FILE__), __('General Settings','appthemes'), __('Settings','appthemes'), 'manage_options', 'settings', 'cp_settings' );\r\n\tadd_submenu_page( basename(__FILE__), __('Emails','appthemes'), __('Emails','appthemes'), 'manage_options', 'emails', 'cp_emails' );\r\n\tadd_submenu_page( basename(__FILE__), __('Pricing Settings','appthemes'), __('Pricing','appthemes'), 'manage_options', 'pricing', 'cp_pricing' );\r\n\tadd_submenu_page( basename(__FILE__), __('Packages','appthemes'), __('Packages','appthemes'), 'manage_options', 'packages', 'cp_ad_packs' );\r\n\t\r\n\t//edite by dazake add menu page \r\n // add_submenu_page( basename(__FILE__), __('Dazake Packages','appthemes'), __('Dazake Packages','appthemes'), 'manage_options', 'dazake_packages', 'cp_ad_dazake_packs' );\r\n add_submenu_page( basename(__FILE__), __('Premium Packages','appthemes'), __('Premium Packages','appthemes'), 'manage_options', 'premium_packages', 'cp_ad_premium_packs' );\r\n\t//end edite by dazake \r\n\t\r\n\tadd_submenu_page( basename(__FILE__), __('Coupons','appthemes'), __('Coupons','appthemes'), 'manage_options', 'coupons', 'cp_coupons' );\r\n\tadd_submenu_page( basename(__FILE__), __('Payment Gateway Options','appthemes'), __('Gateways','appthemes'), 'manage_options', 'gateways', 'cp_gateways' );\r\n\tadd_submenu_page( basename(__FILE__), __('Form Layouts','appthemes'), __('Form Layouts','appthemes'), 'manage_options', 'layouts', 'cp_form_layouts' );\r\n\tadd_submenu_page( basename(__FILE__), __('Custom Fields','appthemes'), __('Custom Fields','appthemes'), 'manage_options', 'fields', 'cp_custom_fields' );\r\n\tadd_submenu_page( basename(__FILE__), __('Transactions','appthemes'), __('Transactions','appthemes'), 'manage_options', 'transactions', 'cp_transactions' );\r\n\tappthemes_add_submenu_page(); // do_action hook\r\n\tadd_submenu_page( basename(__FILE__), __('System Info','appthemes'), __('System Info','appthemes'), 'manage_options', 'sysinfo', 'cp_system_info' );\r\n}", "function tb_settings_init() {\n if ( get_option( \"tb_theme_options\" ) == false ) {\n add_option( \"tb_theme_options\", apply_filters( \"tb_default_options\", tb_default_options() ) );\n }\n\n // Add a section to our submenu\n add_settings_section (\n \"tb_settings_section\",\n \"Tickets Broadway Theme Options\",\n \"tb_section_callback\",\n \"tb_theme_options\"\n );\n\n // Add option for banner image on homepage\n add_settings_field (\n \"Banner Image\",\n \"Homepage Banner Image\",\n \"banner_callback\",\n \"tb_theme_options\",\n \"tb_settings_section\"\n );\n\n // Add option for banner image link on homepage\n add_settings_field (\n \"Banner Image Link\",\n \"Homepage Banner Link\",\n \"banner_link_callback\",\n \"tb_theme_options\",\n \"tb_settings_section\"\n );\n\n // Add option for selecting a city (for spinning out microsites)\n add_settings_field (\n \"City Selection\",\n \"Microsite City\",\n \"microsite_city_callback\",\n \"tb_theme_options\",\n \"tb_settings_section\"\n );\n\n // Lastly, register them settings\n register_setting (\n \"tb_theme_options\",\n \"tb_theme_options\"\n );\n}", "function skudo_add_theme_menu(){\n\tadd_theme_page( \"Skudo\", \"Skudo Options\", 'delete_pages', SKUDO_OPTIONS_PAGE, 'skudo_theme_admin', null);\n\tadd_theme_page( \"Skudo\", \"Skudo Style Options\", 'delete_pages', SKUDO_STYLE_OPTIONS_PAGE, 'skudo_theme_style_options_admin', null);\n\tadd_theme_page( \"Skudo\", \"Skudo Demos\", 'delete_pages', SKUDO_DEMOS_PAGE, 'skudo_theme_demos_admin', null);\n}", "function cinerama_edge_init_theme_options() {\n\t\tglobal $cinerama_edge_global_options;\n\t\tglobal $cinerama_edge_global_Framework;\n\t\tif ( isset( $cinerama_edge_global_options['reset_to_defaults'] ) ) {\n\t\t\tif ( $cinerama_edge_global_options['reset_to_defaults'] == 'yes' ) {\n\t\t\t\tdelete_option( \"edgtf_options_cinerama\" );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! get_option( \"edgtf_options_cinerama\" ) ) {\n\t\t\tadd_option( \"edgtf_options_cinerama\", $cinerama_edge_global_Framework->edgtOptions->options );\n\n\t\t\t$cinerama_edge_global_options = $cinerama_edge_global_Framework->edgtOptions->options;\n\t\t}\n\t}", "function custom_theme_options() {\n\n \n\n /* OptionTree is not loaded yet */\n\n if ( ! function_exists( 'ot_settings_id' ) )\n\n return false;\n\n \n\n /**\n\n * Get a copy of the saved settings array. \n\n */\n\n $saved_settings = get_option( ot_settings_id(), array() );\n\n \n\n /**\n\n * Custom settings array that will eventually be \n\n * passes to the OptionTree Settings API Class.\n\n */\n\n $custom_settings = array( \n\n 'contextual_help' => array( \n\n 'sidebar' => ''\n\n ),\n\n 'sections' => array( \n\n array(\n\n 'id' => 'general',\n\n 'title' => __( 'General', 'theme-options.php' )\n\n ),\n\n\n array(\n\n 'id' => 'slider',\n\n 'title' => __( 'Slider', 'theme-options.php' )\n\n ),\n\n array(\n\n 'id' => 'footer',\n\n 'title' => __( 'Footer', 'theme-options.php' )\n\n ),\n\n array(\n\n 'id' => 'social_links',\n\n 'title' => __( 'Social Links', 'theme-options.php' )\n\n )\n\n ),\n\n 'settings' => array( \n\n array(\n\n 'id' => 'theme_logo',\n\n 'label' => __( 'Theme Logo', 'theme-options.php' ),\n\n 'desc' => __( 'Upload your Logo Image Here.Logo Dimension width:223px,Height:52px.', 'theme-options.php' ),\n\n 'std' => '',\n\n 'type' => 'upload',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n array(\n\n 'id' => 'alert',\n\n 'label' => __( 'Add or Change Alert Box Text from Home Page', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n array(\n\n 'id' => 'column_one_direction',\n\n 'label' => __( 'Add Column One Hours & Direction ', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'textarea',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t array(\n\n 'id' => 'column_two_direction',\n\n 'label' => __( 'Add Column Two Hours & Direction With Button', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'textarea',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t\n\t array(\n\n 'id' => 'mail_chimp',\n\n 'label' => __( 'Add Mailchimp Form Image:Dimension: width:340px & Height:151px', 'theme-options.php' ),\n\n 'desc' => __( '.', 'theme-options.php' ),\n\n 'std' => '',\n\n 'type' => 'upload',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n \n\n\t array(\n\n 'id' => 'slide',\n\n 'label' => __( 'Slide', 'theme-options.php' ),\n\n 'desc' => 'Click Add New Button to add the slider Images.Slider Image Dimention - Width:1400px Height:573px',\n\n 'std' => '',\n\n 'type' => 'slider',\n\n 'section' => 'slider',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n \n\n\t \n\n array(\n\n 'id' => 'copyright',\n\n 'label' => __( 'Add Your Footer Bottom Copyright Text', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'footer',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t array(\n\n 'id' => 'address',\n\n 'label' => __( 'Add Your Footer Address Here', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'footer',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t array(\n\n 'id' => 'phone',\n\n 'label' => __( 'Add Your Footer Phone Number Here', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'footer',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n\n array(\n\n 'id' => 'soc_pintrest',\n\n 'label' => __( 'Add Your Pintrest Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\t array(\n\n 'id' => 'soc_instagram',\n\n 'label' => __( 'Add Your instagram Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\t array(\n\n 'id' => 'soc_google',\n\n 'label' => __( 'Add Your Google Plus Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n array(\n\n 'id' => 'soc_facebook',\n\n 'label' => __( 'Add Your Facebook Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n array(\n\n 'id' => 'soc_twitter',\n\n 'label' => __( 'Add Your Twitter Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n\n array(\n\n 'id' => 'soc_youtube',\n\n 'label' => __( 'Add Your YouTube Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n )\n\n )\n\n );\n\n \n\n /* allow settings to be filtered before saving */\n\n $custom_settings = apply_filters( ot_settings_id() . '_args', $custom_settings );\n\n \n\n /* settings are not the same update the DB */\n\n if ( $saved_settings !== $custom_settings ) {\n\n update_option( ot_settings_id(), $custom_settings ); \n\n }\n\n \n\n /* Lets OptionTree know the UI Builder is being overridden */\n\n global $ot_has_custom_theme_options;\n\n $ot_has_custom_theme_options = true;\n\n \n\n}", "function nxt_posts_p_add_options(){\n\n\tadd_option( 'nxt_post_option_template_select', 'themes/theme_1.php');\n\tadd_option( 'nxt_post_plugin_enable');\n}", "function cinerama_edge_register_theme_settings() {\n\t\tregister_setting( EDGE_OPTIONS_SLUG, 'edgtf_options' );\n\t}", "public function admin_menu() {\n add_theme_page(__('Customize', 'sofa'), __('Customize', 'sofa'), 'edit_themes', 'customize.php');\n }", "function custom_theme_options()\n{\n\tif ( ! defined( 'UNCODE_SLIM' ) ) {\n\t\treturn;\n\t}\n\n\tglobal $wpdb, $uncode_colors, $uncode_post_types;\n\n\tif (!isset($uncode_post_types)) $uncode_post_types = uncode_get_post_types();\n\t/**\n\t * Get a copy of the saved settings array.\n\t */\n\t$saved_settings = get_option(ot_settings_id() , array());\n\n\t/**\n\t * Custom settings array that will eventually be\n\t * passes to the OptionTree Settings API Class.\n\t */\n\n\tif (!function_exists('ot_filter_measurement_unit_types'))\n\t{\n\t\tfunction ot_filter_measurement_unit_types($array, $field_id)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'px' => 'px',\n\t\t\t\t'%' => '%'\n\t\t\t);\n\t\t}\n\t}\n\n\tadd_filter('ot_measurement_unit_types', 'ot_filter_measurement_unit_types', 10, 2);\n\n\tfunction run_array_to($array, $key = '', $value = '')\n\t{\n\t\t$array[$key] = $value;\n\t\treturn $array;\n\t}\n\n\t$stylesArrayMenu = array(\n\t\tarray(\n\t\t\t'value' => 'light',\n\t\t\t'label' => esc_html__('Light', 'uncode') ,\n\t\t\t'src' => ''\n\t\t) ,\n\t\tarray(\n\t\t\t'value' => 'dark',\n\t\t\t'label' => esc_html__('Dark', 'uncode') ,\n\t\t\t'src' => ''\n\t\t)\n\t);\n\n\t$menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );\n\t$menus_array = array();\n\t$menus_array[] = array(\n\t\t'value' => '',\n\t\t'label' => esc_html__('Inherit', 'uncode')\n\t);\n\tforeach ($menus as $menu)\n\t{\n\t\t$menus_array[] = array(\n\t\t\t'value' => $menu->slug,\n\t\t\t'label' => $menu->name\n\t\t);\n\t}\n\n\t$uncodeblock = array(\n\t\t'value' => 'header_uncodeblock',\n\t\t'label' => esc_html__('Content Block', 'uncode') ,\n\t);\n\n\t$uncodeblocks = array(\n\t\tarray(\n\t\t\t'value' => '','label' => esc_html__('Inherit', 'uncode')\n\t\t),\n\t\tarray(\n\t\t\t'value' => 'none','label' => esc_html__('None', 'uncode')\n\t\t)\n\t);\n\n\t$blocks_query = new WP_Query( 'post_type=uncodeblock&posts_per_page=-1&post_status=publish&orderby=title&order=ASC' );\n\n\tforeach ($blocks_query->posts as $block) {\n\t\t$uncodeblocks[] = array(\n\t\t\t'value' => $block->ID,\n\t\t\t'label' => $block->post_title,\n\t\t\t'postlink' => get_edit_post_link($block->ID),\n\t\t);\n\t}\n\n\tif ($blocks_query->post_count === 0) {\n\t\t$uncodeblocks[] = array(\n\t\t\t'value' => '',\n\t\t\t'label' => esc_html__('No Content Blocks found', 'uncode')\n\t\t);\n\t}\n\n\t$uncodeblock_404 = array(\n\t\t'id' => '_uncode_404_body',\n\t\t'label' => esc_html__('404 content', 'uncode') ,\n\t\t'desc' => esc_html__('Specify a content for the 404 page.', 'uncode'),\n\t\t'std' => '',\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Default', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'body_uncodeblock',\n\t\t\t\t'label' => esc_html__('Content Block', 'uncode') ,\n\t\t\t),\n\t\t),\n\t\t'section' => 'uncode_404_section',\n\t);\n\n\t$uncodeblocks_404 = array(\n\t\t'id' => '_uncode_404_body_block',\n\t\t'label' => esc_html__('404 Content Block', 'uncode') ,\n\t\t'desc' => esc_html__('Specify a content for the 404 page.', 'uncode'),\n\t\t'type' => 'select',\n\t\t'choices' => $uncodeblocks,\n\t\t'section' => 'uncode_404_section',\n\t\t'operator' => 'and',\n\t\t'condition' => '_uncode_404_body:is(body_uncodeblock)',\n\t);\n\n\tif ( class_exists( 'RevSliderFront' ) )\n\t{\n\n\t\t$revslider = array(\n\t\t\t'value' => 'header_revslider',\n\t\t\t'label' => esc_html__('Revolution Slider', 'uncode') ,\n\t\t);\n\n\t\t$rs = $wpdb->get_results(\"SELECT id, title, alias FROM \" . $wpdb->prefix . \"revslider_sliders WHERE type != 'template' ORDER BY id ASC LIMIT 999\");\n\t\t$revsliders = array();\n\t\tif ($rs)\n\t\t{\n\t\t\tforeach ($rs as $slider)\n\t\t\t{\n\t\t\t\t$revsliders[] = array(\n\t\t\t\t\t'value' => $slider->alias,\n\t\t\t\t\t'label' => $slider->title,\n\t\t\t\t\t'postlink' => admin_url( 'admin.php?page=revslider&view=slider&id=' . $slider->id ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$revsliders[] = array(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('No Revolution Sliders found', 'uncode')\n\t\t\t);\n\t\t}\n\t}\n\telse $revslider = $revsliders = '';\n\n\tif ( class_exists( 'LS_Config' ) )\n\t{\n\n\t\t$layerslider = array(\n\t\t\t'value' => 'header_layerslider',\n\t\t\t'label' => esc_html__('LayerSlider', 'uncode') ,\n\t\t);\n\n\t\t$ls = $wpdb->get_results(\"SELECT id, name FROM \" . $wpdb->prefix . \"layerslider WHERE flag_deleted != '1' ORDER BY id ASC LIMIT 999\");\n\t\t$layersliders = array();\n\t\tif ($ls)\n\t\t{\n\t\t\tforeach ($ls as $slider)\n\t\t\t{\n\t\t\t\t$layersliders[] = array(\n\t\t\t\t\t'value' => $slider->id,\n\t\t\t\t\t'label' => $slider->name,\n\t\t\t\t\t'postlink' => admin_url( 'admin.php?page=layerslider&action=edit&id=' . $slider->id ),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$layersliders[] = array(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('No LayerSliders found', 'uncode')\n\t\t\t);\n\t\t}\n\t}\n\telse $layerslider = $layersliders = '';\n\n\t$title_size = array(\n\t\tarray(\n\t\t\t'value' => 'h1',\n\t\t\t'label' => esc_html__('h1', 'uncode')\n\t\t),\n\t\tarray(\n\t\t\t'value' => 'h2',\n\t\t\t'label' => esc_html__('h2', 'uncode'),\n\t\t),\n\t\tarray(\n\t\t\t'value' => 'h3',\n\t\t\t'label' => esc_html__('h3', 'uncode'),\n\t\t),\n\t\tarray(\n\t\t\t'value' => 'h4',\n\t\t\t'label' => esc_html__('h4', 'uncode'),\n\t\t),\n\t\tarray(\n\t\t\t'value' => 'h5',\n\t\t\t'label' => esc_html__('h5', 'uncode'),\n\t\t),\n\t\tarray(\n\t\t\t'value' => 'h6',\n\t\t\t'label' => esc_html__('h6', 'uncode'),\n\t\t),\n\t);\n\n\t$font_sizes = ot_get_option('_uncode_heading_font_sizes');\n\tif (!empty($font_sizes)) {\n\t\tforeach ($font_sizes as $key => $value) {\n\t\t\t$title_size[] = array(\n\t\t\t\t'value' => $value['_uncode_heading_font_size_unique_id'],\n\t\t\t\t'label' => $value['title'],\n\t\t\t);\n\t\t}\n\t}\n\n\t$title_size[] = array(\n\t\t'value' => 'bigtext',\n\t\t'label' => esc_html__('BigText', 'uncode'),\n\t);\n\n\t$title_height = array(\n\t\tarray(\n\t\t\t'value' => '',\n\t\t\t'label' => esc_html__('Default CSS', \"uncode\")\n\t\t),\n\t);\n\n\t$font_heights = ot_get_option('_uncode_heading_font_heights');\n\tif (!empty($font_heights)) {\n\t\tforeach ($font_heights as $key => $value) {\n\t\t\t$title_height[] = array(\n\t\t\t\t'value' => $value['_uncode_heading_font_height_unique_id'],\n\t\t\t\t'label' => $value['title'],\n\t\t\t);\n\t\t}\n\t}\n\n\t$title_spacing = array(\n\t\tarray(\n\t\t\t'value' => '',\n\t\t\t'label' => esc_html__('Default CSS', \"uncode\")\n\t\t),\n\t);\n\n\t$btn_letter_spacing = $title_spacing;\n\t$btn_letter_spacing[] = array(\n\t\t'value' => 'uncode-fontspace-zero',\n\t\t'label' => esc_html__('Letter Spacing 0', \"uncode\")\n\t);\n\n\t$font_spacings = ot_get_option('_uncode_heading_font_spacings');\n\tif (!empty($font_spacings)) {\n\t\tforeach ($font_spacings as $key => $value) {\n\t\t\t$btn_letter_spacing[] = $title_spacing[] = array(\n\t\t\t\t'value' => $value['_uncode_heading_font_spacing_unique_id'],\n\t\t\t\t'label' => $value['title'],\n\t\t\t);\n\t\t}\n\t}\n\n\t$fonts = get_option('uncode_font_options');\n\t$title_font = array();\n\n\tif (isset($fonts['font_stack']) && $fonts['font_stack'] !== '[]')\n\t{\n\t\t$font_stack_string = $fonts['font_stack'];\n\t\t$font_stack = json_decode(str_replace('&quot;', '\"', $font_stack_string) , true);\n\n\t\tforeach ($font_stack as $font)\n\t\t{\n\t\t\tif ($font['source'] === 'Font Squirrel')\n\t\t\t{\n\t\t\t\t$variants = explode(',', $font['variants']);\n\t\t\t\t$label = (string)$font['family'] . ' - ';\n\t\t\t\t$weight = array();\n\t\t\t\tforeach ($variants as $variant)\n\t\t\t\t{\n\t\t\t\t\tif (strpos(strtolower($variant) , 'hairline') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$weight[] = 100;\n\t\t\t\t\t}\n\t\t\t\t\telse if (strpos(strtolower($variant) , 'light') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$weight[] = 200;\n\t\t\t\t\t}\n\t\t\t\t\telse if (strpos(strtolower($variant) , 'regular') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$weight[] = 400;\n\t\t\t\t\t}\n\t\t\t\t\telse if (strpos(strtolower($variant) , 'semibold') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$weight[] = 500;\n\t\t\t\t\t}\n\t\t\t\t\telse if (strpos(strtolower($variant) , 'bold') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$weight[] = 600;\n\t\t\t\t\t}\n\t\t\t\t\telse if (strpos(strtolower($variant) , 'black') !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$weight[] = 800;\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$weight[] = 400;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$label.= implode(',', $weight);\n\t\t\t\t$title_font[] = array(\n\t\t\t\t\t'value' => urlencode((string)$font['family']),\n\t\t\t\t\t'label' => $label\n\t\t\t\t);\n\t\t\t}\n\t\t\telse if ($font['source'] === 'Google Web Fonts')\n\t\t\t{\n\t\t\t\t$label = (string)$font['family'] . ' - ' . $font['variants'];\n\t\t\t\t$title_font[] = array(\n\t\t\t\t\t'value' => urlencode((string)$font['family']),\n\t\t\t\t\t'label' => $label\n\t\t\t\t);\n\t\t\t}\n\t\t\telse if ($font['source'] === 'Adobe Fonts' || $font['source'] === 'Typekit' )\n\t\t\t{\n\t\t\t\t$label = (string)$font['family'] . ' - ';\n\t\t\t\t$variants = explode(',', $font['variants']);\n\t\t\t\tforeach ($variants as $key => $variant) {\n\t\t\t\t\tif ( $variants[$key] !== '' ) {\n\t\t\t\t\t\tpreg_match(\"|\\d+|\", $variants[$key], $weight);\n\t\t\t\t\t\t$variants[$key] = $weight[0] . '00';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$label.= implode(',', $variants);\n\t\t\t\t$title_font[] = array(\n\t\t\t\t\t'value' => urlencode(str_replace('\"', '', (string)$font['stub'])),\n\t\t\t\t\t'label' => $label\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$title_font[] = array(\n\t\t\t\t\t'value' => urlencode((string)$font['family']),\n\t\t\t\t\t'label' => (string)$font['family']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$title_font = array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('No fonts activated.', \"uncode\"),\n\t\t\t)\n\t\t);\n\t}\n\n\t$title_font[] = array(\n\t\t'value' => 'manual',\n\t\t'label' => esc_html__('Manually entered','uncode')\n\t);\n\n\t$custom_fonts = array(\n\t\tarray(\n\t\t\t'value' => '',\n\t\t\t'label' => esc_html__('Default CSS', \"uncode\"),\n\t\t)\n\t);\n\n\t$custom_fonts_array = ot_get_option('_uncode_font_groups');\n\tif (!empty($custom_fonts_array)) {\n\t\tforeach ($custom_fonts_array as $key => $value) {\n\t\t\t$custom_fonts[] = array(\n\t\t\t\t'value' => $value['_uncode_font_group_unique_id'],\n\t\t\t\t'label' => $value['title'],\n\t\t\t);\n\t\t}\n\t}\n\n\t$title_weight = array(\n\t\tarray(\n\t\t\t'value' => '',\n\t\t\t'label' => esc_html__('Default CSS', \"uncode\"),\n\t\t),\n\t\tarray(\n\t\t\t'value' => 100,\n\t\t\t'label' => '100',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 200,\n\t\t\t'label' => '200',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 300,\n\t\t\t'label' => '300',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 400,\n\t\t\t'label' => '400',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 500,\n\t\t\t'label' => '500',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 600,\n\t\t\t'label' => '600',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 700,\n\t\t\t'label' => '700',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 800,\n\t\t\t'label' => '800',\n\t\t),\n\t\tarray(\n\t\t\t'value' => 900,\n\t\t\t'label' => '900',\n\t\t)\n\t);\n\n\t$menu_section_title = array(\n\t\t'id' => '_uncode_%section%_menu_block_title',\n\t\t'label' => ' <i class=\"fa fa-menu\"></i> ' . esc_html__('Menu', 'uncode') ,\n\t\t'desc' => '' ,\n\t\t'type' => 'textblock-titled',\n\t\t'class' => 'section-title',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$menu = array(\n\t\t'id' => '_uncode_%section%_menu',\n\t\t'label' => esc_html__('Menu', 'uncode') ,\n\t\t'desc' => esc_html__('Override the primary menu created in \\'Appearance -> Menus\\'.','uncode'),\n\t\t'type' => 'select',\n\t\t'choices' => $menus_array,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$menu_width = array(\n\t\t'id' => '_uncode_%section%_menu_width',\n\t\t'label' => esc_html__('Menu width', 'uncode') ,\n\t\t'desc' => esc_html__('Override the menu width.', 'uncode'),\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Inherit', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'full',\n\t\t\t\t'label' => esc_html__('Full', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'limit',\n\t\t\t\t'label' => esc_html__('Limit', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$menu_opaque = array(\n\t\t'id' => '_uncode_%section%_menu_opaque',\n\t\t'label' => esc_html__('Remove transparency', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Override to remove the transparency eventually declared in \\'Customize -> Light/Dark skin\\'.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$menu_no_padding = array(\n\t\t'id' => '_uncode_%section%_menu_no_padding',\n\t\t'label' => esc_html__('Remove menu content padding', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Remove the additional menu padding in the header.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$menu_no_padding_mobile = array(\n\t\t'id' => '_uncode_%section%_menu_no_padding_mobile',\n\t\t'label' => esc_html__('Remove menu content padding on mobile', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Remove the additional menu padding in the header on mobile.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$title_archive_custom_activate = array(\n\t\t'id' => '_uncode_%section%_custom_title_activate',\n\t\t'label' => esc_html__('Activate custom title and subtitle', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Activate this to enable the custom title and subtitle.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$title_archive_custom_text = array(\n\t\t'id' => '_uncode_%section%_custom_title_text',\n\t\t'label' => esc_html__('Custom title', 'uncode') ,\n\t\t'type' => 'text',\n\t\t'desc' => esc_html__('Insert your custom main archive page title.', 'uncode') ,\n\t\t'std' => '',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_custom_title_activate:is(on)',\n\t);\n\n\t$subtitle_archive_custom_text = array(\n\t\t'id' => '_uncode_%section%_custom_subtitle_text',\n\t\t'label' => esc_html__('Custom subtitle', 'uncode') ,\n\t\t'type' => 'text',\n\t\t'desc' => esc_html__('Insert your custom main archive page subtitle.', 'uncode') ,\n\t\t'std' => '',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_custom_title_activate:is(on)',\n\t);\n\n\t$header_section_title = array(\n\t\t'id' => '_uncode_%section%_header_block_title',\n\t\t'label' => '<i class=\"fa fa-columns2\"></i> ' . esc_html__('Header', 'uncode') ,\n\t\t'desc' => '' ,\n\t\t'type' => 'textblock-titled',\n\t\t'class' => 'section-title',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_type = array(\n\t\t'id' => '_uncode_%section%_header',\n\t\t'label' => esc_html__('Type', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the header type.', 'uncode'),\n\t\t'std' => 'none',\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => 'none',\n\t\t\t\t'label' => esc_html__('Select…', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header_basic',\n\t\t\t\t'label' => esc_html__('Basic', 'uncode') ,\n\t\t\t) ,\n\t\t\t$uncodeblock,\n\t\t\t$revslider,\n\t\t\t$layerslider,\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_uncode_block = array(\n\t\t'id' => '_uncode_%section%_blocks',\n\t\t'label' => esc_html__('Content Block', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the Content Block.', 'uncode') ,\n\t\t'type' => 'custom-post-type-select',\n\t\t'condition' => '_uncode_%section%_header:is(header_uncodeblock)',\n\t\t'operator' => 'or',\n\t\t'post_type' => 'uncodeblock',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_revslider = array(\n\t\t'id' => '_uncode_%section%_revslider',\n\t\t'label' => esc_html__('Revslider', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the RevSlider.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_revslider)',\n\t\t'operator' => 'or',\n\t\t'choices' => $revsliders,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_layerslider = array(\n\t\t'id' => '_uncode_%section%_layerslider',\n\t\t'label' => esc_html__('LayerSlider', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the LayerSlider.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_layerslider)',\n\t\t'operator' => 'or',\n\t\t'choices' => $layersliders,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_title = array(\n\t\t'label' => esc_html__('Title in header', 'uncode') ,\n\t\t'id' => '_uncode_%section%_header_title',\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Activate to show title in the header.', 'uncode') ,\n\t\t'std' => 'on',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_title_text = array(\n\t\t'id' => '_uncode_%section%_header_title_text',\n\t\t'label' => esc_html__('Custom text', 'uncode') ,\n\t\t'desc' => esc_html__('Add custom text for the header. Every newline in the field is a new line in the title.', 'uncode') ,\n\t\t'type' => 'textarea-simple',\n\t\t'rows' => '15',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t);\n\n\t$header_style = array(\n\t\t'id' => '_uncode_%section%_header_style',\n\t\t'label' => esc_html__('Skin', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the header text skin.', 'uncode') ,\n\t\t'std' => 'light',\n\t\t'type' => 'select',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'and',\n\t\t'choices' => $stylesArrayMenu\n\t);\n\n\t$header_width = array(\n\t\t'id' => '_uncode_%section%_header_width',\n\t\t'label' => esc_html__('Header width', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Inherit', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'full',\n\t\t\t\t'label' => esc_html__('Full', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'limit',\n\t\t\t\t'label' => esc_html__('Limit', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'desc' => esc_html__('Override the header width.', 'uncode') ,\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:contains(header)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_content_width = array(\n\t\t'id' => '_uncode_%section%_header_content_width',\n\t\t'label' => esc_html__('Content full width', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Activate to expand the header content to full width.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'and',\n\t);\n\n\t$header_custom_width = array(\n\t\t'id' => '_uncode_%section%_header_custom_width',\n\t\t'label' => esc_html__('Custom inner width','uncode'),\n\t\t'desc' => esc_html__('Adjust the inner content width in %.', 'uncode') ,\n\t\t'std' => '100',\n\t\t'type' => 'numeric-slider',\n\t\t'min_max_step' => '0,100,1',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'and',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_align = array(\n\t\t'id' => '_uncode_%section%_header_align',\n\t\t'label' => esc_html__('Content alignment', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the text/content alignment.', 'uncode') ,\n\t\t'std' => 'center',\n\t\t'type' => 'select',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => 'left',\n\t\t\t\t'label' => esc_html__('Left', 'uncode') ,\n\t\t\t\t'src' => ''\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'center',\n\t\t\t\t'label' => esc_html__('Center', 'uncode') ,\n\t\t\t\t'src' => ''\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'right',\n\t\t\t\t'label' => esc_html__('Right', 'uncode') ,\n\t\t\t\t'src' => ''\n\t\t\t)\n\t\t)\n\t);\n\n\t$header_height = array(\n\t\t'id' => '_uncode_%section%_header_height',\n\t\t'label' => esc_html__('Height', 'uncode') ,\n\t\t'desc' => esc_html__('Define the height of the header in px or in % (relative to the window height).', 'uncode') ,\n\t\t'type' => 'measurement',\n\t\t'std' => array(\n\t\t\t'60',\n\t\t\t'%'\n\t\t) ,\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_min_height = array(\n\t\t'id' => '_uncode_%section%_header_min_height',\n\t\t'label' => esc_html__('Minimal height', 'uncode') ,\n\t\t'desc' => esc_html__('Enter a minimun height for the header in pixel.', 'uncode') ,\n\t\t'type' => 'text',\n\t\t'std' => '300',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_position = array(\n\t\t'id' => '_uncode_%section%_header_position',\n\t\t'label' => esc_html__('Position', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the position of the header content inside the container.', 'uncode') ,\n\t\t'std' => 'header-center header-middle',\n\t\t'type' => 'select',\n\t\t'operator' => 'and',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => 'header-left header-top',\n\t\t\t\t'label' => esc_html__('Left Top', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-left header-center',\n\t\t\t\t'label' => esc_html__('Left Center', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-left header-bottom',\n\t\t\t\t'label' => esc_html__('Left Bottom', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-center header-top',\n\t\t\t\t'label' => esc_html__('Center Top', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-center header-middle',\n\t\t\t\t'label' => esc_html__('Center Center', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-center header-bottom',\n\t\t\t\t'label' => esc_html__('Center Bottom', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-right header-top',\n\t\t\t\t'label' => esc_html__('Right Top', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-right header-center',\n\t\t\t\t'label' => esc_html__('Right Center', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'header-right header-bottom',\n\t\t\t\t'label' => esc_html__('Right Bottom', 'uncode') ,\n\t\t\t) ,\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_title_font = array(\n\t\t'id' => '_uncode_%section%_header_title_font',\n\t\t'label' => esc_html__('Title font family', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the font for the title.', 'uncode') ,\n\t\t'std' => 'font-555555',\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => $custom_fonts,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_title_size = array(\n\t\t'id' => '_uncode_%section%_header_title_size',\n\t\t'label' => esc_html__('Title font size', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the font size for the title.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => $title_size,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_title_height = array(\n\t\t'id' => '_uncode_%section%_header_title_height',\n\t\t'label' => esc_html__('Title line height', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the line height for the title.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => $title_height,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_title_spacing = array(\n\t\t'id' => '_uncode_%section%_header_title_spacing',\n\t\t'label' => esc_html__('Title letter spacing', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the letter spacing for the title.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => $title_spacing,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_title_weight = array(\n\t\t'id' => '_uncode_%section%_header_title_weight',\n\t\t'label' => esc_html__('Title font weight', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the font weight for the title.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => $title_weight,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_title_italic = array(\n\t\t'id' => '_uncode_%section%_header_title_italic',\n\t\t'label' => esc_html__('Title italic', 'uncode') ,\n\t\t'desc' => esc_html__('Activate the font style italic for the title.', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t);\n\n\t$header_title_transform = array(\n\t\t'id' => '_uncode_%section%_header_title_transform',\n\t\t'label' => esc_html__('Title text transform', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the title text transformation.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Default CSS', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'uppercase',\n\t\t\t\t'label' => esc_html__('Uppercase', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'lowercase',\n\t\t\t\t'label' => esc_html__('Lowercase', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'capitalize',\n\t\t\t\t'label' => esc_html__('Capitalize', 'uncode') ,\n\t\t\t) ,\n\t\t)\n\t);\n\n\t$header_text_animation = array(\n\t\t'id' => '_uncode_%section%_header_text_animation',\n\t\t'label' => esc_html__('Text animation', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the entrance animation of the title text.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on)',\n\t\t'operator' => 'and',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Select…', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'top-t-bottom',\n\t\t\t\t'label' => esc_html__('Top to bottom', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'left-t-right',\n\t\t\t\t'label' => esc_html__('Left to right', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'right-t-left',\n\t\t\t\t'label' => esc_html__('Right to left', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'bottom-t-top',\n\t\t\t\t'label' => esc_html__('Bottom to top', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'zoom-in',\n\t\t\t\t'label' => esc_html__('Zoom in', 'uncode') ,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'value' => 'zoom-out',\n\t\t\t\t'label' => esc_html__('Zoom out', 'uncode') ,\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'value' => 'alpha-anim',\n\t\t\t\t'label' => esc_html__('Alpha', 'uncode') ,\n\t\t\t)\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_animation_delay = array(\n\t\t'id' => '_uncode_%section%_header_animation_delay',\n\t\t'label' => esc_html__('Animation delay', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the entrance animation delay of the title text in milliseconds.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on),_uncode_%section%_header_text_animation:not()',\n\t\t'operator' => 'and',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('None', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '100',\n\t\t\t\t'label' => esc_html__('ms 100', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '200',\n\t\t\t\t'label' => esc_html__('ms 200', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '300',\n\t\t\t\t'label' => esc_html__('ms 300', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '400',\n\t\t\t\t'label' => esc_html__('ms 400', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '500',\n\t\t\t\t'label' => esc_html__('ms 500', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '600',\n\t\t\t\t'label' => esc_html__('ms 600', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '700',\n\t\t\t\t'label' => esc_html__('ms 700', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '800',\n\t\t\t\t'label' => esc_html__('ms 800', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '900',\n\t\t\t\t'label' => esc_html__('ms 900', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1000',\n\t\t\t\t'label' => esc_html__('ms 1000', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1100',\n\t\t\t\t'label' => esc_html__('ms 1100', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1200',\n\t\t\t\t'label' => esc_html__('ms 1200', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1300',\n\t\t\t\t'label' => esc_html__('ms 1300', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1400',\n\t\t\t\t'label' => esc_html__('ms 1400', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1500',\n\t\t\t\t'label' => esc_html__('ms 1500', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1600',\n\t\t\t\t'label' => esc_html__('ms 1600', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1700',\n\t\t\t\t'label' => esc_html__('ms 1700', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1800',\n\t\t\t\t'label' => esc_html__('ms 1800', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1900',\n\t\t\t\t'label' => esc_html__('ms 1900', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '2000',\n\t\t\t\t'label' => esc_html__('ms 2000', 'uncode') ,\n\t\t\t) ,\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_animation_speed = array(\n\t\t'id' => '_uncode_%section%_header_animation_speed',\n\t\t'label' => esc_html__('Animation speed', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the entrance animation speed of the title text in milliseconds.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header_title:is(on),_uncode_%section%_header_text_animation:not()',\n\t\t'operator' => 'and',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Default (400)', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '100',\n\t\t\t\t'label' => esc_html__('ms 100', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '200',\n\t\t\t\t'label' => esc_html__('ms 200', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '300',\n\t\t\t\t'label' => esc_html__('ms 300', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '400',\n\t\t\t\t'label' => esc_html__('ms 400', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '500',\n\t\t\t\t'label' => esc_html__('ms 500', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '600',\n\t\t\t\t'label' => esc_html__('ms 600', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '700',\n\t\t\t\t'label' => esc_html__('ms 700', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '800',\n\t\t\t\t'label' => esc_html__('ms 800', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '900',\n\t\t\t\t'label' => esc_html__('ms 900', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '1000',\n\t\t\t\t'label' => esc_html__('ms 1000', 'uncode') ,\n\t\t\t) ,\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$header_featured = array(\n\t\t'label' => esc_html__('Featured media in header', 'uncode') ,\n\t\t'id' => '_uncode_%section%_header_featured',\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Activate to use the featured image in the header.', 'uncode') ,\n\t\t'std' => 'on',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_background = array(\n\t\t'id' => '_uncode_%section%_header_background',\n\t\t'label' => esc_html__('Background', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the background media and color.', 'uncode') ,\n\t\t'type' => 'background',\n\t\t'std' => array(\n\t\t\t'background-color' => 'color-gyho',\n\t\t\t'background-repeat' => '',\n\t\t\t'background-attachment' => '',\n\t\t\t'background-position' => '',\n\t\t\t'background-size' => '',\n\t\t\t'background-image' => '',\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_parallax = array(\n\t\t'id' => '_uncode_%section%_header_parallax',\n\t\t'label' => esc_html__('Parallax', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'desc' => esc_html__('Activate the background parallax effect.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_kburns = array(\n\t\t'id' => '_uncode_%section%_header_kburns',\n\t\t'label' => esc_html__('Zoom Effect', 'uncode') ,\n\t\t'desc' => esc_html__('Select the background zoom effect you prefer.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('None', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'on',\n\t\t\t\t'label' => esc_html__('Ken Burns', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'zoom',\n\t\t\t\t'label' => esc_html__('Zoom Out', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_overlay_color = array(\n\t\t'id' => '_uncode_%section%_header_overlay_color',\n\t\t'label' => esc_html__('Overlay color', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the overlay background color.', 'uncode') ,\n\t\t'type' => 'uncode_color',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_overlay_color_alpha = array(\n\t\t'id' => '_uncode_%section%_header_overlay_color_alpha',\n\t\t'label' => esc_html__('Overlay color opacity', 'uncode') ,\n\t\t'desc' => esc_html__('Set the overlay opacity.', 'uncode') ,\n\t\t'std' => '100',\n\t\t'min_max_step' => '0,100,1',\n\t\t'type' => 'numeric-slider',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_scroll_opacity = array(\n\t\t'id' => '_uncode_%section%_header_scroll_opacity',\n\t\t'label' => esc_html__('Scroll opacity', 'uncode') ,\n\t\t'desc' => esc_html__('Activate alpha animation when scrolling down.', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:is(header_basic),_uncode_%section%_header:is(header_uncodeblock)',\n\t\t'operator' => 'or',\n\t);\n\n\t$header_scrolldown = array(\n\t\t'id' => '_uncode_%section%_header_scrolldown',\n\t\t'label' => esc_html__('Scroll down arrow', 'uncode') ,\n\t\t'desc' => esc_html__('Activate the scroll down arrow button.', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'std' => 'off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_header:not(none)',\n\t\t'operator' => 'or',\n\t);\n\n\t$show_breadcrumb = array(\n\t\t'id' => '_uncode_%section%_breadcrumb',\n\t\t'label' => esc_html__('Show breadcrumb', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the navigation breadcrumb.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$breadcrumb_align = array(\n\t\t'id' => '_uncode_%section%_breadcrumb_align',\n\t\t'label' => esc_html__('Breadcrumb align', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the breadcrumb alignment','uncode'),\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Right', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'center',\n\t\t\t\t'label' => esc_html__('Center', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'left',\n\t\t\t\t'label' => esc_html__('Left', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_breadcrumb:is(on)',\n\t\t'operator' => 'or',\n\t);\n\n\t$show_title = array(\n\t\t'id' => '_uncode_%section%_title',\n\t\t'label' => esc_html__('Show title', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the title in the content area.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'operator' => 'or'\n\t);\n\n\t$remove_pagination = array(\n\t\t'id' => '_uncode_%section%_remove_pagination',\n\t\t'label' => esc_html__('Remove pagination', 'uncode') ,\n\t\t'desc' => esc_html__('Activate this to remove the pagination (useful when you use a custom Content Block with Pagination or Load More options).', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'operator' => 'or'\n\t);\n\n\t$products_per_page = array(\n\t\t'id' => '_uncode_%section%_ppp',\n\t\t'label' => esc_html__('Number of products', 'uncode') ,\n\t\t'desc' => esc_html__('Set the number of items to display on product archives. \\'Inherit\\' inherits the WordPress Settings > Readings > Blog Number of Posts', 'uncode') ,\n\t\t'std' => '0',\n\t\t'min_max_step' => '0,100,1',\n\t\t'type' => 'numeric-slider',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$show_media = array(\n\t\t'id' => '_uncode_%section%_media',\n\t\t'label' => esc_html__('Show media', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the medias in the content area.', 'uncode') ,\n\t\t'std' => 'on',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$show_featured_media = array(\n\t\t'id' => '_uncode_%section%_featured_media',\n\t\t'label' => esc_html__('Show featured image', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the featured image in the content area.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'condition' => '_uncode_%section%_media:not(on)',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$show_tags = array(\n\t\t'id' => '_uncode_%section%_tags',\n\t\t'label' => esc_html__('Show tags', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the tags and choose visbility by post to post bases.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$show_tags_align = array(\n\t\t'id' => '_uncode_%section%_tags_align',\n\t\t'label' => esc_html__('Tags alignment', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the tags alignment.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => 'left',\n\t\t\t\t'label' => esc_html__('Left align', 'uncode') ,\n\t\t\t\t'src' => ''\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'center',\n\t\t\t\t'label' => esc_html__('Center align', 'uncode') ,\n\t\t\t\t'src' => ''\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'right',\n\t\t\t\t'label' => esc_html__('Right align', 'uncode') ,\n\t\t\t\t'src' => ''\n\t\t\t)\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_tags:is(on)',\n\t\t'operator' => 'or',\n\t);\n\n\t$show_comments = array(\n\t\t'id' => '_uncode_%section%_comments',\n\t\t'label' => esc_html__('Show comments', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the comments and choose visbility by post to post bases.', 'uncode') ,\n\t\t'std' => 'on',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$show_share = array(\n\t\t'id' => '_uncode_%section%_share',\n\t\t'label' => esc_html__('Show share', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the share module.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$image_layout = array(\n\t\t'id' => '_uncode_%section%_image_layout',\n\t\t'label' => esc_html__('Media layout', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the layout mode for the product images section.', 'uncode') ,\n\t\t'std' => '',\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Standard', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'stack',\n\t\t\t\t'label' => esc_html__('Stack', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$media_size = array(\n\t\t'id' => '_uncode_%section%_media_size',\n\t\t'label' => esc_html__('Media layout size', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the size of the media layout area.', 'uncode') ,\n\t\t'std' => '6',\n\t\t'min_max_step' => '1,11,1',\n\t\t'type' => 'numeric-slider',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$enable_sticky_desc = array(\n\t\t'id' => '_uncode_%section%_sticky_desc',\n\t\t'label' => esc_html__('Sticky content', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to enable sticky effect for product description.', 'uncode') ,\n\t\t'std' => 'on',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_image_layout:is(stack)',\n\t);\n\n\t$enable_woo_zoom = array(\n\t\t'id' => '_uncode_%section%_enable_zoom',\n\t\t'label' => esc_html__('Zoom', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to enable drag zoom effect on product image.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$thumb_cols = array(\n\t\t'id' => '_uncode_%section%_thumb_cols',\n\t\t'label' => esc_html__('Thumbnails columns', 'uncode') ,\n\t\t'desc' => esc_html__('Specify how many columns to display for your product gallery thumbs.', 'uncode') ,\n\t\t'std' => '',\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '2',\n\t\t\t\t'label' => '2',\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => '3',\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '4',\n\t\t\t\t'label' => '4',\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '5',\n\t\t\t\t'label' => '5',\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '6',\n\t\t\t\t'label' => '6',\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_image_layout:is()',\n\t);\n\n\t$enable_woo_slider = array(\n\t\t'id' => '_uncode_%section%_enable_slider',\n\t\t'label' => esc_html__('Thumbnails carousel', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to enable carousel slider when you click gallery thumbs.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_image_layout:is()',\n\t);\n\n\t$body_section_title = array(\n\t\t'id' => '_uncode_%section%_body_title',\n\t\t'label' => '<i class=\"fa fa-layout\"></i> ' . esc_html__('Content', 'uncode') ,\n\t\t'desc' => '' ,\n\t\t'type' => 'textblock-titled',\n\t\t'class' => 'section-title',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_uncode_block = array(\n\t\t'id' => '_uncode_%section%_content_block',\n\t\t'label' => esc_html__('Content Block', 'uncode') ,\n\t\t'desc' => esc_html__('Define the Content Block to use. NB. Select \"Inherit\" to use the default template.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'choices' => $uncodeblocks,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_uncode_block_before = array(\n\t\t'id' => '_uncode_%section%_content_block_before',\n\t\t'label' => esc_html__('Content Block - Before Content', 'uncode') ,\n\t\t'desc' => esc_html__('Define the Content Block to use.', 'uncode') ,\n\t\t'type' => 'custom-post-type-select',\n\t\t'post_type' => 'uncodeblock',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_uncode_block_after_pre = array(\n\t\t'id' => '_uncode_%section%_content_block_after_pre',\n\t\t'label' => esc_html__('After Content (ex: Author Profile)', 'uncode') ,\n\t\t'desc' => esc_html__('Define the Content Block to use.', 'uncode') ,\n\t\t'type' => 'custom-post-type-select',\n\t\t'post_type' => 'uncodeblock',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_uncode_block_after = array(\n\t\t'id' => '_uncode_%section%_content_block_after',\n\t\t'label' => esc_html__('After Content (ex: Related Posts)', 'uncode') ,\n\t\t'desc' => esc_html__('Define the Content Block to use.', 'uncode') ,\n\t\t'type' => 'custom-post-type-select',\n\t\t'post_type' => 'uncodeblock',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_layout_width = array(\n\t\t'id' => '_uncode_%section%_layout_width',\n\t\t'label' => esc_html__('Content width', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the content width.', 'uncode'),\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Inherit', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'full',\n\t\t\t\t'label' => esc_html__('Full', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'limit',\n\t\t\t\t'label' => esc_html__('Limit', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_layout_width_custom = array(\n\t\t'id' => '_uncode_%section%_layout_width_custom',\n\t\t'label' => esc_html__('Custom width', 'uncode') ,\n\t\t'desc' => esc_html__('Define the custom width for the content area in px or in %. This option takes effect with normal contents (not Page Builder).', 'uncode') ,\n\t\t'type' => 'measurement',\n\t\t'condition' => '_uncode_%section%_layout_width:is(limit)',\n\t\t'operator' => 'or',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_single_post_width = array(\n\t\t'id' => '_uncode_%section%_single_width',\n\t\t'label' => esc_html__('Single post width', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the single post width from 1 to 12.', 'uncode'),\n\t\t'type' => 'select',\n\t\t'std' => '4',\n\t\t'condition' => '_uncode_%section%_content_block:is(),_uncode_%section%_content_block:is(none)',\n\t\t'operator' => 'or',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '1',\n\t\t\t\t'label' => '1' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '2',\n\t\t\t\t'label' => '2' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '3',\n\t\t\t\t'label' => '3' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '4',\n\t\t\t\t'label' => '4' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '5',\n\t\t\t\t'label' => '5' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '6',\n\t\t\t\t'label' => '6' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '7',\n\t\t\t\t'label' => '7' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '8',\n\t\t\t\t'label' => '8' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '9',\n\t\t\t\t'label' => '9' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '10',\n\t\t\t\t'label' => '10' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '11',\n\t\t\t\t'label' => '11' ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => '12',\n\t\t\t\t'label' => '12' ,\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$body_single_text_lenght = array(\n\t\t'id' => '_uncode_%section%_single_text_length',\n\t\t'label' => esc_html__('Single teaser text length', 'uncode') ,\n\t\t'desc' => esc_html__('Enter the number of words you want for the teaser. If nothing in entered the full content will be showed.', 'uncode') ,\n\t\t'type' => 'text',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_content_block:is(),_uncode_%section%_content_block:is(none)',\n\t\t'operator' => 'or',\n\t);\n\n\t$sidebar_section_title = array(\n\t\t'id' => '_uncode_%section%_sidebar_title',\n\t\t'label' => '<i class=\"fa fa-content-right\"></i> ' . esc_html__('Sidebar', 'uncode') ,\n\t\t'desc' => '' ,\n\t\t'type' => 'textblock-titled',\n\t\t'class' => 'section-title',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$sidebar_activate = array(\n\t\t'id' => '_uncode_%section%_activate_sidebar',\n\t\t'label' => esc_html__('Activate the sidebar', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the sidebar.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$sidebar_widget = array(\n\t\t'id' => '_uncode_%section%_sidebar',\n\t\t'label' => esc_html__('Sidebar', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the sidebar.', 'uncode') ,\n\t\t'type' => 'sidebar-select',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_activate_sidebar:not(off)',\n\t);\n\n\t$sidebar_position = array(\n\t\t'id' => '_uncode_%section%_sidebar_position',\n\t\t'label' => esc_html__('Position', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the position of the sidebar.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => 'sidebar_right',\n\t\t\t\t'label' => esc_html__('Right', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'sidebar_left',\n\t\t\t\t'label' => esc_html__('Left', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'condition' => '_uncode_%section%_activate_sidebar:not(off)',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$sidebar_size = array(\n\t\t'id' => '_uncode_%section%_sidebar_size',\n\t\t'label' => esc_html__('Size', 'uncode') ,\n\t\t'desc' => esc_html__('Set the size of the sidebar.', 'uncode') ,\n\t\t'std' => '4',\n\t\t'min_max_step' => '1,11,1',\n\t\t'type' => 'numeric-slider',\n\t\t'condition' => '_uncode_%section%_activate_sidebar:not(off)',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$sidebar_sticky = array(\n\t\t'id' => '_uncode_%section%_sidebar_sticky',\n\t\t'label' => esc_html__('Sticky sidebar', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to have a sticky sidebar.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'condition' => '_uncode_%section%_activate_sidebar:not(off)',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$sidebar_style = array(\n\t\t'id' => '_uncode_%section%_sidebar_style',\n\t\t'label' => esc_html__('Skin', 'uncode') ,\n\t\t'desc' => esc_html__('Override the sidebar text skin color.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Inherit', \"uncode\") ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'light',\n\t\t\t\t'label' => esc_html__('Light', \"uncode\") ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'dark',\n\t\t\t\t'label' => esc_html__('Dark', \"uncode\") ,\n\t\t\t)\n\t\t),\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_activate_sidebar:not(off)',\n\t);\n\n\t$sidebar_bgcolor = array(\n\t\t'id' => '_uncode_%section%_sidebar_bgcolor',\n\t\t'label' => esc_html__('Background color', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the sidebar background color.', 'uncode') ,\n\t\t'type' => 'uncode_color',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'condition' => '_uncode_%section%_activate_sidebar:not(off)',\n\t);\n\n\t$sidebar_fill = array(\n\t\t'id' => '_uncode_%section%_sidebar_fill',\n\t\t'label' => esc_html__('Sidebar filling space', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to remove padding around the sidebar and fill the height.', 'uncode') ,\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'std' => 'off',\n\t\t'operator' => 'and',\n\t\t'condition' => '_uncode_%section%_sidebar_bgcolor:not(),_uncode_%section%_activate_sidebar:not(off)',\n\t);\n\n\t$navigation_section_title = array(\n\t\t'id' => '_uncode_%section%_navigation_title',\n\t\t'label' => '<i class=\"fa fa-location\"></i> ' . esc_html__('Navigation', 'uncode') ,\n\t\t'desc' => '' ,\n\t\t'type' => 'textblock-titled',\n\t\t'class' => 'section-title',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$navigation_activate = array(\n\t\t'id' => '_uncode_%section%_navigation_activate',\n\t\t'label' => esc_html__('Navigation bar', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the navigation bar.', 'uncode') ,\n\t\t'std' => 'on',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$navigation_page_index = array(\n\t\t'id' => '_uncode_%section%_navigation_index',\n\t\t'label' => esc_html__('Navigation index', 'uncode') ,\n\t\t'desc' => esc_html__('Specify the page you want to use as index.', 'uncode'),\n\t\t'type' => 'page-select',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'operator' => 'and',\n\t\t'condition' => '_uncode_%section%_navigation_activate:not(off)',\n\t);\n\n\t$navigation_index_label = array(\n\t\t'id' => '_uncode_%section%_navigation_index_label',\n\t\t'label' => esc_html__('Index custom label', 'uncode') ,\n\t\t'desc' => esc_html__('Enter a custom label for the index button.', 'uncode') ,\n\t\t'type' => 'text',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'operator' => 'and',\n\t\t'condition' => '_uncode_%section%_navigation_activate:not(off)',\n\t);\n\n\t$navigation_nextprev_title = array(\n\t\t'id' => '_uncode_%section%_navigation_nextprev_title',\n\t\t'label' => esc_html__('Navigation titles', 'uncode') ,\n\t\t'desc' => esc_html__('Activate to show the next/prev post title.', 'uncode') ,\n\t\t'std' => 'off',\n\t\t'type' => 'on-off',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'operator' => 'and',\n\t\t'condition' => '_uncode_%section%_navigation_activate:not(off)',\n\t);\n\n\t$footer_section_title = array(\n\t\t'id' => '_uncode_%section%_footer_block_title',\n\t\t'label' => '<i class=\"fa fa-ellipsis\"></i> ' . esc_html__('Footer', 'uncode') ,\n\t\t'desc' => '' ,\n\t\t'type' => 'textblock-titled',\n\t\t'class' => 'section-title',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$footer_uncode_block = array(\n\t\t'id' => '_uncode_%section%_footer_block',\n\t\t'label' => esc_html__('Content Block', 'uncode') ,\n\t\t'desc' => esc_html__('Override the Content Block.', 'uncode') ,\n\t\t'type' => 'select',\n\t\t'choices' => $uncodeblocks,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$footer_width = array(\n\t\t'id' => '_uncode_%section%_footer_width',\n\t\t'label' => esc_html__('Footer width', 'uncode') ,\n\t\t'desc' => esc_html__('Override the footer width.' ,'uncode'),\n\t\t'type' => 'select',\n\t\t'choices' => array(\n\t\t\tarray(\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => esc_html__('Inherit', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'full',\n\t\t\t\t'label' => esc_html__('Full', 'uncode') ,\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'value' => 'limit',\n\t\t\t\t'label' => esc_html__('Limit', 'uncode') ,\n\t\t\t) ,\n\t\t) ,\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$custom_fields_section_title = array(\n\t\t'id' => '_uncode_%section%_cf_title',\n\t\t'label' => '<i class=\"fa fa-pencil3\"></i> ' . esc_html__('Custom fields', 'uncode') ,\n\t\t'desc' => '' ,\n\t\t'type' => 'textblock-titled',\n\t\t'class' => 'section-title',\n\t\t'section' => 'uncode_%section%_section',\n\t);\n\n\t$custom_fields_list = array(\n\t\t'id' => '_uncode_%section%_custom_fields',\n\t\t'class' => 'uncode-custom-fields-list',\n\t\t'label' => esc_html__('Custom fields', 'uncode') ,\n\t\t'desc' => esc_html__('Create here all the custom fields that can be used inside the posts module.', 'uncode') ,\n\t\t'type' => 'list-item',\n\t\t'section' => 'uncode_%section%_section',\n\t\t'settings' => array(\n\t\t\tarray(\n\t\t\t\t'id' => '_uncode_cf_unique_id',\n\t\t\t\t'class' => 'unique_id',\n\t\t\t\t'std' => 'detail-',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'label' => esc_html__('Unique custom field ID','uncode') ,\n\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t),\n\t\t)\n\t);\n\n\t$portfolio_cpt_name = ot_get_option('_uncode_portfolio_cpt');\n\tif ($portfolio_cpt_name == '') $portfolio_cpt_name = 'portfolio';\n\n\t$cpt_single_sections = array();\n\t$cpt_index_sections = array();\n\t$cpt_single_options = array();\n\t$cpt_index_options = array();\n\n\tif (count($uncode_post_types) > 0) {\n\t\tforeach ($uncode_post_types as $key => $value) {\n\t\t\tif ($value !== 'portfolio' && $value !== 'product') {\n\t\t\t\t$cpt_obj = get_post_type_object($value);\n\n\t\t\t\tif ( is_object($cpt_obj) ) {\n\t\t\t\t\t$cpt_name = $cpt_obj->labels->name;\n\t\t\t\t\t$cpt_sing_name = $cpt_obj->labels->singular_name;\n\t\t\t\t\t$cpt_single_sections[] = array(\n\t\t\t\t\t\t'id' => 'uncode_'.$value.'_section',\n\t\t\t\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-paper\"></i> ' . ucfirst($cpt_sing_name) . '</span>',\n\t\t\t\t\t\t'group' => esc_html__('Single', 'uncode')\n\t\t\t\t\t);\n\t\t\t\t\t$cpt_index_sections[] = array(\n\t\t\t\t\t\t'id' => 'uncode_'.$value.'_index_section',\n\t\t\t\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-archive2\"></i> ' . ucfirst($cpt_name) . '</span>',\n\t\t\t\t\t\t'group' => esc_html__('Archives', 'uncode')\n\t\t\t\t\t);\n\t\t\t\t} elseif ( $value == 'author' ) {\n\t\t\t\t\t$cpt_index_sections[] = array(\n\t\t\t\t\t\t'id' => 'uncode_'.$value.'_index_section',\n\t\t\t\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-archive2\"></i> ' . esc_html__('Authors', 'uncode') . '</span>',\n\t\t\t\t\t\t'group' => esc_html__('Archives', 'uncode')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ($uncode_post_types as $key => $value) {\n\t\t\tif ($value !== 'portfolio' && $value !== 'product' && $value !== 'author') {\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $menu_section_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $menu);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $menu_width);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $menu_opaque);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_section_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_type);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_uncode_block);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_revslider);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_layerslider);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_width);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_height);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_min_height);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_style);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_content_width);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_custom_width);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_align);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_position);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title_font);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title_size);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title_height);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title_spacing);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title_weight);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title_transform);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_title_italic);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_text_animation);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_animation_speed);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_animation_delay);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_featured);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_background);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_parallax);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_kburns);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_overlay_color);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_overlay_color_alpha);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_scroll_opacity);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $header_scrolldown);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $body_section_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $body_layout_width);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $body_layout_width_custom);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $show_breadcrumb);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $breadcrumb_align);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, run_array_to($show_title, 'std', 'on'));\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $show_media);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $show_featured_media);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $show_comments);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $show_share);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $image_layout);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $media_size);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $enable_sticky_desc);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $enable_woo_zoom);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $thumb_cols);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $enable_woo_slider);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $body_uncode_block_after_pre);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $body_uncode_block_after);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_section_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_activate);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_widget);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_position);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_size);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_sticky);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_style);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_bgcolor);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $sidebar_fill);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $navigation_section_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $navigation_activate);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $navigation_page_index);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $navigation_index_label);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $navigation_nextprev_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $footer_section_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $footer_uncode_block);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $footer_width);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $custom_fields_section_title);\n\t\t\t\t$cpt_single_options[] = str_replace('%section%', $value, $custom_fields_list);\n\t\t\t}\n\t\t}\n\t\tforeach ($uncode_post_types as $key => $value) {\n\t\t\tif ($value !== 'portfolio' && $value !== 'product') {\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $menu_section_title);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $menu);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $menu_width);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $menu_opaque);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_section_title);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', run_array_to($header_type, 'std', 'header_basic'));\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_uncode_block);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_revslider);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_layerslider);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_width);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_height);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_min_height);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_style);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_content_width);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_custom_width);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_align);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_position);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title_font);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title_size);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title_height);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title_spacing);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title_weight);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title_transform);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_title_italic);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_text_animation);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_animation_speed);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_animation_delay);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_featured);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_background);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_parallax);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_kburns);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_overlay_color);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_overlay_color_alpha);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_scroll_opacity);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $header_scrolldown);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $menu_no_padding);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $menu_no_padding_mobile);\n\t\t\t\tif ($value !== 'author') {\n\t\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $title_archive_custom_activate);\n\t\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $title_archive_custom_text);\n\t\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $subtitle_archive_custom_text);\n\t\t\t\t}\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $body_section_title);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $show_breadcrumb);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $breadcrumb_align);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $body_uncode_block);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $body_layout_width);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $body_single_post_width);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $body_single_text_lenght);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $show_title);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $remove_pagination);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_section_title);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', run_array_to($sidebar_activate, 'std', 'on'));\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_widget);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_position);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_size);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_sticky);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_style);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_bgcolor);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $sidebar_fill);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $footer_section_title);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $footer_uncode_block);\n\t\t\t\t$cpt_index_options[] = str_replace('%section%', $value . '_index', $footer_width);\n\t\t\t}\n\t\t}\n\t}\n\n\t$custom_settings_section_one = array(\n\t\tarray(\n\t\t\t'id' => 'uncode_header_section',\n\t\t\t'title' => '<i class=\"fa fa-heart3\"></i> ' . esc_html__('Navbar', 'uncode'),\n\t\t\t'group' => esc_html__('General', 'uncode'),\n\t\t\t'group_icon' => 'fa-layout'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_main_section',\n\t\t\t'title' => '<i class=\"fa fa-layers\"></i> ' . esc_html__('Layout', 'uncode'),\n\t\t\t'group' => esc_html__('General', 'uncode'),\n\t\t) ,\n\t\t// array(\n\t\t// \t'id' => 'uncode_header_section',\n\t\t// \t'title' => '<i class=\"fa fa-menu\"></i> ' . esc_html__('Menu', 'uncode'),\n\t\t// \t'group' => esc_html__('General', 'uncode')\n\t\t// ) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_footer_section',\n\t\t\t'title' => '<i class=\"fa fa-ellipsis\"></i> ' . esc_html__('Footer', 'uncode'),\n\t\t\t'group' => esc_html__('General', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_post_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-paper\"></i> ' . esc_html__('Post', 'uncode') . '</span>',\n\t\t\t'group' => esc_html__('Single', 'uncode'),\n\t\t\t'group_icon' => 'fa-file2'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_page_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-paper\"></i> ' . esc_html__('Page', 'uncode') . '</span>',\n\t\t\t'group' => esc_html__('Single', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_portfolio_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-paper\"></i> ' . ucfirst($portfolio_cpt_name) . '</span>',\n\t\t\t'group' => esc_html__('Single', 'uncode')\n\t\t) ,\n\t);\n\n\t$custom_settings_section_one = array_merge( $custom_settings_section_one, $cpt_single_sections );\n\n\t$custom_settings_section_two = array(\n\t\tarray(\n\t\t\t'id' => 'uncode_post_index_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-archive2\"></i> ' . esc_html__('Posts', 'uncode') . '</span>',\n\t\t\t'group' => esc_html__('Archives', 'uncode'),\n\t\t\t'group_icon' => 'fa-archive2'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_page_index_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-archive2\"></i> ' . esc_html__('Pages', 'uncode') . '</span>',\n\t\t\t'group' => esc_html__('Archives', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_portfolio_index_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-archive2\"></i> ' . ucfirst($portfolio_cpt_name) . 's</span>',\n\t\t\t'group' => esc_html__('Archives', 'uncode')\n\t\t) ,\n\t);\n\n\t$custom_settings_section_one = array_merge( $custom_settings_section_one, $custom_settings_section_two );\n\t$custom_settings_section_one = array_merge( $custom_settings_section_one, $cpt_index_sections );\n\n\t$custom_settings_section_three = array(\n\t\tarray(\n\t\t\t'id' => 'uncode_search_index_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-archive2\"></i> ' . esc_html__('Search', 'uncode') . '</span>',\n\t\t\t'group' => esc_html__('Archives', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_404_section',\n\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-help\"></i> ' . esc_html__('404', 'uncode') . '</span>',\n\t\t\t'group' => esc_html__('Single', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_colors_section',\n\t\t\t'title' => '<i class=\"fa fa-drop\"></i> ' . esc_html__('Palette', 'uncode'),\n\t\t\t'group' => esc_html__('Visual', 'uncode'),\n\t\t\t'group_icon' => 'fa-eye2'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_typography_section',\n\t\t\t'title' => '<i class=\"fa fa-font\"></i> ' . esc_html__('Typography', 'uncode'),\n\t\t\t'group' => esc_html__('Visual', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_customize_section',\n\t\t\t'title' => '<i class=\"fa fa-box\"></i> ' . esc_html__('Customize', 'uncode'),\n\t\t\t'group' => esc_html__('Visual', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_extra_section',\n\t\t\t'title' => esc_html__('Extra', 'uncode'),\n\t\t\t'group' => esc_html__('Visual', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_sidebars_section',\n\t\t\t'title' => '<i class=\"fa fa-content-right\"></i> ' . esc_html__('Sidebars', 'uncode'),\n\t\t\t'group' => esc_html__('Utility', 'uncode'),\n\t\t\t'group_icon' => 'fa-cog2'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_connections_section',\n\t\t\t'title' => '<i class=\"fa fa-share2\"></i> ' . esc_html__('Socials', 'uncode'),\n\t\t\t'group' => esc_html__('Utility', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_gmaps_section',\n\t\t\t'title' => '<i class=\"fa fa-map-o\"></i> ' . esc_html__('Google Maps', 'uncode'),\n\t\t\t'group' => esc_html__('Utility', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_redirect_section',\n\t\t\t'title' => '<i class=\"fa fa-reply2\"></i> ' . esc_html__('Redirect', 'uncode'),\n\t\t\t'group' => esc_html__('Utility', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_cssjs_section',\n\t\t\t'title' => '<i class=\"fa fa-code\"></i> ' . esc_html__('CSS & JS', 'uncode'),\n\t\t\t'group' => esc_html__('Utility', 'uncode')\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => 'uncode_performance_section',\n\t\t\t'title' => '<i class=\"fa fa-loader\"></i> ' . esc_html__('Performance', 'uncode'),\n\t\t\t'group' => esc_html__('Utility', 'uncode')\n\t\t) ,\n\t);\n\n\t$custom_settings_section_one = array_merge( $custom_settings_section_one, $custom_settings_section_three );\n\n\t$custom_settings_one = array(\n\t\tarray(\n\t\t\t'id' => '_uncode_general_block_title',\n\t\t\t'label' => '<i class=\"fa fa-globe3\"></i> ' . esc_html__('General', 'uncode') ,\n\t\t\t'desc' => '',\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_main_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_main_width',\n\t\t\t'label' => esc_html__('Site width', 'uncode') ,\n\t\t\t'desc' => esc_html__('Enter the width of your site.', 'uncode') ,\n\t\t\t'std' => array(\n\t\t\t\t'1200',\n\t\t\t\t'px'\n\t\t\t) ,\n\t\t\t'type' => 'measurement',\n\t\t\t'section' => 'uncode_main_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_main_align',\n\t\t\t'label' => esc_html__('Site layout align', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the alignment of the content area when is less then 100% width.', 'uncode') ,\n\t\t\t'std' => 'center',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_main_section',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'left',\n\t\t\t\t\t'label' => esc_html__('Left align', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'center',\n\t\t\t\t\t'label' => esc_html__('Center align', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'right',\n\t\t\t\t\t'label' => esc_html__('Right align', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_boxed',\n\t\t\t'label' => esc_html__('Boxed', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate for the boxed layout.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_main_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_body_border',\n\t\t\t'label' => esc_html__('Body frame', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the thickness of the frame around the body', 'uncode') ,\n\t\t\t'std' => '0',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'min_max_step'=> '0,36,9',\n\t\t\t'section' => 'uncode_main_section',\n\t\t\t'condition' => '_uncode_boxed:is(off)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_body_border_color',\n\t\t\t'label' => esc_html__('Body frame color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the body frame color.', 'uncode') ,\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_main_section',\n\t\t\t'condition' => '_uncode_boxed:is(off),_uncode_body_border:not(0)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tstr_replace('%section%', 'main', run_array_to($header_section_title, 'condition', '_uncode_boxed:is(off)')),\n\t\tarray(\n\t\t\t'id' => '_uncode_header_full',\n\t\t\t'label' => esc_html__('Container full width', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to expand the header container to full width.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_main_section',\n\t\t\t'condition' => '_uncode_boxed:is(off)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tstr_replace('%section%', 'main', run_array_to($body_section_title, 'condition', '_uncode_boxed:is(off)')),\n\t\tarray(\n\t\t\t'id' => '_uncode_body_full',\n\t\t\t'label' => esc_html__('Content area full width', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to expand the content area to full width.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_main_section',\n\t\t\t'condition' => '_uncode_boxed:is(off)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_logo_block_title',\n\t\t\t'label' => '<i class=\"fa fa-heart3\"></i> ' . esc_html__('Logo', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_switch',\n\t\t\t'label' => esc_html__('Switchable logo', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to upload different logo for each skin.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo',\n\t\t\t'label' => esc_html__('Logo', 'uncode') ,\n\t\t\t'desc' => esc_html__('Upload a logo. You can use Images, SVG code or HTML code.', 'uncode') ,\n\t\t\t'type' => 'upload',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_logo_switch:is(off)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_light',\n\t\t\t'label' => esc_html__('Logo - Light', 'uncode') ,\n\t\t\t'desc' => esc_html__('Upload a logo for the light skin.', 'uncode') ,\n\t\t\t'type' => 'upload',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_logo_switch:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_dark',\n\t\t\t'label' => esc_html__('Logo - Dark', 'uncode') ,\n\t\t\t'desc' => esc_html__('Upload a logo for the dark skin.', 'uncode') ,\n\t\t\t'type' => 'upload',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_logo_switch:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_mobile_switch',\n\t\t\t'label' => esc_html__('Different Logo Mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to upload different logo for mobile devices.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_mobile',\n\t\t\t'label' => esc_html__('Logo Mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Upload a logo for mobile. You can use Images, SVG code or HTML code.', 'uncode') ,\n\t\t\t'type' => 'upload',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_logo_mobile_switch:is(on),_uncode_logo_switch:is(off)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_mobile_light',\n\t\t\t'label' => esc_html__('Logo Mobile - Light', 'uncode') ,\n\t\t\t'desc' => esc_html__('Upload a logo mobile for the light skin.', 'uncode') ,\n\t\t\t'type' => 'upload',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_logo_mobile_switch:is(on),_uncode_logo_switch:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_mobile_dark',\n\t\t\t'label' => esc_html__('Logo Mobile - Dark', 'uncode') ,\n\t\t\t'desc' => esc_html__('Upload a logo mobile for the dark skin.', 'uncode') ,\n\t\t\t'type' => 'upload',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_logo_mobile_switch:is(on),_uncode_logo_switch:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_height',\n\t\t\t'label' => esc_html__('Logo height', 'uncode'),\n\t\t\t'desc' => esc_html__('Enter the height of the logo in px.', 'uncode') ,\n\t\t\t'std' => '20',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_height_mobile',\n\t\t\t'label' => esc_html__('Logo height mobile', 'uncode'),\n\t\t\t'desc' => esc_html__('Enter the height of the logo in px for mobile version.', 'uncode') ,\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_headers_block_title',\n\t\t\t'label' => '<i class=\"fa fa-menu\"></i> ' . esc_html__('Menu', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_headers',\n\t\t\t'desc' => esc_html__('Specify the menu layout.', 'uncode') ,\n\t\t\t'label' => '' ,\n\t\t\t'std' => 'hmenu-right',\n\t\t\t'type' => 'radio-image',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_hmenu_position',\n\t\t\t'label' => esc_html__('Menu horizontal position', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the horizontal position of the menu.', 'uncode') ,\n\t\t\t'std' => 'left',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:contains(hmenu)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'left',\n\t\t\t\t\t'label' => esc_html__('Left', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'right',\n\t\t\t\t\t'label' => esc_html__('Right', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_vmenu_position',\n\t\t\t'label' => esc_html__('Menu horizontal position', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the horizontal position of the menu.', 'uncode') ,\n\t\t\t'std' => 'left',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:contains(vmenu),_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'left',\n\t\t\t\t\t'label' => esc_html__('Left', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'right',\n\t\t\t\t\t'label' => esc_html__('Right', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_vmenu_v_position',\n\t\t\t'label' => esc_html__('Menu vertical alignment', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the vertical alignment of the menu.', 'uncode') ,\n\t\t\t'std' => 'middle',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:contains(vmenu),_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'top',\n\t\t\t\t\t'label' => esc_html__('Top', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'middle',\n\t\t\t\t\t'label' => esc_html__('Middle', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'bottom',\n\t\t\t\t\t'label' => esc_html__('Bottom', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_vmenu_align',\n\t\t\t'label' => esc_html__('Menu horizontal alignment', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the horizontal alignment of the menu.', 'uncode') ,\n\t\t\t'std' => 'left',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:contains(vmenu),_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'left',\n\t\t\t\t\t'label' => esc_html__('Left Align', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'center',\n\t\t\t\t\t'label' => esc_html__('Center Align', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'right',\n\t\t\t\t\t'label' => esc_html__('Right Align', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_vmenu_width',\n\t\t\t'label' => esc_html__('Vertical menu width','uncode') ,\n\t\t\t'desc' => esc_html__('Vertical menu width in px', 'uncode') ,\n\t\t\t'std' => '252',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'rows' => '',\n\t\t\t'post_type' => '',\n\t\t\t'taxonomy' => '',\n\t\t\t'min_max_step' => '108,504,12',\n\t\t\t'class' => '',\n\t\t\t'condition' => '_uncode_headers:contains(vmenu)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_accordion_active',\n\t\t\t'label' => esc_html__('Vertical menu open', 'uncode') ,\n\t\t\t'desc' => esc_html__('Open the accordion menu at the current item menu on page loading.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:is(vmenu)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_full',\n\t\t\t'label' => esc_html__('Menu full width', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to expand the menu to full width. (Only for the horizontal menus).', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_boxed:is(off)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_visuals_block_title',\n\t\t\t'label' => '<i class=\"fa fa-eye2\"></i> ' . esc_html__('Visuals', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_shadows',\n\t\t\t'label' => esc_html__('Menu divider shadow', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to show the menu divider shadow.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_submenu_shadows',\n\t\t\t'label' => esc_html__('Menu dropdown shadow', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate this for the shadow effect on menu dropdown on desktop view. NB. this option works for horizontal menus only.', 'uncode') ,\n\t\t\t'std' => 'none',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'std' => '',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => '',\n\t\t\t\t\t'label' => esc_html__('None', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'xs',\n\t\t\t\t\t'label' => esc_html__('Extra Small', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'sm',\n\t\t\t\t\t'label' => esc_html__('Small', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'std',\n\t\t\t\t\t'label' => esc_html__('Standard', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'lg',\n\t\t\t\t\t'label' => esc_html__('Large', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'xl',\n\t\t\t\t\t'label' => esc_html__('Extra Large', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t),\n\t\t\t'condition' => '_uncode_headers:contains(hmenu),_uncode_headers:is(vmenu-offcanvas),_uncode_headers:is(menu-overlay)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_submenu_darker_shadows',\n\t\t\t'label' => esc_html__('Menu dropdown darker shadow', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate this for the dark shadow effect on menu dropdown on desktop view.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_submenu_shadows:not()',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_borders',\n\t\t\t'label' => esc_html__('Menu borders', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to show the menu borders.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_no_arrows',\n\t\t\t'label' => esc_html__('Hide dropdown arrows', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to hide the dropdow arrows.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_mobile_transparency',\n\t\t\t'label' => esc_html__('Menu mobile transparency', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the menu transparency when possible.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_custom_padding',\n\t\t\t'label' => esc_html__('Custom vertical padding', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate custom padding above and below the logo.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_custom_padding_desktop',\n\t\t\t'label' => esc_html__('Padding on desktop', 'uncode') ,\n\t\t\t'desc' => esc_html__('Set custom padding on desktop devices.', 'uncode') ,\n\t\t\t'std' => '27',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'min_max_step'=> '0,36,9',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_menu_custom_padding:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_custom_padding_mobile',\n\t\t\t'label' => esc_html__('Padding on mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Set custom padding on mobile devices.', 'uncode') ,\n\t\t\t'std' => '27',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'min_max_step'=> '0,36,9',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_menu_custom_padding:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_animation_block_title',\n\t\t\t'label' => '<i class=\"fa fa-fast-forward2\"></i> ' . esc_html__('Animation', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t// 'condition' => '_uncode_headers:contains(hmenu),_uncode_headers:is(vmenu-offcanvas),_uncode_headers:is(menu-overlay)',\n\t\t\t// 'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_sticky',\n\t\t\t'label' => esc_html__('Menu sticky', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the sticky menu. This is a menu that is locked into place so that it does not disappear when the user scrolls down the page.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:contains(hmenu),_uncode_headers:is(vmenu-offcanvas),_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_sticky_mobile',\n\t\t\t'label' => esc_html__('Menu sticky mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the sticky menu on mobile devices. This is a menu that is locked into place so that it does not disappear when the user scrolls down the page.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_mobile_centered',\n\t\t\t'label' => esc_html__('Menu centered mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the centered style for mobile menu. NB. You need to have the Menu Sticky Mobile active.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_menu_sticky_mobile:is(on)',\n\t\t\t'operator' => 'and',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_hide',\n\t\t\t'label' => esc_html__('Menu hide', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the autohide menu. This is a menu that is hiding after the user have scrolled down the page.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:contains(hmenu),_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center),_uncode_headers:is(vmenu-offcanvas)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_hide_mobile',\n\t\t\t'label' => esc_html__('Menu hide mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the autohide menu on mobile devices. This is a menu that is hiding after the user have scrolled down the page.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_shrink',\n\t\t\t'label' => esc_html__('Menu shrink', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the shrink menu. This is a menu where the logo shrinks after the user have scrolled down the page.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:contains(hmenu),_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center),_uncode_headers:is(vmenu-offcanvas)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_li_animation',\n\t\t\t'label' => esc_html__('Menu sub-levels animated', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the animation for menu sub-levels. NB. this option works for horizontal menus only.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:not(vmenu)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_mobile_animation',\n\t\t\t'label' => esc_html__('Menu open items animation', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu items animation when opening.', 'uncode') ,\n\t\t\t'std' => 'none',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_menu_sticky_mobile:is(on),_uncode_menu_hide_mobile:is(on)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'none',\n\t\t\t\t\t'label' => esc_html__('None', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'scale',\n\t\t\t\t\t'label' => esc_html__('Scale', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_overlay_animation',\n\t\t\t'label' => esc_html__('Menu overlay animation', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the overlay menu animation when opening and closing.', 'uncode') ,\n\t\t\t'std' => 'sequential',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => '3d',\n\t\t\t\t\t'label' => esc_html__('3D', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'sequential',\n\t\t\t\t\t'label' => esc_html__('Flat', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_min_logo',\n\t\t\t'label' => esc_html__('Minimum logo height', 'uncode'),\n\t\t\t'desc' => esc_html__('Enter the minimal height of the shrinked logo in <b>px</b>.', 'uncode') ,\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_menu_shrink:is(on),_uncode_headers:not(vmenu)',\n\t\t\t'operator' => 'and',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_add_block_title',\n\t\t\t'label' => '<i class=\"fa fa-square-plus\"></i> ' . esc_html__('Additionals', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_no_secondary',\n\t\t\t'label' => esc_html__('Hide secondary menu', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to hide the secondary menu.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_no_cta',\n\t\t\t'label' => esc_html__('Hide Call To Action menu', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to hide the Call To Action menu.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_secondary_padding',\n\t\t\t'label' => esc_html__('Secondary menu padding', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to increase secondary menu padding.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_menu_no_secondary:is(off)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_socials',\n\t\t\t'label' => esc_html__('Social icons', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to show the social connection icons in the menu bar.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_search',\n\t\t\t'label' => esc_html__('Search icon', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to show the search icon in the menu bar.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_search_animation',\n\t\t\t'label' => esc_html__('Search overlay animation', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the search overlay animation when opening and closing.', 'uncode') ,\n\t\t\t'std' => 'sequential',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => '3d',\n\t\t\t\t\t'label' => esc_html__('3D', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'sequential',\n\t\t\t\t\t'label' => esc_html__('Flat', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t) ,\n\t\t\t'condition' => '_uncode_menu_search:is(on)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_woocommerce_cart',\n\t\t\t'label' => esc_html__('Woocommerce cart', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to show the Woocommerce icon in the menu bar.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_woocommerce_cart_desktop',\n\t\t\t'label' => esc_html__('Woocommerce cart on menu bar', 'uncode') ,\n\t\t\t'desc' => esc_html__('Show the cart icon in the menu bar when layout is on desktop mode (only for Overlay and Offcanvas menu).', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_woocommerce_cart:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_woocommerce_cart_mobile',\n\t\t\t'label' => esc_html__('Woocommerce cart on menu bar for mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Show the cart icon in the menu bar when layout is on mobile mode.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_woocommerce_cart:is(on)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_bloginfo',\n\t\t\t'label' => esc_html__('Top line text', 'uncode') ,\n\t\t\t'desc' => esc_html__('Insert additional text on top of the menu.','uncode') ,\n\t\t\t'type' => 'textarea',\n\t\t\t'section' => 'uncode_header_section',\n\t\t\t'condition' => '_uncode_headers:is(hmenu-right),_uncode_headers:is(hmenu-left),_uncode_headers:is(hmenu-justify),_uncode_headers:is(hmenu-center),_uncode_headers:is(hmenu-center-split)',\n\t\t\t'operator' => 'or'\n\t\t) ,\n\t\t//////////////////////\n\t\t// Post Single\t\t///\n\t\t//////////////////////\n\t\tstr_replace('%section%', 'post', $menu_section_title),\n\t\tstr_replace('%section%', 'post', $menu),\n\t\tstr_replace('%section%', 'post', $menu_width),\n\t\tstr_replace('%section%', 'post', $menu_opaque),\n\t\tstr_replace('%section%', 'post', $header_section_title),\n\t\tstr_replace('%section%', 'post', run_array_to($header_type, 'std', 'header_basic')),\n\t\tstr_replace('%section%', 'post', $header_uncode_block),\n\t\tstr_replace('%section%', 'post', $header_revslider),\n\t\tstr_replace('%section%', 'post', $header_layerslider),\n\n\t\tstr_replace('%section%', 'post', $header_width),\n\t\tstr_replace('%section%', 'post', $header_height),\n\t\tstr_replace('%section%', 'post', $header_min_height),\n\t\tstr_replace('%section%', 'post', $header_title),\n\t\tstr_replace('%section%', 'post', $header_style),\n\t\tstr_replace('%section%', 'post', $header_content_width),\n\t\tstr_replace('%section%', 'post', $header_custom_width),\n\t\tstr_replace('%section%', 'post', $header_align),\n\t\tstr_replace('%section%', 'post', $header_position),\n\t\tstr_replace('%section%', 'post', $header_title_font),\n\t\tstr_replace('%section%', 'post', $header_title_size),\n\t\tstr_replace('%section%', 'post', $header_title_height),\n\t\tstr_replace('%section%', 'post', $header_title_spacing),\n\t\tstr_replace('%section%', 'post', $header_title_weight),\n\t\tstr_replace('%section%', 'post', $header_title_transform),\n\t\tstr_replace('%section%', 'post', $header_title_italic),\n\t\tstr_replace('%section%', 'post', $header_text_animation),\n\t\tstr_replace('%section%', 'post', $header_animation_speed),\n\t\tstr_replace('%section%', 'post', $header_animation_delay),\n\t\tstr_replace('%section%', 'post', $header_featured),\n\t\tstr_replace('%section%', 'post', $header_background),\n\t\tstr_replace('%section%', 'post', $header_parallax),\n\t\tstr_replace('%section%', 'post', $header_kburns),\n\t\tstr_replace('%section%', 'post', $header_overlay_color),\n\t\tstr_replace('%section%', 'post', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', 'post', $header_scroll_opacity),\n\t\tstr_replace('%section%', 'post', $header_scrolldown),\n\n\t\tstr_replace('%section%', 'post', $body_section_title),\n\t\tstr_replace('%section%', 'post', $body_layout_width),\n\t\tstr_replace('%section%', 'post', $body_layout_width_custom),\n\t\tstr_replace('%section%', 'post', $show_breadcrumb),\n\t\tstr_replace('%section%', 'post', $breadcrumb_align),\n\t\t// str_replace('%section%', 'post', $body_uncode_block_before),\n\t\tstr_replace('%section%', 'post', $show_title),\n\t\tstr_replace('%section%', 'post', $show_media),\n\t\tstr_replace('%section%', 'post', $show_featured_media),\n\t\tstr_replace('%section%', 'post', $show_comments),\n\t\tstr_replace('%section%', 'post', $show_share),\n\t\tstr_replace('%section%', 'post', $show_tags),\n\t\tstr_replace('%section%', 'post', $show_tags_align),\n\t\tstr_replace('%section%', 'post', $body_uncode_block_after_pre),\n\t\tstr_replace('%section%', 'post', $body_uncode_block_after),\n\t\tstr_replace('%section%', 'post', $sidebar_section_title),\n\t\tstr_replace('%section%', 'post', run_array_to($sidebar_activate, 'std', 'on')),\n\t\tstr_replace('%section%', 'post', $sidebar_widget),\n\t\tstr_replace('%section%', 'post', $sidebar_position),\n\t\tstr_replace('%section%', 'post', $sidebar_size),\n\t\tstr_replace('%section%', 'post', $sidebar_sticky),\n\t\tstr_replace('%section%', 'post', $sidebar_style),\n\t\tstr_replace('%section%', 'post', $sidebar_bgcolor),\n\t\tstr_replace('%section%', 'post', $sidebar_fill),\n\n\t\tstr_replace('%section%', 'post', $navigation_section_title),\n\t\tstr_replace('%section%', 'post', $navigation_activate),\n\t\tstr_replace('%section%', 'post', $navigation_page_index),\n\t\tstr_replace('%section%', 'post', $navigation_index_label),\n\t\tstr_replace('%section%', 'post', $navigation_nextprev_title),\n\t\tstr_replace('%section%', 'post', $footer_section_title),\n\t\tstr_replace('%section%', 'post', $footer_uncode_block),\n\t\tstr_replace('%section%', 'post', $footer_width),\n\t\tstr_replace('%section%', 'post', $custom_fields_section_title),\n\t\tstr_replace('%section%', 'post', $custom_fields_list),\n\t\t///////////////\n\t\t// Page\t\t///\n\t\t///////////////\n\t\tstr_replace('%section%', 'page', $menu_section_title),\n\t\tstr_replace('%section%', 'page', $menu),\n\t\tstr_replace('%section%', 'page', $menu_width),\n\t\tstr_replace('%section%', 'page', $menu_opaque),\n\t\tstr_replace('%section%', 'page', $header_section_title),\n\t\tstr_replace('%section%', 'page', $header_type),\n\t\tstr_replace('%section%', 'page', $header_uncode_block),\n\t\tstr_replace('%section%', 'page', $header_revslider),\n\t\tstr_replace('%section%', 'page', $header_layerslider),\n\n\t\tstr_replace('%section%', 'page', $header_width),\n\t\tstr_replace('%section%', 'page', $header_height),\n\t\tstr_replace('%section%', 'page', $header_min_height),\n\t\tstr_replace('%section%', 'page', $header_title),\n\t\tstr_replace('%section%', 'page', $header_style),\n\t\tstr_replace('%section%', 'page', $header_content_width),\n\t\tstr_replace('%section%', 'page', $header_custom_width),\n\t\tstr_replace('%section%', 'page', $header_align),\n\t\tstr_replace('%section%', 'page', $header_position),\n\t\tstr_replace('%section%', 'page', $header_title_font),\n\t\tstr_replace('%section%', 'page', $header_title_size),\n\t\tstr_replace('%section%', 'page', $header_title_height),\n\t\tstr_replace('%section%', 'page', $header_title_spacing),\n\t\tstr_replace('%section%', 'page', $header_title_weight),\n\t\tstr_replace('%section%', 'page', $header_title_transform),\n\t\tstr_replace('%section%', 'page', $header_title_italic),\n\t\tstr_replace('%section%', 'page', $header_text_animation),\n\t\tstr_replace('%section%', 'page', $header_animation_speed),\n\t\tstr_replace('%section%', 'page', $header_animation_delay),\n\t\tstr_replace('%section%', 'page', $header_featured),\n\t\tstr_replace('%section%', 'page', $header_background),\n\t\tstr_replace('%section%', 'page', $header_parallax),\n\t\tstr_replace('%section%', 'page', $header_kburns),\n\t\tstr_replace('%section%', 'page', $header_overlay_color),\n\t\tstr_replace('%section%', 'page', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', 'page', $header_scroll_opacity),\n\t\tstr_replace('%section%', 'page', $header_scrolldown),\n\t\tstr_replace('%section%', 'page', $body_section_title),\n\t\tstr_replace('%section%', 'page', $body_layout_width),\n\t\tstr_replace('%section%', 'page', $body_layout_width_custom),\n\t\tstr_replace('%section%', 'page', $show_breadcrumb),\n\t\tstr_replace('%section%', 'page', $breadcrumb_align),\n\t\tstr_replace('%section%', 'page', run_array_to($show_title, 'std', 'on')),\n\t\tstr_replace('%section%', 'page', $show_media),\n\t\tstr_replace('%section%', 'page', $show_featured_media),\n\t\tstr_replace('%section%', 'page', $show_comments),\n\t\tstr_replace('%section%', 'page', $body_uncode_block_after),\n\t\tstr_replace('%section%', 'page', $sidebar_section_title),\n\t\tstr_replace('%section%', 'page', $sidebar_activate),\n\t\tstr_replace('%section%', 'page', $sidebar_widget),\n\t\tstr_replace('%section%', 'page', $sidebar_position),\n\t\tstr_replace('%section%', 'page', $sidebar_size),\n\t\tstr_replace('%section%', 'page', $sidebar_sticky),\n\t\tstr_replace('%section%', 'page', $sidebar_style),\n\t\tstr_replace('%section%', 'page', $sidebar_bgcolor),\n\t\tstr_replace('%section%', 'page', $sidebar_fill),\n\t\tstr_replace('%section%', 'page', $footer_section_title),\n\t\tstr_replace('%section%', 'page', $footer_uncode_block),\n\t\tstr_replace('%section%', 'page', $footer_width),\n\t\tstr_replace('%section%', 'page', $custom_fields_section_title),\n\t\tstr_replace('%section%', 'page', $custom_fields_list),\n\t\t///////////////////////////\n\t\t// Portfolio Single\t\t///\n\t\t///////////////////////////\n\t\tstr_replace('%section%', 'portfolio', $menu_section_title),\n\t\tstr_replace('%section%', 'portfolio', $menu),\n\t\tstr_replace('%section%', 'portfolio', $menu_width),\n\t\tstr_replace('%section%', 'portfolio', $menu_opaque),\n\t\tstr_replace('%section%', 'portfolio', $header_section_title),\n\t\tstr_replace('%section%', 'portfolio', $header_type),\n\t\tstr_replace('%section%', 'portfolio', $header_uncode_block),\n\t\tstr_replace('%section%', 'portfolio', $header_revslider),\n\t\tstr_replace('%section%', 'portfolio', $header_layerslider),\n\n\t\tstr_replace('%section%', 'portfolio', $header_width),\n\t\tstr_replace('%section%', 'portfolio', $header_height),\n\t\tstr_replace('%section%', 'portfolio', $header_min_height),\n\t\tstr_replace('%section%', 'portfolio', $header_title),\n\t\tstr_replace('%section%', 'portfolio', $header_style),\n\t\tstr_replace('%section%', 'portfolio', $header_content_width),\n\t\tstr_replace('%section%', 'portfolio', $header_custom_width),\n\t\tstr_replace('%section%', 'portfolio', $header_align),\n\t\tstr_replace('%section%', 'portfolio', $header_position),\n\t\tstr_replace('%section%', 'portfolio', $header_title_font),\n\t\tstr_replace('%section%', 'portfolio', $header_title_size),\n\t\tstr_replace('%section%', 'portfolio', $header_title_height),\n\t\tstr_replace('%section%', 'portfolio', $header_title_spacing),\n\t\tstr_replace('%section%', 'portfolio', $header_title_weight),\n\t\tstr_replace('%section%', 'portfolio', $header_title_transform),\n\t\tstr_replace('%section%', 'portfolio', $header_title_italic),\n\t\tstr_replace('%section%', 'portfolio', $header_text_animation),\n\t\tstr_replace('%section%', 'portfolio', $header_animation_speed),\n\t\tstr_replace('%section%', 'portfolio', $header_animation_delay),\n\t\tstr_replace('%section%', 'portfolio', $header_featured),\n\t\tstr_replace('%section%', 'portfolio', $header_background),\n\t\tstr_replace('%section%', 'portfolio', $header_parallax),\n\t\tstr_replace('%section%', 'portfolio', $header_kburns),\n\t\tstr_replace('%section%', 'portfolio', $header_overlay_color),\n\t\tstr_replace('%section%', 'portfolio', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', 'portfolio', $header_scroll_opacity),\n\t\tstr_replace('%section%', 'portfolio', $header_scrolldown),\n\n\t\tstr_replace('%section%', 'portfolio', $body_section_title),\n\t\tstr_replace('%section%', 'portfolio', $body_layout_width),\n\t\tstr_replace('%section%', 'portfolio', $body_layout_width_custom),\n\t\tstr_replace('%section%', 'portfolio', $show_breadcrumb),\n\t\tstr_replace('%section%', 'portfolio', $breadcrumb_align),\n\t\tstr_replace('%section%', 'portfolio', run_array_to($show_title, 'std', 'on')),\n\t\tstr_replace('%section%', 'portfolio', $show_media),\n\t\tstr_replace('%section%', 'portfolio', $show_featured_media),\n\t\tstr_replace('%section%', 'portfolio', run_array_to($show_comments, 'std', 'off')),\n\t\tstr_replace('%section%', 'portfolio', $show_share),\n\t\tstr_replace('%section%', 'portfolio', $body_uncode_block_after),\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_details_title',\n\t\t\t'label' => '<i class=\"fa fa-briefcase3\"></i> ' . esc_html__('Details', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_portfolio_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_details',\n\t\t\t'label' => ucfirst($portfolio_cpt_name) . ' ' . esc_html__('details', 'uncode') ,\n\t\t\t'desc' => sprintf(esc_html__('Create here all the %s details label that you need.', 'uncode') , $portfolio_cpt_name) ,\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_portfolio_section',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_portfolio_detail_unique_id',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'std' => 'detail-',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => sprintf(esc_html__('Unique %s detail ID','uncode') , $portfolio_cpt_name) ,\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_position',\n\t\t\t'label' => ucfirst($portfolio_cpt_name) . ' ' . esc_html__('details layout', 'uncode') ,\n\t\t\t'desc' => sprintf(esc_html__('Specify the layout template for all the %s posts.', 'uncode') , $portfolio_cpt_name) ,\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_portfolio_section',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => '',\n\t\t\t\t\t'label' => esc_html__('Select…', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'portfolio_top',\n\t\t\t\t\t'label' => esc_html__('Details on the top', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'sidebar_right',\n\t\t\t\t\t'label' => esc_html__('Details on the right', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'portfolio_bottom',\n\t\t\t\t\t'label' => esc_html__('Details on the bottom', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'sidebar_left',\n\t\t\t\t\t'label' => esc_html__('Details on the left', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_sidebar_size',\n\t\t\t'label' => esc_html__('Sidebar size', 'uncode') ,\n\t\t\t'desc' => esc_html__('Set the sidebar size.', 'uncode') ,\n\t\t\t'std' => '4',\n\t\t\t'min_max_step' => '1,12,1',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'section' => 'uncode_portfolio_section',\n\t\t\t'operator' => 'and',\n\t\t\t'condition' => '_uncode_portfolio_position:not(),_uncode_portfolio_position:contains(sidebar)',\n\t\t) ,\n\t\tstr_replace('%section%', 'portfolio', run_array_to($sidebar_sticky, 'condition', '_uncode_portfolio_position:not(),_uncode_portfolio_position:contains(sidebar)')),\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_style',\n\t\t\t'label' => esc_html__('Skin', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the sidebar text skin color.', 'uncode') ,\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => '',\n\t\t\t\t\t'label' => esc_html__('Inherit', \"uncode\") ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'light',\n\t\t\t\t\t'label' => esc_html__('Light', \"uncode\") ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'dark',\n\t\t\t\t\t'label' => esc_html__('Dark', \"uncode\") ,\n\t\t\t\t)\n\t\t\t),\n\t\t\t'section' => 'uncode_portfolio_section',\n\t\t\t'condition' => '_uncode_portfolio_position:not()',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_bgcolor',\n\t\t\t'label' => esc_html__('Sidebar color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the sidebar background color.', 'uncode') ,\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_portfolio_section',\n\t\t\t'condition' => '_uncode_portfolio_position:not()',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_sidebar_fill',\n\t\t\t'label' => esc_html__('Sidebar filling space', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to remove padding around the sidebar and fill the height.', 'uncode') ,\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_portfolio_section',\n\t\t\t'std' => 'off',\n\t\t\t'operator' => 'and',\n\t\t\t'condition' => '_uncode_portfolio_position:not(),_uncode_portfolio_sidebar_bgcolor:not(),_uncode_portfolio_position:contains(sidebar)',\n\t\t),\n\t\tstr_replace('%section%', 'portfolio', $navigation_section_title),\n\t\tstr_replace('%section%', 'portfolio', $navigation_activate),\n\t\tstr_replace('%section%', 'portfolio', $navigation_page_index),\n\t\tstr_replace('%section%', 'portfolio', $navigation_index_label),\n\t\tstr_replace('%section%', 'portfolio', $navigation_nextprev_title),\n\t\tstr_replace('%section%', 'portfolio', $footer_section_title),\n\t\tstr_replace('%section%', 'portfolio', $footer_uncode_block),\n\t\tstr_replace('%section%', 'portfolio', $footer_width),\n\t\tstr_replace('%section%', 'portfolio', $custom_fields_section_title),\n\t\tstr_replace('%section%', 'portfolio', $custom_fields_list),\n\t);\n\n\t$custom_settings_one = array_merge( $custom_settings_one, $cpt_single_options );\n\n\t$custom_settings_two = array(\n\t\t///////////////////\n\t\t// Page 404\t\t///\n\t\t///////////////////\n\t\tstr_replace('%section%', '404', $menu_section_title),\n\t\tstr_replace('%section%', '404', $menu),\n\t\tstr_replace('%section%', '404', $menu_width),\n\t\tstr_replace('%section%', '404', $menu_opaque),\n\t\tstr_replace('%section%', '404', $header_section_title),\n\t\tstr_replace('%section%', '404', $header_type),\n\t\tstr_replace('%section%', '404', $header_uncode_block),\n\t\tstr_replace('%section%', '404', $header_revslider),\n\t\tstr_replace('%section%', '404', $header_layerslider),\n\n\t\tstr_replace('%section%', '404', $header_width),\n\t\tstr_replace('%section%', '404', $header_height),\n\t\tstr_replace('%section%', '404', $header_min_height),\n\t\tstr_replace('%section%', '404', $header_title),\n\t\tstr_replace('%section%', '404', $header_title_text),\n\t\tstr_replace('%section%', '404', $header_style),\n\t\tstr_replace('%section%', '404', $header_content_width),\n\t\tstr_replace('%section%', '404', $header_custom_width),\n\t\tstr_replace('%section%', '404', $header_align),\n\t\tstr_replace('%section%', '404', $header_position),\n\t\tstr_replace('%section%', '404', $header_title_font),\n\t\tstr_replace('%section%', '404', $header_title_size),\n\t\tstr_replace('%section%', '404', $header_title_height),\n\t\tstr_replace('%section%', '404', $header_title_spacing),\n\t\tstr_replace('%section%', '404', $header_title_weight),\n\t\tstr_replace('%section%', '404', $header_title_transform),\n\t\tstr_replace('%section%', '404', $header_title_italic),\n\t\tstr_replace('%section%', '404', $header_text_animation),\n\t\tstr_replace('%section%', '404', $header_animation_speed),\n\t\tstr_replace('%section%', '404', $header_animation_delay),\n\t\tstr_replace('%section%', '404', $header_background),\n\t\tstr_replace('%section%', '404', $header_parallax),\n\t\tstr_replace('%section%', '404', $header_kburns),\n\t\tstr_replace('%section%', '404', $header_overlay_color),\n\t\tstr_replace('%section%', '404', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', '404', $header_scroll_opacity),\n\t\tstr_replace('%section%', '404', $header_scrolldown),\n\n\t\tstr_replace('%section%', '404', $body_section_title),\n\t\tstr_replace('%section%', '404', $body_layout_width),\n\t\tstr_replace('%section%', '404', $uncodeblock_404),\n\t\tstr_replace('%section%', '404', $uncodeblocks_404),\n\t\tstr_replace('%section%', '404', $footer_section_title),\n\t\tstr_replace('%section%', '404', $footer_uncode_block),\n\t\tstr_replace('%section%', '404', $footer_width),\n\t\t//////////////////////\n\t\t// Posts Index\t\t///\n\t\t//////////////////////\n\t\tstr_replace('%section%', 'post_index', $menu_section_title),\n\t\tstr_replace('%section%', 'post_index', $menu),\n\t\tstr_replace('%section%', 'post_index', $menu_width),\n\t\tstr_replace('%section%', 'post_index', $menu_opaque),\n\t\tstr_replace('%section%', 'post_index', $header_section_title),\n\t\tstr_replace('%section%', 'post_index', run_array_to($header_type, 'std', 'header_basic')),\n\t\tstr_replace('%section%', 'post_index', $header_uncode_block),\n\t\tstr_replace('%section%', 'post_index', $header_revslider),\n\t\tstr_replace('%section%', 'post_index', $header_layerslider),\n\n\t\tstr_replace('%section%', 'post_index', $header_width),\n\t\tstr_replace('%section%', 'post_index', $header_height),\n\t\tstr_replace('%section%', 'post_index', $header_min_height),\n\t\tstr_replace('%section%', 'post_index', $header_title),\n\t\tstr_replace('%section%', 'post_index', $header_style),\n\t\tstr_replace('%section%', 'post_index', $header_content_width),\n\t\tstr_replace('%section%', 'post_index', $header_custom_width),\n\t\tstr_replace('%section%', 'post_index', $header_align),\n\t\tstr_replace('%section%', 'post_index', $header_position),\n\t\tstr_replace('%section%', 'post_index', $header_title_font),\n\t\tstr_replace('%section%', 'post_index', $header_title_size),\n\t\tstr_replace('%section%', 'post_index', $header_title_height),\n\t\tstr_replace('%section%', 'post_index', $header_title_spacing),\n\t\tstr_replace('%section%', 'post_index', $header_title_weight),\n\t\tstr_replace('%section%', 'post_index', $header_title_transform),\n\t\tstr_replace('%section%', 'post_index', $header_title_italic),\n\t\tstr_replace('%section%', 'post_index', $header_text_animation),\n\t\tstr_replace('%section%', 'post_index', $header_animation_speed),\n\t\tstr_replace('%section%', 'post_index', $header_animation_delay),\n\t\tstr_replace('%section%', 'post_index', $header_featured),\n\t\tstr_replace('%section%', 'post_index', $header_background),\n\t\tstr_replace('%section%', 'post_index', $header_parallax),\n\t\tstr_replace('%section%', 'post_index', $header_kburns),\n\t\tstr_replace('%section%', 'post_index', $header_overlay_color),\n\t\tstr_replace('%section%', 'post_index', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', 'post_index', $header_scroll_opacity),\n\t\tstr_replace('%section%', 'post_index', $header_scrolldown),\n\t\tstr_replace('%section%', 'post_index', $menu_no_padding),\n\t\tstr_replace('%section%', 'post_index', $menu_no_padding_mobile),\n\t\tstr_replace('%section%', 'post_index', $title_archive_custom_activate),\n\t\tstr_replace('%section%', 'post_index', $title_archive_custom_text),\n\t\tstr_replace('%section%', 'post_index', $subtitle_archive_custom_text),\n\n\t\tstr_replace('%section%', 'post_index', $body_section_title),\n\t\tstr_replace('%section%', 'post_index', $show_breadcrumb),\n\t\tstr_replace('%section%', 'post_index', $breadcrumb_align),\n\t\tstr_replace('%section%', 'post_index', $body_uncode_block),\n\t\tstr_replace('%section%', 'post_index', $body_layout_width),\n\t\tstr_replace('%section%', 'post_index', $body_single_post_width),\n\t\tstr_replace('%section%', 'post_index', $body_single_text_lenght),\n\t\tstr_replace('%section%', 'post_index', $show_title),\n\t\tstr_replace('%section%', 'post_index', $remove_pagination),\n\t\tstr_replace('%section%', 'post_index', $sidebar_section_title),\n\t\tstr_replace('%section%', 'post_index', run_array_to($sidebar_activate, 'std', 'on')),\n\t\tstr_replace('%section%', 'post_index', $sidebar_widget),\n\t\tstr_replace('%section%', 'post_index', $sidebar_position),\n\t\tstr_replace('%section%', 'post_index', $sidebar_size),\n\t\tstr_replace('%section%', 'post_index', $sidebar_sticky),\n\t\tstr_replace('%section%', 'post_index', $sidebar_style),\n\t\tstr_replace('%section%', 'post_index', $sidebar_bgcolor),\n\t\tstr_replace('%section%', 'post_index', $sidebar_fill),\n\t\tstr_replace('%section%', 'post_index', $footer_section_title),\n\t\tstr_replace('%section%', 'post_index', $footer_uncode_block),\n\t\tstr_replace('%section%', 'post_index', $footer_width),\n\t\t//////////////////////\n\t\t// Pages Index\t\t///\n\t\t//////////////////////\n\t\tstr_replace('%section%', 'page_index', $menu_section_title),\n\t\tstr_replace('%section%', 'page_index', $menu),\n\t\tstr_replace('%section%', 'page_index', $menu_width),\n\t\tstr_replace('%section%', 'page_index', $menu_opaque),\n\t\tstr_replace('%section%', 'page_index', $header_section_title),\n\t\tstr_replace('%section%', 'page_index', run_array_to($header_type, 'std', 'header_basic')),\n\t\tstr_replace('%section%', 'page_index', $header_uncode_block),\n\t\tstr_replace('%section%', 'page_index', $header_revslider),\n\t\tstr_replace('%section%', 'page_index', $header_layerslider),\n\n\t\tstr_replace('%section%', 'page_index', $header_width),\n\t\tstr_replace('%section%', 'page_index', $header_height),\n\t\tstr_replace('%section%', 'page_index', $header_min_height),\n\t\tstr_replace('%section%', 'page_index', $header_title),\n\t\tstr_replace('%section%', 'page_index', $header_style),\n\t\tstr_replace('%section%', 'page_index', $header_content_width),\n\t\tstr_replace('%section%', 'page_index', $header_custom_width),\n\t\tstr_replace('%section%', 'page_index', $header_align),\n\t\tstr_replace('%section%', 'page_index', $header_position),\n\t\tstr_replace('%section%', 'page_index', $header_title_font),\n\t\tstr_replace('%section%', 'page_index', $header_title_size),\n\t\tstr_replace('%section%', 'page_index', $header_title_height),\n\t\tstr_replace('%section%', 'page_index', $header_title_spacing),\n\t\tstr_replace('%section%', 'page_index', $header_title_weight),\n\t\tstr_replace('%section%', 'page_index', $header_title_transform),\n\t\tstr_replace('%section%', 'page_index', $header_title_italic),\n\t\tstr_replace('%section%', 'page_index', $header_text_animation),\n\t\tstr_replace('%section%', 'page_index', $header_animation_speed),\n\t\tstr_replace('%section%', 'page_index', $header_animation_delay),\n\t\tstr_replace('%section%', 'page_index', $header_featured),\n\t\tstr_replace('%section%', 'page_index', $header_background),\n\t\tstr_replace('%section%', 'page_index', $header_parallax),\n\t\tstr_replace('%section%', 'page_index', $header_kburns),\n\t\tstr_replace('%section%', 'page_index', $header_overlay_color),\n\t\tstr_replace('%section%', 'page_index', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', 'page_index', $header_scroll_opacity),\n\t\tstr_replace('%section%', 'page_index', $header_scrolldown),\n\t\tstr_replace('%section%', 'page_index', $menu_no_padding),\n\t\tstr_replace('%section%', 'page_index', $menu_no_padding_mobile),\n\n\t\tstr_replace('%section%', 'page_index', $body_section_title),\n\t\tstr_replace('%section%', 'page_index', $show_breadcrumb),\n\t\tstr_replace('%section%', 'page_index', $breadcrumb_align),\n\t\tstr_replace('%section%', 'page_index', $body_uncode_block),\n\t\tstr_replace('%section%', 'page_index', $body_layout_width),\n\t\tstr_replace('%section%', 'page_index', $body_single_post_width),\n\t\tstr_replace('%section%', 'page_index', $body_single_text_lenght),\n\t\tstr_replace('%section%', 'page_index', $show_title),\n\t\tstr_replace('%section%', 'page_index', $remove_pagination),\n\t\tstr_replace('%section%', 'page_index', $sidebar_section_title),\n\t\tstr_replace('%section%', 'page_index', run_array_to($sidebar_activate, 'std', 'on')),\n\t\tstr_replace('%section%', 'page_index', $sidebar_widget),\n\t\tstr_replace('%section%', 'page_index', $sidebar_position),\n\t\tstr_replace('%section%', 'page_index', $sidebar_size),\n\t\tstr_replace('%section%', 'page_index', $sidebar_sticky),\n\t\tstr_replace('%section%', 'page_index', $sidebar_style),\n\t\tstr_replace('%section%', 'page_index', $sidebar_bgcolor),\n\t\tstr_replace('%section%', 'page_index', $sidebar_fill),\n\t\tstr_replace('%section%', 'page_index', $footer_section_title),\n\t\tstr_replace('%section%', 'page_index', $footer_uncode_block),\n\t\tstr_replace('%section%', 'page_index', $footer_width),\n\t\t////////////////////////\n\t\t// Archive Index\t\t///\n\t\t////////////////////////\n\t\tstr_replace('%section%', 'portfolio_index', $menu_section_title),\n\t\tstr_replace('%section%', 'portfolio_index', $menu),\n\t\tstr_replace('%section%', 'portfolio_index', $menu_width),\n\t\tstr_replace('%section%', 'portfolio_index', $menu_opaque),\n\t\tstr_replace('%section%', 'portfolio_index', $header_section_title),\n\t\tstr_replace('%section%', 'portfolio_index', run_array_to($header_type, 'std', 'header_basic')),\n\t\tstr_replace('%section%', 'portfolio_index', $header_uncode_block),\n\t\tstr_replace('%section%', 'portfolio_index', $header_revslider),\n\t\tstr_replace('%section%', 'portfolio_index', $header_layerslider),\n\n\t\tstr_replace('%section%', 'portfolio_index', $header_width),\n\t\tstr_replace('%section%', 'portfolio_index', $header_height),\n\t\tstr_replace('%section%', 'portfolio_index', $header_min_height),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title),\n\t\tstr_replace('%section%', 'portfolio_index', $header_style),\n\t\tstr_replace('%section%', 'portfolio_index', $header_content_width),\n\t\tstr_replace('%section%', 'portfolio_index', $header_custom_width),\n\t\tstr_replace('%section%', 'portfolio_index', $header_align),\n\t\tstr_replace('%section%', 'portfolio_index', $header_position),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title_font),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title_size),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title_height),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title_spacing),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title_weight),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title_transform),\n\t\tstr_replace('%section%', 'portfolio_index', $header_title_italic),\n\t\tstr_replace('%section%', 'portfolio_index', $header_text_animation),\n\t\tstr_replace('%section%', 'portfolio_index', $header_animation_speed),\n\t\tstr_replace('%section%', 'portfolio_index', $header_animation_delay),\n\t\tstr_replace('%section%', 'portfolio_index', $header_featured),\n\t\tstr_replace('%section%', 'portfolio_index', $header_background),\n\t\tstr_replace('%section%', 'portfolio_index', $header_parallax),\n\t\tstr_replace('%section%', 'portfolio_index', $header_kburns),\n\t\tstr_replace('%section%', 'portfolio_index', $header_overlay_color),\n\t\tstr_replace('%section%', 'portfolio_index', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', 'portfolio_index', $header_scroll_opacity),\n\t\tstr_replace('%section%', 'portfolio_index', $header_scrolldown),\n\t\tstr_replace('%section%', 'portfolio_index', $menu_no_padding),\n\t\tstr_replace('%section%', 'portfolio_index', $menu_no_padding_mobile),\n\t\tstr_replace('%section%', 'portfolio_index', $title_archive_custom_activate),\n\t\tstr_replace('%section%', 'portfolio_index', $title_archive_custom_text),\n\t\tstr_replace('%section%', 'portfolio_index', $subtitle_archive_custom_text),\n\n\t\tstr_replace('%section%', 'portfolio_index', $body_section_title),\n\t\tstr_replace('%section%', 'portfolio_index', $show_breadcrumb),\n\t\tstr_replace('%section%', 'portfolio_index', $breadcrumb_align),\n\t\tstr_replace('%section%', 'portfolio_index', $body_uncode_block),\n\t\tstr_replace('%section%', 'portfolio_index', $body_layout_width),\n\t\tstr_replace('%section%', 'portfolio_index', $body_single_post_width),\n\t\tstr_replace('%section%', 'portfolio_index', $show_title),\n\t\tstr_replace('%section%', 'portfolio_index', $remove_pagination),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_section_title),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_activate),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_widget),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_position),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_size),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_sticky),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_style),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_bgcolor),\n\t\tstr_replace('%section%', 'portfolio_index', $sidebar_fill),\n\t\tstr_replace('%section%', 'portfolio_index', $footer_section_title),\n\t\tstr_replace('%section%', 'portfolio_index', $footer_uncode_block),\n\t\tstr_replace('%section%', 'portfolio_index', $footer_width),\n\t);\n\n\t$custom_settings_one = array_merge( $custom_settings_one, $custom_settings_two );\n\t$custom_settings_one = array_merge( $custom_settings_one, $cpt_index_options );\n\n\t$custom_settings_three = array(\n\t\t///////////////////////\n\t\t// Search Index\t\t///\n\t\t///////////////////////\n\t\tstr_replace('%section%', 'search_index', $menu_section_title),\n\t\tstr_replace('%section%', 'search_index', $menu),\n\t\tstr_replace('%section%', 'search_index', $menu_width),\n\t\tstr_replace('%section%', 'search_index', $menu_opaque),\n\t\tstr_replace('%section%', 'search_index', $header_section_title),\n\t\tstr_replace('%section%', 'search_index', run_array_to($header_type, 'std', 'header_basic')),\n\t\tstr_replace('%section%', 'search_index', $header_uncode_block),\n\t\tstr_replace('%section%', 'search_index', $header_revslider),\n\t\tstr_replace('%section%', 'search_index', $header_layerslider),\n\n\t\tstr_replace('%section%', 'search_index', $header_width),\n\t\tstr_replace('%section%', 'search_index', $header_height),\n\t\tstr_replace('%section%', 'search_index', $header_min_height),\n\t\tstr_replace('%section%', 'search_index', $header_title),\n\t\tstr_replace('%section%', 'search_index', $header_title_text),\n\t\tstr_replace('%section%', 'search_index', $header_style),\n\t\tstr_replace('%section%', 'search_index', $header_content_width),\n\t\tstr_replace('%section%', 'search_index', $header_custom_width),\n\t\tstr_replace('%section%', 'search_index', $header_align),\n\t\tstr_replace('%section%', 'search_index', $header_position),\n\t\tstr_replace('%section%', 'search_index', $header_title_font),\n\t\tstr_replace('%section%', 'search_index', $header_title_size),\n\t\tstr_replace('%section%', 'search_index', $header_title_height),\n\t\tstr_replace('%section%', 'search_index', $header_title_spacing),\n\t\tstr_replace('%section%', 'search_index', $header_title_weight),\n\t\tstr_replace('%section%', 'search_index', $header_title_transform),\n\t\tstr_replace('%section%', 'search_index', $header_title_italic),\n\t\tstr_replace('%section%', 'search_index', $header_text_animation),\n\t\tstr_replace('%section%', 'search_index', $header_animation_speed),\n\t\tstr_replace('%section%', 'search_index', $header_animation_delay),\n\t\tstr_replace('%section%', 'search_index', $header_background),\n\t\tstr_replace('%section%', 'search_index', $header_parallax),\n\t\tstr_replace('%section%', 'search_index', $header_kburns),\n\t\tstr_replace('%section%', 'search_index', $header_overlay_color),\n\t\tstr_replace('%section%', 'search_index', $header_overlay_color_alpha),\n\t\tstr_replace('%section%', 'search_index', $header_scroll_opacity),\n\t\tstr_replace('%section%', 'search_index', $header_scrolldown),\n\t\tstr_replace('%section%', 'search_index', $menu_no_padding),\n\t\tstr_replace('%section%', 'search_index', $menu_no_padding_mobile),\n\t\tstr_replace('%section%', 'search_index', $title_archive_custom_activate),\n\t\tstr_replace('%section%', 'search_index', $title_archive_custom_text),\n\t\tstr_replace('%section%', 'search_index', $subtitle_archive_custom_text),\n\n\t\tstr_replace('%section%', 'search_index', $body_section_title),\n\t\tstr_replace('%section%', 'search_index', $body_uncode_block),\n\t\tstr_replace('%section%', 'search_index', $body_layout_width),\n\t\tstr_replace('%section%', 'search_index', $remove_pagination),\n\t\tstr_replace('%section%', 'search_index', $sidebar_section_title),\n\t\tstr_replace('%section%', 'search_index', $sidebar_activate),\n\t\tstr_replace('%section%', 'search_index', $sidebar_widget),\n\t\tstr_replace('%section%', 'search_index', $sidebar_position),\n\t\tstr_replace('%section%', 'search_index', $sidebar_size),\n\t\tstr_replace('%section%', 'search_index', $sidebar_sticky),\n\t\tstr_replace('%section%', 'search_index', $sidebar_style),\n\t\tstr_replace('%section%', 'search_index', $sidebar_bgcolor),\n\t\tstr_replace('%section%', 'search_index', $sidebar_fill),\n\t\tstr_replace('%section%', 'search_index', $footer_section_title),\n\t\tstr_replace('%section%', 'search_index', $footer_uncode_block),\n\t\tstr_replace('%section%', 'search_index', $footer_width),\n\n\t\tarray(\n\t\t\t'id' => '_uncode_sidebars',\n\t\t\t'label' => esc_html__('Site sidebars', 'uncode') ,\n\t\t\t'desc' => esc_html__('Define here all the sidebars you will need. A default sidebar is already defined.', 'uncode') ,\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_sidebars_section',\n\t\t\t'class' => 'list-item',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_sidebar_unique_id',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'std' => 'sidebar-',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__('Unique sidebar ID','uncode'),\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_font_groups',\n\t\t\t'label' => esc_html__('Custom fonts', 'uncode') ,\n\t\t\t'desc' => esc_html__('Define here all the fonts you will need.', 'uncode') ,\n\t\t\t'std' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title' => 'Font Default',\n\t\t\t\t\t'_uncode_font_group_unique_id' => 'font-555555',\n\t\t\t\t\t'_uncode_font_group' => 'manual',\n\t\t\t\t\t'_uncode_font_manual' => '-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_font_group_unique_id',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'std' => 'font-',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__('Unique font ID','uncode'),\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_font_group',\n\t\t\t\t\t'label' => esc_html__('Uncode font', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Specify a font.', 'uncode') ,\n\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t'choices' => $title_font,\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_font_manual',\n\t\t\t\t\t'label' => esc_html__('Font family', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Enter a font family.', 'uncode') ,\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'condition' => '_uncode_font_group:is(manual)',\n\t\t\t\t\t'operator' => 'and'\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_font_size',\n\t\t\t'label' => esc_html__('Default font size', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for p,li,dt,dd,dl,address,label,small,pre in px.', 'uncode') ,\n\t\t\t'std' => '15',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_large_text_size',\n\t\t\t'label' => esc_html__('Large text font size', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for large text in px.', 'uncode') ,\n\t\t\t'std' => '18',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_h1',\n\t\t\t'label' => esc_html__('Font size H1', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for H1 in <b>px</b>.', 'uncode') ,\n\t\t\t'std' => '35',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_h2',\n\t\t\t'label' => esc_html__('Font size H2', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for H2 in <b>px</b>.', 'uncode') ,\n\t\t\t'std' => '29',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_h3',\n\t\t\t'label' => esc_html__('Font size H3', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for H3 in <b>px</b>.', 'uncode') ,\n\t\t\t'std' => '24',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_h4',\n\t\t\t'label' => esc_html__('Font size H4', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for H4 in <b>px</b>.', 'uncode') ,\n\t\t\t'std' => '20',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_h5',\n\t\t\t'label' => esc_html__('Font size H5', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for H5 in <b>px</b>.', 'uncode') ,\n\t\t\t'std' => '17',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_h6',\n\t\t\t'label' => esc_html__('Font size H6', 'uncode') ,\n\t\t\t'desc' => esc_html__('Font size for H6 in <b>px</b>.', 'uncode') ,\n\t\t\t'std' => '14',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_font_sizes',\n\t\t\t'label' => esc_html__('Custom font size', 'uncode') ,\n\t\t\t'desc' => esc_html__('Define here all the additional font sizes you will need.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_heading_font_size_unique_id',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'std' => 'fontsize-',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__('Unique font size ID','uncode'),\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_heading_font_size',\n\t\t\t\t\t'label' => esc_html__('Font size', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Font size in <b>px</b>.', 'uncode') ,\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_font_heights',\n\t\t\t'label' => esc_html__('Custom line height', 'uncode') ,\n\t\t\t'desc' => esc_html__('Define here all the additional font line heights you will need.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_heading_font_height_unique_id',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'std' => 'fontheight-',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__('Unique font height ID','uncode'),\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_heading_font_height',\n\t\t\t\t\t'label' => esc_html__('Font line height', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Insert a line height.', 'uncode') ,\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_font_spacings',\n\t\t\t'label' => esc_html__('Custom letter spacing', 'uncode') ,\n\t\t\t'desc' => esc_html__('Define here all the letter spacings you will need.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_typography_section',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_heading_font_spacing_unique_id',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'std' => 'fontspace-',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__('Unique letter spacing ID','uncode'),\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_heading_font_spacing',\n\t\t\t\t\t'label' => esc_html__('Letter spacing', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Letter spacing with the unit (em or px). Ex. 0.2em', 'uncode') ,\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_colors_list',\n\t\t\t'label' => esc_html__('Color palettes', 'uncode') ,\n\t\t\t'desc' => esc_html__('Define all the colors you will need.', 'uncode') ,\n\t\t\t'std' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Black','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-jevc',\n\t\t\t\t\t'_uncode_custom_color' => '#000000',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Dark 1','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-nhtu',\n\t\t\t\t\t'_uncode_custom_color' => '#101213',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Dark 2','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-wayh',\n\t\t\t\t\t'_uncode_custom_color' => '#141618',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Dark 3','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-rgdb',\n\t\t\t\t\t'_uncode_custom_color' => '#1b1d1f',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Dark 4','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-prif',\n\t\t\t\t\t'_uncode_custom_color' => '#303133',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('White','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-xsdn',\n\t\t\t\t\t'_uncode_custom_color' => '#ffffff',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Light 1','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-lxmt',\n\t\t\t\t\t'_uncode_custom_color' => '#f7f7f7',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Light 2','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-gyho',\n\t\t\t\t\t'_uncode_custom_color' => '#eaeaea',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Light 3','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-uydo',\n\t\t\t\t\t'_uncode_custom_color' => '#dddddd',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Light 4','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-wvjs',\n\t\t\t\t\t'_uncode_custom_color' => '#777',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Cerulean','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-vyce',\n\t\t\t\t\t'_uncode_custom_color' => '#0cb4ce',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'title' => esc_html__('Blue Ribbon','uncode'),\n\t\t\t\t\t'_uncode_custom_color_unique_id' => 'color-210407',\n\t\t\t\t\t'_uncode_custom_color' => '#006cff',\n\t\t\t\t\t'_uncode_custom_color_regular' => 'on',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_colors_section',\n\t\t\t'class' => 'list-colors',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_custom_color_unique_id',\n\t\t\t\t\t'std' => 'color-',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__('Unique color ID','uncode'),\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_custom_color_regular',\n\t\t\t\t\t'label' => esc_html__('Monochrome', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Activate to assign a monochromatic color, otherwise a gradient will be used.', 'uncode') ,\n\t\t\t\t\t'std' => 'on',\n\t\t\t\t\t'type' => 'on-off',\n\t\t\t\t\t'section' => 'uncode_customize_section',\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_custom_color',\n\t\t\t\t\t'label' => esc_html__('Colorpicker', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Specify the color for this palette. You can also define a color with the alpha value.', 'uncode') ,\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'type' => 'colorpicker',\n\t\t\t\t\t'condition' => '_uncode_custom_color_regular:is(on)',\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_custom_color_gradient',\n\t\t\t\t\t'label' => esc_html__('Gradient', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Specify the gradient color for this palette. NB. You can use a gradient color only as a background color.', 'uncode') ,\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'type' => 'gradientpicker',\n\t\t\t\t\t'condition' => '_uncode_custom_color_regular:is(off)',\n\t\t\t\t) ,\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_light_block_title',\n\t\t\t'label' => '<i class=\"fa fa-square-o\"></i> ' . esc_html__('Light skin', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_color_light',\n\t\t\t'label' => esc_html__('SVG/Text logo color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the logo color if it\\'s a SVG or textual.', 'uncode') ,\n\t\t\t'std' => 'color-prif',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_color_light',\n\t\t\t'label' => esc_html__('Menu text color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu text color.', 'uncode') ,\n\t\t\t'std' => 'color-prif',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_bg_color_light',\n\t\t\t'label' => esc_html__('Primary menu background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary menu background color.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_bg_alpha_light',\n\t\t\t'label' => esc_html__('Primary menu background opacity', 'uncode') ,\n\t\t\t'desc' => esc_html__('Adjust the primary menu background transparency.', 'uncode') ,\n\t\t\t'std' => '100',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_submenu_bg_color_light',\n\t\t\t'label' => esc_html__('Primary submenu background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary submenu background color.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_border_color_light',\n\t\t\t'label' => esc_html__('Primary menu border color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary menu border color.', 'uncode') ,\n\t\t\t'std' => 'color-gyho',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_border_alpha_light',\n\t\t\t'label' => esc_html__('Primary menu border opacity', 'uncode') ,\n\t\t\t'desc' => esc_html__('Adjust the primary menu border transparency.', 'uncode') ,\n\t\t\t'std' => '100',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_secmenu_bg_color_light',\n\t\t\t'label' => esc_html__('Secondary menu background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the secondary menu background color.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_color_light',\n\t\t\t'label' => esc_html__('Headings color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the headings text color.', 'uncode') ,\n\t\t\t'std' => 'color-prif',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_text_color_light',\n\t\t\t'label' => esc_html__('Content text color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the content area text color.', 'uncode') ,\n\t\t\t'std' => 'color-wvjs',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_background_color_light',\n\t\t\t'label' => esc_html__('Content background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the content background color.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_dark_block_title',\n\t\t\t'label' => '<i class=\"fa fa-square\"></i> ' . esc_html__('Dark skin', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_logo_color_dark',\n\t\t\t'label' => esc_html__('SVG/Text logo color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the logo color if it\\'s a SVG or textual.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_color_dark',\n\t\t\t'label' => esc_html__('Menu text color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu text color.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_bg_color_dark',\n\t\t\t'label' => esc_html__('Primary menu background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary menu background color.', 'uncode') ,\n\t\t\t'std' => 'color-wayh',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_bg_alpha_dark',\n\t\t\t'label' => esc_html__('Primary menu background opacity', 'uncode') ,\n\t\t\t'desc' => esc_html__('Adjust the primary menu background transparency.', 'uncode') ,\n\t\t\t'std' => '100',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_submenu_bg_color_dark',\n\t\t\t'label' => esc_html__('Primary submenu background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary submenu background color.', 'uncode') ,\n\t\t\t'std' => 'color-rgdb',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_border_color_dark',\n\t\t\t'label' => esc_html__('Primary menu border color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary menu border color.', 'uncode') ,\n\t\t\t'std' => 'color-prif',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_border_alpha_dark',\n\t\t\t'label' => esc_html__('Primary menu border opacity', 'uncode') ,\n\t\t\t'desc' => esc_html__('Adjust the primary menu border transparency.', 'uncode') ,\n\t\t\t'std' => '100',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_secmenu_bg_color_dark',\n\t\t\t'label' => esc_html__('Secondary menu background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the secondary menu background color.', 'uncode') ,\n\t\t\t'std' => 'color-wayh',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_color_dark',\n\t\t\t'label' => esc_html__('Headings color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the headings text color.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_text_color_dark',\n\t\t\t'label' => esc_html__('Content text color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the content area text color.', 'uncode') ,\n\t\t\t'std' => 'color-xsdn',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_background_color_dark',\n\t\t\t'label' => esc_html__('Content background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the content background color.', 'uncode') ,\n\t\t\t'std' => 'color-wayh',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_general_block_title',\n\t\t\t'label' => '<i class=\"fa fa-globe3\"></i> ' . esc_html__('General', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_body_background',\n\t\t\t'label' => esc_html__('HTML body background', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the body background color and media.', 'uncode') ,\n\t\t\t'type' => 'background',\n\t\t\t'std' => array(\n\t\t\t\t'background-color' => 'color-lxmt',\n\t\t\t\t'background-repeat' => '',\n\t\t\t\t'background-attachment' => '',\n\t\t\t\t'background-position' => '',\n\t\t\t\t'background-size' => '',\n\t\t\t\t'background-image' => '',\n\t\t\t),\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_accent_color',\n\t\t\t'label' => esc_html__('Accent color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the accent color.', 'uncode') ,\n\t\t\t'std' => 'color-210407',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_body_link_color',\n\t\t\t'label' => esc_html__('Links color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the color of links in page textual contents.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => '',\n\t\t\t\t\t'label' => esc_html__('Default', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'accent',\n\t\t\t\t\t'label' => esc_html__('Accent color', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_body_font_family',\n\t\t\t'label' => esc_html__('Body font family', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the body font family.', 'uncode') ,\n\t\t\t'std' => 'font-555555',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $custom_fonts\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_body_font_weight',\n\t\t\t'label' => esc_html__('Body font weight', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the body font weight.', 'uncode') ,\n\t\t\t'std' => '400',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $title_weight\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_ui_font_family',\n\t\t\t'label' => esc_html__('UI font family', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the UI font family.', 'uncode') ,\n\t\t\t'std' => 'font-555555',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $custom_fonts\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_ui_font_weight',\n\t\t\t'label' => esc_html__('UI font weight', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the UI font weight.', 'uncode') ,\n\t\t\t'std' => '600',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $title_weight\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_font_family',\n\t\t\t'label' => esc_html__('Headings font family', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the headings font family.', 'uncode') ,\n\t\t\t'std' => 'font-555555',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $custom_fonts\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_heading_font_weight',\n\t\t\t'label' => esc_html__('Headings font weight', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the Headings font weight.', 'uncode') ,\n\t\t\t'std' => '600',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $title_weight\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_letter_spacing',\n\t\t\t'label' => esc_html__('Headings letter spacing', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the letter spacing in EMs.', 'uncode') ,\n\t\t\t'std' => '0.00',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_input_underline',\n\t\t\t'label' => esc_html__('Input text underlined', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to style all the input text with the underline.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_fallback_font',\n\t\t\t'label' => esc_html__('Fallback font', 'uncode') ,\n\t\t\t'desc' => esc_html__('Select a font to use as fallback when Google Fonts import is not available.', 'uncode') ,\n\t\t\t'std' => 'font-555555',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $custom_fonts\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_style_block_title',\n\t\t\t'label' => '<i class=\"fa fa-menu\"></i> ' . esc_html__('Menu', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_overlay_menu_style',\n\t\t\t'label' => esc_html__('Overlay menu skin', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the overlay menu skin.', 'uncode') ,\n\t\t\t'std' => 'light',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'condition' => '_uncode_headers:is(menu-overlay),_uncode_headers:is(menu-overlay-center)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $stylesArrayMenu\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_color_hover',\n\t\t\t'label' => esc_html__('Menu highlight color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu active and hover effect color (If not specified an opaque version of the menu color will be used).', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_primary_menu_style',\n\t\t\t'label' => esc_html__('Primary menu skin', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary menu skin.', 'uncode') ,\n\t\t\t'std' => 'light',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'choices' => $stylesArrayMenu\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_primary_submenu_style',\n\t\t\t'label' => esc_html__('Primary submenu skin', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the primary submenu skin.', 'uncode') ,\n\t\t\t'std' => 'light',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'choices' => $stylesArrayMenu\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_secondary_menu_style',\n\t\t\t'label' => esc_html__('Secondary menu skin', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the secondary menu skin.', 'uncode') ,\n\t\t\t'std' => 'dark',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'condition' => '_uncode_headers:is(hmenu-right),_uncode_headers:is(hmenu-left),_uncode_headers:is(hmenu-justify),_uncode_headers:is(hmenu-center)',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $stylesArrayMenu\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_font_size',\n\t\t\t'label' => esc_html__('Menu font size', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu font size. NB: the Overlay menu font size is automatic relative to the viewport.', 'uncode') ,\n\t\t\t'std' => '12',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_submenu_font_size',\n\t\t\t'label' => esc_html__('Submenu font size', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the submenu font size. NB: the Overlay submenu font size is automatic relative to the viewport.', 'uncode') ,\n\t\t\t'std' => '12',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_mobile_font_size',\n\t\t\t'label' => esc_html__('Mobile menu font size', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu font size for mobile (when the Navbar > Animation > is not Menu Centered Mobile).', 'uncode') ,\n\t\t\t'std' => '12',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_font_family',\n\t\t\t'label' => esc_html__('Menu font family', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu font family.', 'uncode') ,\n\t\t\t'std' => 'font-555555',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $custom_fonts\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_font_weight',\n\t\t\t'label' => esc_html__('Menu font weight', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the menu font weight.', 'uncode') ,\n\t\t\t'std' => '600',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $title_weight\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_letter_spacing',\n\t\t\t'label' => esc_html__('Menu letter spacing', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the letter spacing in EMs (the default value is 0.05).', 'uncode') ,\n\t\t\t'std' => '0.05',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_first_uppercase',\n\t\t\t'label' => esc_html__('Menu first level uppercase', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to transform the first menu level to uppercase.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_menu_other_uppercase',\n\t\t\t'label' => esc_html__('Menu other levels uppercase', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to transform all the others menu level to uppercase.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_content_block_title',\n\t\t\t'label' => '<i class=\"fa fa-layout\"></i> ' . esc_html__('Content', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_general_style',\n\t\t\t'label' => esc_html__('Skin', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the content skin.', 'uncode') ,\n\t\t\t'std' => 'light',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'light',\n\t\t\t\t\t'label' => esc_html__('Light', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'dark',\n\t\t\t\t\t'label' => esc_html__('Dark', 'uncode') ,\n\t\t\t\t\t'src' => ''\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_general_bg_color',\n\t\t\t'label' => esc_html__('Background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify a custom content background color.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_buttons_block_title',\n\t\t\t'label' => '<i class=\"fa fa-download3\"></i> ' . esc_html__('Buttons and Forms', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_buttons_font_family',\n\t\t\t'label' => esc_html__('Buttons font family', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the buttons font family.', 'uncode') ,\n\t\t\t'std' => 'font-555555',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $custom_fonts\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_buttons_font_weight',\n\t\t\t'label' => esc_html__('Buttons font weight', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the buttons font weight.', 'uncode') ,\n\t\t\t'std' => '600',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $title_weight\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_buttons_text_transform',\n\t\t\t'label' => esc_html__('Buttons text transform', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the buttons text transform.', 'uncode') ,\n\t\t\t'std' => 'uppercase',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'initial',\n\t\t\t\t\t'label' => esc_html__('Default', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'uppercase',\n\t\t\t\t\t'label' => esc_html__('Uppercase', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'lowercase',\n\t\t\t\t\t'label' => esc_html__('Lowercase', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'capitalize',\n\t\t\t\t\t'label' => esc_html__('Capitalize', 'uncode') ,\n\t\t\t\t) ,\n\t\t\t) ,\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_buttons_letter_spacing',\n\t\t\t'label' => esc_html__('Buttons letter spacing', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the letter spacing value.', 'uncode') ,\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'operator' => 'or',\n\t\t\t'choices' => $btn_letter_spacing,\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_buttons_border_width',\n\t\t\t'label' => esc_html__('Button and form fields border', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the width of the borders for buttons and form fields', 'uncode') ,\n\t\t\t'std' => '1',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'min_max_step'=> '1,5,1',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_button_hover',\n\t\t\t'label' => esc_html__('Button hover effect', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify an effect on hover state.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => '',\n\t\t\t\t\t'label' => esc_html__('Outlined', 'uncode')\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'full-colored',\n\t\t\t\t\t'label' => esc_html__('Flat', 'uncode')\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_style_block_title',\n\t\t\t'label' => '<i class=\"fa fa-ellipsis\"></i> ' . esc_html__('Footer', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_last_style',\n\t\t\t'label' => esc_html__('Copyright area skin', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the copyright area skin color.', 'uncode') ,\n\t\t\t'std' => 'dark',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and',\n\t\t\t'choices' => $stylesArrayMenu\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_bg_color',\n\t\t\t'label' => esc_html__('Copyright area custom background color', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify a custom copyright area background color.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'uncode_color',\n\t\t\t'section' => 'uncode_customize_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_customize_extra_block_title',\n\t\t\t'label' => '<i class=\"fa fa-download3\"></i> ' . esc_html__('Scroll & Parallax', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_scroll_constant',\n\t\t\t'label' => esc_html__('ScrollTo constant speed', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate this to always have a constant speed when scrolling to point.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_scroll_constant_factor',\n\t\t\t'label' => esc_html__('ScrollTo constant speed factor', 'uncode') ,\n\t\t\t'desc' => esc_html__('Adjust the constant scroll speed factor. Default 2', 'uncode') ,\n\t\t\t'std' => '2',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'min_max_step'=> '1,15,0.25',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t\t'operator' => 'or',\n\t\t\t'condition' => '_uncode_scroll_constant:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_scroll_speed_value',\n\t\t\t'label' => esc_html__('ScrollTo speed fixed', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the scroll speed time in milliseconds.', 'uncode') ,\n\t\t\t'std' => '1000',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t\t'operator' => 'or',\n\t\t\t'condition' => '_uncode_scroll_constant:is(off)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_parallax_factor',\n\t\t\t'label' => esc_html__('Parallax speed factor', 'uncode') ,\n\t\t\t'desc' => esc_html__('Adjust the parallax speed factor. Default 2.5', 'uncode') ,\n\t\t\t'std' => '2.5',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'min_max_step'=> '0.5,3,0.5',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_portfolio_block_title',\n\t\t\t'label' => '<i class=\"fa fa-briefcase3\"></i> ' . ucfirst($portfolio_cpt_name) . ' ' . esc_html__('CPT', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_cpt',\n\t\t\t'label' => ucfirst($portfolio_cpt_name) . ' ' . esc_html__('CPT label', 'uncode') ,\n\t\t\t'desc' => esc_html__('Enter a custom portfolio post type label.', 'uncode') ,\n\t\t\t'std' => 'portfolio',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_portfolio_cpt_slug',\n\t\t\t'label' => ucfirst($portfolio_cpt_name) . ' ' . esc_html__('CPT slug', 'uncode') ,\n\t\t\t'desc' => esc_html__('Enter a custom portfolio post type slug.', 'uncode') ,\n\t\t\t'std' => 'portfolio',\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t)\n\t);\n\n\tif (class_exists('WooCommerce')) {\n\n\t\t$custom_settings_three[] = array(\n\t\t\t'id' => '_uncode_woocommerce_block_title',\n\t\t\t'label' => '<i class=\"fa fa-shopping-cart\"></i> ' . esc_html__('WooCommerce', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t);\n\n\t\t$custom_settings_three[] = array(\n\t\t\t'id' => '_uncode_woocommerce_cart_icon',\n\t\t\t'label' => esc_html__('Cart icon', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the cart icon', 'uncode') ,\n\t\t\t'std' => 'fa fa-bag',\n\t\t\t'type' => 'text',\n\t\t\t'class' => 'button_icon_container',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t);\n\n\t\t$custom_settings_three[] = array(\n\t\t\t'id' => '_uncode_woocommerce_hooks',\n\t\t\t'label' => esc_html__('Enable Hooks', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate this to enable default WooCommerce hooks on product loops.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t);\n\n\t\t$custom_settings_three[] = array(\n\t\t\t'id' => '_uncode_woocommerce_enhanced_atc',\n\t\t\t'label' => esc_html__('Enhance Add To Cart Button', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate this to enable the enhanced Add To Cart button on loops.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t);\n\t}\n\n\t$custom_settings_four = array(\n\t\tarray(\n\t\t\t'id' => '_uncode_customize_admin_block_title',\n\t\t\t'label' => '<i class=\"fa fa-dashboard\"></i> ' . esc_html__('Admin', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_admin_help',\n\t\t\t'label' => esc_html__('Help button in admin bar', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to show the Uncode help button in the WP admin bar.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_extra_section',\n\t\t) ,\n\t);\n\n\t$custom_settings_five = array(\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_layout_block_title',\n\t\t\t'label' => '<i class=\"fa fa-layers\"></i> ' . esc_html__('Layout', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_full',\n\t\t\t'label' => esc_html__('Footer full width', 'uncode') ,\n\t\t\t'desc' => esc_html__('Expand the footer to full width.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t\t'condition' => '_uncode_boxed:is(off)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_content_block_title',\n\t\t\t'label' => '<i class=\"fa fa-cog2\"></i> ' . esc_html__('Widget area', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_block',\n\t\t\t'label' => esc_html__('Content Block', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the Content Block to use as a footer content.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'custom-post-type-select',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t\t'post_type' => 'uncodeblock',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_last_block_title',\n\t\t\t'label' => '<i class=\"fa fa-copyright\"></i> ' . esc_html__('Copyright area', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_copy_hide',\n\t\t\t'label' => esc_html__('Hide Copyright Area', 'uncode') ,\n\t\t\t'type' => 'on-off',\n\t\t\t'desc' => esc_html__('Activate this to hide the Copyright Area.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_copyright',\n\t\t\t'label' => esc_html__('Automatic copyright text', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to use an automatic copyright text.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_text',\n\t\t\t'label' => esc_html__('Custom copyright text', 'uncode') ,\n\t\t\t'desc' => esc_html__('Insert a custom text for the footer copyright area.', 'uncode') ,\n\t\t\t'type' => 'textarea',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t\t'operator' => 'or',\n\t\t\t'condition' => '_uncode_footer_copyright:is(off)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_position',\n\t\t\t'label' => esc_html__('Content alignment', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the footer copyright text alignment.', 'uncode') ,\n\t\t\t'std' => 'left',\n\t\t\t'type' => 'select',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t\t'choices' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'left',\n\t\t\t\t\t'label' => esc_html__('Left', 'uncode')\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'center',\n\t\t\t\t\t'label' => esc_html__('Center', 'uncode')\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'right',\n\t\t\t\t\t'label' => esc_html__('Right', 'uncode')\n\t\t\t\t)\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_social',\n\t\t\t'label' => esc_html__('Social links', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to have the social icons in the footer copyright area.', 'uncode') ,\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_add_block_title',\n\t\t\t'label' => '<i class=\"fa fa-square-plus\"></i> ' . esc_html__('Additionals', 'uncode') ,\n\t\t\t'type' => 'textblock-titled',\n\t\t\t'class' => 'section-title',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_uparrow',\n\t\t\t'label' => esc_html__('Scroll up button', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to add a scroll up button in the footer.', 'uncode') ,\n\t\t\t'type' => 'on-off',\n\t\t\t'std' => 'on',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_footer_uparrow_mobile',\n\t\t\t'label' => esc_html__('Scroll up button on mobile', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to add a scroll up button in the footer for mobile devices.', 'uncode') ,\n\t\t\t'type' => 'on-off',\n\t\t\t'std' => 'on',\n\t\t\t'condition' => '_uncode_footer_uparrow:is(on)',\n\t\t\t'operator' => 'and',\n\t\t\t'section' => 'uncode_footer_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_social_list',\n\t\t\t'label' => esc_html__('Social Networks', 'uncode') ,\n\t\t\t'desc' => esc_html__('Define here all the social networks you will need.', 'uncode') ,\n\t\t\t'type' => 'list-item',\n\t\t\t'section' => 'uncode_connections_section',\n\t\t\t'class' => 'list-social',\n\t\t\t'settings' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_social_unique_id',\n\t\t\t\t\t'class' => 'unique_id',\n\t\t\t\t\t'std' => 'social-',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => esc_html__('Unique social ID','uncode'),\n\t\t\t\t\t'desc' => esc_html__('This value is created automatically and it shouldn\\'t be edited unless you know what you are doing.','uncode'),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_social',\n\t\t\t\t\t'label' => esc_html__('Social Network Icon', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Specify the social network icon.', 'uncode') ,\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'class' => 'button_icon_container',\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_link',\n\t\t\t\t\t'label' => esc_html__('Social Network Link', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Enter your social network link.', 'uncode') ,\n\t\t\t\t\t'std' => '',\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'condition' => '',\n\t\t\t\t\t'operator' => 'and'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'id' => '_uncode_menu_hidden',\n\t\t\t\t\t'label' => esc_html__('Hide In The Menu', 'uncode') ,\n\t\t\t\t\t'desc' => esc_html__('Activate to hide the social icon in the menu (if the social connections in the menu is active).', 'uncode') ,\n\t\t\t\t\t'std' => 'off',\n\t\t\t\t\t'type' => 'on-off',\n\t\t\t\t\t'condition' => '',\n\t\t\t\t\t'operator' => 'and'\n\t\t\t\t) ,\n\t\t\t)\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_gmaps_api',\n\t\t\t'label' => esc_html__('Google Maps API KEY', 'uncode') ,\n\t\t\t'desc' => sprintf( wp_kses(__( 'To use Uncode custom styled Google Maps you need to create <a href=\"%s\" target=\"_blank\">here the Google API KEY</a> and paste it in this field.', 'uncode' ), array( 'a' => array( 'href' => array(),'target' => array() ) ) ), 'https://developers.google.com/maps/documentation/javascript/get-api-key#get-an-api-key' ),\n\t\t\t'type' => 'text',\n\t\t\t'section' => 'uncode_gmaps_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_css',\n\t\t\t'label' => esc_html__('CSS', 'uncode') ,\n\t\t\t'desc' => esc_html__('Enter here your custom CSS.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'css',\n\t\t\t'section' => 'uncode_cssjs_section',\n\t\t\t'rows' => '20',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_js',\n\t\t\t'label' => esc_html__('Javascript', 'uncode') ,\n\t\t\t'desc' => esc_html__('Enter here your custom Javacript code.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'textarea-simple',\n\t\t\t'section' => 'uncode_cssjs_section',\n\t\t\t'rows' => '20',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_custom_tracking',\n\t\t\t'label' => esc_html__('Tracking', 'uncode') ,\n\t\t\t'desc' => esc_html__('Enter here your custom Tracking code.', 'uncode') ,\n\t\t\t'std' => '',\n\t\t\t'type' => 'textarea-simple',\n\t\t\t'section' => 'uncode_cssjs_section',\n\t\t\t'rows' => '20',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive',\n\t\t\t'label' => esc_html__('Adaptive images', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to take advantage of the Adaptive Images system. Adaptive Images detects your visitor\\'s screen size and automatically delivers device appropriate re-scaled images.', 'uncode') ,\n\t\t\t'std' => 'on',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive_async',\n\t\t\t'label' => esc_html__('Asynchronous adaptive image system', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to load the adaptive images asynchronously, this will improve the loading performance and it\\'s necessary if using an aggresive caching system.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'operator' => 'or',\n\t\t\t'condition' => '_uncode_adaptive:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive_async_blur',\n\t\t\t'label' => esc_html__('Asynchronous loading blur effect', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to use a bluring effect when loading the images.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'operator' => 'and',\n\t\t\t'condition' => '_uncode_adaptive:is(on),_uncode_adaptive_async:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive_mobile_advanced',\n\t\t\t'label' => esc_html__('Mobile settings', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to set specific mobile options.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'operator' => 'or',\n\t\t\t'condition' => '_uncode_adaptive:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive_use_orientation_width',\n\t\t\t'label' => esc_html__('Use current mobile orientation width', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to use the current mobile orientation width (portrait or landscape) instead of the max device\\'s width (landscape).', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'operator' => 'and',\n\t\t\t'condition' => '_uncode_adaptive:is(on),_uncode_adaptive_mobile_advanced:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive_limit_density',\n\t\t\t'label' => esc_html__('Limit device density', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to limit the pixel density to 2 when generating the most appropriate image for high pixel density displays.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'operator' => 'and',\n\t\t\t'condition' => '_uncode_adaptive:is(on),_uncode_adaptive_mobile_advanced:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive_quality',\n\t\t\t'label' => esc_html__('Image quality', 'uncode') ,\n\t\t\t'desc' => esc_html__('Adjust the images compression quality.', 'uncode') ,\n\t\t\t'std' => '90',\n\t\t\t'type' => 'numeric-slider',\n\t\t\t'min_max_step'=> '60,100,1',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'operator' => 'or',\n\t\t\t'condition' => '_uncode_adaptive:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_adaptive_sizes',\n\t\t\t'label' => esc_html__('Image sizes range', 'uncode') ,\n\t\t\t'desc' => esc_html__('Enter all the image sizes you want use for the Adaptive Images system. NB. The values needs to be comma separated.', 'uncode') ,\n\t\t\t'type' => 'text',\n\t\t\t'std' => '258,516,720,1032,1440,2064,2880',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'operator' => 'or',\n\t\t\t'condition' => '_uncode_adaptive:is(on)',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_htaccess',\n\t\t\t'label' => esc_html__('Apache Server Configs', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate the enhanced .htaccess, this will improve the web site\\'s performance and security.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_production',\n\t\t\t'label' => esc_html__('Production mode', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate this to switch to production mode, the CSS and JS will be cached by the browser and the JS minified.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_performance_section',\n\t\t\t'condition' => '',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_redirect',\n\t\t\t'label' => esc_html__('Activate page redirect', 'uncode') ,\n\t\t\t'desc' => esc_html__('Activate to redirect all the website calls to a specific page. NB. This can only be visible when the user is not logged in.', 'uncode') ,\n\t\t\t'std' => 'off',\n\t\t\t'type' => 'on-off',\n\t\t\t'section' => 'uncode_redirect_section',\n\t\t) ,\n\t\tarray(\n\t\t\t'id' => '_uncode_redirect_page',\n\t\t\t'label' => esc_html__('Redirect page', 'uncode') ,\n\t\t\t'desc' => esc_html__('Specify the redirect page. NB. This page will be presented without menu and footer.', 'uncode') ,\n\t\t\t'type' => 'page_select',\n\t\t\t'section' => 'uncode_redirect_section',\n\t\t\t'post_type' => 'page',\n\t\t\t'condition' => '_uncode_redirect:is(on)',\n\t\t\t'operator' => 'and'\n\t\t) ,\n\t);\n\n\t$custom_settings_one = array_merge( $custom_settings_one, $custom_settings_three );\n\n\tif ( ! defined('ENVATO_HOSTED_SITE') )\n\t\t$custom_settings_one = array_merge( $custom_settings_one, $custom_settings_four );\n\n\t$custom_settings_one = array_merge( $custom_settings_one, $custom_settings_five );\n\n\t$custom_settings = array(\n\t\t'sections' => $custom_settings_section_one,\n\t\t'settings' => $custom_settings_one,\n\t);\n\n\tif (class_exists('WooCommerce'))\n\t{\n\n\t\t$woo_section = array(\n\t\t\t// array(\n\t\t\t// \t'id' => 'uncode_woocommerce_section',\n\t\t\t// \t'title' => '<i class=\"fa fa-shopping-cart\"></i> ' . esc_html__('WooCommerce', 'uncode')\n\t\t\t// ),\n\t\t\tarray(\n\t\t\t\t'id' => 'uncode_product_section',\n\t\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-paper\"></i> ' . esc_html__('Product', 'uncode') . '</span>',\n\t\t\t\t'group' => esc_html__('Single', 'uncode'),\n\t\t\t) ,\n\t\t\tarray(\n\t\t\t\t'id' => 'uncode_product_index_section',\n\t\t\t\t'title' => '<span class=\"smaller\"><i class=\"fa fa-archive2\"></i> ' . esc_html__('Products', 'uncode') . '</span>',\n\t\t\t\t'group' => esc_html__('Archives', 'uncode'),\n\t\t\t) ,\n\t\t);\n\n\t\t$menus_array[] = array(\n\t\t\t'value' => '',\n\t\t\t'label' => esc_html__('Select…', 'uncode')\n\t\t);\n\t\t$menu_array = array();\n\t\t$nav_menus = get_registered_nav_menus();\n\n\t\tforeach ($nav_menus as $location => $description)\n\t\t{\n\n\t\t\t$menu_array['value'] = $location;\n\t\t\t$menu_array['label'] = $description;\n\t\t\t$menus_array[] = $menu_array;\n\t\t}\n\n\t\t$menus_array[] = array(\n\t\t\t'value' => 'social',\n\t\t\t'label' => esc_html__('Social Menu', 'uncode')\n\t\t);\n\n\t\t$woocommerce_post = array(\n\t\t\t/////////////////////////\n\t\t\t// Product Single\t\t///\n\t\t\t/////////////////////////\n\t\t\tstr_replace('%section%', 'product', $menu_section_title),\n\t\t\tstr_replace('%section%', 'product', $menu),\n\t\t\tstr_replace('%section%', 'product', $menu_width),\n\t\t\tstr_replace('%section%', 'product', $menu_opaque),\n\t\t\tstr_replace('%section%', 'product', $header_section_title),\n\t\t\tstr_replace('%section%', 'product', $header_type),\n\t\t\tstr_replace('%section%', 'product', $header_uncode_block),\n\t\t\tstr_replace('%section%', 'product', $header_revslider),\n\t\t\tstr_replace('%section%', 'product', $header_layerslider),\n\n\t\t\tstr_replace('%section%', 'product', $header_width),\n\t\t\tstr_replace('%section%', 'product', $header_height),\n\t\t\tstr_replace('%section%', 'product', $header_min_height),\n\t\t\tstr_replace('%section%', 'product', $header_title),\n\t\t\tstr_replace('%section%', 'product', $header_style),\n\t\t\tstr_replace('%section%', 'product', $header_content_width),\n\t\t\tstr_replace('%section%', 'product', $header_custom_width),\n\t\t\tstr_replace('%section%', 'product', $header_align),\n\t\t\tstr_replace('%section%', 'product', $header_position),\n\t\t\tstr_replace('%section%', 'product', $header_title_font),\n\t\t\tstr_replace('%section%', 'product', $header_title_size),\n\t\t\tstr_replace('%section%', 'product', $header_title_height),\n\t\t\tstr_replace('%section%', 'product', $header_title_spacing),\n\t\t\tstr_replace('%section%', 'product', $header_title_weight),\n\t\t\tstr_replace('%section%', 'product', $header_title_transform),\n\t\t\tstr_replace('%section%', 'product', $header_title_italic),\n\t\t\tstr_replace('%section%', 'product', $header_text_animation),\n\t\t\tstr_replace('%section%', 'product', $header_animation_speed),\n\t\t\tstr_replace('%section%', 'product', $header_animation_delay),\n\t\t\tstr_replace('%section%', 'product', $header_featured),\n\t\t\tstr_replace('%section%', 'product', $header_background),\n\t\t\tstr_replace('%section%', 'product', $header_parallax),\n\t\t\tstr_replace('%section%', 'product', $header_kburns),\n\t\t\tstr_replace('%section%', 'product', $header_overlay_color),\n\t\t\tstr_replace('%section%', 'product', $header_overlay_color_alpha),\n\t\t\tstr_replace('%section%', 'product', $header_scroll_opacity),\n\t\t\tstr_replace('%section%', 'product', $header_scrolldown),\n\n\t\t\tstr_replace('%section%', 'product', $body_section_title),\n\t\t\tstr_replace('%section%', 'product', $body_layout_width),\n\t\t\tstr_replace('%section%', 'product', $body_layout_width_custom),\n\t\t\tstr_replace('%section%', 'product', $show_breadcrumb),\n\t\t\tstr_replace('%section%', 'product', $breadcrumb_align),\n\t\t\tstr_replace('%section%', 'product', $show_title),\n\t\t\tstr_replace('%section%', 'product', $show_share),\n\t\t\tstr_replace('%section%', 'product', $image_layout),\n\t\t\tstr_replace('%section%', 'product', $media_size),\n\t\t\tstr_replace('%section%', 'product', $enable_sticky_desc),\n\t\t\tstr_replace('%section%', 'product', $enable_woo_zoom),\n\t\t\tstr_replace('%section%', 'product', $thumb_cols),\n\t\t\tstr_replace('%section%', 'product', $enable_woo_slider),\n\t\t\tstr_replace('%section%', 'product', $body_uncode_block_after),\n\t\t\tstr_replace('%section%', 'product', $navigation_section_title),\n\t\t\tstr_replace('%section%', 'product', $navigation_activate),\n\t\t\tstr_replace('%section%', 'product', $navigation_page_index),\n\t\t\tstr_replace('%section%', 'product', $navigation_index_label),\n\t\t\tstr_replace('%section%', 'product', $navigation_nextprev_title),\n\t\t\tstr_replace('%section%', 'product', $footer_section_title),\n\t\t\tstr_replace('%section%', 'product', $footer_uncode_block),\n\t\t\tstr_replace('%section%', 'product', $footer_width),\n\t\t\tstr_replace('%section%', 'product', $custom_fields_section_title),\n\t\t\tstr_replace('%section%', 'product', $custom_fields_list),\n\t\t\t/////////////////////////\n\t\t\t// Products Index\t\t///\n\t\t\t/////////////////////////\n\t\t\tstr_replace('%section%', 'product_index', $menu_section_title),\n\t\t\tstr_replace('%section%', 'product_index', $menu),\n\t\t\tstr_replace('%section%', 'product_index', $menu_width),\n\t\t\tstr_replace('%section%', 'product_index', $menu_opaque),\n\t\t\tstr_replace('%section%', 'product_index', $header_section_title),\n\t\t\tstr_replace('%section%', 'product_index', run_array_to($header_type, 'std', 'header_basic')),\n\t\t\tstr_replace('%section%', 'product_index', $header_uncode_block),\n\t\t\tstr_replace('%section%', 'product_index', $header_revslider),\n\t\t\tstr_replace('%section%', 'product_index', $header_layerslider),\n\n\t\t\tstr_replace('%section%', 'product_index', $header_width),\n\t\t\tstr_replace('%section%', 'product_index', $header_height),\n\t\t\tstr_replace('%section%', 'product_index', $header_min_height),\n\t\t\tstr_replace('%section%', 'product_index', $header_title),\n\t\t\tstr_replace('%section%', 'product_index', $header_style),\n\t\t\tstr_replace('%section%', 'product_index', $header_content_width),\n\t\t\tstr_replace('%section%', 'product_index', $header_custom_width),\n\t\t\tstr_replace('%section%', 'product_index', $header_align),\n\t\t\tstr_replace('%section%', 'product_index', $header_position),\n\t\t\tstr_replace('%section%', 'product_index', $header_title_font),\n\t\t\tstr_replace('%section%', 'product_index', $header_title_size),\n\t\t\tstr_replace('%section%', 'product_index', $header_title_height),\n\t\t\tstr_replace('%section%', 'product_index', $header_title_spacing),\n\t\t\tstr_replace('%section%', 'product_index', $header_title_weight),\n\t\t\tstr_replace('%section%', 'product_index', $header_title_transform),\n\t\t\tstr_replace('%section%', 'product_index', $header_title_italic),\n\t\t\tstr_replace('%section%', 'product_index', $header_text_animation),\n\t\t\tstr_replace('%section%', 'product_index', $header_animation_speed),\n\t\t\tstr_replace('%section%', 'product_index', $header_animation_delay),\n\t\t\tstr_replace('%section%', 'product_index', $header_featured),\n\t\t\tstr_replace('%section%', 'product_index', $header_background),\n\t\t\tstr_replace('%section%', 'product_index', $header_parallax),\n\t\t\tstr_replace('%section%', 'product_index', $header_kburns),\n\t\t\tstr_replace('%section%', 'product_index', $header_overlay_color),\n\t\t\tstr_replace('%section%', 'product_index', $header_overlay_color_alpha),\n\t\t\tstr_replace('%section%', 'product_index', $header_scroll_opacity),\n\t\t\tstr_replace('%section%', 'product_index', $header_scrolldown),\n\t\t\tstr_replace('%section%', 'product_index', $menu_no_padding),\n\t\t\tstr_replace('%section%', 'product_index', $menu_no_padding_mobile),\n\t\t\tstr_replace('%section%', 'product_index', $title_archive_custom_activate),\n\t\t\tstr_replace('%section%', 'product_index', $title_archive_custom_text),\n\t\t\tstr_replace('%section%', 'product_index', $subtitle_archive_custom_text),\n\n\t\t\tstr_replace('%section%', 'product_index', $body_section_title),\n\t\t\tstr_replace('%section%', 'product_index', $show_breadcrumb),\n\t\t\tstr_replace('%section%', 'product_index', $breadcrumb_align),\n\t\t\tstr_replace('%section%', 'product_index', $body_uncode_block),\n\t\t\tstr_replace('%section%', 'product_index', $body_layout_width),\n\t\t\tstr_replace('%section%', 'product_index', $body_single_post_width),\n\t\t\tstr_replace('%section%', 'product_index', $show_title),\n\t\t\tstr_replace('%section%', 'product_index', $remove_pagination),\n\t\t\tstr_replace('%section%', 'product_index', $products_per_page),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_section_title),\n\t\t\tstr_replace('%section%', 'product_index', run_array_to($sidebar_activate, 'std', 'on')),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_widget),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_position),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_size),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_sticky),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_style),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_bgcolor),\n\t\t\tstr_replace('%section%', 'product_index', $sidebar_fill),\n\t\t\tstr_replace('%section%', 'product_index', $footer_section_title),\n\t\t\tstr_replace('%section%', 'product_index', $footer_uncode_block),\n\t\t\tstr_replace('%section%', 'product_index', $footer_width),\n\t\t);\n\n\t\t$custom_settings['sections'] = array_merge( $custom_settings['sections'], $woo_section );\n\t\t// array_push($custom_settings['settings'], $woocommerce_cart_icon);\n\t\t// array_push($custom_settings['settings'], $woocommerce_hooks);\n\t\t$custom_settings['settings'] = array_merge( $custom_settings['settings'], $woocommerce_post );\n\n\t}\n\n\t$custom_settings['settings'] = array_filter( $custom_settings['settings'], 'uncode_is_not_null' );\n\n\t/* allow settings to be filtered before saving */\n\t$custom_settings = apply_filters(ot_settings_id() . '_args', $custom_settings);\n\n\t/* settings are not the same update the DB */\n\tif ($saved_settings !== $custom_settings)\n\t{\n\t\tupdate_option(ot_settings_id() , $custom_settings);\n\t}\n\n\t/**\n\t * Filter on layout images.\n\t */\n\tfunction filter_layout_radio_images($array, $layout)\n\t{\n\n\t\t/* only run the filter where the field ID is my_radio_images */\n\t\tif ($layout == '_uncode_headers')\n\t\t{\n\t\t\t$array = array(\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'hmenu-right',\n\t\t\t\t\t'label' => esc_html__('Right', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/hmenu-right.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'hmenu-justify',\n\t\t\t\t\t'label' => esc_html__('Justify', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/hmenu-justify.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'hmenu-left',\n\t\t\t\t\t'label' => esc_html__('Left', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/hmenu-left.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'hmenu-center',\n\t\t\t\t\t'label' => esc_html__('Center', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/hmenu-center.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'hmenu-center-split',\n\t\t\t\t\t'label' => esc_html__('Center Split', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/hmenu-splitted.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'hmenu-center-double',\n\t\t\t\t\t'label' => esc_html__('Center Double', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/hmenu-center-double.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'vmenu',\n\t\t\t\t\t'label' => esc_html__('Lateral', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/vmenu.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'vmenu-offcanvas',\n\t\t\t\t\t'label' => esc_html__('Offcanvas', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/offcanvas.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'menu-overlay',\n\t\t\t\t\t'label' => esc_html__('Overlay', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/overlay.jpg'\n\t\t\t\t) ,\n\t\t\t\tarray(\n\t\t\t\t\t'value' => 'menu-overlay-center',\n\t\t\t\t\t'label' => esc_html__('Overlay Center', 'uncode') ,\n\t\t\t\t\t'src' => get_template_directory_uri() . '/core/assets/images/layout/overlay-center.jpg'\n\t\t\t\t) ,\n\t\t\t);\n\t\t}\n\t\treturn $array;\n\t}\n\tadd_filter('ot_radio_images', 'filter_layout_radio_images', 10, 2);\n}", "function tt_theme_customize_setup(){\n new TT_Theme_Customizer();\n}", "function TS_VCSC_Set_Plugin_Options() {\r\n\t\t// Redirect Option\r\n\t\tadd_option('ts_vcsc_extend_settings_redirect', \t\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_activation', \t\t\t\t\t\t0);\r\n\t\t// Options for Theme Authors\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypes', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeWidget',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeTeam',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeTestimonial',\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeLogo', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_posttypeSkillset',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_additions', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_codeeditors', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_fontimport', \t\t\t\t 1);\r\n\t\tadd_option('ts_vcsc_extend_settings_iconicum', \t\t\t\t \t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_dashboard', \t\t\t\t\t\t1);\r\n\t\t// Options for Custom CSS/JS Editor\r\n\t\tadd_option('ts_vcsc_extend_settings_customCSS',\t\t\t\t\t\t\t'/* Welcome to the Custom CSS Editor! Please add all your Custom CSS here. */');\r\n\t\tadd_option('ts_vcsc_extend_settings_customJS', \t\t\t\t '/* Welcome to the Custom JS Editor! Please add all your Custom JS here. */');\r\n\t\t// Other Options\r\n\t\tadd_option('ts_vcsc_extend_settings_frontendEditor', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_buffering', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_mainmenu', \t\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsDomain', \t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_previewImages',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_visualSelector',\t\t\t\t\t1);\r\n add_option('ts_vcsc_extend_settings_nativeSelector',\t\t\t\t\t1);\r\n add_option('ts_vcsc_extend_settings_nativePaginator',\t\t\t\t\t'200');\r\n\t\tadd_option('ts_vcsc_extend_settings_backendPreview',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_extended', \t\t\t\t 0);\r\n\t\tadd_option('ts_vcsc_extend_settings_systemInfo',\t\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_socialDefaults', \t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_builtinLightbox', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_lightboxIntegration', \t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowAutoUpdate', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowNotification', \t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowDeprecated', \t\t\t\t\t0);\r\n\t\t// Font Active / Inactive\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceMedia',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceIcon',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceAwesome',\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceBrankic',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCountricons',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCurrencies',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceElegant',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceEntypo',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceFoundation',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceGenericons',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceIcoMoon',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceMonuments',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceSocialMedia',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceTypicons',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceFontsAll',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Awesome',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Entypo',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Linecons',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_OpenIconic',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceVC_Typicons',\t\t\t\t0);\t\t\r\n\t\t// Custom Font Data\r\n\t\tadd_option('ts_vcsc_extend_settings_IconFontSettings',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustom',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomArray',\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomJSON',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomPath',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomPHP', \t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomName',\t\t\t\t\t'Custom User Font');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomAuthor',\t\t\t\t'Custom User');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomCount',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomDate',\t\t\t\t\t'');\r\n\t\tadd_option('ts_vcsc_extend_settings_tinymceCustomDirectory',\t\t\t'');\r\n\t\t// Row + Column Extensions\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsRows',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsColumns',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsRowEffectsBreak',\t\t\t'600');\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsSmoothScroll',\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_additionsSmoothSpeed',\t\t\t\t'30');\r\n\t\t// Custom Post Types\r\n\t\tadd_option('ts_vcsc_extend_settings_customWidgets',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customTeam',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customTestimonial',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_customSkillset',\t\t\t\t\t0);\t\t\r\n\t\tadd_option('ts_vcsc_extend_settings_customTimelines', \t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_customLogo', \t\t\t\t\t\t0);\r\n\t\t// tinyMCE Icon Shortcode Generator\r\n\t\tadd_option('ts_vcsc_extend_settings_useIconGenerator',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_useTinyMCEMedia', \t\t\t\t\t1);\r\n\t\t// Standard Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_StandardElements',\t\t\t\t\t'');\r\n\t\t// Demo Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_DemoElements', \t\t\t\t\t\t'');\r\n\t\t// WooCommerce Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_WooCommerceUse',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_WooCommerceElements',\t\t\t\t'');\r\n\t\t// bbPress Elements\r\n\t\tadd_option('ts_vcsc_extend_settings_bbPressUse',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_bbPressElements',\t\t\t\t\t'');\r\n\t\t// Options for External Files\r\n\t\tadd_option('ts_vcsc_extend_settings_loadForcable',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadLightbox', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadTooltip', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadFonts', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadEnqueue',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadHeader',\t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadjQuery', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadModernizr',\t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadWaypoints', \t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadCountTo', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadMooTools', \t\t\t\t\t\t1);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadDetector', \t\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_loadHammerNew', \t\t\t\t\t1);\r\n\t\t// Google Font Manager Settings\r\n\t\tadd_option('ts_vcsc_extend_settings_allowGoogleManager', \t\t\t\t1);\r\n\t\t// Single Page Navigator\r\n\t\tadd_option('ts_vcsc_extend_settings_allowPageNavigator', \t\t\t\t0);\r\n\t\t// EnlighterJS - Syntax Highlighter\r\n\t\tadd_option('ts_vcsc_extend_settings_allowEnlighterJS',\t\t\t\t\t0);\r\n\t\tadd_option('ts_vcsc_extend_settings_allowThemeBuilder',\t\t\t\t\t0);\r\n\t\t// Post Type Menu Positions\r\n\t\t$TS_VCSC_Menu_Positions_Defaults_Init = array(\r\n\t\t\t'ts_widgets'\t\t\t\t\t=> 50,\r\n\t\t\t'ts_timeline'\t\t\t\t\t=> 51,\r\n\t\t\t'ts_team'\t\t\t\t\t\t=> 52,\r\n\t\t\t'ts_testimonials'\t\t\t\t=> 53,\r\n\t\t\t'ts_skillsets'\t\t\t\t\t=> 54,\r\n\t\t\t'ts_logos'\t\t\t\t\t\t=> 55,\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_menuPositions',\t\t\t\t\t\t$TS_VCSC_Menu_Positions_Defaults_Init);\r\n\t\t// Row Toggle Settings\r\n\t\t$TS_VCSC_Row_Toggle_Defaults_Init = array(\r\n\t\t\t'Large Devices' => 1200,\r\n\t\t\t'Medium Devices' => 992,\r\n\t\t\t'Small Devices' => 768,\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_rowVisibilityLimits', \t\t\t\t$TS_VCSC_Row_Toggle_Defaults_Init);\r\n\t\t// Language Settings: Countdown\r\n\t\t$TS_VCSC_Countdown_Language_Defaults_Init = array(\r\n\t\t\t'DayPlural' => 'Days',\r\n\t\t\t'DaySingular' => 'Day',\r\n\t\t\t'HourPlural' => 'Hours',\r\n\t\t\t'HourSingular' => 'Hour',\r\n\t\t\t'MinutePlural' => 'Minutes',\r\n\t\t\t'MinuteSingular' => 'Minute',\r\n\t\t\t'SecondPlural' => 'Seconds',\r\n\t\t\t'SecondSingular' => 'Second',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsCountdown', \t\t\t$TS_VCSC_Countdown_Language_Defaults_Init);\r\n\t\t// Language Settings: Google Maps PLUS\r\n\t\t$TS_VCSC_Google_MapPLUS_Language_Defaults_Init = array(\r\n\t\t\t'ListenersStart' => 'Start Listeners',\r\n\t\t\t'ListenersStop' => 'Stop Listeners',\r\n\t\t\t'MobileShow' => 'Show Google Map',\r\n\t\t\t'MobileHide' => 'Hide Google Map',\r\n\t\t\t'StyleDefault' => 'Google Standard',\r\n\t\t\t'StyleLabel' => 'Change Map Style',\r\n\t\t\t'FilterAll' => 'All Groups',\r\n\t\t\t'FilterLabel' => 'Filter by Groups',\r\n\t\t\t'SelectLabel' => 'Zoom to Location',\r\n\t\t\t'ControlsOSM' => 'Open Street',\r\n\t\t\t'ControlsHome' => 'Home',\r\n\t\t\t'ControlsBounds' => 'Fit All',\r\n\t\t\t'ControlsBike' => 'Bicycle Trails',\r\n\t\t\t'ControlsTraffic' => 'Traffic',\r\n\t\t\t'ControlsTransit' => 'Transit',\r\n\t\t\t'TrafficMiles' => 'Miles per Hour',\r\n\t\t\t'TrafficKilometer' => 'Kilometers per Hour',\r\n\t\t\t'TrafficNone' => 'No Data Available',\r\n\t\t\t'SearchButton' => 'Search Location',\r\n\t\t\t'SearchHolder' => 'Enter address to search for ...',\r\n\t\t\t'SearchGoogle' => 'View on Google Maps',\r\n\t\t\t'SearchDirections' => 'Get Directions',\r\n\t\t\t'OtherLink' => 'Learn More!',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsGoogleMapPLUS', \t\t$TS_VCSC_Google_MapPLUS_Language_Defaults_Init);\r\n\t\t// Language Settings: Google Maps (Deprecated)\r\n\t\t$TS_VCSC_Google_Map_Language_Defaults_Init = array(\r\n\t\t\t'TextCalcShow' => 'Show Address Input',\r\n\t\t\t'TextCalcHide' => 'Hide Address Input',\r\n\t\t\t'TextDirectionShow' => 'Show Directions',\r\n\t\t\t'TextDirectionHide' => 'Hide Directions',\r\n\t\t\t'TextResetMap' => 'Reset Map',\r\n\t\t\t'PrintRouteText' \t\t\t => 'Print Route',\r\n\t\t\t'TextViewOnGoogle' => 'View on Google',\r\n\t\t\t'TextButtonCalc' => 'Show Route',\r\n\t\t\t'TextSetTarget' => 'Please enter your Start Address:',\r\n\t\t\t'TextGeoLocation' => 'Get My Location',\r\n\t\t\t'TextTravelMode' => 'Travel Mode',\r\n\t\t\t'TextDriving' => 'Driving',\r\n\t\t\t'TextWalking' => 'Walking',\r\n\t\t\t'TextBicy' => 'Bicycling',\r\n\t\t\t'TextWP' => 'Optimize Waypoints',\r\n\t\t\t'TextButtonAdd' => 'Add Stop on the Way',\r\n\t\t\t'TextDistance' => 'Total Distance:',\r\n\t\t\t'TextMapHome' => 'Home',\r\n\t\t\t'TextMapBikes' => 'Bicycle Trails',\r\n\t\t\t'TextMapTraffic' => 'Traffic',\r\n\t\t\t'TextMapSpeedMiles' => 'Miles Per Hour',\r\n\t\t\t'TextMapSpeedKM' => 'Kilometers Per Hour',\r\n\t\t\t'TextMapNoData' => 'No Data Available!',\r\n\t\t\t'TextMapMiles' => 'Miles',\r\n\t\t\t'TextMapKilometes' => 'Kilometers',\r\n\t\t\t'TextMapActivate' => 'Show Google Map',\r\n\t\t\t'TextMapDeactivate' => 'Hide Google Map',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsGoogleMap', \t\t\t$TS_VCSC_Google_Map_Language_Defaults_Init);\r\n\t\t// Language Settings: Isotope Posts\r\n\t\t$TS_VCSC_Isotope_Posts_Language_Defaults_Init = array(\r\n\t\t\t'ButtonFilter'\t\t => 'Filter Posts', \r\n\t\t\t'ButtonLayout'\t\t => 'Change Layout',\r\n\t\t\t'ButtonSort'\t\t => 'Sort Criteria',\r\n\t\t\t// Standard Post Strings\r\n\t\t\t'Date' \t\t\t\t => 'Post Date', \r\n\t\t\t'Modified' \t\t\t => 'Post Modified', \r\n\t\t\t'Title' \t\t\t => 'Post Title', \r\n\t\t\t'Author' \t\t\t => 'Post Author', \r\n\t\t\t'PostID' \t\t\t => 'Post ID', \r\n\t\t\t'Comments' \t\t\t => 'Number of Comments',\r\n\t\t\t// Layout Strings\r\n\t\t\t'SeeAll'\t\t\t => 'See All',\r\n\t\t\t'Timeline' \t\t\t => 'Timeline',\r\n\t\t\t'Masonry' \t\t\t => 'Centered Masonry',\r\n\t\t\t'FitRows'\t\t\t => 'Fit Rows',\r\n\t\t\t'StraightDown' \t\t => 'Straigt Down',\r\n\t\t\t// WooCommerce Strings\r\n\t\t\t'WooFilterProducts' => 'Filter Products',\r\n\t\t\t'WooTitle' => 'Product Title',\r\n\t\t\t'WooPrice' => 'Product Price',\r\n\t\t\t'WooRating' => 'Product Rating',\r\n\t\t\t'WooDate' => 'Product Date',\r\n\t\t\t'WooModified' => 'Product Modified',\r\n\t\t\t// General Strings\r\n\t\t\t'Categories' => 'Categories',\r\n\t\t\t'Tags' => 'Tags',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_translationsIsotopePosts', \t\t\t$TS_VCSC_Isotope_Posts_Language_Defaults_Init);\r\n\t\t// Options for Lightbox Settings\r\n\t\t$TS_VCSC_Lightbox_Setting_Defaults_Init = array(\r\n\t\t\t'thumbs' => 'bottom',\r\n\t\t\t'thumbsize' => 50,\r\n\t\t\t'animation' => 'random',\r\n\t\t\t'captions' => 'data-title',\r\n\t\t\t'closer' => 1, // true/false\r\n\t\t\t'duration' => 5000,\r\n\t\t\t'share' => 0, // true/false\r\n\t\t\t'social' \t => 'fb,tw,gp,pin',\r\n\t\t\t'notouch' => 1, // true/false\r\n\t\t\t'bgclose'\t\t\t => 1, // true/false\r\n\t\t\t'nohashes'\t\t\t => 1, // true/false\r\n\t\t\t'keyboard'\t\t\t => 1, // 0/1\r\n\t\t\t'fullscreen'\t\t => 1, // 0/1\r\n\t\t\t'zoom'\t\t\t\t => 1, // 0/1\r\n\t\t\t'fxspeed'\t\t\t => 300,\r\n\t\t\t'scheme'\t\t\t => 'dark',\r\n\t\t\t'removelight' => 0,\r\n\t\t\t'customlight' => 0,\r\n\t\t\t'customcolor'\t\t => '#ffffff',\r\n\t\t\t'backlight' \t\t => '#ffffff',\r\n\t\t\t'usecolor' \t\t => 0, // true/false\r\n\t\t\t'background' => '',\r\n\t\t\t'repeat' => 'no-repeat',\r\n\t\t\t'overlay' => '#000000',\r\n\t\t\t'noise' => '',\r\n\t\t\t'cors' => 0, // true/false\r\n\t\t\t'scrollblock' => 'css',\r\n\t\t);\r\n\t\tadd_option('ts_vcsc_extend_settings_defaultLightboxSettings',\t\t\t$TS_VCSC_Lightbox_Setting_Defaults_Init);\r\n\t\tadd_option('ts_vcsc_extend_settings_defaultLightboxAnimation', \t\t\t'random');\r\n\t\t// Options for Envato Sales Data\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoData', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoInfo', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoLink', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoPrice', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoRating', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoSales', \t\t\t\t\t '');\r\n\t\tadd_option('ts_vcsc_extend_settings_envatoCheck', \t\t\t\t\t 0);\r\n\t\t$roles \t\t\t\t\t\t\t\t= get_editable_roles();\r\n\t\tforeach ($GLOBALS['wp_roles']->role_objects as $key => $role) {\r\n\t\t\tif (isset($roles[$key]) && $role->has_cap('edit_pages') && !$role->has_cap('ts_vcsc_extend')) {\r\n\t\t\t\t$role->add_cap('ts_vcsc_extend');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function admin_menu(){\t\tif(!empty($this->settings_manager->sections)){\n\t\t\tadd_theme_page(__('Theme Settings'), __('Theme Settings'), 'edit_theme_options', $this->options->option_name, array($this, 'theme_settings'));\n\t\t}\n\t}", "function my_theme_menu()\n\t{\n\t\t$settings_page = add_theme_page('Theme Options',\n\t\t\t\t\t\t\t\t\t\t'Theme Options',\n\t\t\t\t\t\t\t\t\t\t'edit_theme_options',\n\t\t\t\t\t\t\t\t\t\t'theme-options',\n\t\t\t\t\t\t\t\t\t\t'theme_options_page' );\n\t\t\n\t\tadd_action( \"load-{$settings_page}\", 'load_settings_page' );\n\t}", "function my_theme_menu()\n\t{\n\t\t$settings_page = add_theme_page('Theme Options',\n\t\t\t\t\t\t\t\t\t\t'Theme Options',\n\t\t\t\t\t\t\t\t\t\t'edit_theme_options',\n\t\t\t\t\t\t\t\t\t\t'theme-options',\n\t\t\t\t\t\t\t\t\t\t'theme_options_page' );\n\t\t\n\t\tadd_action( \"load-{$settings_page}\", 'load_settings_page' );\n\t}", "function autodidact_theme_setup() {\n\n}", "function devTheme_theme_menu(){\r\n\t// check if current user has permission\r\n\t$current_user = wp_get_current_user();\r\n\t$user_id = $current_user->ID;\r\n\r\n\tif(!user_can($user_id, 'create_users'))\r\n\t\treturn false;\r\n\r\n?>\r\n\r\n<div class=\"wrap\">\r\n\t<h2>Theme Settings</h2>\r\n</div>\r\n\r\n<div>\r\n\t<?php\r\n\t\tgeneral_settings();\r\n\t?>\r\n</div>\r\n\r\n<?php\r\n}", "function setup_framework_options(){\n$args = array();\n\n//Set it to dev mode to view the class settings/info in the form - default is false\n$args['dev_mode'] = false;\n\n//google api key MUST BE DEFINED IF YOU WANT TO USE GOOGLE WEBFONTS\n//$args['google_api_key'] = '***';\n\n//Remove the default stylesheet? make sure you enqueue another one all the page will look whack!\n//$args['stylesheet_override'] = true;\n\n//Choose to disable the import/export feature\n$args['show_import_export'] = false;\n\n//Choose a custom option name for your theme options, the default is the theme name in lowercase with spaces replaced by underscores\n$args['opt_name'] = 'paraiso_linux';\n\n//Custom menu icon\n//$args['menu_icon'] = '';\n\n//Custom menu title for options page - default is \"Options\"\n$args['menu_title'] = __('Opciones del tema', 'nhp-opts');\n\n//Custom Page Title for options page - default is \"Options\"\n$args['page_title'] = __('Opciones del theme de Paraiso Linux', 'nhp-opts');\n\n//Custom page slug for options page (wp-admin/themes.php?page=***) - default is \"nhp_theme_options\"\n$args['page_slug'] = 'pl_theme_options';\n\n//Custom page capability - default is set to \"manage_options\"\n//$args['page_cap'] = 'manage_options';\n\n//page type - \"menu\" (adds a top menu section) or \"submenu\" (adds a submenu) - default is set to \"menu\"\n//$args['page_type'] = 'submenu';\n\n//parent menu - default is set to \"themes.php\" (Appearance)\n//the list of available parent menus is available here: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters\n//$args['page_parent'] = 'themes.php';\n\n//custom page location - default 100 - must be unique or will override other items\n$args['page_position'] = 27;\n\n//Custom page icon class (used to override the page icon next to heading)\n//$args['page_icon'] = 'icon-themes';\n\n//Want to disable the sections showing as a submenu in the admin? uncomment this line\n//$args['allow_sub_menu'] = false;\n\t\t\n//Set the Help Sidebar for the options page - no sidebar by default\t\t\t\t\t\t\t\t\t\t\n$args['help_sidebar'] = __('<p>This is the sidebar content, HTML is allowed.</p>', 'nhp-opts');\n\n\n\n$sections = array();\n\t\t\t\t\n$sections[] = array(\n\t\t\t\t'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_107_text_resize.png',\n\t\t\t\t'title' => __('Adsense', 'nhp-opts'),\n\t\t\t\t'desc' => __('<p class=\"description\">Bloques de adsense</p>', 'nhp-opts'),\n\t\t\t\t'fields' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'adsense-bloque-superior',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Bloque superior', 'nhp-opts'), \n\t\t\t\t\t\t'sub_desc' => __('HTML Allowed (wp_kses)', 'nhp-opts')\t\n\t\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'adsense-bloque-inferior',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Bloque inferior', 'nhp-opts'), \n\t\t\t\t\t\t'sub_desc' => __('HTML Allowed (wp_kses)', 'nhp-opts')\n\t\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'adsense-analytics',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Analytics', 'nhp-opts'), \n\t\t\t\t\t\t'sub_desc' => __('HTML Allowed (wp_kses)', 'nhp-opts')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\t\t\t\t\n\t\t\t\t\n\t$tabs = array();\n\t\t\t\n\t\n\tif(file_exists(trailingslashit(get_stylesheet_directory()).'README.html')){\n\t\t$tabs['theme_docs'] = array(\n\t\t\t\t\t\t'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_071_book.png',\n\t\t\t\t\t\t'title' => __('Documentation', 'nhp-opts'),\n\t\t\t\t\t\t'content' => nl2br(file_get_contents(trailingslashit(get_stylesheet_directory()).'README.html'))\n\t\t\t\t\t\t);\n\t}//if\n\n\tglobal $NHP_Options;\n\t$NHP_Options = new NHP_Options($sections, $args, $tabs);\n\n}", "function sunrise_theme_settings_page()\n {\n require_once(get_template_directory().'/inc/templates/sunrise-admin.php');\n }", "function custom_theme_options() {\n \n /* OptionTree is not loaded yet */\n if ( ! function_exists( 'ot_settings_id' ) )\n return false;\n \n /**\n * Get a copy of the saved settings array. \n */\n $saved_settings = get_option( ot_settings_id(), array() );\n \n /**\n * Custom settings array that will eventually be \n * passes to the OptionTree Settings API Class.\n */\n $custom_settings = array( \n 'contextual_help' => array( \n 'sidebar' => ''\n ),\n 'sections' => array( \n array(\n 'id' => 'general_default',\n 'title' => '基本设置'\n ),\n array(\n 'id' => 'advanced_settings',\n 'title' => '高级设置'\n ),\n array(\n 'id' => 'appearance',\n 'title' => '外观样式'\n ),\n array(\n 'id' => 'social_icons',\n 'title' => '社交网络'\n ),\n array(\n 'id' => 'analytics_seo',\n 'title' => '统计代码&amp;SEO'\n )\n ),\n 'settings' => array( \n array(\n 'id' => 'owner_photo',\n 'label' => '首页头像',\n 'desc' => '请填写图片网址或者上传图片,建议尺寸:100x100',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'owner_first_name',\n 'label' => '姓氏',\n 'desc' => '将显示在头像的左侧。建议1-4个字,或者留空',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'owner_last_name',\n 'label' => '名字',\n 'desc' => '将显示在头像的右侧。建议1-4个字,或者留空',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'contact_info',\n 'label' => '欢迎辞/网站公告',\n 'desc' => '填写后将出现在首页右上角、社交图标的上方',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'general_default',\n 'rows' => '5',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'copyright_text',\n 'label' => '页脚文字',\n 'desc' => '显示于每个页面的最下方,可以是版权信息、站点地图链接等,支持HTML代码',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'general_default',\n 'rows' => '5',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'profile_page',\n 'label' => '指定首页页面',\n 'desc' => '首页内容一般为简要的自我介绍。新建相应页面后,在这里选中,网站首页显示的即为该页面的内容',\n 'std' => '',\n 'type' => 'page-select',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'resume_page',\n 'label' => '指定简历页面',\n 'desc' => '新建相应页面后,在这里选中,“简历”显示的即为该页面的内容',\n 'std' => '',\n 'type' => 'page-select',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'portfolio_page',\n 'label' => '指定作品页面',\n 'desc' => '新建相应页面(页面的模板必须为“Portofolio 模版”)后,在这里选中,新建的“作品”将显示在该页面内',\n 'std' => '',\n 'type' => 'page-select',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'blog_page',\n 'label' => '指定博客页面',\n 'desc' => '新建相应页面(页面的模板必须为“Blog 模版”)后,在这里选中,新建的“文章”将显示在该页面内',\n 'std' => '',\n 'type' => 'page-select',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'contact_page',\n 'label' => '指定留言页面',\n 'desc' => '新建相应页面(页面的模板为“Contact 模版”)后,在这里选中,将其指定为“留言”页面',\n 'std' => '',\n 'type' => 'page-select',\n 'section' => 'general_default',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'if_ajaxify',\n 'label' => '是否开启全站Ajax',\n 'desc' => '如果希望全站播放背景音乐,请务必开启此项',\n 'std' => '',\n 'type' => 'on-off',\n 'section' => 'advanced_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'custom_reloadjs',\n 'label' => '重载JS',\n 'desc' => '开启全站Ajax后可能导致某些document.ready触发的功能失效(比如百度推荐),请在此处粘贴相应JS代码',\n 'std' => '',\n 'type' => 'textarea-simple',\n 'section' => 'advanced_settings',\n 'rows' => '6',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'bgm',\n 'label' => '背景音乐列表',\n 'desc' => '请填写js列表网址或直接上传文件,此处留空则不播放背景音乐。js列表格式请参照“无需上传文件”文件夹中的 radio_content_example.js',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'advanced_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'work_items_link_status',\n 'label' => '作品链接至详情页面',\n 'desc' => '勾选后点击作品的名字可以进入该作品页面。适用于每个作品都有详细介绍的情况',\n 'std' => '',\n 'type' => 'on-off',\n 'section' => 'advanced_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'blog_sidebar',\n 'label' => '博客侧边栏小工具',\n 'desc' => '是否启用博客页面的侧边栏小工具',\n 'std' => '',\n 'type' => 'on-off',\n 'section' => 'advanced_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'duoshuo_domain',\n 'label' => '多说域名(×××.duoshuo.com)',\n 'desc' => '填写后多说“最近访客”小工具才能正常使用。已经注册过多说的用户直接填写×××处内容,未注册的请先到 <a href=\"http://duoshuo.com/create-site/\" title=\"创建多说站点\" target=\"_blank\">这里</a> 创建站点,然后填写',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'advanced_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'background_pattern',\n 'label' => '背景图片',\n 'desc' => '请填写图片网址或者上传图片',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'appearance',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'background_grid',\n 'label' => '背景网点',\n 'desc' => '背景图上是否加一层网点',\n 'std' => '',\n 'type' => 'radio',\n 'section' => 'appearance',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and',\n 'choices' => array( \n array(\n 'value' => 'bright',\n 'label' => '灰色网点(偏亮)',\n 'src' => ''\n ),\n array(\n 'value' => 'dark',\n 'label' => '黑色网点(偏暗)',\n 'src' => ''\n ),\n array(\n 'value' => 'no',\n 'label' => '不使用',\n 'src' => ''\n )\n )\n ),\n array(\n 'id' => 'custom_css',\n 'label' => '自定义CSS',\n 'desc' => '请直接粘贴你的CSS源代码',\n 'std' => '',\n 'type' => 'textarea-simple',\n 'section' => 'appearance',\n 'rows' => '8',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'fav_icon',\n 'label' => 'Favicon图标',\n 'desc' => '请填写图标网址或者上传图标,建议尺寸:16x16',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'appearance',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'apple_touch_icon',\n 'label' => 'Favicon图标(57x57)',\n 'desc' => '请填写图标网址或者上传图标,建议尺寸:57x57',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'appearance',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'apple_touch_icon_72',\n 'label' => 'Favicon图标(72x72)',\n 'desc' => '请填写图标网址或者上传图标,建议尺寸:72x72',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'appearance',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'apple_touch_icon_114',\n 'label' => 'Favicon图标(114x114)',\n 'desc' => '请填写图标网址或者上传图标,建议尺寸:114x114',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'appearance',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'sina_id',\n 'label' => '新浪微博(http://weibo.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'tencent_id',\n 'label' => '腾讯微博(http://t.qq.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'baidu_id',\n 'label' => '百度贴吧(http://www.baidu.com/p/×××?from=tieba 或者 http://tieba.baidu.com/home/main?id=×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'renren_id',\n 'label' => '人人(http://www.renren.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'kaixin_id',\n 'label' => '开心网(http://www.kaixin001.com/home/?uid=×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'qq_id',\n 'label' => 'QQ',\n 'desc' => '请填写数字QQ号。如果不想在网址中暴露QQ号,请到 <a href=\"http://shang.qq.com/v3/widget.html\" target=\"_blank\">这里</a> ——设置——安全级别设置,选择“安全加密”,保存后刷新网页,到“QQ通讯组件”获取代码,并在此处填入您的IDKEY(代码中IDKEY=后面的48位字符串)',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'qq_qr',\n 'label' => '手机QQ二维码',\n 'desc' => '请填写您的QQ二维码网址,在此处上传,或者直接使用媒体库中的图片',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'twitter_id',\n 'label' => 'Twitter(https://twitter.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'facebook_id',\n 'label' => 'Facebook(https://www.facebook.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'gplus_id',\n 'label' => 'Google Plus(https://plus.google.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'skype_id',\n 'label' => 'Skype',\n 'desc' => '请填写您的Skype帐号。访客点击后默认会启动Skype打开和您的文字聊天窗口。',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'youku_id',\n 'label' => '优酷(http://i.youku.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'tudou_id',\n 'label' => '土豆(http://www.tudou.com/home/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'bilibili_id',\n 'label' => '哔哩哔哩(http://space.bilibili.tv/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'xiami_id',\n 'label' => '虾米(http://www.xiami.com/u/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'songtaste_id',\n 'label' => 'SongTaste(http://www.songtaste.com/user/×××/)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'huaban_id',\n 'label' => '花瓣(http://huaban.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'youtube_id',\n 'label' => 'Youtube(https://www.youtube.com/user/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'vimeo_id',\n 'label' => 'Vimeo(http://vimeo.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'soundcloud_id',\n 'label' => 'SoundCloud(https://soundcloud.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'flickr_id',\n 'label' => 'Flickr(https://www.flickr.com/photos/×××/)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'instagram_id',\n 'label' => 'Instagram(http://instagram.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'f500px_id',\n 'label' => '500px(http://500px.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'pinterest_id',\n 'label' => 'Pinterest(http://www.pinterest.com/×××/)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'zhihu_id',\n 'label' => '知乎(http://www.zhihu.com/people/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'guokr_id',\n 'label' => '果壳(http://www.guokr.com/i/×××/)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'douban_id',\n 'label' => '豆瓣(http://www.douban.com/people/×××/)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'zcool_id',\n 'label' => '站酷(http://www.zcool.com.cn/u/××× 或 http://×××.zcool.com.cn/)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'yiyan_id',\n 'label' => '译言(http://user.yeeyan.org/u/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'segmentfault_id',\n 'label' => 'SegmentFault(http://segmentfault.com/u/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'quora_id',\n 'label' => 'Quora(https://www.quora.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'dropbox_id',\n 'label' => 'Dropbox 邀请链接(https://db.tt/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'linkedin_id',\n 'label' => 'Linkedin(http://www.linkedin.com/pub/×××/×××/×××/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'dribbble_id',\n 'label' => 'Dribbble(http://dribbble.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'github_id',\n 'label' => 'Github(https://github.com/×××)',\n 'desc' => '请填写完整URL,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'stackexchange_id',\n 'label' => 'StackExchange(http://stackexchange.com/users/×××)',\n 'desc' => '请填写完整URL,包含http(s)://。注意这里是总站StackExchange的,不要填成了StackOverflow的',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'wechat_qr',\n 'label' => '微信',\n 'desc' => '请填写您的微信二维码网址,在此处上传,或者直接使用媒体库中的图片',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'yixin_qr',\n 'label' => '易信',\n 'desc' => '请填写您的易信二维码网址,在此处上传,或者直接使用媒体库中的图片',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'line_qr',\n 'label' => 'Line',\n 'desc' => '请填写您的Line二维码网址,在此处上传,或者直接使用媒体库中的图片',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'whatsapp_qr',\n 'label' => 'Whatsapp',\n 'desc' => '请填写您的Whatsapp二维码网址,在此处上传,或者直接使用媒体库中的图片',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'mail_address',\n 'label' => 'E-mail',\n 'desc' => '请填写邮箱地址(如[email protected])或者在线写信类网址(如QQ邮箱“邮我”,在设置——账户的最下方开启该功能并获取代码后,在此处填入href=之后,双引号之间的那个网址)',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'rss_feed',\n 'label' => 'RSS Feed',\n 'desc' => '请填写完整网址,包含http(s)://。一般为“您的博客网址/feed/”',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'any_url',\n 'label' => '自定义链接',\n 'desc' => '请填写完整网址,包含http(s)://',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'social_icons',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'header_analytics_code',\n 'label' => '页头统计代码',\n 'desc' => '适用于任何要求在页头(head)部分加载的统计代码,如谷歌统计,百度统计异步代码。请直接粘贴您的代码(包含script标签),支持多个统计代码,但建议只用一个',\n 'std' => '',\n 'type' => 'textarea-simple',\n 'section' => 'analytics_seo',\n 'rows' => '4',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'footer_analytics',\n 'label' => '页尾统计代码',\n 'desc' => '适用于任何要求在页尾(footer)部分加载的统计代码,如腾讯统计,百度统计普通代码。请直接粘贴您的代码(包含script标签),支持多个统计代码,但建议只用一个',\n 'std' => '',\n 'type' => 'textarea-simple',\n 'section' => 'analytics_seo',\n 'rows' => '4',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'baidu_tuijian',\n 'label' => '百度推荐',\n 'desc' => '在<a href=\"http://tuijian.baidu.com\" target=\"_blank\">百度推荐</a>获取异步代码后,填写id=\"hm_t_×××\"引号中的内容',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'analytics_seo',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'site_description',\n 'label' => '站点描述',\n 'desc' => '适当、准确地描述你的网站。如果不想出现 Description 标签用于SEO,此处请留空',\n 'std' => '',\n 'type' => 'textarea-simple',\n 'section' => 'analytics_seo',\n 'rows' => '4',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'site_keywords',\n 'label' => '关键词',\n 'desc' => '网站关键词,关键词之间用半角英文逗号隔开。如果不想出现 Keywords 标签用于SEO,此处请留空',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'analytics_seo',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n array(\n 'id' => 'site_author',\n 'label' => '作者',\n 'desc' => '网站作者或者所有者的名字。如果不想出现 Author 标签用于SEO,此处请留空',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'analytics_seo',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n )\n )\n );\n \n /* allow settings to be filtered before saving */\n $custom_settings = apply_filters( ot_settings_id() . '_args', $custom_settings );\n \n /* settings are not the same update the DB */\n if ( $saved_settings !== $custom_settings ) {\n update_option( ot_settings_id(), $custom_settings ); \n }\n \n /* Lets OptionTree know the UI Builder is being overridden */\n global $ot_has_custom_theme_options;\n $ot_has_custom_theme_options = true;\n \n}", "function dynamik_theme_settings()\r\n{\r\n\t$user = wp_get_current_user();\r\n?>\r\n\t<div class=\"wrap\">\r\n\t\t\r\n\t\t<div id=\"dynamik-settings-saved\" class=\"dynamik-update-box\"></div>\r\n\t\t\r\n\t\t<?php\r\n\t\tif( !empty( $_POST['action'] ) && $_POST['action'] == 'reset' )\r\n\t\t{\r\n\t\t\tupdate_option( 'dynamik_gen_theme_settings', dynamik_theme_settings_defaults() );\r\n\t\t\tdynamik_write_files( $css = true, $ez = false, $custom = false );\r\n\t\t\tdynamik_get_settings( null, $args = array( 'cached' => false, 'array' => false ) );\r\n\t\t\tdynamik_protect_folders();\r\n\t\t?>\r\n\t\t\t<script type=\"text/javascript\">jQuery(document).ready(function($){ $('#dynamik-settings-saved').html('Theme Settings Reset').css(\"position\", \"fixed\").fadeIn('slow');window.setTimeout(function(){$('#dynamik-settings-saved').fadeOut( 'slow' );}, 2222); });</script>\r\n\t\t<?php\r\n\t\t}\r\n\r\n\t\tif( !empty( $_GET['activetab'] ) )\r\n\t\t{ ?>\r\n\t\t\t<script type=\"text/javascript\">jQuery(document).ready(function($) { $('#<?php echo $_GET['activetab']; ?>').click(); });</script>\t\r\n\t\t<?php\r\n\t\t} ?>\r\n\t\t\r\n\t\t<div id=\"icon-options-general\" class=\"icon32\"></div>\r\n\t\t\r\n\t\t<h2 id=\"dynamik-admin-heading\"><?php _e( 'Dynamik - Theme Settings', 'dynamik' ); ?></h2>\r\n\t\t\r\n\t\t<div id=\"dynamik-admin-wrap\">\r\n\t\t\t\r\n\t\t\t<form action=\"/\" id=\"theme-settings-form\" name=\"theme-settings-form\">\r\n\t\t\t\r\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"dynamik_theme_settings_save\" />\r\n\t\t\t\t<input type=\"hidden\" name=\"security\" value=\"<?php echo wp_create_nonce( 'theme-settings' ); ?>\" />\r\n\t\t\t\t\r\n\t\t\t\t<div id=\"dynamik-floating-save\">\r\n\t\t\t\t\t<input type=\"submit\" value=\"<?php _e( 'Save Changes', 'dynamik' ); ?>\" name=\"Submit\" alt=\"Save Changes\" class=\"dynamik-save-button button button-primary\"/>\r\n\t\t\t\t\t<img class=\"dynamik-ajax-save-spinner\" src=\"<?php echo site_url() . '/wp-admin/images/spinner-2x.gif'; ?>\" />\r\n\t\t\t\t\t<span class=\"dynamik-saved\"></span>\r\n\t\t\t\t</div>\r\n\t\t\t\t\t\r\n\t\t\t\t<div id=\"dynamik-theme-settings-nav\" class=\"dynamik-admin-nav\">\r\n\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t<li id=\"dynamik-theme-settings-nav-info\" class=\"dynamik-options-nav-all dynamik-options-nav-active\"><a href=\"#\">Child Theme Info</a></li><li id=\"dynamik-theme-settings-nav-general\" class=\"dynamik-options-nav-all\"><a href=\"#\">General Settings</a></li><li id=\"dynamik-theme-settings-nav-import-export\" class=\"dynamik-options-nav-all\"><a class=\"dynamik-options-nav-last\" href=\"#\">Import / Export</a></li>\r\n\t\t\t\t\t</ul>\r\n\t\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t\t<div class=\"dynamik-theme-settings-wrap\">\r\n\t\t\t\t\t<?php require_once( CHILD_DIR . '/lib/admin/boxes/settings-general.php' ); ?>\r\n\t\t\t\t</div>\r\n\t\t\t\r\n\t\t\t</form>\r\n\t\t\t\r\n\t\t\t<div class=\"dynamik-theme-settings-wrap\">\r\n\t\t\t\t<?php require_once( CHILD_DIR . '/lib/admin/boxes/settings-theme-info.php' ); ?>\r\n\t\t\t\t<?php require_once( CHILD_DIR . '/lib/admin/boxes/settings-import-export.php' ); ?>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t\t<div id=\"dynamik-admin-footer\">\r\n\t\t\t\t<p>\r\n\t\t\t\t\t<a href=\"https://cobaltapps.com\" target=\"_blank\">CobaltApps.com</a> | <a href=\"http://docs.cobaltapps.com/\" target=\"_blank\">Docs</a> | <a href=\"https://cobaltapps.com/my-account/\" target=\"_blank\">My Account</a> | <a href=\"https://cobaltapps.com/community/\" target=\"_blank\">Community Forum</a> | <a href=\"https://cobaltapps.com/affiliates/\" target=\"_blank\">Affiliates</a> &middot;\r\n\t\t\t\t\t<a><span id=\"show-options-reset\" class=\"dynamik-options-reset-button button\" style=\"margin:0; float:none !important;\"><?php _e( 'Theme Settings Reset', 'dynamik' ); ?></span></a><a href=\"http://dynamikdocs.cobaltapps.com/article/152-theme-settings-reset\" class=\"tooltip-mark\" target=\"_blank\">[?]</a>\r\n\t\t\t\t</p>\r\n\t\t\t</div>\r\n\t\t\t\r\n\t\t\t<div style=\"display:none; width:160px; border:none; background:none; margin:0 auto; padding:0; float:none; position:inherit;\" id=\"show-options-reset-box\" class=\"dynamik-custom-fonts-box\">\r\n\t\t\t\t<form style=\"float:left;\" id=\"dynamik-reset-theme-settings\" method=\"post\">\r\n\t\t\t\t\t<input style=\"background:#D54E21; width:160px !important; color:#FFFFFF !important; -webkit-box-shadow:none; box-shadow:none;\" type=\"submit\" value=\"<?php _e( 'Reset Theme Settings', 'dynamik' ); ?>\" class=\"dynamik-reset button\" name=\"Submit\" onClick='return confirm(\"<?php _e( 'Are you sure your want to reset your Dynamik Theme Settings?', 'dynamik' ); ?>\")'/><input type=\"hidden\" name=\"action\" value=\"reset\" />\r\n\t\t\t\t</form>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div> <!-- Close Wrap -->\r\n<?php\r\n}", "function add_theme_help()\n{\n add_menu_page('Theme Help', 'Theme Help', 'manage_options', 'theme-help', 'theme_help');\n}", "function bureau_theme_options() {\n echo 'Activate and Deactivate';\n}", "function options() {\n\t\tif ( ! current_user_can( 'manage_options' ) )\t{\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t\t}\n\t\tinclude WP_PLUGIN_DIR . '/qoorate/admin_options_page.php';\n\t}", "function create_theme_options_page() {\n global $lulisaurus_settings_page;\n\n $lulisaurus_settings_page = add_menu_page('Optionen', 'Optionen', 'read', 'lulisaurus_settings', 'build_options_page', 'dashicons-lightbulb');\n\n // Add contextual help\n add_action( 'load-' . $lulisaurus_settings_page, 'add_contextual_theme_help' );\n}", "public function panel_register_menu() {\n\t\tadd_menu_page( Theme_Name, 'Theme Options', 'manage_options', 'optionsframework');\n\t}", "function wp_ajax_install_theme()\n {\n }", "function socialConnect_adminMenu() {\n\t\t$sc_adminMenu = add_options_page('Social Connect Widget Settings', 'Social Connect Widget', 'manage_options', 'social-connect-settings', 'socialConnect_optionsPage');\n\t\tadd_action('admin_print_styles-' . $sc_adminMenu, 'socialConnect_loadCSS');\n\t}", "function mm_menu_options() {\n // add_theme_page( $page_title, $menu_title, $capability, $menu_slug, $function);\n add_menu_page('Mirror Muscles Options', 'Mirror Muscles Options', 'manage_options', 'mm-settings', 'mm_admin_options_page');\n}", "function on_admin_menu() {\n $theme_data = wp_get_theme();\n \n $this->pagehook = add_options_page( 'Slideshow Settings', 'Slideshow Settings', 'manage_options', SLIDESHOW_SETTINGS, array(&$this, 'on_show_page'));\n add_action('load-' . $this->pagehook, array(&$this, 'on_load_page'));\n }", "function custom_theme_options() {\n /**\n * Get a copy of the saved settings array. \n */\n $saved_settings = get_option( 'option_tree_settings', array() );\n \n /**\n * Custom settings array that will eventually be \n * passed to the OptionTree Settings API Class.\n */\n $custom_settings = array( \n 'contextual_help' => array( \n 'sidebar' => ''\n ),\n 'sections' => array( \n array(\n 'id' => 'general',\n 'title' => 'General'\n ),\n array(\n 'id' => 'style',\n 'title' => 'Style'\n ),\n array(\n 'id' => 'homepage_settings',\n 'title' => 'Homepage Settings'\n ),\n array(\n 'id' => 'home_slider',\n 'title' => 'Home Slider'\n ),\n array(\n 'id' => 'portfolio_settings',\n 'title' => 'Portfolio Settings'\n ),\n array(\n 'id' => 'slider_settings',\n 'title' => 'Global Slider Settings'\n ),\n array(\n 'id' => 'blog',\n 'title' => 'Blog'\n ),\n array(\n 'id' => 'social',\n 'title' => 'Social Accounts'\n ),\n array(\n 'id' => 'contact_settings',\n 'title' => 'Contact Infos'\n ),\n array(\n 'id' => 'woocommerce_settings',\n 'title' => 'WooCommerce'\n )\n ),\n 'settings' => array( \n array(\n 'id' => 'logo',\n 'label' => 'Logo',\n 'desc' => 'Upload a logo for your site.',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'full_width_menu',\n 'label' => 'Full Width Menu',\n 'desc' => 'Enable full width menu or not?',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Full Width Menu',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'favicon',\n 'label' => 'Favicon',\n 'desc' => 'Upload a favicon for your site.',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'enable_top_bar',\n 'label' => 'Enable Top Bar',\n 'desc' => 'Enable top bar or not?',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Enable Top Bar',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'top_bar_info',\n 'label' => 'Top Bar Info',\n 'desc' => 'Enter the info you would like to display in top bar of your site.',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'header_info',\n 'label' => 'Header Info',\n 'desc' => 'Enter the info you would like to display in the header of your site.',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'info_under_the_footer',\n 'label' => 'Info Under the Footer',\n 'desc' => '<p>Enter the info you would like to display under the footer of your site.</p>',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'footer_info',\n 'label' => 'Footer Info',\n 'desc' => 'Enter the info you would like to display in the footer of your site.',\n 'std' => 'Copyright &copy; 2012. All Rights Reserved.',\n 'type' => 'textarea',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'sub_footer_info',\n 'label' => 'Sub-Footer Info',\n 'desc' => 'Enter the info you would like to display in the sub-footer of your site.',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'tracking_code',\n 'label' => 'Tracking Code',\n 'desc' => 'Paste your Google Analytics (or other) tracking code here.',\n 'std' => '',\n 'type' => 'textarea-simple',\n 'section' => 'general',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'primary_typography',\n 'label' => 'Primary Typography',\n 'desc' => 'The Primary Typography option type is for adding typographic styles to your site. The most important one though is Google Fonts to create custom font stacks. Default color is #111111.',\n 'std' => array(\n 'font-color' => '#111111'\n ),\n 'type' => 'typography',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'google_font_family',\n 'label' => 'Google Web Font Primary Typography',\n 'desc' => '<p class=\"warning\">Paste Google Web Font link to your website.</p><p><b>Read more:</b> <a href=\"http://www.google.com/webfonts\" target=\"_blank\"><code>http://www.google.com/webfonts</code></a></p>',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'google_font_name',\n 'label' => 'Google Web Font Name for Primary Typography',\n 'desc' => 'Enter the Google Web Font name for primary typography.',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'header_typography',\n 'label' => 'Header Typography',\n 'desc' => 'The Header Typography option type is for adding typographic styles for headers to your site. The most important one though is Google Fonts to create custom font stacks. Default color is #111111.',\n 'std' => '',\n 'type' => 'typography',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'header_google_font_family',\n 'label' => 'Google Web Font Header Typography',\n 'desc' => '<p class=\"warning\">Paste Google Web Font link for headings to your website.</p><p><b>Read more:</b> <a href=\"http://www.google.com/webfonts\" target=\"_blank\"><code>http://www.google.com/webfonts</code></a></p>',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'header_google_font_name',\n 'label' => 'Google Web Font Name for Header Typography',\n 'desc' => 'Enter the Google Web Font name for header typography.',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'primary_link_color',\n 'label' => 'Primary Link Color',\n 'desc' => 'Choose a color for primary link color. Default value is #ababab.',\n 'std' => '#ababab',\n 'type' => 'colorpicker',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'secondary_link_color',\n 'label' => 'Secondary Link Color',\n 'desc' => 'Choose a value for secondary link color. Default value is #111111.',\n 'std' => '#111111',\n 'type' => 'colorpicker',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'secondary_link_color_hover',\n 'label' => 'Secondary Link Color &mdash; Hover/Active',\n 'desc' => 'Choose a value for secondary link color &mdash; hover/active. Default value is #bca474.',\n 'std' => '#bca474',\n 'type' => 'colorpicker',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'navigation_link_color',\n 'label' => 'Navigation Link Color &mdash; Hover/Active',\n 'desc' => 'Choose a value for navigation link color &mdash; hover/active. Default value is #bca474.',\n 'std' => '#bca474',\n 'type' => 'colorpicker',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'secondary_text_color',\n 'label' => 'Secondary Text Color',\n 'desc' => 'Choose a value for secondary text color. Default value is #777777.',\n 'std' => '#777777',\n 'type' => 'colorpicker',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'primary_borders_color',\n 'label' => 'Primary Borders Color',\n 'desc' => 'Choose a value for primary borders color. Default value is #cfcfcf.',\n 'std' => '#cfcfcf',\n 'type' => 'colorpicker',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'background',\n 'label' => 'Background',\n 'desc' => 'Upload a background for your site.',\n 'std' => '',\n 'type' => 'background',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'custom_css',\n 'label' => 'Custom CSS',\n 'desc' => 'Quickly add some CSS to your theme by adding it to this block.',\n 'std' => '',\n 'type' => 'css',\n 'section' => 'style',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_welcome_message',\n 'label' => 'Home Welcome Message',\n 'desc' => '<p>The large welcome message that appears above the slider.</p>',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'homepage_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_portfolios_per_page',\n 'label' => 'Portfolio Items',\n 'desc' => 'Enter the amount of portfolio items you would like to show on the homepage.',\n 'std' => '16',\n 'type' => 'text',\n 'section' => 'homepage_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'view_more_projects_text',\n 'label' => '&ldquo;View more projects&rdquo; link',\n 'desc' => 'Enter the title of the &ldquo;View more projects&rdquo; link.',\n 'std' => '',\n 'type' => 'text',\n 'section' => 'homepage_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'enable_home_slider',\n 'label' => 'Enable Slideshow',\n 'desc' => 'Enable slideshow or not?',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'home_slider',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Enable Slideshow',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'home_slider_height',\n 'label' => 'Slider Height',\n 'desc' => '<p>Customize height of slideshow.</p><p>Note: The optimal dimensions for your slideshow images are 959px wide by 370px high.</p>',\n 'std' => '370',\n 'type' => 'text',\n 'section' => 'home_slider',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_slider_list',\n 'label' => 'Home Slider',\n 'desc' => '<p>You can create as many slides as your project requires and use them how you see fit.</p><p>All of the slides can be sorted and rearranged to your liking with Drag &amp; Drop. Don\\'t worry about the order in which you create your slides, you can always reorder them.</p>',\n 'std' => '',\n 'type' => 'list-item',\n 'section' => 'home_slider',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'settings' => array( \n array(\n 'id' => 'home_slider_image',\n 'label' => 'Image',\n 'desc' => '',\n 'std' => '',\n 'type' => 'upload',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_slider_highlight_color',\n 'label' => 'Title highlight color',\n 'desc' => 'Choose a value for title highlight color. Default value is #111111.',\n 'std' => '#111111',\n 'type' => 'colorpicker',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_slider_link',\n 'label' => 'Link',\n 'desc' => '',\n 'std' => 'javascript:void(null);',\n 'type' => 'text',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_slider_description',\n 'label' => 'Description',\n 'desc' => '',\n 'std' => '',\n 'type' => 'textarea',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n )\n )\n ),\n array(\n 'id' => 'portfolio_message',\n 'label' => 'Portfolio Message',\n 'desc' => '<p>The large message that appears above the portfolio items.</p>',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'portfolio_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'portfolios_per_page',\n 'label' => 'Portfolio pages show at most',\n 'desc' => 'Enter the number of Portfolios to show per page.',\n 'std' => '12',\n 'type' => 'text',\n 'section' => 'portfolio_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'portfolio_filtering',\n 'label' => 'Portfolio Filtering',\n 'desc' => 'Display portfolio filtering or not?',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'portfolio_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Portfolio Filtering',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'portfolio_meta',\n 'label' => 'Portfolio Meta',\n 'desc' => 'Select what information to display for each portfolio item on the portfolio page just under their title.',\n 'std' => '',\n 'type' => 'select',\n 'section' => 'portfolio_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'categories',\n 'label' => 'Categories',\n 'src' => ''\n ),\n array(\n 'value' => 'none',\n 'label' => 'None',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'portfolio_page',\n 'label' => 'Portfolio Page',\n 'desc' => 'Select the portfolio page. Used for the \"Back to portfolio\" link.',\n 'std' => '',\n 'type' => 'page-select',\n 'section' => 'portfolio_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'autoplay',\n 'label' => 'Autoplay',\n 'desc' => '<p>Enable autoplay or not?</p>',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'slider_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Autoplay',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'pause_on_hover',\n 'label' => 'Pause on Hover',\n 'desc' => '<p>Pause autoplay on hover?</p>',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'slider_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Pause on Hover',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'delay',\n 'label' => 'Delay between slides in ms',\n 'desc' => '<p>Delay between items in ms.</p>',\n 'std' => '4500',\n 'type' => 'text',\n 'section' => 'slider_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'control_navigation',\n 'label' => 'Control Navigation',\n 'desc' => '<p>Select navigation type.</p>',\n 'std' => '',\n 'type' => 'select',\n 'section' => 'slider_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'bullets',\n 'label' => 'Bullets',\n 'src' => ''\n ),\n array(\n 'value' => 'thumbnails',\n 'label' => 'Thumbnails',\n 'src' => ''\n ),\n array(\n 'value' => 'none',\n 'label' => 'None',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'enable_blog_title',\n 'label' => 'Enable Title / Welcome Message',\n 'desc' => 'Enable Title / Welcome Message or not?',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'blog',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Enable Title / Welcome Message',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'blog_message',\n 'label' => 'Blog Message',\n 'desc' => '<p>The large message that appears above posts.</p>',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'blog',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'social_accounts',\n 'label' => 'Social Accounts',\n 'desc' => '<p>Which links would you like to display?</p>',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'facebook',\n 'label' => 'Facebook',\n 'src' => ''\n ),\n array(\n 'value' => 'twitter',\n 'label' => 'Twitter',\n 'src' => ''\n ),\n array(\n 'value' => 'gplus',\n 'label' => 'Google Plus',\n 'src' => ''\n ),\n array(\n 'value' => 'linkedin',\n 'label' => 'LinkedIn',\n 'src' => ''\n ),\n array(\n 'value' => 'dribbble',\n 'label' => 'Dribbble',\n 'src' => ''\n ),\n array(\n 'value' => 'pinterest',\n 'label' => 'Pinterest',\n 'src' => ''\n ),\n array(\n 'value' => 'foursquare',\n 'label' => 'Foursquare',\n 'src' => ''\n ),\n array(\n 'value' => 'instagram',\n 'label' => 'Instagram',\n 'src' => ''\n ),\n array(\n 'value' => 'vimeo',\n 'label' => 'Vimeo',\n 'src' => ''\n ),\n array(\n 'value' => 'flickr',\n 'label' => 'Flickr',\n 'src' => ''\n ),\n array(\n 'value' => 'github',\n 'label' => 'GitHub',\n 'src' => ''\n ),\n array(\n 'value' => 'tumblr',\n 'label' => 'Tumblr',\n 'src' => ''\n ),\n array(\n 'value' => 'forrst',\n 'label' => 'Forrst',\n 'src' => ''\n ),\n array(\n 'value' => 'lastfm',\n 'label' => 'Last.fm',\n 'src' => ''\n ),\n array(\n 'value' => 'stumbleupon',\n 'label' => 'StumbleUpon',\n 'src' => ''\n ),\n array(\n 'value' => 'feed',\n 'label' => 'RSS',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'facebook_url',\n 'label' => 'Facebook Address (URL)',\n 'desc' => '',\n 'std' => 'http://www.facebook.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'twitter_url',\n 'label' => 'Twitter Address (URL)',\n 'desc' => '',\n 'std' => 'https://twitter.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'gplus_url',\n 'label' => 'Google Plus Address (URL)',\n 'desc' => '',\n 'std' => 'https://plus.google.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'linkedin_url',\n 'label' => 'LinkedIn Address (URL)',\n 'desc' => '',\n 'std' => 'http://www.linkedin.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'dribbble_url',\n 'label' => 'Dribbble Address (URL)',\n 'desc' => '',\n 'std' => 'http://dribbble.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'pinterest_url',\n 'label' => 'Pinterest Address (URL)',\n 'desc' => '',\n 'std' => 'http://pinterest.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'foursquare_url',\n 'label' => 'Foursquare Address (URL)',\n 'desc' => '',\n 'std' => 'https://foursquare.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'instagram_url',\n 'label' => 'Instagram Address (URL)',\n 'desc' => '',\n 'std' => 'http://instagram.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'vimeo_url',\n 'label' => 'Vimeo Address (URL)',\n 'desc' => '',\n 'std' => 'https://vimeo.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'flickr_url',\n 'label' => 'Flickr Address (URL)',\n 'desc' => '',\n 'std' => 'http://www.flickr.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'github_url',\n 'label' => 'GitHub Address (URL)',\n 'desc' => '',\n 'std' => 'https://github.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'tumblr_url',\n 'label' => 'Tumblr Address (URL)',\n 'desc' => '',\n 'std' => 'https://www.tumblr.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'forrst_url',\n 'label' => 'Forrst Address (URL)',\n 'desc' => '',\n 'std' => 'http://forrst.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'lastfm_url',\n 'label' => 'Last.fm Address (URL)',\n 'desc' => '',\n 'std' => 'http://www.lastfm.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'stumbleupon_url',\n 'label' => 'StumbleUpon Address (URL)',\n 'desc' => '',\n 'std' => 'http://www.stumbleupon.com/',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'feed_url',\n 'label' => 'RSS Address (URL)',\n 'desc' => '',\n 'std' => 'javascript:void(null);',\n 'type' => 'text',\n 'section' => 'social',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'contact_message',\n 'label' => 'Contact Message',\n 'desc' => '<p>The large message that appears above the map.</p>',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'contact_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'map_address',\n 'label' => 'Adress',\n 'desc' => '<p>Insert your Adress here. Example:</p><p>13/2 Elizabeth Street, Melbourne VIC 3000</p>',\n 'std' => '3/2 Elizabeth Street, Melbourne VIC 3000',\n 'type' => 'text',\n 'section' => 'contact_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'map_height',\n 'label' => 'Map Height',\n 'desc' => 'Insert map height.',\n 'std' => '401',\n 'type' => 'text',\n 'section' => 'contact_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'map_content',\n 'label' => 'Map Info Content',\n 'desc' => 'Insert Map Info Content here. Example:<p>Envato (FlashDen Pty Ltd) 13/2 Elizabeth Street, Melbourne VIC 3000 (03) 9023 0074 &middot; envato.com</p>',\n 'std' => 'Envato (FlashDen Pty Ltd) 13/2 Elizabeth Street, Melbourne VIC 3000 (03) 9023 0074 &middot; envato.com',\n 'type' => 'textarea-simple',\n 'section' => 'contact_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'map_grayscale',\n 'label' => 'Grayscale',\n 'desc' => '<p>Enable grayscale or not?</p>',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'contact_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Grayscale',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'map_custom_marker',\n 'label' => 'Custom Marker',\n 'desc' => 'Upload a custom marker for your address.',\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'contact_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'woo_account',\n 'label' => 'Display My Account link',\n 'desc' => '<p>Displays a link to the user account section?</p><br><p>If the user is not logged in the link will display &ldquo;Login / Registration&rdquo; and take the use to the login / signup page. If the user is logged in the link will display &ldquo;My account&rdquo; and take them directly to their account.</p>',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'woocommerce_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Account',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'enable_home_banners_shop',\n 'label' => 'Enable Banners',\n 'desc' => 'Enable banners or not?',\n 'std' => '',\n 'type' => 'checkbox',\n 'section' => 'woocommerce_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'choices' => array( \n array(\n 'value' => 'yes',\n 'label' => 'Enable Banners',\n 'src' => ''\n )\n ),\n ),\n array(\n 'id' => 'home_banners_shop_list',\n 'label' => 'Banners',\n 'desc' => '<p>You can create as many banners as your project requires and use them how you see fit.</p><p>Note: The optimal dimensions for your banner images are 300px wide by 280px high.</p><p>All of the banners can be sorted and rearranged to your liking with Drag &amp; Drop. Don\\'t worry about the order in which you create your slides, you can always reorder them.</p>',\n 'std' => '',\n 'type' => 'list-item',\n 'section' => 'woocommerce_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => '',\n 'settings' => array( \n array(\n 'id' => 'home_banner_image',\n 'label' => 'Image',\n 'desc' => '',\n 'std' => '',\n 'type' => 'upload',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_banner_highlight_color',\n 'label' => 'Title highlight color',\n 'desc' => 'Choose a value for title highlight color. Default value is #E0CE79.',\n 'std' => '#E0CE79',\n 'type' => 'colorpicker',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_banner_link',\n 'label' => 'Link',\n 'desc' => '',\n 'std' => '',\n 'type' => 'text',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'home_banner_description',\n 'label' => 'Description',\n 'desc' => '',\n 'std' => '',\n 'type' => 'textarea-simple',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n )\n )\n ),\n array(\n 'id' => 'account_benefits_info',\n 'label' => 'Account Benefits Info',\n 'desc' => 'Enter the info you would like to display under the <strong>&ldquo;Create an account&rdquo;</strong> form of your site.',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'woocommerce_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n ),\n array(\n 'id' => 'returning_customer_info',\n 'label' => 'Returning Customer Info',\n 'desc' => 'Enter the info you would like to display under the <strong>&ldquo;Returning Customer Info&rdquo;</strong> form of your site.',\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'woocommerce_settings',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'class' => ''\n )\n )\n );\n \n /* allow settings to be filtered before saving */\n $custom_settings = apply_filters( 'option_tree_settings_args', $custom_settings );\n \n /* settings are not the same update the DB */\n if ( $saved_settings !== $custom_settings ) {\n update_option( 'option_tree_settings', $custom_settings ); \n }\n \n}", "public function setup_theme()\n {\n }", "function gssettings_theme_options() {\n global $_gssettings_settings_pagehook;\n $_gssettings_settings_pagehook = add_submenu_page( 'genesis', 'Sandbox Settings', 'Sandbox Settings', 'edit_theme_options', GSSETTINGS_SETTINGS_FIELD, 'gssettings_theme_options_page' );\n \n //add_action( 'load-'.$_gssettings_settings_pagehook, 'gssettings_settings_styles' );\n add_action( 'load-'.$_gssettings_settings_pagehook, 'gssettings_settings_scripts' );\n add_action( 'load-'.$_gssettings_settings_pagehook, 'gssettings_settings_boxes' );\n }", "function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }", "function settingsCustomizeRegister($wp_customize)\n{\n\t$wp_customize->add_section(\n\t\t'settings_section',\n\t\tarray(\n\t\t\t'title' => 'Theme Settings',\n\t\t\t'description' => 'Edit the theme setings.',\n\t\t\t'priority' => 0,\n\t\t)\n\t);\n\t\n\t$wp_customize->add_setting(\n\t\t'google_maps_api_key',\n\t\tarray(\n\t\t\t'type' => 'option',\n\t\t)\n\t);\n\t\n\t$wp_customize->add_control(\n\t\t'google_maps_api_key',\n\t\tarray(\n\t\t\t'label' => 'Google Maps API Key',\n\t\t\t'section' => 'settings_section',\n\t\t\t'type' => 'text'\n\t\t)\n\t);\n\t\n\t$wp_customize->add_setting(\n\t\t'navbar_type',\n\t\tarray(\n\t\t\t'default' => 'Inline',\n\t\t\t'type' => 'option',\n\t\t)\n\t);\n\t\n\t$wp_customize->add_control(\n\t\t'navbar_type',\n\t\tarray(\n\t\t\t'label' => 'Navbar Type',\n\t\t\t'section' => 'settings_section',\n\t\t\t'type' => 'select',\n\t\t\t'choices' => array(\n\t\t\t\t'inline' => 'Inline',\n\t\t\t\t'layered' => 'Layered',\n\t\t\t\t'layered--centered' => 'Layered but Centered',\n\t\t\t\t'logo-center' => 'Layered with logo in center',\n\t\t\t)\n\t\t)\n\t);\n\n\t$wp_customize->add_setting(\n\t\t'facebook_url',\n\t\tarray(\n\t\t\t'type' => 'option',\n\t\t)\n\t);\n\t\n\t$wp_customize->add_control(\n\t\t'facebook_url',\n\t\tarray(\n\t\t\t'label' => 'Facebook Profile URL',\n\t\t\t'section' => 'settings_section',\n\t\t\t'type' => 'text'\n\t\t)\n\t);\n\n\t$wp_customize->add_setting(\n\t\t'twitter_url',\n\t\tarray(\n\t\t\t'type' => 'option',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'twitter_url',\n\t\tarray(\n\t\t\t'label' => 'Twitter Profile URL',\n\t\t\t'section' => 'settings_section',\n\t\t\t'type' => 'text'\n\t\t)\n\t);\n\n\t$wp_customize->add_setting(\n\t\t'instagram_url',\n\t\tarray(\n\t\t\t'type' => 'option',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'instagram_url',\n\t\tarray(\n\t\t\t'label' => 'Instagram Profile URL',\n\t\t\t'section' => 'settings_section',\n\t\t\t'type' => 'text'\n\t\t)\n\t);\n\n\t$wp_customize->add_setting(\n\t\t'github_url',\n\t\tarray(\n\t\t\t'type' => 'option',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'github_url',\n\t\tarray(\n\t\t\t'label' => 'Github Profile URL',\n\t\t\t'section' => 'settings_section',\n\t\t\t'type' => 'text'\n\t\t)\n\t);\n\n\t$wp_customize->add_setting(\n\t\t'linkedin_url',\n\t\tarray(\n\t\t\t'type' => 'option',\n\t\t)\n\t);\n\n\t$wp_customize->add_control(\n\t\t'linkedin_url',\n\t\tarray(\n\t\t\t'label' => 'LinkedIn Profile URL',\n\t\t\t'section' => 'settings_section',\n\t\t\t'type' => 'text'\n\t\t)\n\t);\n\n $wp_customize->add_setting(\n 'youtube_url',\n array(\n 'type' => 'option',\n )\n );\n\n $wp_customize->add_control(\n 'youtube_url',\n array(\n 'label' => 'Youtube Channel URL',\n 'section' => 'settings_section',\n 'type' => 'text'\n )\n );\n\n}", "public function addAdminPage() {\n\t\t\t// global $themename, $shortname, $options;\n\t\t\tif ( current_user_can( 'edit_theme_options' ) && isset( $_GET['page'] ) && $_GET['page'] == basename(__FILE__) ) {\n\t\t\t\tif ( ! empty( $_REQUEST['save-theme-options-nonce'] ) && wp_verify_nonce( $_REQUEST['save-theme-options-nonce'], 'save-theme-options' ) && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'save' ) {\n\t\t\t\t\tforeach ($this->options as $value) {\n\t\t\t\t\t\tif ( array_key_exists('id', $value) ) {\n\t\t\t\t\t\t\tif ( isset( $_REQUEST[ $value['id'] ] ) ) {\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tin_array(\n\t\t\t\t\t\t\t\t\t\t$value['id'],\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t$this->shortname.'_background_color',\n\t\t\t\t\t\t\t\t\t\t\t$this->shortname.'_hover_color',\n\t\t\t\t\t\t\t\t\t\t\t$this->shortname.'_link_color',\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\t$opt_value = preg_match( '/^#([a-zA-Z0-9]){3}$|([a-zA-Z0-9]){6}$/', trim( $_REQUEST[ $value['id'] ] ) ) ? trim( $_REQUEST[ $value['id'] ] ) : '';\n\t\t\t\t\t\t\t\t\tupdate_option( $value['id'], $opt_value );\n\t\t\t\t\t\t\t\t} elseif (\n\t\t\t\t\t\t\t\t\tin_array(\n\t\t\t\t\t\t\t\t\t\t$value['id'],\n\t\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\t$this->shortname.'_categories_to_exclude',\n\t\t\t\t\t\t\t\t\t\t\t$this->shortname.'_pages_to_exclude',\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\t$opt_value = implode(',', array_filter( array_map( 'intval', explode(',', $_REQUEST[ $value['id'] ] ) ) ) );\n\t\t\t\t\t\t\t\t\tupdate_option( $value['id'], $opt_value );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tupdate_option( $value['id'], stripslashes( $_REQUEST[ $value['id'] ] ) );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tdelete_option( $value['id'] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twp_redirect(\"themes.php?page=\".basename(__FILE__).\"&saved=true\");\n\t\t\t\t\texit;\n\t\t\t\t} else if ( ! empty( $_REQUEST['reset-theme-options-nonce'] ) && wp_verify_nonce( $_REQUEST['reset-theme-options-nonce'], 'reset-theme-options' ) && isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'reset' ) {\n\t\t\t\t\tforeach ($this->options as $value) {\n\t\t\t\t\t\tif ( array_key_exists('id', $value) ) {\n\t\t\t\t\t\t\tdelete_option( $value['id'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\twp_redirect(\"themes.php?page=\".basename(__FILE__).\"&reset=true\");\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tadd_theme_page(\n\t\t\t\t__( 'Theme Options' ),\n\t\t\t\t__( 'Theme Options' ),\n\t\t\t\t'edit_theme_options',\n\t\t\t\tbasename(__FILE__),\n\t\t\t\tarray(&$this, 'adminPage' )\n\t\t\t);\n\t\t}", "function gtpress_admin_menu() {\r\n\t$gtpress_ico = get_option('siteurl').'/wp-content/plugins/'.basename(dirname(__FILE__)).'/';\r\n\tadd_options_page('GT Press', 'GT Press Setup', 8, basename(__FILE__), 'gtpressMenu_options_page', '', $gtpress_ico.'gtpress.png');\r\n}", "function techfak_theme_options_init() {\n\tregister_setting(\n\t\t'techfak_options', // Options group, see settings_fields() call in theme_options_render_page()\n\t\t'techfak_theme_options', // Database option, see techfak_get_theme_options()\n\t\t'techfak_theme_options_validate' // The sanitization callback, see techfak_theme_options_validate()\n\t);\n}", "function cyberchimps_admin_add_customizer_page() {\n // add the Customize link to the admin menu\n add_theme_page( __( 'Customize', 'cyberchimps_core' ), __( 'Customize', 'cyberchimps_core' ), 'edit_theme_options', 'customize.php' );\n}", "function theme_add_admin_page() {\r\n\tadd_menu_page(\r\n\t\t'Theme Options', // page_title\r\n\t\t'Site Data', // menu_title\r\n\t\t'manage_options', // capability\r\n\t\t'vw-slug', // menu_slug\r\n\t\t'theme_create_admin_page', // function\r\n\t\t'dashicons-welcome-write-blog', // icon_url\r\n\t\t110 // position\r\n\t);\r\n\r\n\tadd_action( 'admin_init', 'theme_custom_settings' );\r\n}", "public function __construct() {\n\n\t\t\t// Call to admin page render function and register new settings \n\t\t\tif ( is_admin() ) {\t\n\t\t\t\tadd_action( 'admin_init', array( 'ELMT_theme_options', 'register_settings' ) );\n\t\t\t}\n\n\t\t}", "function admin_custom_style() {\n if ( ! current_user_can( 'manage_options' ) ) {\n echo '<style type=\"text/css\">\n #wp-admin-bar-wp-logo, #wp-admin-bar-updates, #wp-admin-bar-comments, #wp-admin-bar-new-content,\n #dashboard_right_now .b-tags, \n #dashboard_right_now .tags, \n #dashboard_right_now .b-comments, \n #dashboard_right_now .comments,#dashboard_right_now .b-posts, \n #dashboard_right_now .posts,\n #dashboard_right_now .table_discussion, \n #screen-meta-links, \n .plugin-version-author-uri, .plugin-update-tr, .update-plugins, .update-nag, \n #wp-version-message, \n #dashboard_right_now .main p {\n display:none;\n }\n </style>';\n }\n}", "function jm_create_menu(){\n\tadd_submenu_page('themes.php', 'Super Themer Options', 'Theme Options', 'manage_options', 'jm_settings_page', 'jm_settings_page');\n\tadd_action('admin_init', 'jm_register_settings');\n}", "function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}", "function ajb_options_add_page() {\n\tadd_theme_page( __( 'Homepage Options', 'ajb' ), __( 'Theme Options', 'ajb' ), ajb_get_options_page_cap(), 'ajb_options', 'ajb_options_do_page' );\n}", "public function init() {\n\t\t$this->add_options_page( 'Theme options' );\n\n\t\t$this->has(\n\t\t\t$this->build('theme_options', [\n\t\t\t\t'style' => 'seamless',\n\t\t\t])\n\t\t\t\t->addTab( 'General' )\n\t\t\t\t->addFields( $this->general_tab() )\n\t\t\t\t->addTab( 'Socials Links' )\n\t\t\t\t->addFields( $this->socials_tab() )\n\t\t\t\t->addTab( '404 Page' )\n\t\t\t\t->addFields( $this->page_404_tab() )\n\t\t\t\t->setLocation( 'options_page', '==', 'acf-options-theme-options' )\n\t\t);\n\t}", "function custom_theme_options() {\n\n /* OptionTree is not loaded yet, or this is not an admin request */\n if ( ! function_exists( 'ot_settings_id' ) || ! is_admin() )\n return false;\n\n /**\n * Get a copy of the saved settings array. \n */\n $saved_settings = get_option( ot_settings_id(), array() );\n \n /**\n * Custom settings array that will eventually be \n * passes to the OptionTree Settings API Class.\n */\n $custom_settings = array( \n \n\t\n 'sections' => array( \n\t array(\n 'id' => 'home_page_setting',\n 'title' => __( 'Home page setting', 'theme-text-domain' )\n ),\n array(\n 'id' => 'option_body',\n 'title' => __( 'Body Section', 'theme-text-domain' )\n ),\n\t array(\n 'id' => 'header_section',\n 'title' => __( 'Header Section', 'theme-text-domain' )\n ),\n\t array(\n 'id' => 'footer_section',\n 'title' => __( 'Footer Section', 'theme-text-domain' )\n ),\n\t array(\n 'id' => 'contact_info',\n 'title' => __( 'Contact Info', 'theme-text-domain' )\n )\n ),\n 'settings' => array( \n\t\t\t\n\t\t array(\n 'label' => __( 'Home Slider', 'theme-text-domain' ),\n 'id' => 'home_slider',\n 'type' => 'gallery',\n 'desc' => sprintf( __( 'This is a slider Picture option type. It displays when %s.', 'theme-text-domain' ), '<code>demo_show_gallery:is(on)</code>' ),\n 'section' => 'home_page_setting'\n ),\n\t\t array(\n 'id' => 'slider_on_off',\n 'label' => __( 'Slider On/Off', 'theme-text-domain' ),\n 'desc' => sprintf( __( 'The On/Off option type displays a simple switch that can be used to turn things on or off. The saved return value is either %s or %s.', 'theme-text-domain' ), '<code>on</code>', '<code>off</code>' ),\n 'std' => '',\n 'type' => 'on-off',\n 'section' => 'home_page_setting',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n\t \n \n\tarray(\n 'id' => 'fashion_typography',\n 'label' => __( 'Typography', 'theme-text-domain' ),\n 'desc' => sprintf( __( 'The Typography option type is for adding typography styles to your theme either dynamically via the CSS option type above or manually with %s. The Typography option type has filters that allow you to remove fields or change the defaults. For example, you can filter %s to remove unwanted fields from all Background options or an individual one. You can also filter %s. These filters allow you to fine tune the select lists for your specific needs.', 'theme-text-domain' ), '<code>ot_get_option()</code>', '<code>ot_recognized_typography_fields</code>', '<code>ot_recognized_font_families</code>, <code>ot_recognized_font_sizes</code>, <code>ot_recognized_font_styles</code>, <code>ot_recognized_font_variants</code>, <code>ot_recognized_font_weights</code>, <code>ot_recognized_letter_spacing</code>, <code>ot_recognized_line_heights</code>, <code>ot_recognized_text_decorations</code> ' . __( 'and', 'theme-text-domain' ) . ' <code>ot_recognized_text_transformations</code>' ),\n 'std' => '',\n 'type' => 'typography',\n 'section' => 'option_body',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n\t array(\n 'id' => 'header_logo',\n 'label' => __( 'Logo Upload', 'theme-text-domain' ),\n 'desc' => sprintf( __('You Should logo height 25px and width 135px') ),\n 'std' => '',\n 'type' => 'upload',\n 'section' => 'header_section'\n ),\n\t array(\n 'id' => 'header_text_color',\n 'label' => __( 'Header Text Color', 'theme-text-domain' ),\n 'desc' => sprintf( __('Header Text color under Logo') ),\n 'std' => '',\n 'type' => 'colorpicker',\n 'section' => 'header_section'\n ),\n\t \n\t \n array(\n 'id' => 'footer_social_links',\n 'label' => __( 'Social Links', 'theme-text-domain' ),\n 'desc' => '<p>' . sprintf( __( 'The Social Links option type utilizes a drag & drop interface to create a list of social links.', 'theme-text-domain' ) ) . '</p>',\n 'std' => '',\n 'type' => 'social-links',\n 'section' => 'footer_section',\n 'rows' => '',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n\t \n array(\n 'id' => 'footer_copyright_text',\n 'label' => __( 'Footer Copyright Text', 'theme-text-domain' ),\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'footer_section'\n ),\n\t \n array(\n 'id' => 'fashion_javascript',\n 'label' => __( 'JavaScript', 'theme-text-domain' ),\n 'desc' => '<p>' . sprintf( __( 'The JavaScript option type is a textarea that uses the %s code editor to highlight your JavaScript and display errors as you type.', 'theme-text-domain' ), '<code>ace.js</code>' ) . '</p>',\n 'std' => '',\n 'type' => 'javascript',\n 'section' => 'footer_section',\n 'rows' => '20',\n 'post_type' => '',\n 'taxonomy' => '',\n 'min_max_step'=> '',\n 'class' => '',\n 'condition' => '',\n 'operator' => 'and'\n ),\n\t array(\n 'id' => 'contact_email',\n 'label' => __( 'Contact Email', 'theme-text-domain' ),\n 'desc' =>__( 'Contact Email for Contact page' ),\n 'std' => '',\n 'type' => 'text',\n 'section' => 'contact_info'\n ),\n\t array(\n 'id' => 'contact_address',\n 'label' => __( 'Contact Address', 'theme-text-domain' ),\n 'desc' =>__( 'Contact Address for Contact page' ),\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'contact_info'\n ),\n\t array(\n 'id' => 'contact_phone',\n 'label' => __( 'Contact Phone', 'theme-text-domain' ),\n 'desc' =>__( 'Contact Phone for Contact page' ),\n 'std' => '',\n 'type' => 'text',\n 'section' => 'contact_info'\n ),\n\t \n\t array(\n 'id' => 'contact_googlemap',\n 'label' => __( 'Google Map', 'theme-text-domain' ),\n 'desc' =>__( 'please give iframe of google for your address. Go to https://www.google.com/maps/ and find the required location using the search tool in the top left corner. go Setting-> Share or Embed -> Open ‘Embed Map’ tab and copy the code and past this text area' ),\n 'std' => '',\n 'type' => 'textarea',\n 'section' => 'contact_info'\n ),\n\t \n\t array(\n 'id' => 'contact_title',\n 'label' => __( 'Contact body Title', 'theme-text-domain' ),\n 'desc' =>__( 'Contact body Title for Contact page' ),\n 'std' => '',\n 'type' => 'text',\n 'section' => 'contact_info'\n ),\n\t array(\n 'id' => 'contact_subtitle',\n 'label' => __( 'Contact Body Subtitle', 'theme-text-domain' ),\n 'desc' =>__( 'Contact Body Subtitle for Contact page' ),\n 'std' => '',\n 'type' => 'text',\n 'section' => 'contact_info'\n ),\n )\n\t\n );\n \n /* allow settings to be filtered before saving */\n $custom_settings = apply_filters( ot_settings_id() . '_args', $custom_settings );\n \n /* settings are not the same update the DB */\n if ( $saved_settings !== $custom_settings ) {\n update_option( ot_settings_id(), $custom_settings ); \n }\n \n /* Lets OptionTree know the UI Builder is being overridden */\n global $ot_has_custom_theme_options;\n $ot_has_custom_theme_options = true;\n \n}", "function blueauthentic_theme_settings() {\n\tadd_settings_section(\n\t\t'social_section',\n\t\t'Social Media Account Links/URLs',\n\t\t'blueauthentic_social_section_description',\n\t\t'theme-options-section-social'\n\t);\n\n\tadd_option( 'social_facebook_option', 1 );\n\tadd_settings_field(\n\t\t'social_facebook_option',\n\t\t'Facebook Account',\n\t\t'social_facebook_option_callback',\n\t\t'theme-options-section-social',\n\t\t'social_section'\n\t);\n\tregister_setting( 'theme-options-group-social', 'social_facebook_option' );\n\n\tadd_option( 'social_twitter_option', 2 );\n\tadd_settings_field(\n\t\t'social_twitter_option',\n\t\t'Twitter Account',\n\t\t'social_twitter_option_callback',\n\t\t'theme-options-section-social',\n\t\t'social_section'\n\t);\n\tregister_setting( 'theme-options-group-social', 'social_twitter_option' );\n\n\tadd_option( 'social_youtube_option', 3 );\n\tadd_settings_field(\n\t\t'social_youtube_option',\n\t\t'Youtube Account',\n\t\t'social_youtube_option_callback',\n\t\t'theme-options-section-social',\n\t\t'social_section'\n\t);\n\tregister_setting( 'theme-options-group-social', 'social_youtube_option' );\n}", "function install_themes_dashboard()\n {\n }", "function ba_options_page() {\n add_menu_page(\n 'ba Theme Options', // Page title\n 'Theme Options', // Menu title\n 'manage_options', // Capability\n 'ba_options', // Menu slug\n 'ba_options_page_html', // Display\n 'dashicons-format-video', // Icon\n 150\n );\n}", "public function add_global_custom_options()\n {\n add_options_page('Plugin options', 'Plugin options', 'manage_options', 'functions','global_custom_options');\n }", "public function setArguments() {\n\n $theme = wp_get_theme(); // For use with some settings. Not necessary.\n\n $this->args = array(\n // TYPICAL -> Change these values as you need/desire\n 'opt_name' => 'tb_options',\n // This is where your data is stored in the database and also becomes your global variable name.\n 'display_name' => $theme->get( 'Name' ),\n // Name that appears at the top of your panel\n 'display_version' => $theme->get( 'Version' ),\n // Version that appears at the top of your panel\n 'menu_type' => 'menu',\n //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)\n 'allow_sub_menu' => true,\n // Show the sections below the admin menu item or not\n 'menu_title' => __( 'Theme Options', 'slova' ),\n 'page_title' => __( 'Theme Options', 'slova' ),\n // You will need to generate a Google API key to use this feature.\n // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth\n 'google_api_key' => '',\n // Set it you want google fonts to update weekly. A google_api_key value is required.\n 'google_update_weekly' => false,\n // Must be defined to add google fonts to the typography module\n 'async_typography' => true,\n // Use a asynchronous font on the front end or font string\n //'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader\n 'admin_bar' => true,\n // Show the panel pages on the admin bar\n 'admin_bar_icon' => 'dashicons-portfolio',\n // Choose an icon for the admin bar menu\n 'admin_bar_priority' => 50,\n // Choose an priority for the admin bar menu\n 'global_variable' => '',\n // Set a different name for your global variable other than the opt_name\n 'dev_mode' => false,\n // Show the time the page took to load, etc\n 'update_notice' => false,\n // If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo\n 'customizer' => true,\n // Enable basic customizer support\n //'open_expanded' => true, // Allow you to start the panel in an expanded way initially.\n //'disable_save_warn' => true, // Disable the save warning when a user changes a field\n\n // OPTIONAL -> Give you extra features\n 'page_priority' => null,\n // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.\n 'page_parent' => 'themes.php',\n // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters\n 'page_permissions' => 'manage_options',\n // Permissions needed to access the options panel.\n 'menu_icon' => '',\n // Specify a custom URL to an icon\n 'last_tab' => '',\n // Force your panel to always open to a specific tab (by id)\n 'page_icon' => 'icon-themes',\n // Icon displayed in the admin panel next to your menu_title\n 'page_slug' => '_options',\n // Page slug used to denote the panel\n 'save_defaults' => true,\n // On load save the defaults to DB before user clicks save or not\n 'default_show' => false,\n // If true, shows the default value next to each field that is not the default value.\n 'default_mark' => '',\n // What to print by the field's title if the value shown is default. Suggested: *\n 'show_import_export' => true,\n // Shows the Import/Export panel when not used as a field.\n\n // CAREFUL -> These options are for advanced use only\n 'transient_time' => 60 * MINUTE_IN_SECONDS,\n 'output' => true,\n // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output\n 'output_tag' => true,\n // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head\n // 'footer_credit' => '', // Disable the footer credit of Redux. Please leave if you can help it.\n\n // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.\n 'database' => '',\n // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!\n 'system_info' => false,\n // REMOVE\n\n // HINTS\n 'hints' => array(\n 'icon' => 'icon-question-sign',\n 'icon_position' => 'right',\n 'icon_color' => 'lightgray',\n 'icon_size' => 'normal',\n 'tip_style' => array(\n 'color' => 'light',\n 'shadow' => true,\n 'rounded' => false,\n 'style' => '',\n ),\n 'tip_position' => array(\n 'my' => 'top left',\n 'at' => 'bottom right',\n ),\n 'tip_effect' => array(\n 'show' => array(\n 'effect' => 'slide',\n 'duration' => '500',\n 'event' => 'mouseover',\n ),\n 'hide' => array(\n 'effect' => 'slide',\n 'duration' => '500',\n 'event' => 'click mouseleave',\n ),\n ),\n )\n );\n\t\t\t\t\n // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons.\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Visit us on GitHub',\n 'icon' => 'el-icon-github'\n //'img' => '', // You can use icon OR img. IMG needs to be a full URL.\n );\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Like us on Facebook',\n 'icon' => 'el-icon-facebook'\n );\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Follow us on Twitter',\n 'icon' => 'el-icon-twitter'\n );\n $this->args['share_icons'][] = array(\n 'url' => '#',\n 'title' => 'Find us on LinkedIn',\n 'icon' => 'el-icon-linkedin'\n );\n }", "function splashgate_admin_init(){\n\t\t\tregister_setting(\tSPLASHGATE_SETTINGS_GROUP, 'splashgate_options' ); // 'options' will be an array holding everything\n\t\t}", "function mp_theme_bundle_theme_activation_one() {\n\n\tglobal $mp_core_options;\n\n\t$mp_core_options['mp_theme_bundle_activation_set_up_plugin'] = true;\n\n\tupdate_option( 'mp_core_options', $mp_core_options );\n\n}", "function theme_options_init(){\n\tregister_setting( 'sample_options', 'site_description', 'theme_options_validate' );\n\tregister_setting( 'ga_options', 'ga_account', 'ga_validate' );\n\tadd_filter('site_description', 'stripslashes');\n}", "function ind_after_setup_theme() {\r\n\tif ( ! is_admin() ) {\r\n\t\t// We're not on an admin page.\r\n\t\tshow_admin_bar( current_user_can( 'admin_toolbar' ) );\r\n\t}\r\n}", "function admin_menu(){\r\n //$level = 'manage-options'; // for wpmu sub blog admins\r\n $level = 'administrator'; // for single blog intalls\r\n $this->hook = add_options_page ( 'TwitterLink Settings', 'TwitterLink Settings', $level, $this->slug, array (&$this, 'options_page' ) );\r\n // load meta box script handlers\r\n add_action ('load-'.$this->hook, array(&$this,'queue_options_page_scripts'));\r\n }", "function tsc_theme_options_page() {\n\tglobal $sa_options, $sa_categories, $sa_layouts;\n\n\tif ( ! isset( $_REQUEST['updated'] ) )\n\t\t$_REQUEST['updated'] = false; // This checks whether the form has just been submitted. ?>\n\n\t<div class=\"wrap\">\n\n\t<?php screen_icon(); echo \"<h2>\" . get_current_theme() . __( ' Theme Options' ) . \"</h2>\";\n\t// This shows the page's name and an icon if one has been provided ?>\n\n\t<?php if ( false !== $_REQUEST['updated'] ) : ?>\n\t<div class=\"updated fade\"><p><strong><?php _e( 'Options saved' ); ?></strong></p></div>\n\t<?php endif; // If the form has just been submitted, this shows the notification ?>\n\n\t<form method=\"post\" action=\"options.php\">\n\n\t<?php $settings = get_option( 'sa_options', $sa_options ); ?>\n\t\n\t<?php settings_fields( 'tsc_theme_options' );\n\t/* This function outputs some hidden fields required by the form,\n\tincluding a nonce, a unique number used to ensure the form has been submitted from the admin page\n\tand not somewhere else, very important for security */ ?>\n\t<div ><?php settings_errors(); ?></div>\n\t<div class=\"tsc-tabs\">\n <ul>\n <li><a href=\"#tabs-1\">General</a></li>\n <li><a href=\"#tabs-2\">Adds and Tracking</a></li>\n <li><a href=\"#tabs-3\">Aenean lacinia</a></li><li><i class=\"submit\"><input type=\"submit\" class=\"button-primary\" value=\"Save Options\" /></i></li>\n </ul>\n <div id=\"tabs-1\">\n \n <?php include(\"general.php\"); ?> \n </div>\n <div id=\"tabs-2\">\n <?php include(\"analytics.php\"); ?> \n </div>\n <div id=\"tabs-3\">\n <?php //include(\"analytics.php\"); ?> \n </div>\n </div>\n \n\n\n\t\n\t<p class=\"submit\"><input type=\"submit\" class=\"button-primary\" value=\"Save Options\" /></p>\n\n\t</form>\n\n\t</div>\n\n\t<?php\n}", "function optionsframework_option_name() {\n return 'options-framework-theme-sample5';\n}", "function add_theme_options_menu( $data ) {\n\t\t\n\t\tadd_menu_page(\n\t\t\tesc_html__( 'Website Settings', 'cyberintellige' ),\n\t\t\tesc_html__( 'Website Settings', 'cyberintellige' ),\n\t\t\t$data['capability'],\n\t\t\t$data['slug'],\n\t\t\t$data['content_callback']\n\t\t);\n\t\t\n\t}", "function hms_mav_customize_register( $wp_customize ) {\n\n $user = wp_get_current_user();\n $allowed_roles = array( 'administrator', );\n \n if( array_intersect($allowed_roles, $user->roles ) ) { \n \n $wp_customize->add_section( 'hms_custom_section', array(\n 'title' => __( 'HMS Options' ),\n 'description' => __( '' ),\n 'priority' => 20,\n 'capability' => 'edit_theme_options',\n ) );\n\n $wp_customize->add_section( 'hms_gutenberg_section', array(\n 'title' => __( 'Gutenberg Editor Pallette' ),\n 'description' => __( 'These colors will be utilized in the Gutenberg Editor only. Sass files and css will need to be updated if you change color values.' ),\n 'priority' => 30,\n 'capability' => 'edit_theme_options',\n ) );\n\n $wp_customize->add_section( 'hms_footer_section', array(\n 'title' => __( 'Footer Options' ),\n 'description' => __( '' ),\n 'priority' => 120,\n 'capability' => 'edit_theme_options',\n ) );\n\n /**\n * Enqueue Font Awesome\n */\n $wp_customize->add_setting( 'hms_enqueue_fa', array(\n 'default' => false,\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n $wp_customize->add_control( 'hms_enqueue_fa', array(\n 'type' => 'checkbox',\n 'section' => 'hms_custom_section', // Required, core or custom.\n 'label' => __( 'Enqueue Font Awesome' ),\n 'description' => __( 'Enabling this option will enqeue the Font Awesome icon library 4.7.' ),\n 'input_attrs' => array(\n 'placeholder' => __( '' ),\n ),\n\n ) );\n\n /**\n * Remove Twenty Seventeen Font Library\n */\n $wp_customize->add_setting( 'hms_deregister_twentyseventeen_fonts', array(\n 'default' => false,\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n $wp_customize->add_control( 'hms_deregister_twentyseventeen_fonts', array(\n 'type' => 'checkbox',\n 'section' => 'hms_custom_section', // Required, core or custom.\n 'label' => __( 'Remove Twenty Seventeen Fonts' ),\n 'description' => __( 'Enabling this option will deregister default fonts used in twentyseventeen. This is recommend if using a custom font library.' ),\n 'input_attrs' => array(\n 'placeholder' => __( '' ),\n ),\n ) );\n\n /**\n * Enqueue Scroll Animation Jquery\n */\n $wp_customize->add_setting( 'hms_enqueue_scroll_animation', array(\n 'default' => false,\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control( 'hms_enqueue_scroll_animation', array(\n 'type' => 'checkbox',\n 'section' => 'hms_custom_section', // Required, core or custom.\n 'label' => __( 'Enqueue Scroll Animation' ),\n 'description' => __( 'Enabling this option will enqueue jQuery 2.2.4 library for custom scrolling animations.' ),\n 'input_attrs' => array(\n 'class' => 'my-custom-class-for-js',\n 'style' => 'border: 1px solid #900',\n 'placeholder' => __( '' ),\n ),\n ) );\n\n /**\n * Remove Emoji Support\n */\n $wp_customize->add_setting( 'hms_emoji_disable', array(\n 'default' => true,\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n\n $wp_customize->add_control( 'hms_emoji_disable', array(\n 'type' => 'checkbox',\n 'section' => 'hms_custom_section', // Required, core or custom.\n 'label' => __( 'Disable WP Emojis' ),\n 'description' => __( 'Enabling this remove emoji support and slightly provide a slight speed increase.' ),\n 'input_attrs' => array(\n 'class' => 'my-custom-class-for-js',\n 'style' => 'border: 1px solid #900',\n 'placeholder' => __( '' ),\n ),\n ) );\n\n /**\n * Enqueue a Google Font\n */\n $wp_customize->add_setting( 'hms_gfont_enqueue', array(\n 'default' => '',\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n\n $wp_customize->add_control( 'hms_gfont_enqueue', array(\n 'type' => 'text',\n 'section' => 'hms_custom_section', // Required, core or custom.\n 'label' => __( 'Google Fonts URL' ),\n 'description' => __( 'Override the default font family by enqueueing your own. <italic>You will need to update styling once you add your font.</italic>' ),\n 'input_attrs' => array(\n 'class' => 'my-custom-class-for-js',\n 'placeholder' => __( '' ),\n ),\n ) );\n\n /**\n * Add Experimental Speed Features\n */\n $wp_customize->add_setting( 'hms_twentyseventeen_minifier', array(\n 'default' => false,\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n $wp_customize->add_control( 'hms_twentyseventeen_minifier', array(\n 'type' => 'checkbox',\n 'section' => 'hms_custom_section', // Required, core or custom.\n 'label' => __( 'Use Minfied Parent Theme Files (EXPERIMENTAL)' ),\n 'description' => __( 'This functionality replaces uniminified files the twentyseventeen theme with minified versions stored in the child theme. <italic>NOTE: Test before using!</italic>' ),\n 'input_attrs' => array(\n 'placeholder' => __( '' ),\n ),\n ) );\n\n /**\n * Add Experimental Speed Features\n */\n $wp_customize->add_setting( 'hms_replace_wp_jquery', array(\n 'default' => false,\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n $wp_customize->add_control( 'hms_replace_wp_jquery', array(\n 'type' => 'checkbox',\n 'section' => 'hms_custom_section', // Required, core or custom.\n 'label' => __( 'Replace default jQuery with Google Library.' ),\n 'description' => __( 'This feature could break functionality on your site. Test before using!' ),\n 'input_attrs' => array(\n 'placeholder' => __( '' ),\n ),\n ) );\n\n /**\n * Gutenberg Color Options\n */\n\n // Color 1\n $wp_customize->add_setting( 'hms_gutenberg_color_1', array(\n 'default' => '#00274c',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n\n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_1', // Not sure what this value is?\n array(\n 'label' => __( 'Color 1', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_1',\n ) ) \n );\n\n // Color 1\n $wp_customize->add_setting( 'hms_gutenberg_color_1', array(\n 'default' => '#0057a8',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_1', // Not sure what this value is?\n array(\n 'label' => __( 'Color 1', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_1',\n ) ) \n );\n\n // Color 2\n $wp_customize->add_setting( 'hms_gutenberg_color_2', array(\n 'default' => '#004585',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_2', // Not sure what this value is?\n array(\n 'label' => __( 'Color 2', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_2',\n ) ) \n );\n\n // Color 3\n $wp_customize->add_setting( 'hms_gutenberg_color_3', array(\n 'default' => '#59cbe8',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_3', // Not sure what this value is?\n array(\n 'label' => __( 'Color 3', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_3',\n ) ) \n );\n\n // Color 3\n $wp_customize->add_setting( 'hms_gutenberg_color_4', array(\n 'default' => '#ff9900',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_4', // Not sure what this value is?\n array(\n 'label' => __( 'Color 4', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_4',\n ) ) \n );\n\n // Color 5\n $wp_customize->add_setting( 'hms_gutenberg_color_5', array(\n 'default' => '#614c98',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_5', // Not sure what this value is?\n array(\n 'label' => __( 'Color 5', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_5',\n ) ) \n );\n\n // Color 6\n $wp_customize->add_setting( 'hms_gutenberg_color_6', array(\n 'default' => '',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_6', // Not sure what this value is?\n array(\n 'label' => __( 'Color 6', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_6',\n ) ) \n );\n\n // Color 7\n $wp_customize->add_setting( 'hms_gutenberg_color_7', array(\n 'default' => '',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_7', // Not sure what this value is?\n array(\n 'label' => __( 'Color 7', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_7',\n ) ) \n );\n\n // Color 8\n $wp_customize->add_setting( 'hms_gutenberg_color_8', array(\n 'default' => '',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_8', // Not sure what this value is?\n array(\n 'label' => __( 'Color 8', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_8',\n ) ) \n );\n\n // Color 9\n $wp_customize->add_setting( 'hms_gutenberg_color_9', array(\n 'default' => '',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_9', // Not sure what this value is?\n array(\n 'label' => __( 'Color 9', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_9',\n ) ) \n );\n\n // Color 10\n $wp_customize->add_setting( 'hms_gutenberg_color_10', array(\n 'default' => '',\n 'sanitize_callback' => 'sanitize_hex_color',\n 'transport' => 'postMessage',\n ) );\n \n $wp_customize->add_control(\n new WP_Customize_Color_Control( \n $wp_customize, \n 'g_color_10', // Not sure what this value is?\n array(\n 'label' => __( 'Color 10', 'hms-maverick' ),\n 'section' => 'hms_gutenberg_section',\n 'settings' => 'hms_gutenberg_color_10',\n ) ) \n );\n\n\n /**\n * Enqueue Font Awesome\n */\n //$default_footer_credits = '&copy;' . date('Y') . ' ' . get_bloginfo('title');\n\n $wp_customize->add_setting( 'hms_footer_credits', array(\n 'default' => 'This is a default',\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n $wp_customize->add_control( 'hms_footer_credits', array(\n 'type' => 'textarea',\n 'section' => 'hms_footer_section', // Required, core or custom.\n 'label' => __( 'Site Footer Credits' ),\n 'description' => __( 'Add a business information to the footer.' ),\n 'input_attrs' => array(\n 'class' => 'credits',\n 'placeholder' => __( '' ),\n ),\n\n ) );\n\n /**\n * Auto Year Copyright\n */\n $wp_customize->add_setting( 'hms_auto_copyright', array(\n 'default' => true,\n 'sanitize_callback' => '',\n 'transport' => 'postMessage',\n ) );\n\n\n $wp_customize->add_control( 'hms_auto_copyright', array(\n 'type' => 'checkbox',\n 'section' => 'hms_footer_section', // Required, core or custom.\n 'label' => __( 'Site Title with Copyright' ),\n 'description' => __( 'This option will prepend your footer credits with a copyright and site title.' ),\n 'input_attrs' => array(\n 'class' => 'my-custom-class-for-js',\n 'placeholder' => __( '' ),\n ),\n ) );\n }\n}", "function optionsframework_option_name() {\n $optionsframework_settings = get_option( 'optionsframework' );\n $optionsframework_settings[\"id\"] = 'options_wpex_themes';\n update_option( 'optionsframework', $optionsframework_settings );\n}", "function set_theme_option($optionName, $optionValue, $themeName = null)\n{\n if (!$themeName) {\n $themeName = Theme::getCurrentThemeName('public');\n }\n Theme::setOption($themeName, $optionName, $optionValue);\n}", "function settings_menu() {\n#\tregister_js(HD_PLUGIN_URL.'production/production.js',100);\n\thd_user_menu('System', 'admin_users','settings_gui', 55);\n}", "function add_settings_page() {\n\tadd_menu_page( __( 'Theme Options' ), __( 'Theme Options' ), 'manage_options', 'settings', 'theme_settings_page');\n}", "function remi_add_admin_page()\n{\n // generate remi admin page\n add_menu_page('Remi Theme Options','Remi','manage_options','Adekunle_remi','remi_theme_create_page',get_template_directory_uri() . '/image/remi_icon_icon.ico', '110' );\n\n // genere remi admin sub pages\n add_submenu_page( 'Adekunle_remi', 'Remi Theme Options', 'General', 'manage_options', 'Adekunle_remi','remi_theme_create_page' );\n\n add_submenu_page( 'Adekunle_remi', 'Remi Contact Options', 'Contact Options', 'manage_options', 'Adekunle_remi_contact','remi_theme_contact_page' );\n\n //Activate custom settings\n add_action( 'admin_init', 'remi_custom_settings' );\n}", "function jn_admin_menu() {\n add_submenu_page('themes.php', 'Theme Settings', 'Theme Settings', 'manage_options', 'theme_settings', 'theme_settings_page');\n}", "function omfg_mobile_pro_theme_select_script() {\n\t\n\tglobal $current_screen;\n\t\t\n\tif( $current_screen->post_type == 'omfg-mobile-pro' ) {\n\n\t\twp_register_script('omfg-mobile-pro-admin', OMFGMOBILEPRO . 'js/omfg-mobile-pro-admin.js', 'jquery');\n\t\twp_enqueue_script('omfg-mobile-pro-admin');\n\n\t}\n}", "function load_plugin() {\n global $fb_opt_name, $gp_opt_name, $popup_fb_page, $popup_delay, $fb_popup_box;\n \n if(is_admin()&& get_option('Activated_Plugin')=='Plugin-Slug') {\n delete_option('Activated_Plugin');\n add_option($fb_opt_name,'on');\n add_option($gp_opt_name,'on');\n add_option($popup_fb_page,'codesamplez');\n add_option($popup_delay,'2');\n add_option($fb_popup_box,'on');\n }\n}", "function wp_using_themes()\n {\n }", "function template_options()\n{\n\tglobal $context, $settings, $options, $scripturl, $txt;\n\n\t$context['theme_options'] = array(\n\t\tarray(\n\t\t\t'id' => 'show_board_desc',\n\t\t\t'label' => $txt['board_desc_inside'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_children',\n\t\t\t'label' => $txt['show_children'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'use_sidebar_menu',\n\t\t\t'label' => $txt['use_sidebar_menu'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_avatars',\n\t\t\t'label' => $txt['show_no_avatars'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_signatures',\n\t\t\t'label' => $txt['show_no_signatures'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'show_no_censored',\n\t\t\t'label' => $txt['show_no_censored'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'return_to_post',\n\t\t\t'label' => $txt['return_to_post'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'no_new_reply_warning',\n\t\t\t'label' => $txt['no_new_reply_warning'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_first',\n\t\t\t'label' => $txt['recent_posts_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'view_newest_pm_first',\n\t\t\t'label' => $txt['recent_pms_at_top'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'posts_apply_ignore_list',\n\t\t\t'label' => $txt['posts_apply_ignore_list'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'wysiwyg_default',\n\t\t\t'label' => $txt['wysiwyg_default'],\n\t\t\t'default' => false,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'popup_messages',\n\t\t\t'label' => $txt['popup_messages'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'copy_to_outbox',\n\t\t\t'label' => $txt['copy_to_outbox'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'pm_remove_inbox_label',\n\t\t\t'label' => $txt['pm_remove_inbox_label'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'auto_notify',\n\t\t\t'label' => $txt['auto_notify'],\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'topics_per_page',\n\t\t\t'label' => $txt['topics_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'messages_per_page',\n\t\t\t'label' => $txt['messages_per_page'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['per_page_default'],\n\t\t\t\t5 => 5,\n\t\t\t\t10 => 10,\n\t\t\t\t25 => 25,\n\t\t\t\t50 => 50,\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'calendar_start_day',\n\t\t\t'label' => $txt['calendar_start_day'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['days'][0],\n\t\t\t\t1 => $txt['days'][1],\n\t\t\t\t6 => $txt['days'][6],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_reply',\n\t\t\t'label' => $txt['display_quick_reply'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_reply1'],\n\t\t\t\t1 => $txt['display_quick_reply2'],\n\t\t\t\t2 => $txt['display_quick_reply3']\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t\tarray(\n\t\t\t'id' => 'display_quick_mod',\n\t\t\t'label' => $txt['display_quick_mod'],\n\t\t\t'options' => array(\n\t\t\t\t0 => $txt['display_quick_mod_none'],\n\t\t\t\t1 => $txt['display_quick_mod_check'],\n\t\t\t\t2 => $txt['display_quick_mod_image'],\n\t\t\t),\n\t\t\t'default' => true,\n\t\t),\n\t);\n}", "function faculty_settings_global() {\n faculty_setting_line(sprintf(__('Start by customizing your <a href=\"%s\">background</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-background')));\n faculty_setting_line(faculty_add_color_setting('body_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('body_font_family', __('Font', FACULTY_DOMAIN), 'family'));\n faculty_setting_line(faculty_add_size_setting('body_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('body_line_height', __('Line Height', FACULTY_DOMAIN)));\n do_action('faculty_settings_global');\n faculty_setting_line(faculty_add_note(__('All fonts listed are considered web-safe', FACULTY_DOMAIN)));\n}", "function purity_theme_init() {\n elgg_extend_view('page/elements/head', 'purity_theme/meta');\n elgg_unregister_menu_item('topbar', 'elgg_logo');\n\telgg_register_plugin_hook_handler('index', 'system', 'purity_theme');\n}", "function spreadshop_admin(){\nif ( !current_user_can( 'manage_options' ) ) {\n\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t}\n\tinclude(plugin_dir_path(__FILE__).'/spreadoptions.php');\n\t\n}", "function wp_lbb_social_admin_menu() {\n\tadd_options_page('Wp Lbb Social','Wp Lbb Social','manage_options','wp-lbb-social-options','wp_lbb_social_settings_page' );\n}", "public function theme_installer()\n {\n }", "function restrict_users_from_changeing_admin_theme () {\n\t$users = get_users();\n\tforeach ($users as $user) {\n\t\tremove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );\n\t\tupdate_user_meta($user->ID, 'admin_color', 'brightlight');\n\t}\n\tif (!current_user_can('manage_options')) {\n\t\tremove_action('admin_color_scheme_picker','admin_color_scheme_picker');\n\t}\n}", "function activate()\n {\n $aData = array( 'SIZE_AVATAR' => 50,\n 'NUMERO_POST' => 5 );\n\n // Comprobamos si existe opciones para este Widget, si no existe las creamos por el contrario actualizamos\n if( ! get_option( 'ultimosPostPorAutor' ) )\n add_option( 'ultimosPostPorAutor' , $aData );\n else\n update_option( 'ultimosPostPorAutor' , $data);\n }", "function cg_activate() {\n\tadd_option('cg-option_3', 'any_value');\n}", "public function composerSettings() {\n\n if ( current_user_can('manage_options') && $this->composer->isPlugin()) {\n //add_options_page(__(\"Swift Page Builder Settings\", \"js_composer\"), __(\"Swift Page Builder\", \"js_composer\"), 'install_plugins', \"wpb_vc_settings\", array($this, \"composerSettingsMenuHTML\"));\n }\n }", "function wpcr_stc_admin_init(){\n\t$options = get_option('wpcr_options');\n\t$tw = wpcr_stc_get_credentials(true);\n\tif(@$options['autotweet_name'] != @$tw->screen_name && !empty($tw->screen_name)){\n\t\t$options['autotweet_name'] = @$tw->screen_name;\n\t\tupdate_option('wpcr_options', $options);\n\t}\n\n\tif (empty($options['twitter_ckey']) || empty($options['twitter_csecret']) || empty($options['autotweet_name'])) {\n\t\t//add_action('admin_notices', create_function( '', \"echo '<div class=\\\"error\\\"><p>\".sprintf('Flowline Customer Reviews - Twitter Connect needs configuration information on its <a href=\"%s\">settings</a> page.', admin_url('options-general.php?page=wpcr_options')).\"</p></div>';\" ) );\n\t}\n\twp_enqueue_script('jquery');\n}", "public function setArguments() {\n\n $theme = wp_get_theme(); // For use with some settings. Not necessary.\n\n $this->args = array(\n // TYPICAL -> Change these values as you need/desire\n 'opt_name' => 'neattheme', // This is where your data is stored in the database and also becomes your global variable name.\n 'display_name' => $theme->get('Name'), // Name that appears at the top of your panel\n 'display_version' => $theme->get('Version'), // Version that appears at the top of your panel\n 'menu_type' => 'submenu', //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only)\n 'allow_sub_menu' => true, // Show the sections below the admin menu item or not\n 'menu_title' => __('Theme Options', 'neat'),\n 'page' => __('Theme Options', 'neat'),\n // You will need to generate a Google API key to use this feature.\n // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth\n 'google_api_key' => '', // Must be defined to add google fonts to the typography module\n 'async_typography' => true,\n //'admin_bar' => false, // Show the panel pages on the admin bar\n 'global_variable' => '', // Set a different name for your global variable other than the opt_name\n 'dev_mode' => false, // Show the time the page took to load, etc\n 'customizer' => true, // Enable basic customizer support\n // OPTIONAL -> Give you extra features\n 'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning.\n 'page_parent' => 'themes.php', // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters\n 'page_permissions' => 'manage_options', // Permissions needed to access the options panel.\n 'menu_icon' => '', // Specify a custom URL to an icon\n 'last_tab' => '', // Force your panel to always open to a specific tab (by id)\n 'page_icon' => 'icon-themes', // Icon displayed in the admin panel next to your menu_title\n 'page_slug' => '_options', // Page slug used to denote the panel\n 'save_defaults' => true, // On load save the defaults to DB before user clicks save or not\n 'default_show' => false, // If true, shows the default value next to each field that is not the default value.\n 'default_mark' => '', // What to print by the field's title if the value shown is default. Suggested: *\n // CAREFUL -> These options are for advanced use only\n 'transient_time' => 60 * MINUTE_IN_SECONDS,\n 'output' => true, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output\n 'output_tag' => true, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head\n //'domain' \t=> 'redux-framework', // Translation domain key. Don't change this unless you want to retranslate all of Redux.\n //'footer_credit' \t=> '', // Disable the footer credit of Redux. Please leave if you can help it.\n // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk.\n 'database' => '', // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning!\n 'show_import_export' => true, // REMOVE\n 'system_info' => false, // REMOVE\n 'help_tabs' => array(),\n 'help_sidebar' => '', // __( '', $this->args['domain'] ); \n );\n $this->args['share_icons'][] = array(\n 'url' => 'https://twitter.com/marstheme',\n 'title' => 'Follow us on Twitter',\n 'icon' => 'el-icon-twitter'\n );\n // Panel Intro text -> before the form\n if (!isset($this->args['global_variable']) || $this->args['global_variable'] !== false) {\n if (!empty($this->args['global_variable'])) {\n $v = $this->args['global_variable'];\n } else {\n $v = str_replace(\"-\", \"_\", $this->args['opt_name']);\n }\n $this->args['intro_text'] = sprintf(__('<p>Did you know that Redux sets a global variable for you? To access any of your saved options from within your code you can use your global variable: <strong>$%1$s</strong></p>', 'neat'), $v);\n } else {\n $this->args['intro_text'] = __('<p>This text is displayed above the options panel. It isn\\'t required, but more info is always better! The intro_text field accepts all HTML.</p>', 'neat');\n }\n\n // Add content after the form.\n //$this->args['footer_text'] = __('<p>This text is displayed below the options panel. It isn\\'t required, but more info is always better! The footer_text field accepts all HTML.</p>', 'neat');\n }", "function optionsframework_option_name() {\r\n\r\n\t// This gets the theme name from the stylesheet\r\n\t$themename = wp_get_theme();\r\n\t$themename = preg_replace(\"/\\W/\", \"_\", strtolower( $themename ) );\r\n\r\n\t$optionsframework_settings = get_option( 'optionsframework' );\r\n\t$optionsframework_settings['id'] = $themename;\r\n\tupdate_option( 'optionsframework', $optionsframework_settings );\r\n\r\n}", "function options() {\n wp_enqueue_style('adminstyles', plugins_url('css/admin-options.css', __FILE__));\n if (version_compare(get_bloginfo('version'), '3.3', '<')) {\n wp_head();\n }\n $buttonOptions = $this->_followOptions->getButtonOptions();\n $style = $this->_followOptions->getDefaultStyle();\n $title = $this->_followOptions->getDefaultTitle();\n\n $commonFollowOptions = get_option('addthis_follow_settings');\n $followWidgetOptions = get_option('widget_addthis-follow-widget');\n /**\n * Restore from widget settings if possible\n */\n if (($commonFollowOptions == false || empty($commonFollowOptions)) && $followWidgetOptions != false) {\n foreach ($followWidgetOptions as $key => $list) {\n if (is_int($key) && is_array($list)) {\n merge_options($list, $buttonOptions, $title, $style);\n }\n }\n $restoreOptions = array('title' => $title, 'style' => $style);\n foreach($buttonOptions as $key => $value) {\n $restoreOptions[$key] = $value['placeholder'];\n }\n add_option('addthis_follow_settings', $restoreOptions);\n } elseif ($commonFollowOptions != false && !empty($commonFollowOptions)) {\n /**\n * Follow options already exists, just update it\n */\n merge_options($commonFollowOptions, $buttonOptions, $title, $style);\n }\n\n $this->displayOptionsForm($buttonOptions, $style, $title);\n }", "function spnin_activate(){\n if(version_compare(get_bloginfo('version'),'4.2','<')){\n wp_die(__('you must have a minimum version of 4.2 use this theme'));\n }else{\n echo \"called the spnin_activate function \";\n }\n\n$theme_opts = get_option('spnin_opts');\nif(!$theme_opts){\n $opts = array(\n 'facebook' =>'',\n 'twitter' =>'',\n 'youtube' =>'',\n 'logotype' =>1,\n 'logo_img' =>'',\n 'footer' =>''\n );\n\n add_option('spnin_opts',$opts);\n\n}\n\n}", "function TencentMicroblogPage() {\r\n\tadd_options_page('腾讯微博插件', '腾讯微博插件', 'manage_options','WTM-options', 'TencentMicroblog_options_page');\r\n}", "function theme_options_page() { \n?> \n<div>\n <h1>Options du thème</h1>\n <form action=\"options.php\" method=\"post\">\n <?php settings_fields('theme_options'); // sécurisation de la transaction ?>\n <?php do_settings_sections('options_theme'); // section des champs input ?>\n \n <input name=\"Submit\" type=\"submit\" value=\"<?php esc_attr_e('Enregistrer'); ?>\" />\n </form>\n</div>\n<?php \n}", "function optionsframework_option_name() {\n\n\t$optionsframework_settings = get_option(\"optionsframework\");\n\n\t// Edit 'options-theme-customizer' and set your own theme name instead\n\t$optionsframework_settings[\"id\"] = \"wp-maintenance\";\n\tupdate_option(\"optionsframework\", $optionsframework_settings);\n}" ]
[ "0.82513016", "0.77239287", "0.75141424", "0.7497059", "0.73338497", "0.72287863", "0.71937156", "0.71146613", "0.7084322", "0.70411", "0.69942826", "0.6983187", "0.6969877", "0.69619626", "0.6918007", "0.6892931", "0.6883487", "0.6881056", "0.6850881", "0.6848199", "0.6845609", "0.6841148", "0.6837373", "0.68355376", "0.68335736", "0.683334", "0.683334", "0.6804173", "0.67934126", "0.6781285", "0.67434186", "0.67425656", "0.67370975", "0.67364395", "0.67356706", "0.6731651", "0.67243886", "0.6682671", "0.6661084", "0.6649717", "0.6643911", "0.6642159", "0.6639417", "0.6622408", "0.66183925", "0.66139716", "0.6605098", "0.6603628", "0.66017574", "0.6597401", "0.6596383", "0.6586161", "0.65810746", "0.65767646", "0.65713507", "0.65692604", "0.6565651", "0.6557655", "0.65570676", "0.65560484", "0.6554449", "0.6546865", "0.6546246", "0.65455925", "0.6536463", "0.6534787", "0.65255016", "0.65227836", "0.6518415", "0.6516466", "0.64927006", "0.6470748", "0.6468441", "0.64676124", "0.6454382", "0.64532506", "0.64355224", "0.6432978", "0.64320016", "0.64273745", "0.64265513", "0.6419813", "0.64196426", "0.641708", "0.64170355", "0.6410395", "0.6409259", "0.64052236", "0.6402364", "0.6396518", "0.63945174", "0.6389365", "0.6386373", "0.6380878", "0.63793373", "0.63784885", "0.63773483", "0.6376023", "0.63748336", "0.6367422" ]
0.7491769
4
Function to register the settings
function pu_register_settings() { // Register the settings with Validation callback register_setting('pu_theme_options', 'pu_theme_options'); // Add settings section add_settings_section('pu_text_section', 'Social Links', 'pu_display_section', 'pu_theme_options.php'); // Create textbox field $field_args = array( 'type' => 'text', 'id' => 'twitter_link', 'name' => 'twitter_link', 'desc' => 'Twitter Link - Example: http://twitter.com/username', 'std' => '', 'label_for' => 'twitter_link', 'class' => 'css_class' ); // Add twitter field add_settings_field('twitter_link', 'Twitter', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args); $field_args = array( 'type' => 'text', 'id' => 'facebook_link', 'name' => 'facebook_link', 'desc' => 'Facebook Link - Example: http://facebook.com/username', 'std' => '', 'label_for' => 'facebook_link', 'class' => 'css_class' ); // Add facebook field add_settings_field('facebook_link', 'Facebook', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args); $field_args = array( 'type' => 'text', 'id' => 'gplus_link', 'name' => 'gplus_link', 'desc' => 'Google+ Link - Example: http://plus.google.com/user_id', 'std' => '', 'label_for' => 'gplus_link', 'class' => 'css_class' ); // Add Google+ field add_settings_field('gplus_link', 'Google+', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args); $field_args = array( 'type' => 'text', 'id' => 'youtube_link', 'name' => 'youtube_link', 'desc' => 'Youtube Link - Example: https://www.youtube.com/channel/channel_id', 'std' => '', 'label_for' => 'youtube_link', 'class' => 'css_class' ); // Add youtube field add_settings_field('youtube_ink', 'Youtube', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args); $field_args = array( 'type' => 'text', 'id' => 'linkedin-square_link', 'name' => 'linkedin-square_link', 'desc' => 'LinkedIn Link - Example: http://linkedin-square.com/in/username', 'std' => '', 'label_for' => 'linkedin-square_link', 'class' => 'css_class' ); // Add LinkedIn field add_settings_field('linkedin-square_link', 'LinkedIn', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args); $field_args = array( 'type' => 'text', 'id' => 'instagram_link', 'name' => 'instagram_link', 'desc' => 'Instagram Link - Example: http://instagram.com/username', 'std' => '', 'label_for' => 'instagram_link', 'class' => 'css_class' ); // Add Instagram field add_settings_field('instagram_link', 'Instagram', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args); // Add settings section title here add_settings_section('section_name_here', 'Section Title Here', 'pu_display_section', 'pu_theme_options.php'); // Create textarea field $field_args = array( 'type' => 'textarea', 'id' => 'settings_field_1', 'name' => 'settings_field_1', 'desc' => 'Setting Description Here', 'std' => '', 'label_for' => 'settings_field_1' ); // section_name should be same as section_name above (line 116) add_settings_field('settings_field_1', 'Setting Title Here', 'pu_display_setting', 'pu_theme_options.php', 'section_name_here', $field_args); // Copy lines 118 through 129 to create additional field within that section // Copy line 116 for a new section and then 118-129 to create a field in that section }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_settings()\n {\n }", "public function register_settings()\n {\n }", "function register_settings() {\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'endpoint'); // Sanitize\n\t\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'check_interval'); // Sanitize\n\t\n\tregister_setting('StandardsReader_settings_group', 'mapPage');\n\tregister_setting('StandardsReader_settings_group', 'mapListing');\n\t\t \n}", "public static function register_settings() {\n\t\t// Settings\n\t\t$settings = array(\n\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t'weight' => 124,\n\t\t\t\t'settings' => array(\n\t\t\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t\t\t'label' => self::__( 'Merchant Edit Profile Path' ),\n\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t'label' => trailingslashit( get_home_url() ),\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => self::$edit_path\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\tdo_action( 'gb_settings', $settings, Group_Buying_UI::SETTINGS_PAGE );\n\t}", "public function register_settings()\n\t{\n\t\t$this->register_setting( NHS_SECTIONS );\n\t}", "function mpc_register_settings() {\n\tregister_setting('mpc_settings_group', 'mpc_settings');\n}", "public function initSettings()\n {\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_key');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_secret');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_path');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_expires');\n }", "function wcusp_register_settings() {\n\tregister_setting('wcusp_settings_group', 'wcusp_settings');\n}", "public function register_settings(){\n // Default API KEY Google Maps\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_api_key', array($this,'maps_api_validation') );\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_enable_geocode', array('type'=>'boolean') );\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_enable_places', array('type'=>'boolean') );\n }", "public function registerSettings()\n\t\t{\n\t\t\tforeach($this->options as $id => $options) {\n\t\t\t\tregister_setting('thingdom-options', $this->tag.$id);\n\t\t\t}\n\t\t}", "function sa_register_settings() {\n\t// Register settings and call sanitation functions\n\tregister_setting( 'tsc_theme_options', 'sa_options', 'sa_validate_options' );\n}", "function hb_register_settings() {\r\n\tregister_setting('hb_settings_group', 'hb_settings');\r\n\r\n}", "public function register_settings() {\n\t\tregister_setting('eaboot_options', 'eaboot_options', array(&$this, 'validate_settings'));\n\n\t\tforeach ($this->sections as $slug => $title) {\n\t\t\tif ($slug == 'about')\n\t\t\t\tadd_settings_section($slug, $title, array(&$this, 'display_about_section'), 'eaboot_options');\n\t\t\telse\n\t\t\t\tadd_settings_section($slug, $title, array(&$this, 'display_section'), 'eaboot_options');\n\t\t}\n\n\t\t$this->get_settings();\n\n\t\tforeach ($this->settings as $id => $setting) {\n\t\t\t$setting['id'] = $id;\n\t\t\t$this->create_setting($setting);\n\t\t}\n\t}", "function jm_register_settings(){\n\tregister_setting('jm_social_group', 'jm_facebook');\n\tregister_setting('jm_social_group', 'jm_twitter');\n\tregister_setting('jm_social_group', 'jm_gplus');\n\tregister_setting('jm_social_group', 'jm_linkedin');\n\t\n\tregister_setting('jm_main_group', 'jm_logo');\n\tregister_setting('jm_main_group', 'jm_colorOne');\n\tregister_setting('jm_main_group', 'jm_colorTwo');\n\tregister_setting('jm_main_group', 'jm_analytics');\n}", "public function register_settings()\n\t\t{\n\t\t\tregister_setting('mailgun', 'mailgun', array(&$this, 'validation'));\n\t\t}", "function register_initial_settings()\n {\n }", "function register() {\n $this->settings = new SettingApi();\n\n $this->setPages();\n $this->setSubpages();\n\n $this->setCustomPostTypes();\n $this->setTaxonomies();\n $this->setMetaboxes();\n $this->setFrontEndPages();\n\n $this->settings->loadPages($this->pages)->withSubPage('Action control')->loadSubPages($this->subpages)->register();\n }", "public static function register_settings() {\n\t\t\tregister_setting( 'ELMT_theme_options', 'ELMT_theme_options', array( 'ELMT_theme_options', 'sanitize' ) );\n\t\t}", "function bdpp_register_settings() {\n\tregister_setting( 'bdpp_settings', 'bdpp_opts', 'bdpp_validate_settings' );\n}", "public function register_settings() {\n\t\t$section = 'janrain-capture';\n\n\t\tregister_setting( $this->option_group, 'pn_theme_janrain_enable', array( $this, 'sanitize_input_checkbox' ) );\n\t\tregister_setting( $this->option_group, 'pn_theme_janrain_debug', array( $this, 'sanitize_input_checkbox' ) );\n\n\t\tadd_settings_section( $section, 'Janrain Capture', '__return_false', $this->option_group );\n\t\tadd_settings_field( 'pn_theme_janrain_enable', 'Enable Janrain Capture', array( $this, 'render_input_checkbox' ), $this->option_group, $section, array( 'key' => 'pn_theme_janrain_enable', 'help' => 'Used by theme to register proper click events. eg. Janrain vs. Press+' ) );\n\t\tadd_settings_field( 'pn_theme_janrain_debug', 'Enable Janrain Debug', array( $this, 'render_input_checkbox' ), $this->option_group, $section, array( 'key' => 'pn_theme_janrain_debug', 'help' => 'Turns on Janrain event logging' ) );\n\t}", "public function register_settings(){\n\n\t\t// Register our option\n\t\tregister_setting( 'slack-post-types', 'slack-post-types', array( $this, 'sanitize' ) );\n\n\t\t// Add post post-type as default\n\t\tadd_option( 'slack-post-types', array( 'post' => 1 ) );\n\t}", "public function register_settings() {\n\n\t\t// This include creates a variable called $settings.\n\t\t// TODO: Load this from a file instead ...\n\t\t$settings = array(\n\t\t\tarray(\n\t\t\t\t/*Sections*/\n\t\t\t\t'name'\t\t=> 'default',\n\t\t\t\t'title'\t\t=> __('General Settings','wpchaosclient'),\n\t\t\t\t'fields'\t=> array(\n\t\t\t\t\t/*Section fields*/\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-servicepath',\n\t\t\t\t\t\t'title' => __('Service Path','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-clientguid',\n\t\t\t\t\t\t'title' => __('Client GUID','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-accesspoint-guid',\n\t\t\t\t\t\t'title' => __('Access Point GUID','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-email',\n\t\t\t\t\t\t'title' => __('E-mail used for authentication','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'text'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'wpchaos-password',\n\t\t\t\t\t\t'title' => __('Password','wpchaosclient'),\n\t\t\t\t\t\t'type' => 'password'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$this->settings = apply_filters('wpchaos-config', $settings);\n\n\t\tforeach($this->settings as $section) {\n\n\t\t\t//Validate\n\t\t\tif(!isset($section['name'],$section['title'],$section['fields']))\n\t\t\t\tcontinue;\n\n\t\t\t//Add section to WordPress\n\t\t\tadd_settings_section(\n\t\t\t\t$section['name'],\n\t\t\t\t$section['title'],\n\t\t\t\tnull,\n\t\t\t\t$this->menu_page\n\t\t\t);\n\n\t\t\tforeach($section['fields'] as $setting) {\n\t\t\t\t//Validate\n\t\t \t\tif(!isset($setting['title'],$setting['name'],$setting['type']))\n\t\t \t\t\tcontinue;\n\n\t\t \t\t//Are there any preconditions for this field to work properly?\n\t\t \t\tif(isset($setting['precond'])) {\n\t\t \t\t\tforeach($setting['precond'] as $precondition) {\n\t\t \t\t\t\tif(!$precondition['cond'])\n\t\t \t\t\t\t\tadd_action( 'admin_notices', function() use(&$precondition) { echo '<div class=\"error\"><p>'.$precondition['message'].'</p></div>'; },10);\n\t\t \t\t\t}\n\t\t \t\t}\n\n\t\t \t\t// Add field to section\n\t\t \t\tadd_settings_field($setting['name'],\n\t\t\t\t\t$setting['title'],\n\t\t\t\t\tarray(&$this,'create_setting_field'),\n\t\t\t\t\t$this->menu_page,\n\t\t\t\t\t$section['name'],\n\t\t\t\t\t$setting);\n\n\t\t \t\t// Register field to be manipulated with\n\t\t \t\tregister_setting($this->menu_page,$setting['name']);\n\t\t\t}\n\n\t\t}\n\n\t }", "public function register_settings() {\n\n\t\tadd_settings_section(\n\t \t'thaim_utilities_section',\n\t \t__( 'Thaim Utilities Settings', 'thaim-utilities' ),\n\t \tarray( $this, 'settings_callback_section' ),\n\t \t'buddypress'\n\t );\n\n\t $settings = apply_filters( 'thaim_utilities_settings_fields', array( \n\t \tarray(\n\t \t\t'name' => 'thaim_link_wordpress_org',\n\t \t\t'title' => __( 'WordPress.org account', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'link_wp_org_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_perpage_wordpress_org',\n\t \t\t'title' => __( 'Number of WordPress plugins to display', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'perpage_wp_org_callback' ),\n\t \t\t'sanitize' => 'absint',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_list_github_repos',\n\t \t\t'title' => __( 'List your github repos', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'list_github_repos_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t ) );\n\n\t\tforeach( $settings as $setting ) {\n\t\t\tadd_settings_field(\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['title'],\n\t\t\t\t$setting['display'],\n\t\t\t\t'buddypress',\n\t\t\t\t'thaim_utilities_section'\n\t\t\t);\n\n\t\t\tregister_setting(\n\t\t\t\t'buddypress',\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['sanitize']\n\t\t\t);\n\t\t}\n\t}", "public static function register_settings() {\n\t\t\tregister_setting( 'theme_options', 'theme_options', array( 'IODD_Theme_Options', 'sanitize' ) );\n\t\t}", "function jpst_register_settings() {\n\tregister_setting( 'jpst-settings-group', 'jpst_oauth','saveOptionCallback' );\n}", "public static function register_settings() {\n\t\tregister_setting( 'omnimailer', 'omnimailer', array( get_called_class(), 'validate_options' ) );\n\t}", "public function register_settings()\r\n\t{\t\r\n\t\t//options group declaration\r\n\t register_setting('bookingSearch_settings', 'dbs_client_id');\r\n\t register_setting('bookingSearch_settings', 'dbs_client_secret');\r\n\t register_setting('bookingSearch_settings', 'dbs_authorization');\r\n\r\n\t //sections\r\n\t add_settings_section('bookingSearch_section', __('Customer parameter','Booking-search'), array($this, 'section_html'), 'bookingSearch_settings');\r\n\r\n\t //fields\r\n\t add_settings_field('dbs_client_id', __('Client ID','Booking-search'), array($this, 'dbs_client_id_html'), 'bookingSearch_settings', 'bookingSearch_section');\r\n\t add_settings_field('dbs_client_secret', __('Client secret','Booking-search'), array($this, 'dbs_client_secret_html'), 'bookingSearch_settings', 'bookingSearch_section');\r\n\t add_settings_field('dbs_authorization', __('Authorization','Booking-search'), array($this, 'dbs_authorization_html'), 'bookingSearch_settings', 'bookingSearch_section');\r\n\r\n\t}", "public function register_settings() {\n\n\t\tadd_settings_section(\n\t\t\t'schedule_a_visit_to_sherpa_settings_section',\n\t\t\t__( 'Schedule a Visit Leads to Sherpa', 'schedule-a-visit-to-sherpa' ),\n\t\t\t__return_false(),\n\t\t\t'schedule-a-visit-to-sherpa'\n\t\t);\n\n\t\t$fields = $this->get_settings_fields();\n\n\t\tforeach ( $fields as $field ) {\n\n\t\t\t$field = wp_parse_args( $field, array(\n\t\t\t\t'settings_label' => '',\n\t\t\t) );\n\n\t\t\t$callback = 'rbm_fh_do_field_' . $field['type'];\n\n\t\t\tadd_settings_field(\n\t\t\t\t$field['name'],\n\t\t\t\t$field['settings_label'],\n\t\t\t\t( is_callable( $callback ) ) ? 'rbm_fh_do_field_' . $field['type'] : 'rbm_fh_missing_callback',\n\t\t\t\t'schedule-a-visit-to-sherpa',\n\t\t\t\t'schedule_a_visit_to_sherpa_settings_section',\n\t\t\t\t$field\n\t\t\t);\n\n\t\t\tregister_setting( 'schedule_a_visit_to_sherpa_settings_section', $field['name'] );\n\n\t\t}\n\n\t}", "function register_settings() {\n register_setting( 'athen_tweaks', 'athen_tweaks', array( $this, 'admin_sanitize' ) ); \n }", "function wshop_settings_init(){\n register_setting('wshop_settings', 'wshop_api_key');\n register_setting('wshop_settings', 'wshop_domain', 'remove_protocol');\n // register_setting('wshop_settings', 'wshop_app_id');\n register_setting('wshop_settings', 'wshop_rewrite_slug');\n register_setting('wshop_settings', 'wshop_collections_slug');\n }", "function tsuiseki_tracking_admin_init() {\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_key');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_css_class');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_excluded_uris');\n}", "public function register_dynamic_settings()\n {\n }", "public function init() {\n register_setting( $this->key, $this->key );\n }", "public function init() {\n register_setting( self::$key, self::$key );\n }", "public function registerSettings()\n {\n // Register setting\n register_setting('wpae_crsch_settings', 'wpae_cron_scheduler_exports');\n\n // Settings section\n add_settings_section(\n 'wpae_crsch_section',\n __('Exports list', WPAE_CRSCH_TD),\n [$this, 'registerSettingsCallback'],\n 'wpae_crsch_settings'\n );\n }", "public function register_main_setting() {\n register_setting( 'lp_rating_settings', 'lp_rating_types');\n register_setting( 'lp_rating_settings', 'lp_rating_text');\n register_setting( 'lp_rating_settings', 'lp_rating_text_font_size');\n register_setting( 'lp_rating_settings', 'lp_rating_image_size');\n register_setting( 'lp_rating_settings', 'lp_rating_change_image');\n }", "public function init()\n {\n register_setting($this->key, $this->key);\n }", "public function register() {\n\t\tregister_setting(\n\t\t\t$this->page,\n\t\t\t$this->setting_id,\n\t\t\tarray(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize' ),\n\t\t\t\t'default' => $this->default_value,\n\t\t\t)\n\t\t);\n\t}", "public function register() {\n\t\tregister_setting(\n\t\t\t$this->page,\n\t\t\t$this->setting_id,\n\t\t\tarray(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize' ),\n\t\t\t\t'default' => $this->default_value,\n\t\t\t)\n\t\t);\n\t}", "function register_settings() {\n add_settings_section(\n 'main-settings-section',\n 'Main Settings',\n array($this, 'print_main_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'app_id',\n 'App ID', \n array($this, 'create_input_app_id'), \n 'share-fb-sections-plugin', \n 'main-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_main_settings', array($this, 'plugin_main_settings_validate') );\n \n // add_settings_section( $id, $title, $callback, $page )\n add_settings_section(\n 'additional-settings-section',\n 'Additional Settings & Default Value',\n array($this, 'print_additional_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'render_meta_tag',\n 'Render Meta Tag',\n array($this, 'create_input_render_meta_tag'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'title', \n 'Default Title', \n array($this, 'create_input_title'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'description', \n 'Default Description', \n array($this, 'create_input_description'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'image_url', \n 'Default Image URL', \n array($this, 'create_input_image_url'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_additonal_settings', array($this, 'plugin_additional_settings_validate') );\n }", "public function registerSettings()\n {\n register_setting(self::SETTING_GROUPNAME, self::SETTING_BASENAME);\n \n // Section: API Keys\n // -----------------------------------------------------------------\n\n add_settings_section(\n 'wistia_section-api_keys',\n __('API Settings'),\n [$this->renderer, 'renderAPISettingsSection'],\n self::ADMIN_PAGE_ID\n );\n\n add_settings_field(\n 'url_prefix',\n __('URL Prefix'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'url_prefix',\n null,\n [\n 'before' => '<code>http://</code>',\n 'after' => '<code>.wistia.com</code>',\n ]\n )\n );\n add_settings_field(\n 'project_key',\n __('Project Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'project_key',\n __('Enter the ID of the project that the Upload API should send videos to.'),\n [\n 'classes' => 'regular-text'\n ]\n )\n );\n add_settings_field(\n 'upload_key',\n __('Upload Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'upload_key',\n __('This API key should have <strong>upload permissions only</strong>. It will be '\n .'visible in the source of any front-end pages that use the JavaScript uploader.'),\n [\n 'classes' => 'regular-text',\n ]\n )\n );\n add_settings_field(\n 'data_key',\n __('Data API Key'),\n [$this->renderer, 'renderTextField'],\n self::ADMIN_PAGE_ID,\n 'wistia_section-api_keys',\n $this->getFieldArguments(\n 'data_key',\n __('This API key should have <strong>read and write</strong> permissions.'),\n [\n 'classes' => 'regular-text',\n ]\n )\n );\n }", "function register_mysettings() {\n\tregister_setting( 'myoption-group', 'adsense_id' );\n\tregister_setting( 'myoption-group', 'site_url_one' );\n register_setting( 'myoption-group', 'site_url_two' );\n register_setting( 'myoption-group', 'site_url_three' );\n register_setting( 'myoption-group', 'site_url_four' );\n register_setting( 'myoption-group', 'site_url_five' );\n register_setting( 'myoption-group', 'site_font' );\n register_setting( 'myoption-group', 'site_total_posts' );\n register_setting( 'myoption-group', 'site_randomise_posts' );\n register_setting( 'myoption-group', 'site_show_curator_posts' );\n }", "function register_settings() {\n\t\t\tif( get_option( $this->func . '_settings' ) == false ) {\n\t\t\t\tadd_option( $this->func . '_settings' );\n\t\t\t}\n\n\t\t\tforeach( $this->get_registered_settings() as $tab => $sections ) {\n\t\t\t\tforeach( $sections as $section => $settings ) {\n\t\t\t\t\t// Check for backwards compatibility\n\t\t\t\t\t$section_tabs = $this->get_settings_tab_sections( $tab );\n\n\t\t\t\t\tif( ! is_array( $section_tabs ) || ! array_key_exists( $section, $section_tabs ) ) {\n\t\t\t\t\t\t$section = 'main';\n\t\t\t\t\t\t$settings = $sections;\n\t\t\t\t\t}\n\n\t\t\t\t\tadd_settings_section(\n\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t__return_null(),\n\t\t\t\t\t\t'__return_false',\n\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach( $settings as $option ) {\n\t\t\t\t\t\t// For backwards compatibility\n\t\t\t\t\t\tif( empty( $option['id'] ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$name = isset( $option['name'] ) ? $option['name'] : '';\n\n\t\t\t\t\t\tadd_settings_field(\n\t\t\t\t\t\t\t$this->func . '_settings[' . $option['id'] . ']',\n\t\t\t\t\t\t\t$name,\n\t\t\t\t\t\t\tfunction_exists( $this->func . '_' . $option['type'] . '_callback' ) ? $this->func . '_' . $option['type'] . '_callback' : ( method_exists( $this, $option['type'] . '_callback' ) ? array( $this, $option['type'] . '_callback' ) : array( $this, 'missing_callback' ) ),\n\t\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t\t$this->func . '_settings_' . $tab . '_' . $section,\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'section' => $section,\n\t\t\t\t\t\t\t\t'id' => isset( $option['id'] ) ? $option['id'] : null,\n\t\t\t\t\t\t\t\t'desc' => ! empty( $option['desc'] ) ? $option['desc'] : '',\n\t\t\t\t\t\t\t\t'name' => isset( $option['name'] ) ? $option['name'] : null,\n\t\t\t\t\t\t\t\t'size' => isset( $option['size'] ) ? $option['size'] : null,\n\t\t\t\t\t\t\t\t'options' => isset( $option['options'] ) ? $option['options'] : '',\n\t\t\t\t\t\t\t\t'std' => isset( $option['std'] ) ? $option['std'] : '',\n\t\t\t\t\t\t\t\t'min' => isset( $option['min'] ) ? $option['min'] : null,\n\t\t\t\t\t\t\t\t'max' => isset( $option['max'] ) ? $option['max'] : null,\n\t\t\t\t\t\t\t\t'step' => isset( $option['step'] ) ? $option['step'] : null,\n\t\t\t\t\t\t\t\t'select2' => isset( $option['select2'] ) ? $option['select2'] : null,\n\t\t\t\t\t\t\t\t'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : null,\n\t\t\t\t\t\t\t\t'multiple' => isset( $option['multiple'] ) ? $option['multiple'] : null,\n\t\t\t\t\t\t\t\t'allow_blank' => isset( $option['allow_blank'] ) ? $option['allow_blank'] : true,\n\t\t\t\t\t\t\t\t'readonly' => isset( $option['readonly'] ) ? $option['readonly'] : false,\n\t\t\t\t\t\t\t\t'buttons' => isset( $option['buttons'] ) ? $option['buttons'] : null,\n\t\t\t\t\t\t\t\t'wpautop' => isset( $option['wpautop'] ) ? $option['wpautop'] : null,\n\t\t\t\t\t\t\t\t'teeny' => isset( $option['teeny'] ) ? $option['teeny'] : null,\n\t\t\t\t\t\t\t\t'tab' => isset( $option['tab'] ) ? $option['tab'] : null,\n\t\t\t\t\t\t\t\t'tooltip_title' => isset( $option['tooltip_title'] ) ? $option['tooltip_title'] : false,\n\t\t\t\t\t\t\t\t'tooltip_desc' => isset( $option['tooltip_desc'] ) ? $option['tooltip_desc'] : false,\n\n\t\t\t\t\t\t\t\t'available_header'\t=> isset( $option['available_header'] ) ? $option['available_header'] : null,\n\t\t\t\t\t\t\t\t'selected_header'\t=> isset( $option['selected_header'] ) ? $option['selected_header'] : null,\n\n\t\t\t\t\t\t\t\t'class' => isset( $option['class'] ) ? $option['class'] : '',\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}\n\n\t\t\tregister_setting( $this->func . '_settings', $this->func . '_settings', array( $this, 'settings_sanitize' ) );\n\t\t}", "function get_registered_settings()\n {\n }", "function register_mysettings()\n{\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_shop_id' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_api_key' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_api_secret' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_product_detail_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_product_list_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_designer_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_article_list_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_article_detail_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_items_per_page' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_language' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_locale' );\nregister_setting( 'spreadshop-settings-shop', 'spreadshop_domain' );\n}", "function register_setting($key, $value)\n{\n csSettings::set($key, $value);\n}", "public static function init() {\n static::registerSettings();\n }", "public function register()\n {\n $this->settings = new SettingsApi();\n\n $this->callbacks = new AdminCallbacks(); //call admin callback using callback variable\n\n\n $this->callbacks_mngr = new ManagerCallbacks(); //call admin callback using callback variable\n\n\n $this->setPages();\n\n// $this->setSubpages();\n\n\n $this->setSettings();\n $this->setSections();\n $this->setFields();\n\n $this->settings->addPages( $this->pages )->withSubPage( 'Settings' )->register();\n //$this->settings->addPages( $this->pages )->withSubPage( 'Dashboard' )->addSubPages( $this->subpages )->register();\n }", "public function init() {\r\n\t\tregister_setting( $this->key, $this->key );\r\n\t}", "public function register() {\n\n\t\tregister_setting(\n\t\t\t'emcl_settings',\t\t\t// Group of options\n\t\t\t'emcl_settings', \t // Name of options\n\t\t\tarray( $this, 'sanitize' )\t// Sanitization function\n\t\t);\n\n\t\tadd_settings_section(\n\t\t\t'emcl-server',\t\t\t// ID of the settings section\n\t\t\t'Server Settings',\t\t// Title of the section\n\t\t\t'',\n\t\t\t'emcl-section'\t\t\t// ID of the page\n\t\t);\n\n\t\tforeach( $this->server_fields as $key => $name) {\n\t\t\tadd_settings_field(\n\t\t\t\t$key, \t\t\t// The ID of the settings field\n\t\t\t\t$name, \t// The name of the field of setting(s)\n\t\t\t\tarray( $this, 'display_'.$key ),\n\t\t\t\t'emcl-section', \t// ID of the page on which to display these fields\n\t\t\t\t'emcl-server' // The ID of the setting section\n\t\t\t);\n\t\t}\n\n\t\tadd_settings_section(\n\t\t\t'emcl-app',\t\t\t // ID of the settings section\n\t\t\t'App Settings',\t\t\t// Title of the section\n\t\t\t'',\n\t\t\t'emcl-section'\t\t\t// ID of the page\n\t\t);\n\n\t\tforeach( $this->app_fields as $key => $name) {\n\t\t\tadd_settings_field(\n\t\t\t\t$key, \t\t\t// The ID of the settings field\n\t\t\t\t$name, \t// The name of the field of setting(s)\n\t\t\t\tarray( $this, 'display_'.$key ),\n\t\t\t\t'emcl-section', \t// ID of the page on which to display these fields\n\t\t\t\t'emcl-app' \t// The ID of the setting section\n\t\t\t);\n\t\t}\n\t}", "public function registerSettings()\n {\n return [];\n }", "function myprefix_init_settings() {\t\n\t\n\t// Settings section:\n\t// Multiple settings can go into this section after we set it up.\n\t// We are going to add three settings into this one section.\n\t\tadd_settings_section(settingsSectionOneSlug, settingsSectionOneTitle, \n\t\t\tsettingsSectionOneCallbackFunction, settingsPageID);\n\t\n\t// Settings field:\n\t// We add settings fields to our settings section:\n\t\tadd_settings_field(settingOneSlug, settingOneTitle, settingOneCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingOneSlug ));\n\t\tadd_settings_field(settingTwoSlug, settingTwoTitle, settingTwoCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingTwoSlug ));\n\t\tadd_settings_field(settingThreeSlug, settingThreeTitle, settingThreeCallbackFunction, \n\t\t\tsettingsPageID, settingsSectionOneSlug, array( 'label_for' => settingThreeSlug ));\n\t\n\t// Setting:\n\t// Now we register our settings:\n\t\tregister_setting(settingsPageID, settingOneSlug, settingOneValidationFunction);\n\t\tregister_setting(settingsPageID, settingTwoSlug, settingTwoValidationFunction);\n\t\tregister_setting(settingsPageID, settingThreeSlug, settingThreeValidationFunction);\n}", "public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}", "public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}", "public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}", "public function register_settings() {\n\t\t\tregister_setting( 'wpex_skins_options', 'theme_skin', array( $this, 'sanitize' ) );\n\t\t}", "function vfcf7_register_settings() {\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name1', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name2', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name3', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name4', 'vfcf7_callback' );\n register_setting( 'vfcf7_options_group', 'vfcf7_option_name5', 'vfcf7_callback' );\n}", "public function register()\n {\n register_setting(\n $this->page,\n self::SETTING,\n array($this, 'clean_settings')\n );\n\n add_settings_section(\n self::SECTION,\n __('Simple Login Lockdown', 'simple-login-lockdown'),\n array($this, 'section_cb'),\n $this->page\n );\n\n add_settings_field(\n self::SETTING . '[limit]',\n __('Login Attempt Limit', 'simple-login-lockdown'),\n array($this, 'attempts_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[limit]', 'key' => 'limit')\n );\n\n add_settings_field(\n self::SETTING . '[time]',\n __('Login Lockdown Time', 'simple-login-lockdown'),\n array($this, 'time_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[time]', 'key' => 'time')\n );\n\n add_settings_field(\n self::SETTING . '[trust_proxy]',\n __('Trust Proxy Data', 'simple-login-lockdown'),\n array($this, 'trust_proxy_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[trust_proxy]', 'key' => 'trust_proxy')\n );\n }", "function achilles_settings_init() {\n\t\n\t//create one option to store all of our values. \n register_setting( 'achilles-settings-group', 'achilles-settings' );\n add_settings_section( 'achilles-general-settings', 'General Settings', 'achilles_general_settings_callback', 'achilles' );\n add_settings_field('resident-portal', 'Resident Portal URL', 'resident_portal_url_callback', 'achilles', 'achilles-general-settings');\n add_settings_field('facebook-url', 'Facebook URL', 'facebook_url_callback', 'achilles', 'achilles-general-settings' );\n add_settings_field('google-analytics-id', 'Google Analytics ID', 'google_analytics_id_callback', 'achilles', 'achilles-general-settings');\n\t\n}", "public static function register()\n\t\t\t{\n\t\t\t\t\n\t\t\t\t//IMPORTANT\n\t\t\t\t//Register all of the options that will be used\n\t\t\t\n//\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_po_quote');\n\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_userid');\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_popup_option');\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_copypaste_option');\n\t\t\t\tregister_setting(HE_PLUGINOPTIONS_ID.'_options', 'he_freecode');\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "function register_setting() \n\t{\n\t\tregister_setting('_user_rank_comments', '_user_rank_comments_fields', array(&$this, 'validate_settings'));\n\t\tregister_setting('_user_rank_comments', '_user_rank_comments_filter');\t\n\t}", "function register_my_settings() {\n\t// First say,\n\t// \"Here's a hunk of stuff that\n\t// will be saved in the database.\"\n\tregister_setting(\n\t\t'my-options',\n\t\t'my-options-data',\n\t\t'washing_machine'\n\t);\n\n\t// Next say,\n\t// \"Here are the sections I want\n\t// to present my settings in\n\t// on the page I told you about earlier.\"\n\tadd_settings_section(\n\t\t'section-1',\n\t\t'Header Stuff',\n\t\t'section_ringy_dingy',\n\t\t'my-page-id'\n\t);\n\tadd_settings_section(\n\t\t'section-2',\n\t\t'Footer Stuff',\n\t\t'section_ringy_dingy',\n\t\t'my-page-id'\n\t);\n\n\t// Third, gather the information\n\t// you'll need to display your fields\n\t// into HTML\n\t$extra_tagline_args = array(\n\t\t'id'\t\t=> 'extra_tagline',\n\t\t'desc'\t\t=> 'Enter Your Extra Tagline Here',\n\t\t'label_for'\t=> 'extra_tagline'\n\t);\n\n\t$footer_text_args = array(\n\t\t'id'\t\t=> 'footer_text',\n\t\t'desc'\t\t=> 'Enter Your Footer Text Here',\n\t\t'label_for'\t=> 'footer_text'\n\t);\n\n\t// Finally say,\n\t// \"These are the fields we want\n\t// users to fill in.\"\n\tadd_settings_field(\n\t\t'extra-tagline',\n\t\t'Text for Extra Tagline',\n\t\t'render_text_field',\n\t\t'my-page-id',\n\t\t'section-1',\n\t\t$extra_tagline_args\n\t);\n\tadd_settings_field(\n\t\t'footer-text',\n\t\t'Text for Footer',\n\t\t'render_text_field',\n\t\t'my-page-id',\n\t\t'section-2',\n\t\t$footer_text_args\n\t);\n\n}", "public function admin_init() {\n\t\tregister_setting( $this->options_key, $this->options_key, array( $this, 'save_settings' ) );\n\t}", "function project_register_settings() {\n\tregister_setting(\n\t\t'project_options',\t\t\t\t\t\t// option group\n\t\t'project_options',\t\t\t\t\t\t// option name\n\t\t'project_callback_validate_options'\t\t// callable sanitize callback\n\t);\n\n\tadd_settings_section(\n\t\t'project_section_login',\t\t\t\t// section id\n\t\t'Customize Login Page',\t\t\t\t\t// section title\n\t\t'project_callback_section_login',\t\t// callable \n\t\t'project'\t\t\t\t\t\t\t\t// page on which section to be displayed\n\t);\n\n\tadd_settings_section(\n\t\t'project_section_admin',\n\t\t'Customize Admin Area',\n\t\t'project_callback_section_admin',\n\t\t'project'\n\t);\n\n\tadd_settings_field(\n\t\t'custom_url',\t\t\t\t\t\t\t// id\n\t\t'Custom URL',\t\t\t\t\t\t\t// title\n\t\t'project_callback_field_text',\t\t\t// callback\n\t\t'project',\t\t\t\t\t\t\t\t// page\n\t\t'project_section_login',\t\t\t\t// section\n\t\t['id' => 'custom_url', 'label' => 'Custom URL for the login logo link']\t// args\n\t);\n\n\tadd_settings_field(\n\t\t'custom_title',\t\t\t\t\t\t\n\t\t'Custom Title',\t\t\t\t\t\t\t\n\t\t'project_callback_field_text',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_login',\t\t\t\t\n\t\t['id' => 'custom_title', 'label' => 'Custom Title attribute for logo link']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_style',\t\t\t\t\t\t\n\t\t'Custom Style',\t\t\t\t\t\t\t\n\t\t'project_callback_field_radio',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_login',\t\t\t\t\n\t\t['id' => 'custom_style', 'label' => 'Custom CSS for the Login screen']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_message',\t\t\t\t\t\t\n\t\t'Custom Message',\t\t\t\t\t\t\t\n\t\t'project_callback_field_textarea',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_login',\t\t\t\t\n\t\t['id' => 'custom_message', 'label' => 'Custom text and/or markup']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_footer',\t\t\t\t\t\t\n\t\t'Custom Footer',\t\t\t\t\t\t\t\n\t\t'project_callback_field_text',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_admin',\t\t\t\t\n\t\t['id' => 'custom_footer', 'label' => 'Custom footer text']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_toolbar',\t\t\t\t\t\t\n\t\t'Custom Toolbar',\t\t\t\t\t\t\t\n\t\t'project_callback_field_checkbox',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_admin',\t\t\t\t\n\t\t['id' => 'custom_toolbar', 'label' => 'Remove new post and comment links from the Toolbar']\t\n\t);\n\n\tadd_settings_field(\n\t\t'custom_scheme',\t\t\t\t\t\t\n\t\t'Custom Scheme',\t\t\t\t\t\t\t\n\t\t'project_callback_field_select',\t\t\t\n\t\t'project',\t\t\t\t\t\t\t\t\n\t\t'project_section_admin',\t\t\t\t\n\t\t['id' => 'custom_scheme', 'label' => 'Default color scheme for new users']\t\n\t);\n}", "function jb_register_settings() {\n\tregister_setting( JB_SETTINGS_FIELD, JB_SETTINGS_FIELD );\n\tadd_option( JB_SETTINGS_FIELD , jb_option_defaults() );\n\tadd_settings_section('jb_main','Main Settings', 'jb_main_section_text', JB_SETTINGS_FIELD );\n\tadd_settings_field('jb_featured_cat', 'Featured Category', 'jb_featured_cat_slug_setting', JB_SETTINGS_FIELD , 'jb_main');\n\tadd_settings_field('jb_featured_content_limit', 'Homepage Featured Post Word Count Limit', 'jb_featured_content_limit_setting', JB_SETTINGS_FIELD , 'jb_main');\n\tadd_settings_field('jb_post_content_limit', 'Post Word Count Limit', 'jb_post_content_limit_setting', JB_SETTINGS_FIELD , 'jb_main');\n}", "public function register_settings_sections() {\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_google_verify', array( $this, 'sanitize_google_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_bing_verify', array( $this, 'sanitize_bing_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_facebook_verify', array( $this, 'sanitize_facebook_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_ga_id', array( $this, 'sanitize_ga_id' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_ga4_id', 'sanitize_text_field' );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_analytics_option_map', array( $this, 'sanitize_wsuwp_analytics_option_map' ) );\n\t}", "function register_clix_uppe_admin_settings() {\r\n\t//register our settings\r\n\tregister_setting( 'clix_uppe_settings', 'clix_content_fail' );\r\n\tregister_setting( 'clix_uppe_settings', 'clix_rss_fail' );\r\n}", "private static function setup() {\n if(!isset(self::$settings)) {\n require 'regain/global_settings.php';\n self::$settings = $settings;\n }\n }", "function cxense_register_settings() {\n\n // Setup section on our options page\n add_settings_section('cxense-settings-section', 'cXense Settings', '__return_empty_string', 'cxense-settings');\n\n // Register our settings and create\n foreach(cxense_get_settings() as $setting) {\n\n // Register setting\n register_setting('cxense-settings', $setting['name']);\n\n // Add settings field if add_field isn't false\n if( !isset($setting['add_field']) || $setting['add_field'] !== false) {\n add_settings_field(\n $setting['name'],\n $setting['title'],\n function($args) {\n $value = cxense_get_opt($args['name']);\n if( !empty($args['select']) ) {\n echo '<select name=\"'.$args['name'].'\">';\n foreach($args['select'] as $opt_val => $opt_name) {\n echo '<option value=\"'.$opt_val.'\"'.($opt_val == $value ? ' selected=\"selected\"':'').'>'.$opt_name.'</option>';\n }\n echo '</select>';\n } else {\n echo '<input type=\"text\" name=\"'.$args['name'].'\" value=\"'.$value.'\" />';\n }\n },\n 'cxense-settings',\n 'cxense-settings-section',\n $setting\n );\n }\n }\n}", "public function plugin_settings_init() {\n\t\tregister_setting( 'plugin-boilerplate', 'plugin_settings' );\n\n\t\t//create a settings section - there can be multiple settings sections, just make sure you attribute\n\t\t//the settings fields to the sections you want\n\t\tadd_settings_section( \n\t\t\t'settings-section-id', \n\t\t\t__( 'Plugin Settings Section Title', 'plugin-text-domain' ), \n\t\t\tarray( $this, 'settings_section_callback' ), \n\t\t\t'plugin-boilerplate' );\n\n\t\t//create the settings fields, associate them with the required settings sections\n\t\tadd_settings_field( \n\t\t\t'settings-fields-id', \n\t\t\t__('Settings Fields Title', 'plugin-text-domain' ), \n\t\t\tarray( $this, 'settings_field_callback' ), \n\t\t\t'plugin-boilerplate', \n\t\t\t'settings-section-id' );\n\t\t\n\t}", "function saju_jukebox_settings_register() {\n\n\t// 1: the unique id for the section\n\t// 2: the title or name of the section\n\t// 3: callback to display the section\n\t// 4: the page name: wordlift_settings_section_page\n\tadd_settings_section( SAJU_JUKEBOX_SETTINGS_GENERAL, __( 'General Settings', SAJU_LANGUAGE_DOMAIN ), 'saju_jukebox_echo_section_top', SAJU_JUKEBOX_SETTINGS_GENERAL_PAGE );\n\n\t// Add the setting field for the display as default.\n\tadd_settings_field(\n\t\tSAJU_JUKEBOX_SETTINGS_FIELD_EVENT_URL,\n\t\t__( 'Event URL:', SAJU_LANGUAGE_DOMAIN ),\n\t\t'saju_jukebox_echo_input',\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL_PAGE,\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL,\n\t\tarray(\n\t\t\t'id' => SAJU_JUKEBOX_SETTINGS_FIELD_EVENT_URL,\n\t\t\t'size' => 100\n\t\t)\n\t);\n\n\t// Add the setting field for the color coding of entities.\n\tadd_settings_field(\n\t\tSAJU_JUKEBOX_SETTINGS_FIELD_DATASET_URL,\n\t\t__( 'Dataset URL:', SAJU_LANGUAGE_DOMAIN ),\n\t\t'saju_jukebox_echo_input',\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL_PAGE,\n\t\tSAJU_JUKEBOX_SETTINGS_GENERAL,\n\t\tarray(\n\t\t\t'id' => SAJU_JUKEBOX_SETTINGS_FIELD_DATASET_URL,\n\t\t\t'size' => 100\n\t\t)\n\t);\n\n\t// Register the settings.\n\tregister_setting( SAJU_JUKEBOX_SETTINGS_GENERAL, SAJU_JUKEBOX_SETTINGS_FIELD_EVENT_URL );\n\tregister_setting( SAJU_JUKEBOX_SETTINGS_GENERAL, SAJU_JUKEBOX_SETTINGS_FIELD_DATASET_URL );\n\n}", "public function admin_init()\n\t{\n\t\tforeach( (array) $this->InstanceRegistred as $id => $args ) :\n\t\t\t\\register_setting( $this->page, $args['name'] );\n\t\tendforeach;\n\t}", "abstract protected function define_my_settings();", "function updatenote_regsettings() {\n\tregister_setting( 'updatenote-settings', 'updatenote_options', 'updatenote_validate' );\n}", "function webnotik_register_general_settings() {\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_name' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_phone' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_email' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_address1' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_address2' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_privacy' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_business_tos' );\n\tregister_setting( 'webnotik-general-group', 'webnotik_sma_linkedin' );\n}", "protected function registerSettingsService()\n {\n $this->app->singleton(\n 'streams.settings',\n function () {\n\n return new SettingService(new SettingModel());\n\n }\n );\n }", "function vdtestim_register_settings() {\n\n\t$vdtestim_options = get_option( 'vdtestim_global_settings' );\n\n\n// Create settings and fields for our global settings\n\n\t//* Settings Sections ***************************************\n\t\n\t// Creates Header For Global Options\n\tadd_settings_section(\n\t\t'global_plugin_settings', \t\t\t// ID used to identify this section and with which to register options\n\t\t'Global Settings', \t\t\t\t\t// Title to be displayed on the administration page\n\t\t'vdtestim_global_callback',\t\t \t// Callback\n\t\t'vdtestim_global_settings' \t\t\t\t// Page on which to add this section of options \n\t);\n\n\tadd_settings_section( \n\t\t'style_plugin_settings',\n\t\t'Layout & Style Settings',\n\t\t'vdtestim_style_callback',\n\t\t'vdtestim_style_settings'\n\t);\n\n\n\t//* Settings Fields For Global ****************************************\n\n\t// Adds use_gravatar field\n\tadd_settings_field(\n\t\t'vdtestim_use_gravatar',\t\n\t\t'Testimonial Image',\t\t\n\t\t'vdtestim_use_gravatar_field',\n\t\t'vdtestim_global_settings', \t\t\n\t\t'global_plugin_settings'\t\n\t);\n\n\tif ( $vdtestim_options['use_gravatar'] == 'yes' ) {\n\n\t\t// Adds default_gravatar_url field\n\t\tadd_settings_field(\n\t\t\t'vdtestim_default_gravatar_url',\t\n\t\t\t'Default Avatar Image',\t\t\n\t\t\t'vdtestim_gravatar_url_field',\n\t\t\t'vdtestim_global_settings', \t\t\n\t\t\t'global_plugin_settings'\t\n\t\t);\n\n\n\t\t// Adds gravatar_preview field\n\t\tadd_settings_field(\n\t\t\t'vdtestim_gravatar_preview',\t\n\t\t\t'Avatar Image Preview',\t\t\n\t\t\t'vdtestim_gravatar_preview_field',\n\t\t\t'vdtestim_global_settings', \t\t\n\t\t\t'global_plugin_settings',\n\t\t\tarray( \n\t 'Default image, upload new one to replace.' \n\t ) \n\t\t);\n\n\n\t\t\n\t}\n\n\t// Adds slider_display_duration fields\n\tadd_settings_field(\n\t\t'vdtestim_slider_display_duration',\t\n\t\t'Slider Display Duration',\t\t\n\t\t'vdtestim_slider_display_duration_field',\n\t\t'vdtestim_global_settings', \t\t\n\t\t'global_plugin_settings'\n\t);\n\n\t// Adds slider_fade_duration fields\n\tadd_settings_field(\n\t\t'vdtestim_slider_fade_duration',\t\n\t\t'Slider Fade Duration',\t\t\n\t\t'vdtestim_slider_fade_duration_field',\n\t\t'vdtestim_global_settings', \t\t\n\t\t'global_plugin_settings'\n\t);\n\n\t//* Settings Fields for style ******************************\n\n\t// Adds style selector field\n\tadd_settings_field(\n\t\t'vdtestim_style_settings',\t// ID used to identify the field throughout the theme\n\t\t'Choose The Style',\t\t\t// The label to the left of the option interface element \n\t\t'vdtestim_style_field', \t// Callback\n\t\t'vdtestim_style_settings', \t// The page on which this option will be displayed \n\t\t'style_plugin_settings'\t\t// The name of the section to which this field belongs\n\t);\n\n\tadd_settings_field(\n\t\t'vdtestim_num_testimonials',\n\t\t'Number Of Testimonials',\n\t\t'vdtestim_num_testimonials_callback',\n\t\t'vdtestim_style_settings',\n\t\t'style_plugin_settings'\n\t);\n\n\tadd_settings_field(\n\t\t'vdtestim_slide_testimonials',\n\t\t'Slide Testimonials',\n\t\t'vdtestim_slide_callback',\n\t\t'vdtestim_style_settings',\n\t\t'style_plugin_settings'\n\t);\n\n\tadd_settings_field(\n\t\t'vdtestim_truncate_text',\n\t\t'Limit Text',\n\t\t'vdtestim_truncate_callback',\n\t\t'vdtestim_style_settings',\n\t\t'style_plugin_settings'\n\t);\n\n\tadd_settings_field(\n\t\t'vdtestim_width',\n\t\t'Width',\n\t\t'vdtestim_width_callback',\n\t\t'vdtestim_style_settings',\n\t\t'style_plugin_settings'\n\t);\n\n\t//Adds style preview field\n\tadd_settings_field(\n\t\t'vdtestim_style_preview',\n\t\t'Preview',\n\t\t'vdtestim_style_preview',\n\t\t'vdtestim_style_settings',\n\t\t'style_plugin_settings'\n\t);\n\n\n\n\t//* Register Settings **************************************\n\n\t// creates vdtestim_global_settings array in the options table\n\tregister_setting(\n\t\t'vdtestim_global_settings', \n\t\t'vdtestim_global_settings',\n\t\t'vdtestim_options_validate' \n\t);\n\n\tregister_setting(\n\t\t'vdtestim_style_settings',\n\t\t'vdtestim_style_settings'\n\t);\n}", "public function add_settings() {\n if (self::$settings !== null) {\n $this->print_settings(self::$settings);\n }\n }", "function remi_custom_settings()\n{\n register_setting( 'remi-settings-group','thumbnail_one');\n register_setting( 'remi-settings-group','thumbnail_one_title');\n register_setting( 'remi-settings-group','thumbnail_one_link');\n register_setting( 'remi-settings-group','thumbnail_one_pic');\n\n register_setting( 'remi-settings-group','thumbnail_two');\n register_setting( 'remi-settings-group','thumbnail_two_title');\n register_setting( 'remi-settings-group','thumbnail_two_link');\n register_setting( 'remi-settings-group','thumbnail_two_pic');\n\n register_setting( 'remi-settings-group','thumbnail_three');\n register_setting( 'remi-settings-group','thumbnail_three_title');\n register_setting( 'remi-settings-group','thumbnail_three_link');\n register_setting( 'remi-settings-group','thumbnail_three_pic');\n\n register_setting( 'remi-settings-group','remi_jumbotron');\n register_setting( 'remi-settings-group','remi_jumbotron_link');\n register_setting( 'remi-settings-group','remi_jumbotron_greeting');\n register_setting( 'remi-settings-group','remi_jumbotron_picture');\n register_setting( 'remi-settings-group','remi_home_list');\n register_setting( 'remi-settings-group','remi_home_list_title');\n\n\n /*\n for contact page\n */\n register_setting( 'remi-contact-group','remi_contact_email');\n register_setting( 'remi-contact-group','remi_contact_address');\n register_setting( 'remi-contact-group','remi_contact_city');\n register_setting( 'remi-contact-group','remi_contact_postcode');\n register_setting( 'remi-contact-group','remi_contact_num1');\n register_setting( 'remi-contact-group','remi_contact_num2');\n register_setting( 'remi-contact-group','twitter_handler','remi_sanitize_twitter_handler');\n register_setting( 'remi-contact-group','facebook_handler');\n register_setting( 'remi-contact-group','gplus_handler');\n register_setting( 'remi-contact-group','instagram_handler');\n register_setting( 'remi-contact-group','linkden_handler');\n\n\n add_settings_section( 'remi-home-options', 'Home Options',\n 'remi_home_options', 'Adekunle_remi');\n\n add_settings_section( 'remi-contact-options', 'Contact Options',\n 'remi_contact_options', 'Adekunle_remi2');\n\n\n /*\n for general page\n */\n add_settings_field( 'thumbnail-one', 'Thumbnail One', 'remi_thumbnail_one',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'thumbnail-two', 'Thumbnail Two', 'remi_thumbnail_two',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'thumbnail-three', 'Thumbnail Three', 'remi_thumbnail_three',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'remi-jumbotron-im', 'Jumbotron', 'remi_jumbotron_handler',\n 'Adekunle_remi','remi-home-options');\n\n add_settings_field( 'remi-home-lis', 'Homepage Lists', 'remi_home_page_list',\n 'Adekunle_remi','remi-home-options');\n\n\n /*\n for contact page\n */\n add_settings_field( 'email-add', 'Email Address', 'remi_email_address',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'address-add', 'Full Address', 'remi_a_address',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'phone-add', 'Contact Number', 'remi_a_contact',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'twitter-im', 'Twitter Handler', 'remi_home_twitter_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'facebook-im', 'Facebook Handler', 'remi_home_facebook_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'gplus-im', 'Google+ Handler', 'remi_home_gplus_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'instagram-im', 'Instagram Handler', 'remi_home_instgram_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n add_settings_field( 'linkden-im', 'LinkdIn Handler', 'remi_home_linkden_handler',\n 'Adekunle_remi2','remi-contact-options');\n\n}", "public function init_settings()\n\t{\n\t\tregister_setting('jststm_testimonials_group', 'jststm_testimonials', function($input)\n\t\t{\n\t\t\tforeach($input as $i => $data)\n\t\t\t{\n\t\t\t\t$input[$i]['message'] = sanitize_text_field($data['message']);\n\t\t\t\t$input[$i]['author'] = sanitize_text_field($data['author']);\n\t\t\t}\n\n\t\t\treturn $input;\n\t\t});\n\t}", "public function KemiSitemap_settings()\n {\n\n // Register new settings for \"KemiSitemap_options\" page\n register_setting('KemiSitemap_group', 'KemiSitemap_options');\n\n // Register a new section in the \"KemiSitemap_options\" page\n add_settings_section(\n 'KemiSitemap_options',\n __('Kemi Sitemap', 'KemiSitemap'),\n array( $this, 'KemiSitemap_description' ),\n 'KemiSitemap_group'\n );\n }", "public function _register() {\n\t\t$settings = $this->get_settings();\n\t\t$empty = true;\n\n\t\tif ( is_array($settings) ) {\n\t\t\tforeach ( array_keys($settings) as $number ) {\n\t\t\t\tif ( is_numeric($number) ) {\n\t\t\t\t\t$this->_set($number);\n\t\t\t\t\t$this->_register_one($number);\n\t\t\t\t\t$empty = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $empty ) {\n\t\t\t// If there are none, we register the widget's existence with a\n\t\t\t// generic template\n\t\t\t$this->_set(1);\n\t\t\t$this->_register_one();\n\t\t}\n\t}", "function splashgate_admin_init(){\n\t\t\tregister_setting(\tSPLASHGATE_SETTINGS_GROUP, 'splashgate_options' ); // 'options' will be an array holding everything\n\t\t}", "public function register_settings() {\n\n /**\n * Convenience variable for storing field names to prevent run-time errors\n */\n $fields = array(\n \"image\" => $this->name . '_image'\n );\n \n /**\n * Retrieve the stored option set for this plugin from the db\n */\n $option_values = get_option( $this->name );\n\n /**\n * If the db doesn't return anything (ex: on first run), we will run \n * into null references below, so we define default values for our fields.\n * Note that we're making use of our $fields array from above\n */\n $default_values = array (\n $fields[\"image\"] => \"\"\n );\n\n // Parse option values into predefined keys defined in $data, throw the rest away.\n $data = shortcode_atts( $default_values, $option_values );\n\n /**\n * Register the setting category identified by $this->name\n * We use the same key everywhere since our plugin is simple enough\n * \n * @since 0.1.0\n */\n register_setting( \n $this->name, // Option group, used for settings_fields()\n $this->name, // Option name, key for DB for this option set\n array($this, \"validate_options\")); // validation callback\n\n\n /**\n * Create a section for our settings. For some reason 'default' did not work for me.\n */\n add_settings_section(\n $this->name, // Section ID\n \"Main Settings\", // Title\n array($this, \"render_section\"), // callback to render section\n $this->name // $menu_slug\n );\n\n /**\n * Create the field, which included a callback to render the field view\n * The array is an optional data set which defines arguments provided to\n * the render_image_field callback\n */\n add_settings_field(\n $fields[\"image\"], // Field ID\n \"Image\", // Title\n array( $this, 'render_image_field' ), // callback to render field\n $this->name, // $menu_slug\n $this->name, // Section ID\n array( // Args for callback to render field\n 'option_name' => $this->name,\n 'name' => $fields[\"image\"],\n 'value' => esc_attr($data[$fields[\"image\"]]) \n ) \n );\n }", "private function registerSetting()\n {\n $this->app->bind('setting', function ($app) {\n return new Setting($app);\n });\n\n $this->app->alias('setting', 'Setting\\Setting');\n }", "function lapizzeria_registrar_opciones(){\n register_setting( 'lapizzeria_opciones_grupo', 'lapizzeria_direccion' );\n register_setting( 'lapizzeria_opciones_grupo', 'lapizzeria_telefono' );\n\n register_setting( 'lapizzeria_opciones_gmaps', 'lapizzeria_gmap_iframe' );\n}", "public function register()\n {\n if (Schema::hasTable('m_settings')) {\n $mail = DB::table('m_settings')->first();\n if ($mail) {\n $config = array(\n 'driver' => 'smtp',\n 'host' => $mail->host,\n 'port' => $mail->port,\n 'from' => array('address' => $mail->email, 'name' => 'Seagame'),\n 'username' => $mail->email,\n 'password' => $mail->password,\n 'encryption' => 'tls',\n 'sendmail' => '/usr/sbin/sendmail -bs',\n 'pretend' => false,\n );\n Config::set('mail', $config);\n }\n }\n }", "function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/custom-page-extensions.js');\r\n }", "function sh_custom_settings_callback() {\n //register the user picture field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_picture');\n //register the user name field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_name' );\n //register the user description field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_description' );\n //add settings section\n add_settings_section( 'sh-custom-settings-options', 'Custom Options', 'sh_custom_settings_options_callback', 'custom_settings');\n //add the user name field to the hooked group of custom settings\n add_settings_field( 'sh-user-name', 'User Name', 'sh_custom_user_name_callback', 'custom_settings', 'sh-custom-settings-options');\n //add the user description field to the hooked group of custom settings\n add_settings_field( 'sh-user-description', 'User Description', 'sh_custom_user_description_callback', 'custom_settings', 'sh-custom-settings-options');\n //add the user picture field to the hooked group of custom settings\n add_settings_field( 'sh-user-picture', 'User Picture', 'sh_custom_user_picture_callback', 'custom_settings', 'sh-custom-settings-options');\n}", "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 }", "public function page_init()\n { \n register_setting(\n 'firebird_grupo',\n 'firebird_name',\n array( $this, 'sanitize' )\n );\n\n add_settings_section(\n 'setting_section_id',\n 'Configurações',\n array( $this, 'print_section_info' ),\n 'integracao-firebird-admin'\n ); \n\n add_settings_field(\n 'chave_token_api',\n 'Chave a ser utilizada no acesso a API de Importação',\n array( $this, 'chave_token_api_callback' ),\n 'integracao-firebird-admin',\n 'setting_section_id'\n );\n }", "private function load_settings() {\n\t\t\n\t}", "public function setRegistry()\n {\n $reg = controllers\\Registry::getInstance();\n foreach ($this->config as $key => $value)\n {\n $reg->setResource($key, $value, true);\n }\n\n\n }", "function dblions_settings() {\n\tregister_setting( 'dblions-settings-group', 'footer_text' );\n\tregister_setting( 'dblions-settings-group', 'desc_img' );\n\n\tregister_setting( 'dblions-sidebar-group', 'sidebar_embed' );\n\n\tregister_setting( 'dblions-social-group', 'facebook_link' );\n\tregister_setting( 'dblions-social-group', 'twitter_link' );\n\tregister_setting( 'dblions-social-group', 'instagram_link' );\n\tregister_setting( 'dblions-social-group', 'tumblr_link' );\n\tregister_setting( 'dblions-social-group', 'gplus_link' );\n\n\tadd_settings_section( 'dblions-general-options', 'General Options', \n\t\t'dblions_general_options', 'dblions' );\n\tadd_settings_section( 'dblions-img-options', 'Image Options', \n\t\t'dblions_img_options', 'dblions' );\n\tadd_settings_section( 'dblions-sidebar-options', 'Sidebar Options', \n\t\t'dblions_sidebar_options', 'dblions_sidebar' );\n\tadd_settings_section( 'dblions-social-options', 'Social Media Options', \n\t\t'dblions_social_options', 'dblions_social' );\n\n\tadd_settings_field( 'footer-text', 'Footer Text', 'dblions_footer_text', 'dblions', 'dblions-general-options' );\n\tadd_settings_field( 'desc-img', 'Description Background Image', 'dblions_desc_img', 'dblions', 'dblions-img-options' );\n\n\tadd_settings_field( 'sidebar-embed', 'Sidebar Embed', 'dblions_sidebar_embed', 'dblions_sidebar', 'dblions-sidebar-options' );\n\n\tadd_settings_field( 'facebook-link', 'Facebook Link', 'dblions_fb_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'twitter-link', 'Twitter Link', 'dblions_tw_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'instagram-link', 'Instagram Link', 'dblions_ig_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'tumblr-link', 'Tumblr Link', 'dblions_tumblr_link', 'dblions_social', 'dblions-social-options' );\n\tadd_settings_field( 'gplus-link', 'Google+ Link', 'dblions_gplus_link', 'dblions_social', 'dblions-social-options' );\n}", "function rad_register_setting(){\n\tregister_setting( 'rad_options_group', 'rad_options', 'rad_options_sanitize' );\n}", "public function registerSettings()\n {\n return [\n 'general' => [\n 'label' => 'Responsive Images',\n 'icon' => 'icon-picture-o',\n 'description' => 'HTML5 responsive image support.',\n 'class' => 'Bedard\\Resimg\\Models\\Settings',\n ],\n ];\n }", "public function settings()\n\t\t{\n\t\t\t$section = 'reading';\n\t\t\tadd_settings_section(\n\t\t\t\t$this->tag . '_settings_section',\n\t\t\t\t$this->name . ' Settings',\n\t\t\t\tfunction () {\n\t\t\t\t\techo '<p>Configuration options for the ' . esc_html( $this->name ) .' plugin.</p>';\n\t\t\t\t},\n\t\t\t\t$section\n\t\t\t);\n\t\t\tforeach ( $this->settings AS $id => $options ) {\n\t\t\t\t$options['id'] = $id;\n\t\t\t\tadd_settings_field(\n\t\t\t\t\t$this->tag . '_' . $id . '_settings',\n\t\t\t\t\t$id,\n\t\t\t\t\tarray( &$this, 'settings_field' ),\n\t\t\t\t\t$section,\n\t\t\t\t\t$this->tag . '_settings_section',\n\t\t\t\t\t$options\n\t\t\t\t);\n\t\t\t}\n\t\t\tregister_setting(\n\t\t\t\t$section,\n\t\t\t\t$this->tag,\n\t\t\t\tarray( &$this, 'settings_validate' )\n\t\t\t);\n\t\t}", "function gather_ua_jobs_register_settings() {\n\tregister_setting( 'gather_ua_jobs_settings', 'gather_ua_jobs_settings', 'gather_ua_jobs_sanitize_settings' );\n\n}", "public function register(): void\n {\n $this->mergeConfigFrom(__DIR__ . '/../config/settings.php', 'settings');\n\n $this->app->bind('settings', function () {\n $settingsConfig = config(\n sprintf('settings.repositories.%s', config('settings.default'))\n );\n\n $cacheRepository = Cache::store(\n config('settings.cache.store')\n );\n\n $settingsRepository = new $settingsConfig['handler'];\n\n return new Settings($settingsRepository, $cacheRepository);\n });\n }", "function register_mysettings() { // whitelist options\r\n register_setting( 'myoption-group', 'new_option_name' );\r\n register_setting( 'myoption-group', 'some_other_option' );\r\n register_setting( 'myoption-group', 'option_etc' );\r\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}" ]
[ "0.9039385", "0.9038664", "0.8256201", "0.8089207", "0.8007179", "0.7896884", "0.7880476", "0.78517866", "0.78336895", "0.7806468", "0.77815473", "0.7763555", "0.77361536", "0.7711588", "0.77084935", "0.7682588", "0.76640034", "0.76427954", "0.76252705", "0.76181585", "0.76070756", "0.75963485", "0.75627923", "0.7554893", "0.7553856", "0.75409716", "0.7538124", "0.75249875", "0.74998116", "0.74915475", "0.74914205", "0.74358946", "0.7424405", "0.7400017", "0.73952705", "0.7391207", "0.73698235", "0.73639977", "0.73639977", "0.73562944", "0.7344894", "0.73262084", "0.7315362", "0.7303501", "0.73030424", "0.7210425", "0.7207086", "0.7205586", "0.72039795", "0.71981573", "0.71912396", "0.7183585", "0.71743923", "0.71743923", "0.71743923", "0.7167251", "0.7165715", "0.7159028", "0.7152942", "0.71404606", "0.7115821", "0.7090827", "0.7061909", "0.7059591", "0.69860977", "0.69748706", "0.697", "0.69536084", "0.6951414", "0.6932493", "0.69194025", "0.69188994", "0.69025075", "0.6893342", "0.6879448", "0.68635046", "0.6858709", "0.68341005", "0.6812724", "0.68104535", "0.67893976", "0.67655855", "0.6761072", "0.67520684", "0.67427886", "0.67406714", "0.67322", "0.67255294", "0.67188233", "0.67146176", "0.6713188", "0.670501", "0.6697369", "0.6680365", "0.66590106", "0.6654662", "0.6649809", "0.66489875", "0.6645227", "0.66363776", "0.66292787" ]
0.0
-1
allow wordpress post editor functions to be used in theme options
function pu_display_setting($args) { extract($args); $option_name = 'pu_theme_options'; $options = get_option($option_name); switch ($type) { case 'text': $options[$id] = stripslashes($options[$id]); $options[$id] = esc_attr($options[$id]); echo "<input class='regular-text$class' type='text' id='$id' name='" . $option_name . "[$id]' value='$options[$id]' />"; echo ($desc != '') ? "<br /><span class='description'>$desc</span>" : ""; break; case 'textarea': $options[$id] = stripslashes($options[$id]); //$options[$id] = esc_attr( $options[$id]); $options[$id] = esc_html($options[$id]); printf( wp_editor($options[$id], $id, array('textarea_name' => $option_name . "[$id]", 'style' => 'width: 200px' )) ); // echo "<textarea id='$id' name='" . $option_name . "[$id]' rows='10' cols='50'>".$options[$id]."</textarea>"; // echo ($desc != '') ? "<br /><span class='description'>$desc</span>" : ""; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function posts_visual_editor_options() {\n\t\t// check user permissions\n\t\tif ( !current_user_can('edit_posts') && !current_user_can('edit_pages') ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// check if WYSIWYG is enabled\n\t\tif ( get_user_option('rich_editing') == 'true') {\n\t\t\tadd_filter( 'mce_css', array($this, 'wpe_bsp_add_editor_styles' ) );\n\t\t\tadd_filter( 'mce_external_plugins', array( $this,'add_tinymce_plugin' ) );\n\t\t}\n\t}", "function use_block_editor_for_post($post)\n {\n }", "function wp_default_editor()\n {\n }", "function wp_enqueue_editor()\n {\n }", "function wp_idolondemand_edit_post()\n{\n}", "function fix_no_editor_on_posts_page($post)\n{\n\n if ($post->ID != get_option('page_for_posts')) {\n return;\n }\n\n remove_action('edit_form_after_title', '_wp_posts_page_notice');\n add_post_type_support('page', 'editor');\n\n}", "function use_block_editor_for_post_type($post_type)\n {\n }", "function wysiwyg($args) {\r\n\t\t\t$args = $this->apply_name_fix($this->apply_default_args($args)) ;\r\n\t\t\techo \"<div class='postarea'>\";\r\n\t\t\tthe_editor($args['value'] , $args['formname']);\r\n\t\t\techo \"</div>\";\r\n\t\t\t$this->description($args['description']);\r\n\t\t}", "function eddenvato_mce(){\n\n\t// Don't bother doing this stuff if the current user lacks permissions\n\tif ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )\n\treturn;\n\n\t// Add only in Rich Editor mode\n\tif( get_user_option('rich_editing') == 'true'){\n\n\t\t// Add cutom button to TinyMCE\n\t\tadd_filter('mce_external_plugins', \"eddenvato_mce_register\");\n\t\tadd_filter('mce_buttons', 'eddenvato_add_button', 0);\n\n\t}\n\n}", "function _enable_content_editor_for_navigation_post_type($post)\n {\n }", "function wp_image_editor_supports($args = array())\n {\n }", "function override_edit_to_elementor()\n{\n\t$post_type = get_post_type();\n\tif($post_type == 'show'&&is_admin()&&(strstr( $_SERVER['REQUEST_URI'], 'post-new.php' )))\n\t{\n\t?>\n\t<script>\n\t\tjQuery(document).ready(function(){ \n\t\t\telementor_page_link_el = jQuery(\"#elementor-go-to-edit-page-link\");\n\t\t\telementor_button_el = jQuery('#elementor-switch-mode-button');\n\t\t\tform_el = jQuery(\"#post\");\n\t\t\telementor_page_link = elementor_page_link_el.attr(\"href\");\n\t\t\telementor_button_el.unbind();\n\t\t\telementor_button_el.off();\n\t\t\telementor_button_el.click = '';\n\t\t\telementor_button_el.on(\"click\",function(e){\n\t\t\t\tjQuery(\"#post\");\n\t\t\t\te.preventDefault();\n\t\t\t\t// alert(elementor_page_link);\n\t\t\t\t// alert(jQuery(\"#post_ID\").val());\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\turl: 'post.php',\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\tdata: jQuery(\"#post\").serialize().replace(\"content=\", \"content=[view_3]\"),\n\t\t\t\t})\n\t\t\t\t.done(function() {\n\t\t\t\t\twindow.location.href = elementor_page_link;\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t});\n\t\t});\n\t\t\n\t</script>\n\t<?php\n\t}\n}", "function bg_PatchEditor(){\n // Don't bother doing this stuff if the current user lacks permissions and only in RichEditor mode\n if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') && get_user_option('rich_editing') != 'true'){\n return;\n }\n \n add_filter('tiny_mce_before_init', 'bg_AddBeyondGrammarSettings' );\n add_filter(\"tiny_mce_version\", \"bg_SetupTinyMCEPlugin\" );\n add_filter(\"mce_external_plugins\", \"bg_LoadBeyondGrammarMCEPlugin\");\n add_filter(\"mce_buttons\", \"bg_AddBeyondGrammarButton\");\n}", "function guest_metabox( $post ) {\n\t// lower-case letters. No underscores, no hyphens. Anything else will cause the WYSIWYG\n\t// editor to malfunction.\n\t$meta_key = Classes::GUEST_META_KEY;\n\t$content = get_post_meta( $post->ID, $meta_key, true );\n\twp_editor( $content, 'guestcontent', $settings = array() );\n}", "function kindred_disable_classic_editor()\r\n{\r\n $screen = get_current_screen();\r\n if ('page' !== $screen->id || !isset($_GET['post'])) {\r\n return;\r\n }\r\n\r\n if (kindred_disable_editor($_GET['post'])) {\r\n remove_post_type_support('page', 'editor');\r\n }\r\n}", "function wp_post_preview_js()\n {\n }", "function edit_form_image_editor($post)\n {\n }", "function pu_display_setting($args)\n{\n extract( $args );\n\n $option_name = 'pu_theme_options';\n\n $options = get_option( $option_name );\n\n switch ( $type ) { \n case 'text': \n $options[$id] = stripslashes($options[$id]); \n $options[$id] = esc_attr( $options[$id]); \n echo \"<input class='regular-text$class' type='text' id='$id' name='\" . $option_name . \"[$id]' value='$options[$id]' />\"; \n echo ($desc != '') ? \"<br /><span class='description'>$desc</span>\" : \"\";\n break;\n case 'textarea': \n $options[$id] = stripslashes($options[$id]); \n //$options[$id] = esc_attr( $options[$id]);\n $options[$id] = esc_html( $options[$id]); \n\n printf(\n \twp_editor($options[$id], $id, \n \t\tarray('textarea_name' => $option_name . \"[$id]\",\n \t\t\t'style' => 'width: 200px'\n \t\t\t)) \n\t\t\t\t);\n // echo \"<textarea id='$id' name='\" . $option_name . \"[$id]' rows='10' cols='50'>\".$options[$id].\"</textarea>\"; \n // echo ($desc != '') ? \"<br /><span class='description'>$desc</span>\" : \"\"; \n break; \n }\n}", "function pu_display_setting($args)\n{\n extract($args);\n\n $option_name = 'pu_theme_options';\n\n $options = get_option($option_name);\n\n switch ($type) {\n case 'text':\n $options[$id] = stripslashes($options[$id]);\n $options[$id] = esc_attr($options[$id]);\n echo \"<input class='regular-text$class' type='text' id='$id' name='\" . $option_name . \"[$id]' value='$options[$id]' />\";\n echo ($desc != '') ? \"<br /><span class='description'>$desc</span>\" : \"\";\n break;\n case 'textarea':\n $options[$id] = stripslashes($options[$id]);\n //$options[$id] = esc_attr( $options[$id]);\n $options[$id] = esc_html($options[$id]);\n\n printf(\n wp_editor($options[$id], $id,\n array('textarea_name' => $option_name . \"[$id]\",\n 'style' => 'width: 200px',\n ))\n );\n // echo \"<textarea id='$id' name='\" . $option_name . \"[$id]' rows='10' cols='50'>\".$options[$id].\"</textarea>\";\n // echo ($desc != '') ? \"<br /><span class='description'>$desc</span>\" : \"\";\n break;\n }\n}", "function wp_print_editor_js()\n {\n }", "function caldol_bbp_enable_visual_editor( $args = array() ) {\n\t $args['tinymce'] = true;\n\t $args['html'] = false;\n\t//$args['ckeditor'] = true;\n\treturn $args;\n}", "function bones_ahoy() {\n\n //Allow editor style.\n add_editor_style( get_current_revision(get_stylesheet_directory_uri() . '/library/css/editor-style.css' ));\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY\n //require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'bones_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'bones_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'bones_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'bones_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'bones_filter_ptags_on_images' );\n // cleaning up excerpt\n //add_filter( 'excerpt_more', 'bones_excerpt_more' );\n add_filter( 'excerpt_length', 'bones_excerpt_length', 999 );\n\n add_action( 'wp_default_scripts', 'remove_jquery_migrate' );\n\n}", "public function be_hide_editor() {\n // Get the Post ID\n if (isset($_GET['post']))\n $post_id = $_GET['post'];\n elseif (isset($_POST['post_ID']))\n $post_id = $_POST['post_ID'];\n\n if (!isset($post_id))\n return;\n\n // Get the Page Template\n $template_file = get_post_meta($post_id, '_wp_page_template', TRUE);\n\n //if ('template-photos.php' == $template_file)\n //echo '<style>#postdivrich{display: none;}</style>';\n remove_post_type_support('post', 'editor');\n }", "function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = \\true, $tab_index = 2, $extended = \\true)\n {\n }", "function ffw_port_rich_editor_callback( $args ) {\n global $ffw_port_settings, $wp_version;\n\n if ( isset( $ffw_port_settings[ $args['id'] ] ) )\n $value = $ffw_port_settings[ $args['id'] ];\n else\n $value = isset( $args['std'] ) ? $args['std'] : '';\n\n if ( $wp_version >= 3.3 && function_exists( 'wp_editor' ) ) {\n $html = wp_editor( stripslashes( $value ), 'ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']', array( 'textarea_name' => 'ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']' ) );\n } else {\n $html = '<textarea class=\"large-text\" rows=\"10\" id=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\" name=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\">' . esc_textarea( stripslashes( $value ) ) . '</textarea>';\n }\n\n $html .= '<br/><label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n\n echo $html;\n}", "function wp_caption_input_textarea($edit_post)\n {\n }", "function _disable_content_editor_for_navigation_post_type($post)\n {\n }", "function wp_hooks() \n {\n // Wordpress actions & filters \n add_action( 'admin_menu', array(&$this,'admin_menu_link') );\n add_action( 'admin_head', array(&$this, 'remove_mediabuttons') );\n add_action( 'init', array(&$this, 'add_custom_post_type') );\n add_action( 'admin_init', array(&$this, 'add_metaboxes') );\n add_action( 'save_post', array(&$this, 'save_source_metabox'), 10, 2 );\n add_action( 'manage_posts_custom_column', array(&$this, 'add_custom_columns') ); // sets the row value\n \n $filter = 'manage_edit-' . $this->custom_post_type_name . '_columns';\n add_filter( $filter, array(&$this, 'add_header_columns') );\n add_filter( 'body_class', array(&$this, 'body_classes') );\n add_action('wp_print_styles', array(&$this, 'add_css') );\n\n add_filter( 'enter_title_here', array(&$this, 'change_title_text'), 10, 1 );\n add_filter( 'post_row_actions', array(&$this, 'remove_row_actions'), 10, 1 );\n add_filter( 'post_updated_messages', array(&$this, 'bbquotations_updated_messages') );\n\n add_action( 'admin_print_footer_scripts', array(&$this, 'remove_preview_button') );\n\n // add shortcode\n add_shortcode( 'bbquote', array(&$this, 'shortcode') );\n }", "function disable_visual_editor()\n{\n if ( 'signature' == get_post_type() )\n {\n return false;\n }\n return true;\n}", "function derefe_admin_init(){\n\t// add_action( 'add_meta_boxes', string $post_type, WP_Post $post )\n\n\t// The hook will only run when editing a specific post type. \n\t// add_action( \"add_meta_boxes_{$post_type}\", WP_Post $post )\n\n\tadd_action( 'add_meta_boxes_cus_pot_type', 'derefe_create_metaboxes');\n\tinclude( 'create_metaboxes.php');\n\tinclude( 'custom-post-type-options.php');\n\n}", "function editorize_add_meta_box() {\n\t$current_post_editor = editorize_get_post_editor( get_the_ID() );\n\tif ( $current_post_editor == get_current_user_id() || ! current_user_can( 'edit_others_posts' ) )\n\t\treturn;\n\n\tadd_meta_box( 'editorize', __( 'Post Editor' ), 'editorize_display_meta_box', 'post', 'side' );\n}", "function wp_tiny_mce($teeny = \\false, $settings = \\false)\n {\n }", "function callback_wysiwyg(array $args)\n {\n }", "function init_remove_support(){\n if( !empty($_GET['post']) && intval($_GET['post']) == get_option( 'page_on_front' ) ) {\n remove_post_type_support('page', 'editor');\n }\n}", "function ht_admin_post_format_switcher($hook) {\r\n\tif ($hook == 'post.php' || $hook == 'post-new.php') {\r\n\t\twp_enqueue_script('pf-post-meta', get_template_directory_uri() . '/framework/js/post-format-switcher.js', array( 'jquery' ));\r\n\t}\r\n}", "function _wp_image_editor_choose($args = array())\n {\n }", "function kindred_disable_gutenberg($can_edit, $post_type)\r\n{\r\n if (!(is_admin() && !empty($_GET['post']))) {\r\n return $can_edit;\r\n }\r\n\r\n if (kindred_disable_editor($_GET['post'])) {\r\n $can_edit = false;\r\n }\r\n\r\n return $can_edit;\r\n}", "function nxt_posts_p_add_options(){\n\n\tadd_option( 'nxt_post_option_template_select', 'themes/theme_1.php');\n\tadd_option( 'nxt_post_plugin_enable');\n}", "function bones_ahoy() {\n\n //Allow editor style.\n add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY\n require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'bones_head_cleanup' );\n // wp_title replaced by title_tag below\n //add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'bones_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'bones_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'bones_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'bones_filter_ptags_on_images' );\n // cleaning up excerpt\n add_filter( 'excerpt_more', 'bones_excerpt_more' );\n /*\n * Let WordPress manage the document title.\n * By adding theme support, we declare that this theme does not use a\n * hard-coded <title> tag in the document head, and expect WordPress to\n * provide it for us.\n */\n add_theme_support( 'title-tag' );\n\n}", "function itstar_ahoy() {\n\n //Allow editor style.\n //add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'itstar', get_template_directory() . '/languages' );\n\n // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY\n require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'itstar_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'itstar_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'itstar_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'itstar_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'itstar_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'itstar_scripts_and_styles', 999 );\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n itstar_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'itstar_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'itstar_filter_ptags_on_images' );\n // cleaning up excerpt\n add_filter( 'excerpt_more', 'itstar_excerpt_more' );\n\n remove_filter('template_redirect', 'redirect_canonical'); \n}", "function post_options()\n\t{\n\t\tglobal $auth;\n\n\t\t$this->auth_bbcode = ($auth->acl_get('u_blogbbcode')) ? true : false;\n\t\t$this->auth_smilies = ($auth->acl_get('u_blogsmilies')) ? true : false;\n\t\t$this->auth_img = ($auth->acl_get('u_blogimg')) ? true : false;\n\t\t$this->auth_url = ($auth->acl_get('u_blogurl')) ? true : false;\n\t\t$this->auth_flash = ($auth->acl_get('u_blogflash')) ? true : false;\n\n\t\tblog_plugins::plugin_do('post_options');\n\t}", "function sr_admin_actions() { \n\tadd_options_page(\"Standards Reader\", \"Standards Reader\", \"edit_published_posts\", \"sr_options\", \"sr_admin\");\n}", "function wp_use_widgets_block_editor()\n {\n }", "function use_block_editor_for_post_type($use_block_editor, $post_type)\n {\n }", "function zee_tinymce_js() {\r\n\r\n //make sure the user has correct permissions\r\n if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) {\r\n return;\r\n }\r\n \r\n //only add to visual mode\r\n if ( get_user_option('rich_editing') == 'true' ) {\r\n add_filter( 'mce_external_plugins', 'add_js_plugin' );\r\n add_filter( 'mce_buttons', 'register_zee_tinymce_button' );\r\n }\r\n\r\n}", "function wpestate_tiny_short_codes_register() {\n if (!current_user_can('edit_posts') && !current_user_can('edit_pages')) {\n return;\n }\n \n if (get_user_option('rich_editing') == 'true') {\n add_filter('mce_external_plugins', 'wpestate_add_plugin');\n add_filter('mce_buttons_3', 'wpestate_register_button'); \n }\n\n}", "function wpdocs_theme_add_editor_styles() {\n add_editor_style( 'editor-style.css' );\n}", "function echotheme_add_shortcode_button() {\n\tif ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') ) return;\n\tif ( get_user_option('rich_editing') == 'true') :\n\t\tadd_filter('mce_external_plugins', 'echotheme_add_shortcode_tinymce_plugin');\n\t\tadd_filter('mce_buttons', 'echotheme_register_shortcode_button');\n\tendif;\n}", "abstract public function get_editor_options();", "function hotel_lux_gutenberg_editor_styles() {\r\n\twp_deregister_style('wp-block-library-theme');\r\n\twp_register_style('wp-block-library-theme', '');\r\n\t\r\n wp_enqueue_style('hotel-lux-gutenberg-editor-style', get_theme_file_uri( '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/css/editor-style.css' ), false, '1.0', 'all');\r\n\t\r\n\t\r\n\tif (is_rtl()) {\r\n\t\twp_enqueue_style('hotel-lux-gutenberg-editor-style-rtl', get_template_directory_uri() . '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/css/module-rtl.css', array(), '1.0.0', 'screen');\r\n\t}\r\n\t\r\n\t\r\n\t// Scripts\r\n\twp_enqueue_script('hotel-lux-gutenberg-editor-options-script', get_template_directory_uri() . '/gutenberg/cmsmasters-framework/theme-style' . CMSMASTERS_THEME_STYLE . '/js/editor-options.js', array('jquery'), '1.0.0', true);\r\n\t\r\n\t\r\n\t$gutenberg_module_styles = hotel_lux_gutenberg_module_colors('', true);\r\n\t$gutenberg_module_styles .= hotel_lux_gutenberg_module_fonts('', true);\r\n\t\r\n\twp_add_inline_style('hotel-lux-gutenberg-editor-style', $gutenberg_module_styles);\r\n}", "function custom_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Engagements', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Engagement', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Engagements'),\n\t\t'all_items' => __( 'All Engagements'),\n\t\t'view_item' => __( 'View Engagement'),\n\t\t'add_new_item' => __( 'Add New Engagement'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Engagement'),\n\t\t'update_item' => __( 'Update Engagement')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'engagements'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"engagements\"),\n 'register_meta_box_cb' => 'add_engagements_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'engagements', $args );\n\n}", "function _set_preview($post)\n {\n }", "function add_mce_button() {\n\t\t// Check user permissions\n\t\tif ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if WYSIWYG is enabled\n\t\tif ( 'true' == get_user_option( 'rich_editing' ) ) {\n\t\t\tadd_filter( 'mce_external_plugins', array( &$this, 'add_mce_plugin' ) );\n\t\t\tadd_filter( 'mce_buttons', array( &$this, 'register_mce_button' ) );\n\t\t}\n\t}", "function _show_post_preview()\n {\n }", "function figjam_framework_add_editor_styles() {\n add_editor_style( 'assets/css/editor-styles.css' );\n\n /**\n * Set Content Width\n */\n global $content_width;\n if ( ! isset( $content_width ) ) $content_width = 1170;\n\n //add_post_type_support('testimonial', 'thumbnail');\n //add_post_type_support('portfolio', 'excerpt');\n\n }", "public function registerCustomPost()\n {\n add_action('do_meta_boxes', array($this,'hideMetaBoxes' ));\n add_action('admin_head', array($this,'hideControlls' ));\n add_action('admin_init', array($this, 'buildCustomPostWidgets'));\n add_action('the_post', array($this, 'setFeaturedImage' ));\n add_action('save_post', array($this, 'setFeaturedImage' ));\n add_action('draft_to_publish', array($this, 'setFeaturedImage' ));\n }", "function post_preview()\n {\n }", "function my_add_mce_button() {\n\t// check user permissions\n\tif ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {\n\t\treturn;\n\t}\n\t// check if WYSIWYG is enabled\n\tif ( 'true' == get_user_option( 'rich_editing' ) ) {\n\t\tadd_filter( 'mce_external_plugins', 'my_add_tinymce_plugin' );\n\t\tadd_filter( 'mce_buttons', 'my_register_mce_button' );\n\t}\n}", "function my_add_mce_button() {\n\t// check user permissions\n\tif ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {\n\t\treturn;\n\t}\n\t// check if WYSIWYG is enabled\n\tif ( 'true' == get_user_option( 'rich_editing' ) ) {\n\t\tadd_filter( 'mce_external_plugins', 'my_add_tinymce_plugin' );\n\t\tadd_filter( 'mce_buttons', 'my_register_mce_button' );\n\t}\n}", "static function metabox_at_post_edit_page(){\n\t\t \tadd_meta_box('matebox-to-handle-keywords', 'Affiliate Keywords', array(get_class(), 'metabox_to_deal_keywords'), 'product', 'advanced', 'high');\t \t\n\t\t }", "function _load_edit_functions(){\r\n\r\n add_action( 'restrict_manage_posts', '_filter_by_page_parent' );\r\n add_action( 'pre_get_posts', '_load_edit_function_query' );\r\n\r\n}", "function edit_post($post_data = \\null)\n {\n }", "function faculty_settings_post_meta() {\n faculty_setting_line(faculty_add_background_color_setting('post_meta_background_color', __('Background', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_color_setting('post_meta_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('post_meta_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('post_meta_text_transform', __('Text Transform', FACULTY_DOMAIN), 'transform'));\n do_action('faculty_settings_post_meta');\n}", "public function add_post_preview_meta_options($post){\n\t\t\t\n\t\tglobal $post, $post_type;\n\t\t\n\t\t// Add a nonce field (for security)\n\t\twp_nonce_field( 'sc_upcoming_nonce', 'sc_upcoming_nonce_field' );\n\t\t\n\t\t//determine if we are on a post \n\t\tif('post' == $post_type){\n\t\t\t\n\t\t\t//collect settings\n\t\t\t$upcoming_preview_status = (get_post_meta($post->ID,'upcoming_preview_status',true) ? get_post_meta($post->ID,'upcoming_preview_status',true) : 'false');\n\t\t\t$upcoming_preview_type = (get_post_meta($post->ID,'upcoming_preview_type', true) ? get_post_meta($post->ID,'upcoming_preview_type', true) : 'false');\n\t\t\t$upcoming_preview_type_x_words = (get_post_meta($post->ID,'upcoming_preview_x_words_number', true) ? get_post_meta($post->ID,'upcoming_preview_x_words_number', true) : '');\n\t\t\n\t\t\t?>\n\t\t\t<div class=\"misc-pub-section\">\n\t\t\t\t<div class=\"set-upcoming-preview\">\n\t\t\t\t\t<span class=\"title\">Upcoming Preview:</span>\n\t\t\t\t\t\n\t\t\t\t\t<!--Upcoming post preview on / off option-->\n\t\t\t\t\t<div class=\"content-options \">\n\t\t\t\t\t\t<input class=\"value\" type=\"radio\" name=\"upcoming_preview_status\" id=\"coming_preview_disabled\" value=\"false\" <?php if($upcoming_preview_status == 'false'){ echo 'checked';}?>/>\n\t\t\t\t\t\t<label for=\"coming_preview_disabled\"> Disable upcoming preview</label><br/>\n\t\t\t\t\t\t<input class=\"value\" type=\"radio\" name=\"upcoming_preview_status\" id=\"coming_preview_enabled\" value=\"true\" <?php if($upcoming_preview_status == 'true'){ echo 'checked';}?>/>\n\t\t\t\t\t\t<label for=\"coming_preview_enabled\"> Enable upcoming preview</label>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<!--Upcoming post preview display settings-->\n\t\t\t\t\t\t<div class=\"content-settings <?php echo ($upcoming_preview_status == 'true' ? 'active' : ''); ?>\">\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t//action, execute code before we display main options\n\t\t\t\t\t\t\tdo_action('sc_upcoming_post_admin_form_start', $post);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<input class=\"value\" type=\"radio\" name=\"upcoming_preview_type\" id=\"upcoming_preview_more_tag\" value=\"upcoming_preview_more_tag\" <?php if($upcoming_preview_type == 'upcoming_preview_more_tag'){ echo 'checked';}?>/>\n\t\t\t\t\t\t\t<label for=\"upcoming_preview_more_tag\">Show post preview up to the 'more' tag </label>\n\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<input class=\"value\" type=\"radio\" name=\"upcoming_preview_type\" id=\"upcoming_preview_x_words\" value=\"upcoming_preview_x_words\" <?php if($upcoming_preview_type == 'upcoming_preview_x_words'){ echo 'checked';}?>/>\n\t\t\t\t\t\t\t<label for=\"upcoming_preview_x_words\">Show X number of Words</label>\n\t\t\t\t\t\t\t<!--Upcoming post preview, number of words to display-->\n\t\t\t\t\t\t\t<div class=\"content-sub-settings <?php echo ($upcoming_preview_type == 'upcoming_preview_x_words' ? 'active' : ''); ?>\">\n\t\t\t\t\t\t\t\t<label for=\"upcoming_preview_x_words_number\">Number of words</label>\n\t\t\t\t\t\t\t\t<input type=\"number\" class=\"widefat\" name=\"upcoming_preview_x_words_number\" id=\"upcoming_preview_x_words_number\" value=\"<?php echo $upcoming_preview_type_x_words; ?>\"/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t//action, execute code after we display main options\n\t\t\t\t\t\t\tdo_action('sc_upcoming_post_admin_form_end', $post);\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t}", "function prosody_poem_resources_meta_box($post=null)\n{\n $post = (is_null($post)) ? get_post() : $post;\n\n //Add a nonce field so we can check for it later\n wp_nonce_field(\n 'prosody_poem_resources_meta_box',\n 'prosody_poem_resources_meta_box_nonce'\n );\n\n /*\n * Use get_post_meta() to retrieve an existing value\n * from the database and use the value for the form.\n */\n $value = get_post_meta( $post->ID, 'Resources', true);\n\n echo '<label for=\"prosody_poem_resources_editor\">';\n __( 'Resources:', 'prosody' );\n echo '</label> ';\n $settings = array( 'textarea_rows' => '15', 'tinymce' => true, 'media_buttons' => true, 'quicktags' => true, 'wpautop' => true );\n wp_editor( $value, \"prosody_poem_resources_editor\", $settings );\n}", "function wpse72394_shortcode_button_init() {\r\n if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') && get_user_option('rich_editing') == 'true')\r\n return;\r\n\r\n //Add a callback to regiser our tinymce plugin\r\n add_filter(\"mce_external_plugins\", \"wpse72394_register_tinymce_plugin\");\r\n\r\n // Add a callback to add our button to the TinyMCE toolbar\r\n add_filter('mce_buttons', 'wpse72394_add_tinymce_button');\r\n}", "function dd_if_conditions_addbuttons() {\n if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )\n return;\n \n // Add only in Rich Editor mode\n if ( get_user_option('rich_editing') == 'true') {\n add_filter(\"mce_external_plugins\", \"dd_if_conditions_tinymce_plugin\");\n add_filter('mce_buttons', 'dd_if_conditions_button');\n }\n}", "function subway_setting_callback_function() {\n\n\techo '<textarea id=\"subway_public_post\" name=\"subway_public_post\" rows=\"5\" cols=\"95\">' . esc_attr( trim( get_option( 'subway_public_post' ) ) ) . '</textarea>';\n\n\techo '<p class=\"description\">' . nl2br( esc_html( \"Enter the IDs of posts and pages that you wanted to show in public. You need to separate it by ',' (comma), \\nfor example: 143,123,213. Alternatively, you can enable public viewing of all of your pages and posts by checking the option below.\", 'subway' ) ) . '</p>';\n\n\treturn;\n}", "function wp_ajax_send_link_to_editor()\n {\n }", "function rosemary_meta_callback( $post ) {\r\n wp_nonce_field( basename( __FILE__ ), 'rosemary_nonce' );\r\n $rosemary_stored_meta = get_post_meta( $post->ID );\r\n\tglobal $typenow;\r\n ?>\r\n\t\r\n<?php if($typenow == 'page') : ?>\r\n\t<div id=\"sp-blog-options\">\r\n\t\t\r\n\t\t<p class=\"guten-message\">Make sure to select the \"<strong>Page Blog Template</strong>\" under <strong>Page Attributes</strong> if using the below settings.</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"meta-text-blog-heading\" class=\"prfx-row-title\"><?php _e( 'Blog Heading', 'solopine' )?></label>\r\n\t\t\t<input type=\"text\" name=\"meta-text-blog-heading\" id=\"meta-text-blog-heading\" value=\"<?php if ( isset ( $rosemary_stored_meta['meta-text-blog-heading'] ) ) echo $rosemary_stored_meta['meta-text-blog-heading'][0]; ?>\" />\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"meta-select-blog-layout\" class=\"prfx-row-title\"><?php _e( 'Blog Layout', 'solopine' )?></label>\r\n\t\t\t<select name=\"meta-select-blog-layout\" id=\"meta-select-blog-layout\">\r\n\t\t\t\t<option value=\"full_post\" <?php if ( isset ( $rosemary_stored_meta['meta-select-blog-layout'] ) ) selected( $rosemary_stored_meta['meta-select-blog-layout'][0], 'full_post' ); ?>><?php _e( 'Full Post Layout', 'solopine' )?></option>';\r\n\t\t\t\t<option value=\"grid\" <?php if ( isset ( $rosemary_stored_meta['meta-select-blog-layout'] ) ) selected( $rosemary_stored_meta['meta-select-blog-layout'][0], 'grid' ); ?>><?php _e( 'Grid Layout', 'solopine' )?></option>';\r\n\t\t\t\t<option value=\"full_grid\" <?php if ( isset ( $rosemary_stored_meta['meta-select-blog-layout'] ) ) selected( $rosemary_stored_meta['meta-select-blog-layout'][0], 'full_grid' ); ?>><?php _e( '1 Full then Grid', 'solopine' )?></option>';\r\n\t\t\t\t<option value=\"list\" <?php if ( isset ( $rosemary_stored_meta['meta-select-blog-layout'] ) ) selected( $rosemary_stored_meta['meta-select-blog-layout'][0], 'list' ); ?>><?php _e( 'List Layout', 'solopine' )?></option>';\r\n\t\t\t\t<option value=\"full_list\" <?php if ( isset ( $rosemary_stored_meta['meta-select-blog-layout'] ) ) selected( $rosemary_stored_meta['meta-select-blog-layout'][0], 'full_list' ); ?>><?php _e( '1 Full then List', 'solopine' )?></option>';\r\n\t\t\t</select>\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"meta-number-posts\" class=\"prfx-row-title\"><?php _e( '# of Posts Per Page', 'solopine' )?></label>\r\n\t\t\t<input type=\"number\" min=\"1\" max=\"100\" step=\"1\" name=\"meta-number-posts\" id=\"meta-number-posts\" value=\"<?php if ( isset ( $rosemary_stored_meta['meta-number-posts'] ) ) : echo $rosemary_stored_meta['meta-number-posts'][0]; else : echo 9; endif; ?>\" />\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"meta-blog-category\" class=\"prfx-row-title\"><?php _e( 'Filter by Category (slug)', 'solopine' )?></label>\r\n\t\t\t<input type=\"text\" name=\"meta-blog-category\" id=\"meta-blog-category\" value=\"<?php if ( isset ( $rosemary_stored_meta['meta-blog-category'] ) ) echo $rosemary_stored_meta['meta-blog-category'][0]; ?>\" />\r\n\t\t\t<small style=\"display:block;\">Separate category slugs with a comma. Leave this field blank to show all categories.</small>\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<span class=\"prfx-row-title\"><?php _e( 'Fullwidth Layout (no sidebar)', 'solopine' )?>:</span>\r\n\t\t\t<div class=\"prfx-row-content\">\r\n\t\t\t\t<label for=\"meta-checkbox-fullwidth\">\r\n\t\t\t\t\t<input type=\"checkbox\" name=\"meta-checkbox-fullwidth\" id=\"meta-checkbox-fullwidth\" value=\"yes\" <?php if ( isset ( $rosemary_stored_meta['meta-checkbox-fullwidth'] ) ) checked( $rosemary_stored_meta['meta-checkbox-fullwidth'][0], 'yes' ); ?> />\r\n\t\t\t\t</label>\r\n\t\t\t</div>\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<span class=\"prfx-row-title\"><?php _e( 'Include Page Content', 'solopine' )?>:</span>\r\n\t\t\t<div class=\"prfx-row-content\">\r\n\t\t\t\t<label for=\"meta-checkbox-page-content\">\r\n\t\t\t\t\t<input type=\"checkbox\" name=\"meta-checkbox-page-content\" id=\"meta-checkbox-page-content\" value=\"yes\" <?php if ( isset ( $rosemary_stored_meta['meta-checkbox-page-content'] ) ) checked( $rosemary_stored_meta['meta-checkbox-page-content'][0], 'yes' ); ?> />\r\n\t\t\t\t</label>\r\n\t\t\t</div>\r\n\t\t</p>\t\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<span class=\"prfx-row-title\"><?php _e( 'Include Featured Slider', 'solopine' )?>:</span>\r\n\t\t\t<div class=\"prfx-row-content\">\r\n\t\t\t\t<label for=\"meta-checkbox-blog-slider\">\r\n\t\t\t\t\t<input type=\"checkbox\" name=\"meta-checkbox-blog-slider\" id=\"meta-checkbox-blog-slider\" value=\"yes\" <?php if ( isset ( $rosemary_stored_meta['meta-checkbox-blog-slider'] ) ) checked( $rosemary_stored_meta['meta-checkbox-blog-slider'][0], 'yes' ); ?> />\r\n\t\t\t\t</label>\r\n\t\t\t</div>\r\n\t\t</p>\r\n\t\t<p>\r\n\t\t\t<span class=\"prfx-row-title\"><?php _e( 'Include Promo Boxes', 'solopine' )?>:</span>\r\n\t\t\t<div class=\"prfx-row-content\">\r\n\t\t\t\t<label for=\"meta-checkbox-blog-promo\">\r\n\t\t\t\t\t<input type=\"checkbox\" name=\"meta-checkbox-blog-promo\" id=\"meta-checkbox-blog-promo\" value=\"yes\" <?php if ( isset ( $rosemary_stored_meta['meta-checkbox-blog-promo'] ) ) checked( $rosemary_stored_meta['meta-checkbox-blog-promo'][0], 'yes' ); ?> />\r\n\t\t\t\t</label>\r\n\t\t\t</div>\r\n\t\t</p>\t\r\n\t\t\r\n\t</div>\r\n\t\r\n\t<?php endif; \r\n\r\n}", "function post_excerpt_meta_box($post)\n {\n }", "function caldol_bbp_enable_visual_editor_two( $args = array() ) {\n\n\n $args['tinymce'] = true;\n\t$args['media_buttons'] = true;\n\t$args['textarea_rows'] = true;\n\t$args['dfw'] = false;\n\t$args['tinymce'] = array( 'theme_advanced_buttons1' =>'bold,italic,underline,strikethrough,bullist,numlist,code,blockquote,link,unlink,outdent,indent,|,undo,redo,fullscreen',\n'theme_advanced_buttons2' => '', // 2nd row, if needed\n \t'theme_advanced_buttons3' => '', // 3rd row, if needed\n \t'theme_advanced_buttons4' => '', ); // 4th row, if needed\t\n\t$args['quicktags'] = array ('buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close');\n return $args;\t\n}", "function post_revisions_meta_box($post)\n {\n }", "function wtfdivi099_add_post_types($post_types) {\r\n\tforeach(get_post_types() as $pt) {\r\n\t\tif (!in_array($pt, $post_types) and post_type_supports($pt, 'editor')) {\r\n\t\t\t$post_types[] = $pt;\r\n\t\t}\r\n\t} \r\n\treturn $post_types;\r\n}", "function kstHelpWordpressMisc_customFieldsAndMetaBoxes() {\n ?>\n <p>\n Among the many fabulous but too little used features of WordPress includes\n custom fields. Custom fields are generic form fields below the text editor\n on posts and pages (and custom post types) that allow theme and plugin\n developers the ability to add unique functionality to posts and pages that\n you have control over per post/page.\n </p>\n <p>\n Examples include changing a quote or content box in the header or sidebar\n on a per page basis, embedding media, and adding extra meta-type information to\n display about posts such as \"duration\", \"citations\", \"special guests\", or\n whatever the theme or plugin developer offered.\n </p>\n <p>\n If your theme includes such things hopefully they will have added a help\n entry for you to learn how to use them.\n </p>\n <p>\n The theme or plugin developer may have alternatively created\n \"metaboxes\" that appear in place of the \"generic custom fields\". A metabox\n is a custom mini-form that explicitly tells the contributor what data they\n can enter.\n </p>\n <?php\n}", "function wtfdivi099_add_meta_boxes() {\r\n\tforeach(get_post_types() as $pt) {\r\n\t\tif (post_type_supports($pt, 'editor') and function_exists('et_single_settings_meta_box')) {\r\n\t\t\tadd_meta_box('et_settings_meta_box', __('Divi Custom Post Settings', 'Divi'), 'et_single_settings_meta_box', $pt, 'side', 'high');\r\n\t\t}\r\n\t} \r\n}", "function reviews_metabox_callback($post) {\n // Crear un campo nonce para la metabox - se usa para comprobar que las peticiones al server proceden del sitio web y no de un sitio externo\n wp_nonce_field(basename(__FILE__), 'review_metabox_nonce');\n // Recoger los valores de los campos, si los tuviese\n \n // RELEASE\n $release = get_post_meta($post->ID, 'release', true); // Date\n\n // DEVELOPER\n $developer = get_post_meta($post->ID, 'developer', true); // Text\n\n // points\n $points = get_post_meta($post->ID, 'points', true); // Text\n\n\n $text = get_post_meta($post->ID, 'text', true); // Checkbox\n $voices = get_post_meta($post->ID, 'voices', true); // Checkbox\n\n // PEGI\n $pegi = get_post_meta($post->ID, 'pegi', true); // Radio\n\n // CATEGORIES\n $pc = get_post_meta($post->ID, 'pc', true);\n $ps4 = get_post_meta($post->ID, 'ps4', true);\n $ps5 = get_post_meta($post->ID, 'ps5', true);\n $xboxone = get_post_meta($post->ID, 'xboxone', true);\n $xboxseriesx = get_post_meta($post->ID, 'xboxseriesx', true);\n $switch = get_post_meta($post->ID, 'switch', true);\n\n // GENRES\n $action = get_post_meta($post->ID, 'my_action', true);\n $adventure = get_post_meta($post->ID, 'my_adventure', true);\n $rpg = get_post_meta($post->ID, 'my_rpg', true);\n $strategy = get_post_meta($post->ID, 'my_strategy', true);\n $platforms = get_post_meta($post->ID, 'my_platforms', true);\n $puzzle = get_post_meta($post->ID, 'my_puzzle', true);\n\n // TEXT\n $textspanish = get_post_meta($post->ID, 'my_textspanish', true);\n $textenglish = get_post_meta($post->ID, 'my_textenglish', true);\n\n // VOICES\n $voicesspanish = get_post_meta($post->ID, 'my_voicesspanish', true);\n $voicesenglish = get_post_meta($post->ID, 'my_voicesenglish', true);\n\n // Dibujamos los campos con etiquetas HTML\n ?>\n <div class=\"review_details\">\n <!-- RELEASE -->\n <label for=\"release\">RELEASE:</label><br>\n <input type=\"date\" name=\"release\" id=\"release\" value=\"<?php echo $release; ?>\"><br><br>\n <!-- PEGI -->\n <label for=\"my_app_pegi\">PEGI:</label><br>\n <select id=\"my_app_pegi\" name=\"my_app_pegi\">\n <option value=\"3\" <?php if ($pegi=='3') echo 'selected';?>>3</option>\n <option value=\"7\" <?php if ($pegi=='7') echo 'selected';?>>7</option>\n <option value=\"12\" <?php if ($pegi=='12') echo 'selected';?>>12</option>\n <option value=\"16\" <?php if ($pegi=='16') echo 'selected';?>>16</option>\n <option value=\"18\" <?php if ($pegi=='18') echo 'selected';?>>18</option>\n </select><br><br>\n <!-- CATEGORIES -->\n <label>CATEGORIES:</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($pc, true, true); ?> name=\"pc\" />PC</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($ps4, true, true); ?> name=\"ps4\" />PS4</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($ps5, true, true); ?> name=\"ps5\" />PS5</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($xboxone, true, true); ?> name=\"xboxone\" />Xbox One</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($xboxseriesx, true, true); ?> name=\"xboxseriesx\" />Xbox Series X</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($switch, true, true); ?> name=\"switch\" />Nintendo Switch</label><br><br>\n\n <!-- GENRES -->\n <label>GENRES:</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($action, true, true); ?> name=\"my_action\" />Action</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($adventure, true, true); ?> name=\"my_adventure\" />Adventure</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($rpg, true, true); ?> name=\"my_rpg\" />RPG</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($strategy, true, true); ?> name=\"my_strategy\" />Strategy</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($platforms, true, true); ?> name=\"my_platforms\" />Platforms</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($puzzle, true, true); ?> name=\"my_puzzle\" />Puzzle</label><br><br>\n\n <!-- DEVELOPER -->\n <label for=\"developer\">DEVELOPER:</label><br>\n <input type=\"text\" placeholder=\"E.g. Activision\" name=\"developer\" id=\"developer\" value=\"<?php echo $developer; ?>\"><br><br>\n\n <!-- EDITOR -->\n <label for=\"points\">Note:</label><br>\n <input type=\"number\" max=\"10\" min=\"0\" placeholder=\"0-10\" name=\"points\" id=\"points\" value=\"<?php echo $points; ?>\"><br><br>\n\n <!-- TEXT -->\n <label>TEXT:</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($textspanish, true, true); ?> name=\"my_textspanish\" />Spanish</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($textenglish, true, true); ?> name=\"my_textenglish\" />English</label><br><br>\n\n <!-- VOICES -->\n <label>VOICES:</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($voicesspanish, true, true); ?> name=\"my_voicesspanish\" />Spanish</label><br>\n <label><input type=\"checkbox\" value=\"1\" <?php checked($voicesenglish, true, true); ?> name=\"my_voicesenglish\" />English</label><br>\n </div>\n \n <?php\n }", "function gutenberg_editor_scripts_and_styles( $hook ) {\n\t$is_demo = isset( $_GET['gutenberg-demo'] );\n\n\tglobal $wp_scripts;\n\n\t// Add \"wp-hooks\" as dependency of \"heartbeat\".\n\t$heartbeat_script = $wp_scripts->query( 'heartbeat', 'registered' );\n\tif ( $heartbeat_script && ! in_array( 'wp-hooks', $heartbeat_script->deps ) ) {\n\t\t$heartbeat_script->deps[] = 'wp-hooks';\n\t}\n\n\t// Enqueue heartbeat separately as an \"optional\" dependency of the editor.\n\t// Heartbeat is used for automatic nonce refreshing, but some hosts choose\n\t// to disable it outright.\n\twp_enqueue_script( 'heartbeat' );\n\n\t// Transform a \"heartbeat-tick\" jQuery event into \"heartbeat.tick\" hook action.\n\t// This removes the need of using jQuery for listening to the event.\n\twp_add_inline_script(\n\t\t'heartbeat',\n\t\t'jQuery( document ).on( \"heartbeat-tick\", function ( event, response ) { wp.hooks.doAction( \"heartbeat.tick\", response ) } );',\n\t\t'after'\n\t);\n\n\t// Ignore Classic Editor's `rich_editing` user option, aka \"Disable visual\n\t// editor\". Forcing this to be true guarantees that TinyMCE and its plugins\n\t// are available in Gutenberg. Fixes\n\t// https://github.com/WordPress/gutenberg/issues/5667.\n\tadd_filter( 'user_can_richedit', '__return_true' );\n\n\twp_enqueue_script( 'wp-edit-post' );\n\n\tglobal $post;\n\n\t// Set initial title to empty string for auto draft for duration of edit.\n\t// Otherwise, title defaults to and displays as \"Auto Draft\".\n\t$is_new_post = 'auto-draft' === $post->post_status;\n\n\t// Set the post type name.\n\t$post_type = get_post_type( $post );\n\t$post_type_object = get_post_type_object( $post_type );\n\t$rest_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;\n\n\t// Preload common data.\n\t$preload_paths = array(\n\t\t'/',\n\t\t'/wp/v2/types?context=edit',\n\t\t'/wp/v2/taxonomies?context=edit',\n\t\tsprintf( '/wp/v2/%s/%s?context=edit', $rest_base, $post->ID ),\n\t\tsprintf( '/wp/v2/types/%s?context=edit', $post_type ),\n\t\tsprintf( '/wp/v2/users/me?post_type=%s&context=edit', $post_type ),\n\t);\n\n\t// Ensure the global $post remains the same after\n\t// API data is preloaded. Because API preloading\n\t// can call the_content and other filters, callbacks\n\t// can unexpectedly modify $post resulting in issues\n\t// like https://github.com/WordPress/gutenberg/issues/7468.\n\t$backup_global_post = $post;\n\n\t$preload_data = array_reduce(\n\t\t$preload_paths,\n\t\t'gutenberg_preload_api_request',\n\t\tarray()\n\t);\n\n\t// Restore the global $post as it was before API preloading.\n\t$post = $backup_global_post;\n\n\twp_add_inline_script(\n\t\t'wp-api-fetch',\n\t\tsprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ),\n\t\t'after'\n\t);\n\n\twp_add_inline_script(\n\t\t'wp-blocks',\n\t\tsprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $post ) ) ),\n\t\t'after'\n\t);\n\n\t// Prepopulate with some test content in demo.\n\tif ( $is_new_post && $is_demo ) {\n\t\tob_start();\n\t\tinclude gutenberg_dir_path() . 'post-content.php';\n\t\t$demo_content = ob_get_clean();\n\n\t\twp_add_inline_script(\n\t\t\t'wp-edit-post',\n\t\t\tsprintf(\n\t\t\t\t'window._wpGutenbergDefaultPost = { title: %s, content: %s };',\n\t\t\t\twp_json_encode(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'raw' => __( 'Welcome to the Gutenberg Editor', 'gutenberg' ),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\twp_json_encode(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'raw' => $demo_content,\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t} elseif ( $is_new_post ) {\n\t\twp_add_inline_script(\n\t\t\t'wp-edit-post',\n\t\t\tsprintf(\n\t\t\t\t'window._wpGutenbergDefaultPost = { title: %s };',\n\t\t\t\twp_json_encode(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'raw' => '',\n\t\t\t\t\t\t'rendered' => apply_filters( 'the_title', '', $post->ID ),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}\n\n\t// Prepare Jed locale data.\n\t$locale_data = gutenberg_get_jed_locale_data( 'gutenberg' );\n\twp_add_inline_script(\n\t\t'wp-i18n',\n\t\t'wp.i18n.setLocaleData( ' . json_encode( $locale_data ) . ' );'\n\t);\n\n\t// Preload server-registered block schemas.\n\twp_add_inline_script(\n\t\t'wp-blocks',\n\t\t'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . json_encode( gutenberg_prepare_blocks_for_js() ) . ');'\n\t);\n\n\t// Get admin url for handling meta boxes.\n\t$meta_box_url = admin_url( 'post.php' );\n\t$meta_box_url = add_query_arg(\n\t\tarray(\n\t\t\t'post' => $post->ID,\n\t\t\t'action' => 'edit',\n\t\t\t'classic-editor' => true,\n\t\t\t'meta_box' => true,\n\t\t),\n\t\t$meta_box_url\n\t);\n\twp_localize_script( 'wp-editor', '_wpMetaBoxUrl', $meta_box_url );\n\n\t// Populate default code editor settings by short-circuiting wp_enqueue_code_editor.\n\tglobal $gutenberg_captured_code_editor_settings;\n\tadd_filter( 'wp_code_editor_settings', 'gutenberg_capture_code_editor_settings' );\n\twp_enqueue_code_editor( array( 'type' => 'text/html' ) );\n\tremove_filter( 'wp_code_editor_settings', 'gutenberg_capture_code_editor_settings' );\n\twp_add_inline_script(\n\t\t'wp-editor',\n\t\tsprintf(\n\t\t\t'window._wpGutenbergCodeEditorSettings = %s;',\n\t\t\twp_json_encode( $gutenberg_captured_code_editor_settings )\n\t\t)\n\t);\n\n\t// Initialize the editor.\n\t$gutenberg_theme_support = get_theme_support( 'gutenberg' );\n\t$align_wide = get_theme_support( 'align-wide' );\n\t$color_palette = current( (array) get_theme_support( 'editor-color-palette' ) );\n\t$font_sizes = current( (array) get_theme_support( 'editor-font-sizes' ) );\n\n\t/**\n\t * Filters the allowed block types for the editor, defaulting to true (all\n\t * block types supported).\n\t *\n\t * @param bool|array $allowed_block_types Array of block type slugs, or\n\t * boolean to enable/disable all.\n\t * @param object $post The post resource data.\n\t */\n\t$allowed_block_types = apply_filters( 'allowed_block_types', true, $post );\n\n\t// Get all available templates for the post/page attributes meta-box.\n\t// The \"Default template\" array element should only be added if the array is\n\t// not empty so we do not trigger the template select element without any options\n\t// besides the default value.\n\t$available_templates = wp_get_theme()->get_page_templates( get_post( $post->ID ) );\n\t$available_templates = ! empty( $available_templates ) ? array_merge(\n\t\tarray(\n\t\t\t'' => apply_filters( 'default_page_template_title', __( 'Default template', 'gutenberg' ), 'rest-api' ),\n\t\t),\n\t\t$available_templates\n\t) : $available_templates;\n\n\t// Media settings.\n\t$max_upload_size = wp_max_upload_size();\n\tif ( ! $max_upload_size ) {\n\t\t$max_upload_size = 0;\n\t}\n\n\t$editor_settings = array(\n\t\t'alignWide' => $align_wide || ! empty( $gutenberg_theme_support[0]['wide-images'] ), // Backcompat. Use `align-wide` outside of `gutenberg` array.\n\t\t'availableTemplates' => $available_templates,\n\t\t'allowedBlockTypes' => $allowed_block_types,\n\t\t'disableCustomColors' => get_theme_support( 'disable-custom-colors' ),\n\t\t'disablePostFormats' => ! current_theme_supports( 'post-formats' ),\n\t\t'titlePlaceholder' => apply_filters( 'enter_title_here', __( 'Add title', 'gutenberg' ), $post ),\n\t\t'bodyPlaceholder' => apply_filters( 'write_your_story', __( 'Write your story', 'gutenberg' ), $post ),\n\t\t'isRTL' => is_rtl(),\n\t\t'autosaveInterval' => 10,\n\t\t'maxUploadFileSize' => $max_upload_size,\n\t\t'allowedMimeTypes' => get_allowed_mime_types(),\n\t);\n\n\t$post_autosave = get_autosave_newer_than_post_save( $post );\n\tif ( $post_autosave ) {\n\t\t$editor_settings['autosave'] = array(\n\t\t\t'editLink' => add_query_arg( 'gutenberg', true, get_edit_post_link( $post_autosave->ID ) ),\n\t\t);\n\t}\n\n\tif ( false !== $color_palette ) {\n\t\t$editor_settings['colors'] = $color_palette;\n\t}\n\n\tif ( ! empty( $font_sizes ) ) {\n\t\t$editor_settings['fontSizes'] = $font_sizes;\n\t}\n\n\tif ( ! empty( $post_type_object->template ) ) {\n\t\t$editor_settings['template'] = $post_type_object->template;\n\t\t$editor_settings['templateLock'] = ! empty( $post_type_object->template_lock ) ? $post_type_object->template_lock : false;\n\t}\n\n\t$init_script = <<<JS\n\t( function() {\n\t\tvar editorSettings = %s;\n\t\twindow._wpLoadGutenbergEditor = new Promise( function( resolve ) {\n\t\t\twp.domReady( function() {\n\t\t\t\tresolve( wp.editPost.initializeEditor( 'editor', \"%s\", %d, editorSettings, window._wpGutenbergDefaultPost ) );\n\t\t\t} );\n\t\t} );\n} )();\nJS;\n\n\t/**\n\t * Filters the settings to pass to the block editor.\n\t *\n\t * @since 3.7.0\n\t *\n\t * @param array $editor_settings Default editor settings.\n\t * @param WP_Post $post Post being edited.\n\t */\n\t$editor_settings = apply_filters( 'block_editor_settings', $editor_settings, $post );\n\n\t$script = sprintf( $init_script, wp_json_encode( $editor_settings ), $post->post_type, $post->ID );\n\twp_add_inline_script( 'wp-edit-post', $script );\n\n\t/**\n\t * Scripts\n\t */\n\twp_enqueue_media(\n\t\tarray(\n\t\t\t'post' => $post->ID,\n\t\t)\n\t);\n\twp_enqueue_editor();\n\n\t/**\n\t * Styles\n\t */\n\twp_enqueue_style( 'wp-edit-post' );\n\n\t/**\n\t * Fires after block assets have been enqueued for the editing interface.\n\t *\n\t * Call `add_action` on any hook before 'admin_enqueue_scripts'.\n\t *\n\t * In the function call you supply, simply use `wp_enqueue_script` and\n\t * `wp_enqueue_style` to add your functionality to the Gutenberg editor.\n\t *\n\t * @since 0.4.0\n\t */\n\tdo_action( 'enqueue_block_editor_assets' );\n}", "function my_pre_save_post( $post_id ){\n \n\t\t\n\tif( $post_id != 'new' )\t{\t// check if this is to be an edit instead of a new post\t\n \t\n\t//If it's an edit\n\t$editpost = array(\n\t\t'ID' => $post_id,\n\t\t'post_status' => 'publish',\n\t\t'post_title' => $_POST['fields']['field_53701ca623c65'],\t\t\t\t//!!!!!!!!!!! Check if there's another way to do this - I don't think these fields will remain the same\n\t\t'post_content' => $_POST['fields']['field_53701c4623c64'],\t\t\t\t//even if the plugin is added to the theme\n\t\t'post_category'\t=> array($_POST['fields']['field_53b4955981c40']),\n\t\t'post_type' => 'post'\n );\n\t\t\n $post_id = wp_update_post( $editpost ); // update the post \t\t\n }\n\telse { \n\t\n\t\t// Create the post\n\t$addpost = array(\n\t\t'post_status' => 'publish',\n\t\t'post_title' => $_POST['fields']['field_53701ca623c65'],\t\t\t\t//!!!!!!!!!!! Check if there's another way to do this - I don't think these fields will remain the same\n\t\t'post_content' => $_POST['fields']['field_53701c4623c64'],\t\t\t\t//even if the plugin is added to the theme\n\t\t'post_category'\t=> array($_POST['fields']['field_53b4955981c40']),\n\t\t'post_type' => 'post'\n );\n \n\t\t$post_id = wp_insert_post( $addpost ); // insert the post\n\t}\n \n return $post_id;\t// return the post (new or edited)\n}", "function sc_hide_editor() {\n\t// Get the Post ID\n\tif( isset( $_GET['post'] ) ) $post_id = $_GET['post'];\n\telseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];\n\tif( !isset( $post_id ) ) return;\n\n\t// Get the Page Template\n\t$template_file = get_post_meta($post_id, '_wp_page_template', TRUE);\n \n if( 'template-schedule.php' == $template_file || 'template-speakers.php' == $template_file )\n \techo '<style>#postdivrich{display: none;}</style>';\n}", "function editor_style() {\n wp_enqueue_style('editor', get_stylesheet_directory_uri() . '/inc/editor/editor.min.css');\n}", "function wp_revisions_enabled($post)\n {\n }", "function the_editor($html = null) {\n\t\t\tif (is_admin()) {\n\t\t\t\tif ($this -> language_do()) {\n\t\t\t\t\tif ($this -> is_plugin_screen('send') || $this -> is_plugin_screen('settings_templates')) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tglobal $newsletters_languageplugin;\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($newsletters_languageplugin) {\n\t\t\t\t\t\t\tcase 'qtranslate'\t\t\t\t\t:\n\t\t\t\t\t\t\t\tremove_filter('the_editor', 'qtrans_modifyRichEditor');\t\n\t\t\t\t\t\t\t\tremove_action('wp_tiny_mce_init', 'qtrans_TinyMCE_init');\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'qtranslate-x'\t\t\t\t\t:\n\t\t\t\t\t\t\t\tremove_filter('the_editor', 'qtranxf_modifyRichEditor');\t\n\t\t\t\t\t\t\t\tremove_action('wp_tiny_mce_init', 'qtranxf_TinyMCE_init');\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault \t\t\t\t\t\t\t:\n\t\t\t\t\t\t\t\t//do nothing...\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\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "function gs_theme_setup() {\r\n\r\n\t/**\r\n\t * Load the theme functions library\r\n\t */\r\n\trequire_once('inc/library.php');\r\n\r\n\t/**\r\n\t * Load custom post types\r\n\t */\r\n\trequire_once('inc/cpt.slides.php'); \r\n\r\n\t/**\r\n\t * Load custom widgets\r\n\t */\r\n\trequire_once('inc/widget.feature-box/widget.feature-box.php'); \r\n\trequire_once('inc/widget.gs-recent-posts/widget.gs-recent-posts.php'); \r\n\r\n\t/**\r\n\t * Load custom admin features\r\n\t */\r\n\trequire_once('inc/admin/admin-branding.php'); \r\n\trequire_once('inc/admin/admin-menu.php'); \r\n\trequire_once('inc/admin/dashboard.recent-drafts.php'); \r\n\trequire_once('inc/admin/remove-dashboard-widgets.php'); \r\n\trequire_once('inc/admin/remove-default-widgets.php'); \r\n\trequire_once('inc/admin/tinymce-editor.php'); \r\n\trequire_once('inc/admin/user-capabilities.php'); \r\n\r\n \t/**\r\n * Removes WordPress version number from the document head (for security).\r\n\t *\r\n */\t\r\n\tremove_action('wp_head', 'wp_generator');\r\n\r\n \t/**\r\n * Registers theme menus.\r\n */\t\r\n\tregister_nav_menu('main', 'Main Navigation Menu');\r\n\t//register_nav_menu('Your Menu Name', 'Your Menu Description');\r\n\r\n \t/**\r\n * Registers thumbnail and featured image sizes.\r\n */\t\r\n\tadd_theme_support( 'post-thumbnails' );\r\n\tset_post_thumbnail_size( 150, 150, true ); // Normal post thumbnails\r\n\tadd_image_size( 'slide', 960, 300, true );\r\n\t//add_image_size( 'custom-thumb-name', 150, 150, true ); \r\n\r\n}", "function quasar_frontend_init(){\n\tadd_post_type_support( 'post', 'excerpt');\n}", "public function register_hooks() {\n\t\tif ( \\intval( \\get_option( 'duplicate_post_show_original_meta_box' ) ) === 1\n\t\t\t|| \\intval( \\get_option( 'duplicate_post_show_original_column' ) ) === 1 ) {\n\t\t\t\\add_action( 'save_post', [ $this, 'delete_on_save_post' ] );\n\t\t}\n\t}", "function remove_post_support() {\n remove_post_type_support( 'page', 'editor' );\n }", "function post_custom_meta_box($post)\n {\n }", "function TS_VCSC_Extensions_Admin_Files($hook_suffix) {\r\n\t\t\tglobal $pagenow, $typenow;\r\n\t\t\tif (!function_exists('get_current_screen')) {\r\n\t\t\t\trequire_once(ABSPATH . '/wp-admin/includes/screen.php');\r\n\t\t\t}\r\n\t\t\t$screen \t\t\t\t\t\t= get_current_screen();\r\n\t\t\tif (empty($typenow) && !empty($_GET['post'])) {\r\n\t\t\t\t$post \t\t\t\t\t\t= get_post($_GET['post']);\r\n\t\t\t\t$typenow \t\t\t\t\t= $post->post_type;\r\n\t\t\t}\r\n\t\t\t$url\t\t\t\t\t\t\t= plugin_dir_url( __FILE__ );\r\n\t\t\t$TS_VCSC_IsEditPagePost \t\t= TS_VCSC_IsEditPagePost();\r\n // Check if Invalid WP Bakery PAGE Builder Editor\r\n if ($this->TS_VCSC_WebsiteBuilder_Instead == \"true\") {\r\n $TS_VCSC_IsEditPagePost = false;\r\n }\r\n // Check if Page/Post has been edited with Gutenberg\r\n if (($this->TS_VCSC_GutenbergExists == \"true\") && ((method_exists($screen, 'is_block_editor') && $screen->is_block_editor()) || ((function_exists('is_gutenberg_page') && is_gutenberg_page())))) {\r\n $TS_VCSC_IsGutenbergPost = \"true\";\r\n } else {\r\n $TS_VCSC_IsGutenbergPost = \"false\";\r\n }\r\n // Check for WP Bakery PAGE Builder Content\r\n if (($this->TS_VCSC_GutenbergExists == \"true\") && ($this->TS_VCSC_VCFrontEditMode == \"false\") && ($this->TS_VCSC_Gutenberg_Classic == \"false\") && ($TS_VCSC_IsGutenbergPost == \"false\")) {\r\n $TS_VCSC_IsWBPBContent = (TS_VCSC_CheckWBPageBuilderContent() == true ? \"true\" : \"false\");\r\n } else {\r\n $TS_VCSC_IsWBPBContent = \"true\";\r\n }\r\n // Check for Custom Post Type without VC\r\n\t\t\t$TS_VCSC_IsEditCustomPost \t\t= false;\t\t\t\r\n\t\t\tif ($screen != '' && $screen != \"false\" && $screen != false && ($screen->id == \"ts_timeline\" || $screen->id == \"ts_team\" || $screen->id == \"ts_testimonials\" || $screen->id == \"ts_skillsets\" || $screen->id == \"ts_logos\")) {\r\n\t\t\t\t$TS_VCSC_IsEditCustomPost \t= true;\r\n\t\t\t}\r\n\t\t\t// Files to be loaded on Widgets Page\r\n\t\t\tif ($pagenow == \"widgets.php\") {\r\n\t\t\t\tif ($this->TS_VCSC_CustomPostTypesWidgets == \"true\") {\r\n\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-widgets');\r\n\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-widgets');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Files to be loaded on WBP Settings Page\r\n\t\t\tif (($this->TS_VCSC_Extension_RoleManager == \"true\") || ($this->TS_VCSC_Extension_ElementsUser == \"true\")) {\r\n\t\t\t\twp_enqueue_style('ts-visual-composer-extend-composer');\r\n\t\t\t}\r\n\t\t\t// Files to be loaded with WP Bakery PAGE Builder Extensions Addon \r\n\t\t\tif ((($TS_VCSC_IsEditPagePost) && ($TS_VCSC_IsEditCustomPost == false) && ($this->TS_VCSC_WebsiteBuilder_Instead == \"false\") && (($this->TS_VCSC_GutenbergExists == \"false\") || ($this->TS_VCSC_Gutenberg_Classic == \"true\") || ($this->TS_VCSC_VCFrontEditMode == \"true\") || ($TS_VCSC_IsGutenbergPost = \"false\") || ($TS_VCSC_IsWBPBContent == \"true\"))) || ($this->TS_VCSC_Extension_ToolsetsUser == \"true\")) {\t\t\t\t\r\n if ($this->TS_VCSC_CustomPostTypesLoaded == \"true\") {\r\n\t\t\t\t\twp_enqueue_script('jquery-ui-sortable');\r\n\t\t\t\t}\r\n\t\t\t\tif (($this->TS_VCSC_EditorVisualSelector == \"true\") || ($this->TS_VCSC_IconicumActivated == \"true\") || ($this->TS_VCSC_GeneratorLoad == \"true\")) {\r\n\t\t\t\t\t$this->TS_VCSC_IconFontsEnqueue(false);\r\n\t\t\t\t}\r\n\t\t\t\twp_enqueue_style('ts-font-teammates');\r\n\t\t\t\tif ($this->TS_VCSC_EditorLivePreview == \"true\") {\r\n\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-preview');\r\n\t\t\t\t} else {\r\n\t\t\t\t\twp_enqueue_style('ts-visual-composer-extend-basic');\r\n\t\t\t\t}\r\n\t\t\t\tif ($this->TS_VCSC_LoadEditorNoUiSlider == \"true\") {\r\n\t\t\t\t\twp_enqueue_style('ts-extend-nouislider');\t\t\t\t\r\n\t\t\t\t\twp_enqueue_script('ts-extend-nouislider');\r\n\t\t\t\t}\r\n\t\t\t\twp_enqueue_style('ts-extend-multiselect');\r\n\t\t\t\twp_enqueue_script('ts-extend-multiselect');\r\n\t\t\t\twp_enqueue_script('ts-extend-picker');\t\t\r\n\t\t\t\twp_enqueue_script('ts-extend-iconpicker');\r\n\t\t\t\twp_enqueue_style('ts-extend-iconpicker');\r\n\t\t\t\twp_enqueue_style('ts-extend-colorpicker');\r\n\t\t\t\twp_enqueue_script('ts-extend-colorpicker');\t\r\n\t\t\t\twp_enqueue_script('ts-extend-classygradient');\r\n\t\t\t\twp_enqueue_style('ts-extend-animations');\r\n\t\t\t\twp_enqueue_style('ts-extend-preloaders');\r\n\t\t\t\twp_enqueue_style('ts-visual-composer-extend-admin');\t\t\t\t\r\n\t\t\t\twp_enqueue_script('ts-visual-composer-extend-admin');\r\n\t\t\t\tif (($this->TS_VCSC_WooCommerceActive == \"true\") || ($this->TS_VCSC_Visual_Composer_Elements['TS Rating Scales']['active'] == 'true')) {\r\n\t\t\t\t\twp_enqueue_style('ts-font-ecommerce');\r\n\t\t\t\t}\r\n\t\t\t\tif ($this->TS_VCSC_Visual_Composer_Elements['TS Google Maps PLUS']['active'] == 'true') {\r\n\t\t\t\t\twp_enqueue_style('ts-font-mapmarker');\r\n\t\t\t\t}\r\n\t\t\t\t// Load Custom Backbone View and Files for Rows\r\n\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\tif ((($this->TS_VCSC_PluginExtended == \"true\") && (get_option('ts_vcsc_extend_settings_additions', 1) == 1)) || (($this->TS_VCSC_PluginExtended == \"false\"))) {\r\n\t\t\t\t\t\tif (get_option('ts_vcsc_extend_settings_additionsRows', 0) == 1) {\r\n\t\t\t\t\t\t\twp_enqueue_script('ts-vcsc-backend-rows');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif ($this->TS_VCSC_VCFrontEditMode == \"false\") {\r\n\t\t\t\t\t// Load Custom Backbone View for Other Elements\r\n\t\t\t\t\tif ($this->TS_VCSC_EditorLivePreview == \"true\") {\r\n\t\t\t\t\t\twp_enqueue_script('ts-vcsc-backend-other');\r\n\t\t\t\t\t} else if (($this->TS_VCSC_Visual_Composer_Elements['TS Fancy Tabs (BETA)']['active'] == 'true') || ($this->TS_VCSC_Visual_Composer_Elements['TS Image Hotspot']['active'] == 'true')) {\r\n\t\t\t\t\t\twp_enqueue_script('ts-vcsc-backend-basic');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load Custom Backbone for Shortcode Viewer\r\n\t\t\t\t\tif ($this->TS_VCSC_EditorShortcodesPopup == \"true\") {\r\n\t\t\t\t\t\twp_enqueue_script('ts-vcsc-backend-shortcode');\r\n\t\t\t\t\t\twp_enqueue_script('ts-extend-clipboard');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Load Custom Backbone for Container Toggle\r\n\t\t\t\t\tif ($this->TS_VCSC_EditorContainerToggle == \"true\") {\r\n\t\t\t\t\t\twp_enqueue_script('ts-vcsc-backend-collapse');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Element Setting Panels\r\n\t\t\t\twp_enqueue_script('jquery-ui-autocomplete');\r\n\t\t\t\twp_enqueue_style('ts-visual-composer-extend-composer');\r\n\t\t\t\twp_enqueue_style('ts-visual-composer-extend-parameters');\r\n\t\t\t\twp_enqueue_script('ts-visual-composer-extend-parameters');\r\n\t\t\t\tif ($this->TS_VCSC_EditorElementFilter == \"true\") {\r\n\t\t\t\t\twp_enqueue_script('ts-visual-composer-extend-categories');\r\n\t\t\t\t}\r\n\t\t\t} else if (($TS_VCSC_IsEditPagePost) && ($TS_VCSC_IsEditCustomPost == true) && ($this->TS_VCSC_WebsiteBuilder_Instead == \"false\")) {\r\n if ($this->TS_VCSC_CustomPostTypesLoaded == \"true\") {\r\n\t\t\t\t\twp_enqueue_script('jquery-ui-sortable');\r\n\t\t\t\t}\r\n\t\t\t\twp_enqueue_style('ts-visual-composer-extend-admin');\r\n\t\t\t}\r\n\t\t\t// Files to be loaded for Plugin Settings Pages\r\n if (!is_null($hook_suffix)) {\r\n global $ts_vcsc_main_page;\r\n global $ts_vcsc_settings_page;\r\n global $ts_vcsc_upload_page;\r\n global $ts_vcsc_preview_page;\r\n global $ts_vcsc_generator_page;\r\n global $ts_vcsc_customCSS_page;\r\n global $ts_vcsc_customJS_page;\r\n global $ts_vcsc_transfer_page;\r\n global $ts_vcsc_system_page;\r\n global $ts_vcsc_license_page;\r\n global $ts_vcsc_about_page;\r\n global $ts_vcsc_google_fonts;\r\n global $ts_vcsc_custom_fonts;\r\n global $ts_vcsc_enlighterjs_page;\r\n global $ts_vcsc_downtime_page;\r\n global $ts_vcsc_sidebars_page;\r\n global $ts_vcsc_update_page;\r\n global $ts_vcsc_statistics_page;\r\n if (($ts_vcsc_main_page == $hook_suffix) || ($ts_vcsc_settings_page == $hook_suffix) || ($ts_vcsc_upload_page == $hook_suffix) || ($ts_vcsc_preview_page == $hook_suffix) || ($ts_vcsc_customCSS_page == $hook_suffix) || ($ts_vcsc_customJS_page == $hook_suffix) || ($ts_vcsc_system_page == $hook_suffix) || ($ts_vcsc_transfer_page == $hook_suffix) || ($ts_vcsc_license_page == $hook_suffix) || ($ts_vcsc_about_page == $hook_suffix) || ($ts_vcsc_google_fonts == $hook_suffix) || ($ts_vcsc_custom_fonts == $hook_suffix) || ($ts_vcsc_enlighterjs_page == $hook_suffix) || ($ts_vcsc_downtime_page == $hook_suffix) || ($ts_vcsc_sidebars_page == $hook_suffix) || ($ts_vcsc_statistics_page == $hook_suffix)) {\r\n if (!wp_script_is('jquery')) {\r\n wp_enqueue_script('jquery');\r\n }\r\n if (($ts_vcsc_main_page == $hook_suffix) || ($ts_vcsc_settings_page == $hook_suffix) || ($ts_vcsc_enlighterjs_page == $hook_suffix)) {\r\n wp_enqueue_style('wp-color-picker');\t\t\t\t\r\n wp_enqueue_script('ts-extend-colorpickeralpha');\t\t\t\t\t\r\n if ($ts_vcsc_enlighterjs_page != $hook_suffix) {\r\n wp_enqueue_script('ts-extend-dragsort');\r\n }\r\n wp_enqueue_style('ts-extend-nouislider');\r\n wp_enqueue_script('ts-extend-nouislider');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n }\r\n if ($ts_vcsc_upload_page == $hook_suffix) {\r\n if (get_option('ts_vcsc_extend_settings_tinymceCustomPath', '') != '') {\r\n wp_enqueue_style('ts-font-customvcsc');\r\n }\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-admin');\r\n }\r\n if (($ts_vcsc_upload_page == $hook_suffix) || ($ts_vcsc_preview_page == $hook_suffix)) {\r\n wp_enqueue_style('ts-extend-dropdown');\r\n wp_enqueue_script('ts-extend-dropdown');\r\n wp_enqueue_script('ts-extend-freewall');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n }\r\n if ($ts_vcsc_about_page == $hook_suffix) {\r\n wp_enqueue_script('ts-extend-slidesjs');\r\n }\r\n wp_enqueue_style('dashicons');\r\n wp_enqueue_style('ts-font-teammates');\r\n wp_enqueue_style('ts-extend-sweetalert');\r\n wp_enqueue_script('ts-extend-sweetalert');\r\n if ($ts_vcsc_enlighterjs_page != $hook_suffix) {\r\n wp_enqueue_style('ts-vcsc-extend');\r\n if ($ts_vcsc_downtime_page != $hook_suffix) {\r\n wp_enqueue_script('ts-vcsc-extend');\r\n }\r\n }\r\n wp_enqueue_script('validation-engine');\r\n wp_enqueue_style('validation-engine');\r\n wp_enqueue_script('validation-engine-en');\r\n wp_enqueue_style('ts-visual-composer-extend-buttons');\r\n }\r\n if (($ts_vcsc_generator_page == $hook_suffix) && ($this->TS_VCSC_IconicumStandard == \"false\")) {\r\n wp_enqueue_style('ts-vcsc-extend');\r\n wp_enqueue_script('ts-vcsc-extend');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-extend-clipboard');\r\n wp_enqueue_style('ts-visual-composer-extend-buttons');\r\n }\r\n if ($ts_vcsc_preview_page == $hook_suffix) {\r\n $this->TS_VCSC_IconFontsEnqueue(false);\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-admin');\r\n }\r\n if (($ts_vcsc_system_page == $hook_suffix) || ($ts_vcsc_transfer_page == $hook_suffix) || ($ts_vcsc_about_page == $hook_suffix)) {\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-admin');\t\t\t\t\r\n }\r\n if ($ts_vcsc_downtime_page == $hook_suffix) {\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_script('ts-extend-picker');\r\n wp_enqueue_style('ts-extend-nouislider');\r\n wp_enqueue_style('ts-extend-multiselect');\r\n wp_enqueue_script('ts-extend-nouislider');\r\n wp_enqueue_script('ts-extend-multiselect');\r\n wp_enqueue_script('ts-extend-sumo');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-admin');\r\n wp_enqueue_style('ts-visual-composer-extend-downtime');\r\n wp_enqueue_script('ts-visual-composer-extend-downtime');\t\r\n }\r\n if ($ts_vcsc_sidebars_page == $hook_suffix) {\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_style('ts-extend-nouislider');\r\n wp_enqueue_script('ts-extend-nouislider');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-sidebars');\r\n }\r\n if ($ts_vcsc_google_fonts == $hook_suffix) {\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_style('ts-visual-composer-extend-google');\r\n wp_enqueue_script('ts-visual-composer-extend-google');\r\n }\r\n if ($ts_vcsc_custom_fonts == $hook_suffix) {\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('jquery-ui-sortable');\r\n wp_enqueue_script('ts-extend-repeatable');\r\n wp_enqueue_style('ts-visual-composer-extend-fonts');\r\n wp_enqueue_script('ts-visual-composer-extend-fonts');\r\n }\r\n if (($ts_vcsc_main_page == $hook_suffix) || ($ts_vcsc_settings_page == $hook_suffix)) {\r\n wp_enqueue_script('jquery-ui-sortable');\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_style('ts-extend-sumo');\r\n wp_enqueue_script('ts-extend-sumo');\r\n wp_enqueue_style('ts-extend-multiselect');\r\n wp_enqueue_script('ts-extend-multiselect');\r\n wp_enqueue_media();\r\n }\r\n if ($ts_vcsc_license_page == $hook_suffix) {\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n }\r\n if ($ts_vcsc_statistics_page == $hook_suffix) {\r\n wp_enqueue_style('ts-font-tablefont');\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_style('ts-extend-datatables-full');\r\n wp_enqueue_style('ts-extend-datatables-custom');\r\n wp_enqueue_script('ts-extend-datatables-full');\r\n wp_enqueue_script('ts-extend-datatables-jszip');\r\n wp_enqueue_script('ts-extend-datatables-pdfmaker');\r\n wp_enqueue_script('ts-extend-datatables-pdffonts');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-admin');\r\n wp_enqueue_style('ts-visual-composer-extend-statistics');\r\n wp_enqueue_script('ts-visual-composer-extend-statistics');\r\n }\r\n if (($ts_vcsc_customCSS_page == $hook_suffix) || ($ts_vcsc_customJS_page == $hook_suffix)) {\r\n wp_enqueue_script('ace_code_highlighter_js', \t $url.'assets/ACE/ace.js', '', false, true );\r\n }\r\n if ($ts_vcsc_customCSS_page == $hook_suffix) {\r\n wp_enqueue_script('ace_mode_css', $url.'assets/ACE/mode-css.js', array('ace_code_highlighter_js'), false, true );\r\n wp_enqueue_script('custom_css_js', \t\t \t\t$url.'assets/ACE/custom-css.js', array( 'jquery', 'ace_code_highlighter_js' ), false, true );\r\n wp_enqueue_style('ts-vcsc-extend');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n }\r\n if ($ts_vcsc_customJS_page == $hook_suffix) {\r\n wp_enqueue_script('ace_mode_js', $url.'assets/ACE/mode-javascript.js', array('ace_code_highlighter_js'), false, true );\r\n wp_enqueue_script('custom_js_js', $url.'assets/ACE/custom-js.js', array( 'jquery', 'ace_code_highlighter_js' ), false, true );\r\n wp_enqueue_style('ts-vcsc-extend');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n }\r\n if ($ts_vcsc_enlighterjs_page == $hook_suffix) {\r\n wp_enqueue_style('ts-extend-preloaders');\r\n wp_enqueue_script('ts-library-mootools');\r\n wp_enqueue_style('ts-extend-enlighterjs');\t\t\t\t\r\n wp_enqueue_script('ts-extend-enlighterjs');\t\t\t\t\r\n wp_enqueue_style('ts-extend-syntaxinit');\r\n wp_enqueue_script('ts-extend-syntaxinit');\r\n wp_enqueue_style('ts-extend-themebuilder');\t\r\n wp_enqueue_script('ts-extend-themebuilder');\r\n }\r\n // Files to be loaded for Update Notification\r\n if ($ts_vcsc_update_page == $hook_suffix) {\r\n wp_enqueue_style('dashicons');\r\n wp_enqueue_style('ts-visual-composer-extend-admin');\r\n wp_enqueue_script('ts-visual-composer-extend-admin');\r\n wp_enqueue_style('ts-vcsc-extend');\r\n wp_enqueue_script('ts-vcsc-extend');\r\n }\r\n }\r\n\t\t}", "function custom_theme_options() {\n\n \n\n /* OptionTree is not loaded yet */\n\n if ( ! function_exists( 'ot_settings_id' ) )\n\n return false;\n\n \n\n /**\n\n * Get a copy of the saved settings array. \n\n */\n\n $saved_settings = get_option( ot_settings_id(), array() );\n\n \n\n /**\n\n * Custom settings array that will eventually be \n\n * passes to the OptionTree Settings API Class.\n\n */\n\n $custom_settings = array( \n\n 'contextual_help' => array( \n\n 'sidebar' => ''\n\n ),\n\n 'sections' => array( \n\n array(\n\n 'id' => 'general',\n\n 'title' => __( 'General', 'theme-options.php' )\n\n ),\n\n\n array(\n\n 'id' => 'slider',\n\n 'title' => __( 'Slider', 'theme-options.php' )\n\n ),\n\n array(\n\n 'id' => 'footer',\n\n 'title' => __( 'Footer', 'theme-options.php' )\n\n ),\n\n array(\n\n 'id' => 'social_links',\n\n 'title' => __( 'Social Links', 'theme-options.php' )\n\n )\n\n ),\n\n 'settings' => array( \n\n array(\n\n 'id' => 'theme_logo',\n\n 'label' => __( 'Theme Logo', 'theme-options.php' ),\n\n 'desc' => __( 'Upload your Logo Image Here.Logo Dimension width:223px,Height:52px.', 'theme-options.php' ),\n\n 'std' => '',\n\n 'type' => 'upload',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n array(\n\n 'id' => 'alert',\n\n 'label' => __( 'Add or Change Alert Box Text from Home Page', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n array(\n\n 'id' => 'column_one_direction',\n\n 'label' => __( 'Add Column One Hours & Direction ', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'textarea',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t array(\n\n 'id' => 'column_two_direction',\n\n 'label' => __( 'Add Column Two Hours & Direction With Button', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'textarea',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t\n\t array(\n\n 'id' => 'mail_chimp',\n\n 'label' => __( 'Add Mailchimp Form Image:Dimension: width:340px & Height:151px', 'theme-options.php' ),\n\n 'desc' => __( '.', 'theme-options.php' ),\n\n 'std' => '',\n\n 'type' => 'upload',\n\n 'section' => 'general',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n \n\n\t array(\n\n 'id' => 'slide',\n\n 'label' => __( 'Slide', 'theme-options.php' ),\n\n 'desc' => 'Click Add New Button to add the slider Images.Slider Image Dimention - Width:1400px Height:573px',\n\n 'std' => '',\n\n 'type' => 'slider',\n\n 'section' => 'slider',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n \n\n\t \n\n array(\n\n 'id' => 'copyright',\n\n 'label' => __( 'Add Your Footer Bottom Copyright Text', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'footer',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t array(\n\n 'id' => 'address',\n\n 'label' => __( 'Add Your Footer Address Here', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'footer',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\t array(\n\n 'id' => 'phone',\n\n 'label' => __( 'Add Your Footer Phone Number Here', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'footer',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n\n array(\n\n 'id' => 'soc_pintrest',\n\n 'label' => __( 'Add Your Pintrest Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\t array(\n\n 'id' => 'soc_instagram',\n\n 'label' => __( 'Add Your instagram Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\t array(\n\n 'id' => 'soc_google',\n\n 'label' => __( 'Add Your Google Plus Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n array(\n\n 'id' => 'soc_facebook',\n\n 'label' => __( 'Add Your Facebook Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n array(\n\n 'id' => 'soc_twitter',\n\n 'label' => __( 'Add Your Twitter Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n ),\n\n\n\n array(\n\n 'id' => 'soc_youtube',\n\n 'label' => __( 'Add Your YouTube Profile link', 'theme-options.php' ),\n\n 'desc' => '',\n\n 'std' => '',\n\n 'type' => 'text',\n\n 'section' => 'social_links',\n\n 'rows' => '',\n\n 'post_type' => '',\n\n 'taxonomy' => '',\n\n 'min_max_step'=> '',\n\n 'class' => '',\n\n 'condition' => '',\n\n 'operator' => 'and'\n\n )\n\n )\n\n );\n\n \n\n /* allow settings to be filtered before saving */\n\n $custom_settings = apply_filters( ot_settings_id() . '_args', $custom_settings );\n\n \n\n /* settings are not the same update the DB */\n\n if ( $saved_settings !== $custom_settings ) {\n\n update_option( ot_settings_id(), $custom_settings ); \n\n }\n\n \n\n /* Lets OptionTree know the UI Builder is being overridden */\n\n global $ot_has_custom_theme_options;\n\n $ot_has_custom_theme_options = true;\n\n \n\n}", "function ci_cptr_plugin_options() {\n\t\n\tif ( !current_user_can('manage_options') )\n\t{\n\t\twp_die( __('You do not have sufficient permissions to access this page.') );\n\t}\n\t?>\n\t<div class=\"wrap\" id=\"cptr-options\">\n\t\t<!--<h2><?php echo sprintf(__('CSSIgniter Custom Post Types Relationships v%s - Settings', 'cptr'), CPTR_VERSION); ?></h2>-->\n\t\t<h2><?php echo sprintf(__('CSSIgniter Custom Post Types Relationships', 'cptr'), CPTR_VERSION); ?></h2>\n\t\t<p><?php _e(\"In this page you can define general options for the Custom Post Types Relationships plugin. All options here can be overridden manually by passing the appropriate parameters to the shortcode or the theme function. If you find yourself making changes here that don't have any effect, it's because your WordPress theme has hardcoded options for you, so check with the theme's developer.\", 'cptr'); ?></p>\n\t\t<p><?php echo sprintf(__('For complete usage instructions, please visit the <a href=\"%s\">plugin\\'s homepage</a>.', 'cptr'), 'http://www.cssigniter.com/ignite/custom-post-types-relationships/'); ?></p>\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php settings_fields('ci_cptr_plugin_settings'); ?>\n\t\n\t\t\t<?php\n\t\t\t\t$options = get_option(CI_CPTR_PLUGIN_OPTIONS);\n\t\t\t\t$options = ci_cptr_plugin_settings_validate($options);\n\t\t\t?>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Max number of displayed related posts:', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[limit]\" type=\"text\" value=\"<?php echo $options['limit']; ?>\" class=\"small-text\" />\n\t\t\t\t\t\t<p><?php _e('Set to 0 for no limit.', 'cptr'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Show the excerpt for each post?', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[excerpt]\" type=\"checkbox\" value=\"1\" <?php checked($options['excerpt'], 1); ?> />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('How many words the excerpt should be?', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[words]\" type=\"text\" value=\"<?php echo $options['words']; ?>\" class=\"small-text\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Display the thumbnail?', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[thumb]\" type=\"checkbox\" value=\"1\" <?php checked($options['thumb'], 1); ?> />\n\t\t\t\t\t\t<p><?php _e('The thumbnail will be displayed after the title and before the excerpt.', 'cptr'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Thumbnail size', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<label><?php _e('Width', 'cptr'); ?></label>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[width]\" type=\"text\" value=\"<?php echo $options['width']; ?>\" class=\"small-text\" />\n\t\t\t\t\t\t<label><?php _e('Height', 'cptr'); ?></label>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[height]\" type=\"text\" value=\"<?php echo $options['height']; ?>\" class=\"small-text\" />\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><h3><?php _e('Display Options', 'cptr'); ?></h3></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t&nbsp;\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Metabox title', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input name=\"<?php echo CI_CPTR_PLUGIN_OPTIONS; ?>[metabox_name]\" type=\"text\" value=\"<?php echo $options['metabox_name']; ?>\" class=\"regular-text\" />\n\t\t\t\t\t\t<p><?php _e('This is the title of the metabox that the users will see while in the post edit screens.', 'cptr'); ?></p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Allowed roles', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<p><?php _e('Select the roles that will have access to the plugin (i.e. can create/delete relationships).', 'cptr'); ?></p>\n\t\t\t\t\t\t<fieldset class=\"allowed-roles\">\n\t\t\t\t\t\t\t<?php cptr_checkbox_roles(CI_CPTR_PLUGIN_OPTIONS.'[allowed_roles][]', $options['allowed_roles']); ?>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t\t<tr valign=\"top\">\n\t\t\t\t\t<th scope=\"row\"><?php _e('Allowed post types', 'cptr'); ?></th>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<p><?php _e('Select the post types that the plugin will be available to.', 'cptr'); ?></p>\n\t\t\t\t\t\t<fieldset class=\"allowed-post-types\">\n\t\t\t\t\t\t\t<?php cptr_checkbox_post_types(CI_CPTR_PLUGIN_OPTIONS.'[allowed_post_types][]', $options['allowed_post_types']); ?>\n\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\n\t\t\t</table>\n\t\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n\t\t\t</p>\n\t\t</form>\n\t</div>\n\t\n\t<?php\n}", "function wp_ajax_image_editor()\n {\n }", "function save_meta_options( $postID ){\n\t\t$post = $_POST;\n\t\tif((isset($post['update']) || isset($post['save']) || isset($post['publish']))){\n\n\n\t\t\t$user_template = (isset($post['pagelines_template'])) ? $post['pagelines_template'] : '';\n\n\t\t\tif($user_template != ''){\n\n\t\t\t\t$set = pl_meta($postID, PL_SETTINGS);\n\t\t\t\t\n\t\t\t\t$set['draft']['page-template'] = $user_template; \n\t\t\t\t$set['live']['page-template'] = $user_template; \n\t\t\t\t\n\t\t\t\tpl_meta_update($postID, PL_SETTINGS, $set);\n\t\t\t}\n\n\n\t\t}\n\t}", "function add_shortcodes_button() {\n\t\n\tif ( !current_user_can('edit_posts') && !current_user_can('edit_pages') )\n\t\treturn;\n\t\t\n\tif ( get_user_option('rich_editing') == 'true' ) {\n\t\tadd_filter('mce_external_plugins', 'add_shortcodes_tinymce_plugin');\n\t\tadd_filter('mce_buttons_3', 'register_shortcodes_button');\n\t}\n\t\n}", "function add_buttons() {\n\t\t // Don't bother doing this stuff if the current user lacks permissions\n\t\t if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )\n\t\t\t return;\n\t\t \n\t\t // Add only in Rich Editor mode\n\t\t if ( get_user_option('rich_editing') == 'true') {\n\t\t\t add_filter('mce_external_plugins', array( $this, 'add_tinymce_plugin' ) );\n\t\t\t add_filter('mce_buttons_2', array( $this, 'register_button' ) );\n\t\t }\n\t\t}", "function bg_startPlugin(){\n add_action( 'init', 'bg_PatchEditor' );\n add_action( 'admin_init', 'bg_AddAdminSettings' );\n add_action( 'admin_menu', 'bg_AddPluginMenu' );\n}", "function md_metadraft_metabox($post){\n\n\t$metadraft = md_get_metadraft($post->ID);\n\t$source = md_get_source($post->ID);\n\n\techo \"<div class='submitbox'>\";\n\n\t// Provide a hook to attach metabox content in discrete chunks\n\tdo_action('md_metadraft_metabox', $post, $metadraft, $source);\n\n\techo \"</div>\";\n\n}", "function wp_setup_widgets_block_editor()\n {\n }", "function editor_styles() {\n\n\tadd_editor_style( trailingslashit( get_template_directory_uri() ) . 'assets/editor-style.css' );\n\n}", "function acf_is_block_editor()\n{\n}" ]
[ "0.7599926", "0.74765104", "0.7338044", "0.7308103", "0.7191891", "0.7088848", "0.70305", "0.6955362", "0.6949286", "0.69245565", "0.6893485", "0.68541104", "0.684627", "0.68409765", "0.68390113", "0.6815728", "0.67988145", "0.6790772", "0.678992", "0.6748128", "0.67319655", "0.6688629", "0.6657298", "0.6653536", "0.66450787", "0.663594", "0.6624155", "0.66162705", "0.66081536", "0.6577121", "0.6569887", "0.65680325", "0.65266687", "0.65206856", "0.65204954", "0.6511679", "0.64750487", "0.64720666", "0.64624965", "0.64582133", "0.64548224", "0.6453847", "0.6451641", "0.6448252", "0.6437558", "0.64362437", "0.6427619", "0.6425797", "0.6408738", "0.6397207", "0.6395832", "0.6395146", "0.6392248", "0.6383737", "0.6380792", "0.6373681", "0.6366243", "0.6361029", "0.6361029", "0.6359541", "0.6358514", "0.6356118", "0.63544184", "0.6353093", "0.63487417", "0.63479364", "0.6347388", "0.63438237", "0.63357234", "0.63314015", "0.63278586", "0.6325387", "0.63228637", "0.63224334", "0.6321875", "0.6321605", "0.631605", "0.6315589", "0.6315486", "0.63127697", "0.6308091", "0.63064474", "0.62984306", "0.6296093", "0.6290936", "0.6286466", "0.62848085", "0.6275338", "0.6271569", "0.62652135", "0.6258077", "0.62465703", "0.62374496", "0.6231054", "0.62267643", "0.6223965", "0.6223221", "0.62205136", "0.62194765", "0.62157726" ]
0.6784781
19
END THEME OPTIONS Load site scripts.
function bootstrap_theme_enqueue_scripts() { $template_url = get_template_directory_uri(); // jQuery. wp_enqueue_script('jquery'); // JS wp_enqueue_script('jquery-script', $template_url . '/js/jquery-1.10.2.js', array('jquery'), null, true); wp_enqueue_script('bootstrap-script', $template_url . '/js/bootstrap.min.js', array('jquery'), null, true); wp_enqueue_script('wow-script', $template_url . '/js/wow.js', array('jquery'), null, true); wp_enqueue_script('jquery-ui', $template_url . '/js/jquery-ui.min.js', array('jquery'), null, true); wp_enqueue_script('waypoints', $template_url . '/js/waypoints.min.js', array('jquery'), null, true); wp_enqueue_script('magnific-popup', $template_url . '/js//jquery.magnific-popup.min.js', array('jquery'), null, true); wp_enqueue_script('isotope', $template_url . '/js/isotope.pkgd.min.js', array('jquery'), null, true); wp_enqueue_script('custom', $template_url . '/js/custom.js', array('jquery'), null, true); // CSS wp_enqueue_style('bootstrap-style', $template_url . '/css/bootstrap.min.css', array(), null, 'all'); wp_enqueue_style('animate', $template_url . '/css/animate.css', array(), null, 'all'); wp_enqueue_style('magnific-popup-css', $template_url . '/css/magnific-popup.css', array(), null, 'all'); wp_enqueue_style('font-awesome', $template_url . '/font-awesome/css/font-awesome.min.css', array(), null, 'all'); wp_enqueue_style('preloader', $template_url . '/css/preloader.css', array(), null, 'all'); //Main Style wp_enqueue_style('main-style', get_stylesheet_uri()); //Google Fonts wp_enqueue_style('google-fonts', '//fonts.googleapis.com/css?family=Arvo|Oswald:300|Open+Sans:300,400,700'); // Load Thread comments WordPress script. if (is_singular() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_footer() {\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "function basetheme_scripts() {\n\n //DEREGISTER SCRIPTS\n wp_deregister_script('jquery');\n wp_deregister_script( 'wp-embed' );\n\n\twp_enqueue_style( 'basetheme-style', get_stylesheet_uri() );\n\n wp_enqueue_script( 'jquery', get_template_directory_uri() . '/assets/js/vendor/jquery/jquery-3.5.1.min.js' );\n\twp_enqueue_script( 'basetheme-scripts', get_template_directory_uri() . '/assets/js/app.js' );\n\n\n $datatoBePassed = array (\n 'isHome' => is_home()? 'true' : 'false',\n 'theme_dir' => get_template_directory_uri()\n );\n\n wp_localize_script( 'basetheme-scripts', 'PHPVARS', $datatoBePassed );\n\n}", "function artistpress_scripts() {\n\t\twp_enqueue_style( 'reset', get_template_directory_uri() . '/css/reset.css', array(), '2.0' );\n\t\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.7' );\n\t\twp_enqueue_style( 'main_style', get_template_directory_uri() . '/style.css' );\n\t\twp_enqueue_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', array(), '1.11.3', true );\n\t\twp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '3.3.6', true );\n\t\twp_register_script( 'load', get_template_directory_uri() . '/js/load.js' );\n\n\t\t//localize params for use in load.js\n\t\t$theme_params = array(\n\t\t 'backround_image' => get_option('backround_image'),\n\t\t 'action_url' => get_option('action_url'),\n\t\t);\n\n\t\twp_localize_script( 'load', 'themeParams', $theme_params );\n\n\t\twp_enqueue_script( 'load', get_template_directory_uri() . '/js/load.js', array( 'jquery' ,'bootstrap'), '1', true );\n\t}", "public static function footer_scripts()\n\t{\n\t\tself::$_configInstance->footer_scripts();\n\t}", "function chocorocco_options_override_add_scripts() {\n\t\t$screen = function_exists('get_current_screen') ? get_current_screen() : false;\n\t\tif (is_object($screen) && chocorocco_options_allow_override(!empty($screen->post_type) ? $screen->post_type : $screen->id)) {\n\t\t\twp_enqueue_style( 'chocorocco-fontello', chocorocco_get_file_url('css/fontello/fontello-embedded.css') );\n\t\t\twp_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui'), null, true);\n\t\t\twp_enqueue_script( 'chocorocco-meta-box', chocorocco_get_file_url('theme-options/theme.override.js'), array('jquery'), null, true );\n\t\t\twp_localize_script( 'chocorocco-meta-box', 'chocorocco_dependencies', chocorocco_get_theme_dependencies() );\n\t\t}\n\t}", "function _wp_footer_scripts()\n {\n }", "function skudo_scripts(){\n\t\n\t\tif (!is_admin()){\n\t\t\tglobal $vc_addons_url, $wp_query, $post;\n\t\t\t\n\t\t\tif ( is_singular() ) wp_enqueue_script( 'comment-reply' );\n\t\t\t\n\t \t wp_enqueue_script( 'skudo-upper-modernizr', SKUDO_JS_PATH .'utils/upper-modernizr.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-waypoint', SKUDO_JS_PATH .'utils/upper-waypoint.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-stellar', SKUDO_JS_PATH .'utils/upper-stellar.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-flex', SKUDO_JS_PATH .'utils/upper-flex.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-iso', SKUDO_JS_PATH .'utils/upper-iso.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-qloader', SKUDO_JS_PATH .'utils/upper-qloader.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-tweet', SKUDO_JS_PATH .'utils/upper-tweet.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-bootstrap', SKUDO_JS_PATH .'utils/upper-bootstrap.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-dlmenu', SKUDO_JS_PATH .'utils/upper-dlmenu.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-greyscale', SKUDO_JS_PATH .'utils/upper-greyscale.js', array('jquery'),'1.0',$in_footer = true);\n\t\t\twp_enqueue_script( 'skudo-upper-simpleselect', SKUDO_JS_PATH .'utils/upper-simpleselect.js', array('jquery'),'1.0',$in_footer = true);\n\t \t wp_enqueue_script( 'jquery-effects-core', array('jquery') );\n\t \t wp_register_script( 'skudo-global', SKUDO_JS_PATH .'global.js', array('jquery'), '1',$in_footer = true);\n\t\t\t\n\t\t\tif (is_archive() || is_single() || is_search() || is_page_template('blog-template.php') || is_page_template('blog-masonry-template.php') || is_page_template('blog-masonry-grid-template.php') || is_front_page()) {\n\n\t\t\t\t$nposts = get_option('posts_per_page'); $skudo_more = 0; $skudo_pag = 0; $max = 0; $orderby=\"\"; $category=\"\"; $nposts = \"\"; $order = \"\";\n\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\t\t\t\t\n\t\t\t\t$skudo_reading_option = get_option('skudo_blog_reading_type');\n\n\t\t\t\tswitch ($skudo_reading_option){\n\t\t\t\t\tcase \"scrollauto\": \n\t\t\t\t\t\t\t// Add code to index pages.\n\t\t\t\t\t\t\tif( !is_singular() ) {\t\n\t\t\t\t\t\t\t\tif (is_search()){\n\t\t\t\t\t\t\t\t\t$se = get_option(\"skudo_enable_search_everything\");\n\t\t\t\t\t\t\t\t\t$nposts = get_option('posts_per_page');\n\t\t\t\t\t\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\t\t\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\n\t\t\t\t\t\t\t\t\tif ($se == \"on\"){\n\t\t\t\t\t\t\t\t\t\t$args = array( 'showposts' => get_option('posts_per_page'), 'post_status' => 'publish', 'paged' => $skudo_pag, 's' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array( 'showposts' => -1, 'post_status' => 'publish', 'paged' => $skudo_pag, 's' => esc_html($_GET['s']) );\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$args = array('showposts' => get_option('posts_per_page'),'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array('showposts' => -1,'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$max = ceil($counter->post_count / $nposts);\n\t\t\t\t\t\t\t\t\t$skudo_paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$max = $wp_query->max_num_pages;\n\t\t\t\t\t\t\t\t\t$skudo_paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$skudo_inline_script = '\n\t\t\t\t\t\t\t\t\tjQuery(document).ready(function($){\n\t\t\t\t\t\t\t\t\t\t\"use strict\";\n\t\t\t\t\t\t\t\t\t\tif (window.skudoOptions.reading_option === \"scrollauto\" && !jQuery(\"body\").hasClass(\"single\") && typeof skudo_monitorScrollTop == \"function\"){ \n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_loadingPoint = 0;\n\t\t\t\t\t\t\t\t\t\t\t//monitor page scroll to fire up more posts loader\n\t\t\t\t\t\t\t\t\t\t\twindow.clearInterval(window.skudo_interval);\n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_interval = setInterval(\"skudo_monitorScrollTop()\", 1000 );\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\twp_add_inline_script('skudo-global', $skudo_inline_script, 'after');\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t $args = array('showposts' => $nposts,'orderby' => $orderby,'order' => $order,'cat' => $category,'paged' => $skudo_pag,'post_status' => 'publish');\n\t\t\t\t \t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t \t\t$max = $skudo_the_query->max_num_pages;\n\t\t\t\t\t \t\t$skudo_paged = ( get_query_var('paged') > 1 ) ? get_query_var('paged') : 1;\n\t\t\t\t\t \t\t$skudo_inline_script = '\n\t\t\t\t\t\t\t\t\tjQuery(document).ready(function($){\n\t\t\t\t\t\t\t\t\t\t\"use strict\";\n\t\t\t\t\t\t\t\t\t\tif (window.skudoOptions.reading_option === \"scrollauto\" && !jQuery(\"body\").hasClass(\"single\") && typeof skudo_monitorScrollTop == \"function\"){ \n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_loadingPoint = 0;\n\t\t\t\t\t\t\t\t\t\t\t//monitor page scroll to fire up more posts loader\n\t\t\t\t\t\t\t\t\t\t\twindow.clearInterval(window.skudo_interval);\n\t\t\t\t\t\t\t\t\t\t\twindow.skudo_interval = setInterval(\"skudo_monitorScrollTop()\", 1000 );\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\twp_add_inline_script('skudo-global', $skudo_inline_script, 'after');\n\n\t\t\t\t \t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"scroll\": \n\t\t\t\t\t\t\tif( !is_singular() ) {\t\n\t\t\t\t\t\t\t\tif (is_search()){\n\t\t\t\t\t\t\t\t\t$nposts = get_option('posts_per_page');\n\t\t\t\t\t\t\t\t\t$se = get_option(\"skudo_enable_search_everything\");\n\t\t\t\t\t\t\t\t\tif ($se == \"on\"){\n\t\t\t\t\t\t\t\t\t\t$args = array('showposts' => get_option('posts_per_page'),'post_status' => 'publish','paged' => $skudo_pag,'s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array('showposts' => -1,'post_status' => 'publish','paged' => $skudo_pag,'s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$args = array('showposts' => get_option('posts_per_page'),'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t\t\t\t\t $args2 = array('showposts' => -1,'post_status' => 'publish','paged' => $skudo_pag,'post_type' => 'post','s' => esc_html($_GET['s']));\n\t\t\t\t\t\t\t\t\t\t$counter = new WP_Query($args2);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$max = ceil($counter->post_count / $nposts);\n\t\t\t\t\t\t\t\t\t$skudo_pag = 1;\n\t\t\t\t\t\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\t\t\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$max = $wp_query->max_num_pages;\n\t\t\t\t\t\t\t\t\t$skudo_paged = $skudo_pag;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$orderby = \"\"; $category = \"\";\n\t\t\t\t\t\t\t $args = array('showposts' => $nposts,'orderby' => $orderby,'order' => $order,'cat' => $category,'post_status' => 'publish');\n\t\t\t\t \t\t $skudo_the_query = new WP_Query( $args );\n\t\t\t\t\t \t\t$max = $skudo_the_query->max_num_pages;\n\t\t\t\t\t \t\t$skudo_pag = 1;\n\t\t\t\t\t\t\t\t$skudo_pag = $wp_query->query_vars['paged'];\n\t\t\t\t\t\t\t\tif (!is_numeric($skudo_pag)) $skudo_pag = 1;\n\t\t\t\t \t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\t/* pass needed options values to JS */\n\t\t\t$skudoOptions = array(\n\t\t\t\t\"templatepath\" => esc_url(get_template_directory_uri()).\"/\",\n\t\t\t\t\"homePATH\" => ABSPATH,\n\t\t\t\t\"styleColor\" => \"#\".esc_html(get_option(\"skudo_style_color\")),\n\t\t\t\t\"skudo_no_more_posts_text\" => function_exists('icl_t') ? sprintf(esc_html__(\"%s\", \"skudo\"), icl_t( 'skudo', 'No more posts to load.', get_option('skudo_no_more_posts_text'))) : sprintf(esc_html__(\"%s\", \"skudo\"), get_option('skudo_no_more_posts_text')),\n\t\t\t\t\"skudo_load_more_posts_text\" => function_exists('icl_t') ? sprintf(esc_html__(\"%s\", \"skudo\"), icl_t( 'skudo', 'Load More Posts', get_option('skudo_load_more_posts_text'))) : sprintf(esc_html__(\"%s\", \"skudo\"), get_option('skudo_load_more_posts_text')),\n\t\t\t\t\"skudo_loading_posts_text\" => function_exists('icl_t') ? sprintf(esc_html__(\"%s\", \"skudo\"), icl_t( 'skudo', 'Loading posts.', get_option('skudo_loading_posts_text'))) : sprintf(esc_html__(\"%s\", \"skudo\"), get_option('skudo_loading_posts_text')),\n\t\t\t\t\"searcheverything\" => get_option(\"skudo_enable_search_everything\"),\n\t\t\t\t\"skudo_header_shrink\" => get_option('skudo_fixed_menu') == 'on' && get_option('skudo_header_after_scroll') == 'on' && get_option('skudo_header_shrink_effect') == 'on' ? 'yes' : 'no',\n\t\t\t\t\"skudo_header_after_scroll\" => get_option('skudo_fixed_menu') == 'on' && get_option('skudo_header_after_scroll') == 'on' ? 'yes' : 'no',\n\t\t\t\t\"skudo__portfolio_grayscale_effect\" => get_option(\"skudo_enable_portfolio_grayscale\"),\n\t\t\t\t\"skudo__instagram_grayscale_effect\" => get_option(\"skudo_enable_instagram_grayscale\"),\n\t\t\t\t\"skudo_enable_ajax_search\" => get_option(\"skudo_enable_ajax_search\"),\n\t\t\t\t\"skudo_newsletter_input_text\" => function_exists('icl_t') ? esc_html(icl_t( 'skudo', 'Enter your email here', get_option('skudo_newsletter_input_text'))) : esc_html(get_option('skudo_newsletter_input_text')),\n\t\t\t\t\"skudo_update_section_titles\" => get_option('skudo_update_section_titles'),\n\t\t\t\t\"skudo_wpml_current_lang\" => function_exists('icl_t') ? ICL_LANGUAGE_CODE : \"\",\n\t\t\t\t\"reading_option\" => isset($skudo_reading_option) ? $skudo_reading_option : \"paged\",\n\t\t\t\t\"loader_startPage\" => isset($skudo_pag) ? $skudo_pag : 0,\n\t\t\t\t\"loader_maxPages\" => isset($max) ? $max : 0,\n\t\t\t\t\"skudo_grayscale_effect\" => get_option(\"skudo_enable_grayscale\")\n\t\t\t);\n\t\t\t\n\t\t\twp_localize_script( 'skudo-global', 'skudoOptions', $skudoOptions );\n\t\t\twp_enqueue_script( 'skudo-global' );\n\t\t\tadd_action( 'wp_footer', 'skudo_set_import_fonts' );\n\t\t\t\n\t \t wp_enqueue_script( 'skudo-jquery-twitter', SKUDO_JS_PATH .'twitter/jquery.tweet.js', array(),'1.0',$in_footer = true);\n\t \t \n\t \t\twp_enqueue_script('cubeportfolio-jquery-js',$in_footer = false);\n\t\t\twp_enqueue_style('cubeportfolio-jquery-css',$in_footer = false);\n\t\t\t\n\t\t\tif (class_exists('Ultimate_VC_Addons')) {\n\t\t\t\twp_enqueue_script('ultimate', plugins_url().'/Ultimate_VC_Addons/assets/min-js/ultimate.min.js', array('jquery'),'3.19.4');\n\t\t\t\twp_enqueue_style('ultimate-style-min', plugins_url().'/Ultimate_VC_Addons/assets/min-css/ultimate.min.css', '3.19.4');\n\t\t\t}\n\n\t\t\tif (is_single()){\n\t\t\t\twp_enqueue_style( 'prettyphoto'); wp_enqueue_script( 'prettyphoto'); \n\t\t\t}\n\t\t\tif (isset($post->ID)) $template = get_post_meta( $post->ID, '_wp_page_template' ,true );\n\t\t\t\t\t\t\n\t\t\tif (isset($template) && ( $template == 'template-blank.php' || $template == 'template-under-construction.php' || $template == 'template-home.php' ) || is_404()){\n\t\t\t\tif (class_exists('Ultimate_VC_Addons')) {\n\t\t\t\t\twp_enqueue_script('ultimate', plugins_url().'/Ultimate_VC_Addons/assets/min-js/ultimate.min.js', array('jquery'),'3.19.4');\n\t\t\t\t\twp_enqueue_style('ultimate-style-min', plugins_url().'/Ultimate_VC_Addons/assets/min-css/ultimate.min.css','3.19.4');\n\t\t\t\t\twp_enqueue_script('ultimate-script');\n\t\t\t\t\twp_enqueue_script('ultimate-vc-params');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (isset($template) && ($template == 'one-page-template.php' || $template == 'template-home.php')){\n\t\t\t\twp_enqueue_script('googleapis');\n\t\t\t}\n\t\t\t\n\t\t\tif ((isset($template) && ($template == 'blog-masonry-template.php' || $template == 'blog-template.php')) || is_archive() || is_front_page()){\n\t\t\t\twp_enqueue_script( 'skudo-blog', SKUDO_JS_PATH .'blog.js', array('jquery'), '1',$in_footer = true);\n\t\t\t}\n\t\t\t\n\t\t\twp_dequeue_style( 'wp-mediaelement' );\n\t\t\twp_dequeue_script( 'wp-mediaelement' ); \n\t\t\t\n\t\t}\n\t}", "function pwrstudio_template_scripts() {\n\n // Enque font style file\n // wp_enqueue_style( 'univers_light', get_template_directory_uri() . '/fonts/UniversLTCYR-45Light.css');\n wp_enqueue_style( 'pwrstudio_template-style', get_template_directory_uri() . '/style.css');\n\n if (!is_admin()) {\n\n wp_deregister_script('jquery');\n\n wp_register_script( 'pwr_scripts', get_template_directory_uri() . '/app.min.js', false, '1', true);\n wp_enqueue_script('pwr_scripts');\n\n }\n\n}", "function scripts() {\n\twp_register_script(\n\t\t'bootstrap',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/lib/bootstrap/dist/js/bootstrap.min.js\",\n\t\tarray( 'jquery' ),\n\t\tVINCENTRAGOSTA_COM_VERSION,\n\t\ttrue\n\t);\n\n\twp_enqueue_script(\n\t\t'vincentragosta_com',\n\t\tVINCENTRAGOSTA_COM_TEMPLATE_URL . \"/assets/js/vincentragosta---twenty-seventeen.js\",\n\t\tarray( 'jquery', 'bootstrap' ),\n\t\tVINCENTRAGOSTA_COM_VERSION,\n\t\ttrue\n\t);\n\n\twp_localize_script( 'vincentragosta_com', 'themeUrl', VINCENTRAGOSTA_COM_TEMPLATE_URL );\n}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "public function customizer_footer_scripts()\n {\n $this->add_activate_switch();\n $this->change_title_html();\n do_action('mo_optin_customizer_footer_scripts', $this);\n }", "function pentamint_wp_theme_scripts() {\n\t\t// Initiate Default Wordpress jQuery\n\t\twp_enqueue_script('jquery');\n\n\t\t// Bootstrap Support\n\t\twp_enqueue_script('popper.js', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js', array(), null, true);\n\t\twp_enqueue_script('bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', array(), null, true);\n\n\t\t// Theme Custom\n\t\twp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap', false);\n\t\twp_enqueue_style('nanum-fonts-nanumsquareround', 'https://cdn.rawgit.com/innks/NanumSquareRound/master/nanumsquareround.min.css', false);\n\t\twp_enqueue_style('animate.css', 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.2/animate.min.css', true);\n\t\twp_enqueue_script('ofi-min-js', get_stylesheet_directory_uri() . '/js/ofi.min.js', array(), '3.2.4', true);\n\t\twp_enqueue_script('main-js', get_stylesheet_directory_uri() . '/js/main.js', array('jquery'), time(), true);\n\t}", "function gwself_scripts() {\n\tglobal $post;\n\t//default script - needed everywhere\n\twp_enqueue_script( 'theme-jquery', get_template_directory_uri() . '/dist/js/theme.js', array('jquery'), 20190529, true);\n\twp_localize_script('theme-jquery', 'WPURLS', array('siteurl' => get_option('siteurl')));\n\t//header, footer, global css\n\twp_enqueue_style( 'theme-style', get_template_directory_uri() . '/dist/css/theme.css', array(), date(\"H:i:s\"));\n\n\t//section specific styles and scripts\n\tif(is_front_page()) {\n\t\t//FRONT PAGE SCRIPTS\n\t\twp_enqueue_script( 'fp-script', get_template_directory_uri() . '/dist/js/frontpage.js', array('jquery'), 20190529, true);\n\t\twp_enqueue_style( 'frontpage-style', get_template_directory_uri() . '/dist/css/frontpage.css', array(), date(\"H:i:s\"));\n\t} elseif(is_singular()) {\n\t\t$type = $post->post_type;\n\t\twp_enqueue_style( $type.'-style', get_template_directory_uri() . '/dist/css/type_'.$type.'.css', array(), date(\"H:i:s\"));\n\t} else {\n\t\twp_enqueue_style( 'page-style', get_template_directory_uri() . '/dist/css/type_page.css', array(), date(\"H:i:s\"));\n\t}\n}", "function _appthemes_register_theme_scripts() {\n\n\t// Minimize prod or show expanded in dev.\n\t$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\trequire_once APP_THEME_FRAMEWORK_DIR . '/js/localization.php';\n\n\twp_register_script( 'colorbox', APP_THEME_FRAMEWORK_URI . \"/js/colorbox/jquery.colorbox{$min}.js\", array( 'jquery' ), '1.6.1' );\n\twp_register_style( 'colorbox', APP_THEME_FRAMEWORK_URI . \"/js/colorbox/colorbox{$min}.css\", false, '1.6.1' );\n\twp_register_style( 'font-awesome', APP_THEME_FRAMEWORK_URI . \"/lib/font-awesome/css/font-awesome{$min}.css\", false, '4.7.0' );\n\n\twp_register_script( 'footable', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable{$min}.js\", array( 'jquery' ), '2.0.3' );\n\twp_register_script( 'footable-grid', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.grid{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-sort', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.sort{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-filter', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.filter{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-striping', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.striping{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-paginate', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.paginate{$min}.js\", array( 'footable' ), '2.0.3' );\n\twp_register_script( 'footable-bookmarkable', APP_THEME_FRAMEWORK_URI . \"/js/footable/jquery.footable.bookmarkable{$min}.js\", array( 'footable' ), '2.0.3' );\n\n\t_appthemes_localize_theme_scripts();\n}", "public function loadInitScript() {\n //di(forum()->getCategory());\n include_once forum()->locateTemplate('init');\n //exit;\n }", "function shutdown() {\n // Safety for themes not using wp_footer\n SLPlus_Actions::ManageTheScripts();\n\t\t}", "function px_site_scripts() {\n \n // Load our main stylesheet.\n wp_enqueue_style( 'corppix_site-style', get_stylesheet_uri() );\n \n \n // FOR PRODUCTION STAGE\n// wp_enqueue_style('font_Montserrat', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');\n wp_enqueue_style('corppix_site_style', get_template_directory_uri().'/build/styles/screen.css');\n \n \n // FOR DEVELOPMENT STAGE\n //wp_enqueue_style('corppix_site_style', get_template_directory_uri().'/public/stylesheets/screen.css');\n \n \n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n wp_enqueue_script( 'comment-reply' );\n }\n \n wp_localize_script( 'corppix_site-script', 'screenReaderText', array(\n 'expand' => '<span class=\"screen-reader-text\">' . __( 'expand child menu', 'corppix_site' ) . '</span>',\n 'collapse' => '<span class=\"screen-reader-text\">' . __( 'collapse child menu', 'corppix_site' ) . '</span>',\n ) );\n \n wp_enqueue_script( 'libs_js', get_template_directory_uri() . '/build/js/libs.js', array('jquery'), null, true );\n \n wp_enqueue_script( 'customization_js', get_template_directory_uri() . '/build/js/customization.js?v=s'.rand(1,1000), array('jquery', 'libs_js'), null, true );\n \n $vars = array(\n 'ajax_url' => admin_url( 'admin-ajax.php' ),\n 'theme_path' => get_stylesheet_directory_uri(),\n 'site_url' => get_site_url()\n );\n \n wp_localize_script( 'corppix_site_js', 'var_from_php', $vars );\n \n \n remove_action('wp_head', 'wp_print_scripts');\n remove_action('wp_head', 'wp_print_head_scripts', 9);\n remove_action('wp_head', 'wp_enqueue_scripts', 1);\n \n add_action('wp_footer', 'wp_print_scripts', 5);\n add_action('wp_footer', 'wp_enqueue_scripts', 5);\n add_action('wp_footer', 'wp_print_head_scripts', 5);\n \n}", "function goodrds_admin_scripts() {\n\t\t// only on our backend page\n\t\tif (get_current_screen()->base == 'settings_page_goodrds') {\n\t wp_register_style( 'goodrds_css', plugins_url('goodrds-admin.css', __FILE__), false, '0.1' );\n\t wp_enqueue_style( 'goodrds_css' );\n\n\t wp_register_script( 'goodrds_js', plugins_url('goodrds-admin.js', __FILE__), array('jquery'), '0.1', true );\n\t wp_enqueue_script( 'goodrds_js' );\n\t }\n\t}", "function ncsu_theme_scripts() {\n wp_deregister_script('jquery');\n \n // Register jQuery again from Google's CDN\n wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', array(), null, true);\n \n wp_register_script('ncsu-bootstrap', 'https://cdn.ncsu.edu/brand-assets/bootstrap/js/bootstrap.min.js', array('jquery'), null, true);\n wp_enqueue_script('ncsu-bootstrap');\n \n /** \n * Uncomment to enqueue individual scripts (development)\n *\n */\n \n /*\n wp_register_script('theme-main-js', get_template_directory_uri() . '/js/main.js', array('jquery'), null, true);\n wp_enqueue_script('theme-main-js');\n \n wp_register_script('wp-mobile-nav', get_template_directory_uri() . '/js/ncstate-mobile-nav.js', array('jquery'), null, true);\n wp_enqueue_script('wp-mobile-nav');\n \n wp_register_script('picture-fill', get_template_directory_uri(). '/js/picturefill.min.js');\n wp_enqueue_script('picture-fill');\n\n */\n \n /**\n * Use minified js in production environments - \n * Uncomment the lines below if using non-minified scripts\n *\n */\n \n wp_register_script('minified-js', get_template_directory_uri() . '/js/main.min.js', array('jquery'), null, true);\n wp_enqueue_script('minified-js');\n }", "public function theme_scripts() {\n\t\t$suffix = !TALEMY_DEV_MODE ? '.min' : '';\n\n\t\t// stylesheets\n\t\twp_register_style(\n\t\t\t'font-awesome-5-all',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/font-awesome/css/all.min.css',\n\t\t\tfalse,\n\t\t\t'5.10.1'\n\t\t);\n\n\t\twp_register_style(\n\t\t\t'font-awesome-5-shim',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/font-awesome/css/v4-shims.min.css',\n\t\t\tfalse,\n\t\t\t'5.10.1'\n\t\t);\n\t\t\n\t\twp_register_style(\n\t\t\t'fancybox',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/css/fancybox.min.css'\n\t\t);\n\n\t\twp_register_style(\n\t\t\t'talemy',\n\t\t\tTALEMY_THEME_URI . 'assets/css/style'. $suffix . '.css',\n\t\t\tfalse,\n\t\t\tTALEMY_THEME_VERSION\n\t\t);\n\n\t\twp_enqueue_style( 'font-awesome-5-all' );\n\t\twp_enqueue_style( 'font-awesome-5-shim' );\n\t\twp_enqueue_style( 'talemy' );\n\t\twp_style_add_data( 'talemy', 'rtl', 'replace' );\n\n\t\t// scripts\n\n \twp_register_script(\n \t\t'fancybox',\n \t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.fancybox.min.js',\n \t\tarray( 'jquery' ),\n \t\tTALEMY_THEME_VERSION,\n \t\ttrue\n \t);\n\n\t\twp_register_script(\n\t\t\t'jquery-fitvids',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.fitvids.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.1',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-matchheight',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.matchHeight.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'0.7.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-placeholder',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.placeholder.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'2.3.1',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-requestanimationframe',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.requestanimationframe.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'0.2.3',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-selectric',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.selectric.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.13.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-superfish',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.superfish.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.7.10',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'jquery-throttle-debounce',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/jquery.throttle-debounce.min.js',\n\t\t\tarray( 'jquery' ),\n\t\t\t'1.1',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'resize-sensor',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/ResizeSensor.min.js',\n\t\t\tarray(),\n\t\t\tnull,\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'theia-sticky-sidebar',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/theia-sticky-sidebar.min.js',\n\t\t\tarray( 'jquery', 'resize-sensor' ),\n\t\t\t'1.7.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'talemy-modernizr',\n\t\t\tTALEMY_THEME_URI . 'assets/lib/js/modernizr.js',\n\t\t\tarray(),\n\t\t\t'3.6.0',\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'talemy-block',\n\t\t\tTALEMY_THEME_URI . 'assets/js/talemy-block.min.js',\n\t\t\tarray( 'jquery', 'imagesloaded', 'jquery-matchheight' ),\n\t\t\tTALEMY_THEME_VERSION,\n\t\t\ttrue\n\t\t);\n\n\t\twp_register_script(\n\t\t\t'talemy',\n\t\t\tTALEMY_THEME_URI . 'assets/js/talemy' . $suffix . '.js',\n\t\t\tarray(\n\t\t\t\t'jquery',\n\t\t\t\t'imagesloaded',\n\t\t\t\t'jquery-fitvids',\n\t\t\t\t'jquery-superfish',\n\t\t\t\t'jquery-selectric',\n\t\t\t\t'jquery-throttle-debounce',\n\t\t\t\t'jquery-requestanimationframe',\n\t\t\t\t'jquery-matchheight',\n\t\t\t\t'jquery-placeholder',\n\t\t\t\t'theia-sticky-sidebar',\n\t\t\t\t'talemy-modernizr'\n\t\t\t),\n\t\t\tTALEMY_THEME_VERSION,\n\t\t\ttrue\n\t\t);\n\n\t\twp_enqueue_script( 'jquery-fitvids' );\n\t\twp_enqueue_script( 'jquery-superfish' );\n\t\twp_enqueue_script( 'jquery-selectric' );\n\t\twp_enqueue_script( 'jquery-throttle-debounce' );\n\t\twp_enqueue_script( 'jquery-requestanimationframe' );\n\t\twp_enqueue_script( 'jquery-matchheight' );\n\t\twp_enqueue_script( 'jquery-placeholder' );\n\t\twp_enqueue_script( 'theia-sticky-sidebar' );\n\t\twp_enqueue_script( 'talemy-modernizr' );\n\t\twp_enqueue_script( 'talemy' );\n\t\twp_localize_script( 'talemy', 'talemy_js_data', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );\n\n\t\tif ( is_single() ) {\n\t\t\tif ( talemy_get_option( 'post_comments' ) && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t\t}\n\t\t\tif ( is_singular( 'sfwd-courses' ) ) {\n\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t} else {\n\t\t\t\t$in_focus_mode = false;\n\t\t\t\tif ( class_exists( 'LearnDash_Settings_Section' ) ) {\n\t\t\t\t\t$in_focus_mode = LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Theme_LD30', 'focus_mode_enabled' );\n\t\t\t\t}\n\t\t\t\tif ( !$in_focus_mode && in_array( get_post_type(), array( 'sfwd-lessons', 'sfwd-topic' ) ) ) {\n\t\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( is_page() && !is_front_page() ) {\n\t\t\tif ( talemy_get_option( 'page_comments' ) && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t\t}\n\t\t}\n\t}", "function plugin_loading_options_page() {\r\n\t\twp_enqueue_script('common');\r\n\t\twp_enqueue_script('wp-lists');\r\n\t\twp_enqueue_script('postbox');\r\n\t}", "public function loadScripts() {\n $graphcss = $this->getProperty('graphcss');\n $customcss = $this->getProperty('customcss');\n $loadjquery = $this->getProperty('loadjquery');\n\n $cssUrl = $this->sekug->config['cssUrl'].'web/';\n $jsUrl = $this->sekug->config['jsUrl'].'web/';\n\n if($loadjquery == 1){\n $this->modx->regClientStartupScript($jsUrl.'libs/'.$this->sekug->config['jqueryFile']);\n }\n if($customcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$customcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'gallery.structure.css');\n }\n if($graphcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$graphcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'directory.graph.css');\n }\n }", "public function config_page_scripts() {\n\t\twp_enqueue_script( 'yseo-gc-admin-js', HS_DOCS_API_DIR_URL . 'js/admin.min.js', null, HS_DOCS_API_PLUGIN_VERSION );\n\t}", "function opinionstage_settings_load_footer(){\n}", "function init() {\n\n\t\twp_register_style( THEME_PREFIX . '/copy', get_theme_file_url( 'assets/critical/copy.min.css' ), null, 'init' );\n\n\t\tCalyx()->_register_vendor_assets();\n\n\t\twp_register_script( THEME_PREFIX . '/script_object', get_theme_file_url( 'assets/js/calyx.min.js' ), null, 'init' );\n\n\t\t\t$localize_args = array(\n\t\t\t\t'_site' => home_url(),\n\t\t\t\t'_rest' => home_url( 'wp-json' ),\n\t\t\t\t'_ajax' => admin_url( 'admin-ajax.php' ),\n\n\t\t\t\t '_server_high_load' => json_encode( Calyx()->server()->is_high_load() ),\n\t\t\t\t'_server_extreme_load' => json_encode( Calyx()->server()->is_extreme_load() ),\n\t\t\t\t '_webfontloader' => json_encode( Calyx()->get_webfontloader_settings() ),\n\t\t\t);\n\n\t\t\tis_admin() && $localize_args['_admin'] = json_encode( true );\n\n\t\t\twp_localize_script( THEME_PREFIX . '/script_object', '_' . THEME_PREFIX . '_data', $localize_args );\n\n\t}", "function ManageTheScripts() {\n if (!defined('SLPLUS_SCRIPTS_MANAGED') || !SLPLUS_SCRIPTS_MANAGED) {\n\n // If no shortcode rendered, remove scripts\n //\n if (!defined('SLPLUS_SHORTCODE_RENDERED') || !SLPLUS_SHORTCODE_RENDERED) {\n wp_dequeue_script('google_maps');\n wp_deregister_script('google_maps');\n wp_dequeue_script('csl_script');\n wp_deregister_script('csl_script');\n }\n define('SLPLUS_SCRIPTS_MANAGED',true);\n }\n }", "function load_prod_styles_scripts() {\n // Theme styles\n wp_enqueue_style( 'themename', CHILD_SS_URI . '/assets/dist/style.min.css', false, null, 'all' );\n\n // Header Scripts\n wp_enqueue_script( 'header_scripts', CHILD_SS_URI . '/assets/dist/header.min.js', array(), null, false );\n\n // Footer Scripts\n wp_enqueue_script( 'footer_scripts', CHILD_SS_URI . '/assets/dist/footer.min.js', array( 'jquery' ), null, true );\n\n // Single Scripts\n if ( is_single() ) {\n wp_enqueue_script( 'single_scripts', CHILD_SS_URI . '/assets/dist/single.min.js', array( 'jquery' ), null, true );\n }\n}", "function kesha_theme_scripts() {\n\n // Register Custom CSS\n wp_register_style( 'theme', get_template_directory_uri() . '/dist/css/built.min.css', array(), rand(111,9999), 'all' );\n\n // Enqueue Styles\n wp_enqueue_style( 'theme' );\n\n // Register JS.\n wp_register_script( 'scripts', get_template_directory_uri() . '/dist/js/built.min.js', array( 'jquery' ), rand(111,9999), TRUE );\n\n // Enqueue JS\n wp_enqueue_script( 'scripts' );\n}", "function load_theme_js() {\n\n // Register and load js\n\twp_register_script('modernizr-js', get_template_directory_uri() . '/assets/js/modernizr-2.6.2.min.js', false, null, false);\n\twp_enqueue_script('modernizr-js');\n\n\twp_register_script('bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.js', false, null, true);\n\twp_enqueue_script('bootstrap-js');\n\n\twp_register_script('barba-js', get_template_directory_uri() . '/assets/js/barba.js', false, null, true);\n\twp_enqueue_script('barba-js');\n\n\twp_register_script('slick-js', get_template_directory_uri() . '/assets/js/slick.min.js', false, null, true);\n\twp_enqueue_script('slick-js');\n\n\twp_register_script('lightbox-js', get_template_directory_uri() . '/assets/js/lightbox.js', false, null, true);\n\twp_enqueue_script('lightbox-js');\n\n\twp_register_script('script-js', get_template_directory_uri() . '/assets/js/script.js', false, null, true);\n\twp_enqueue_script('script-js');\n\n\tif (is_home() || is_front_page()){\n\t\twp_register_script('script-homepage-js', get_template_directory_uri() . '/assets/js/script-homepage.js', false, null, true);\n\t\twp_enqueue_script('script-homepage-js');\n\t} else {\n\t\t// enqueue common scripts here\n\t}\n\n}", "function rssmi_footer_scripts() {\n\twp_enqueue_style( 'frontend', plugins_url( 'css/frontend.css', dirname( __FILE__ ) ) );\n\twp_enqueue_script( 'showexcerpt', plugins_url( 'scripts/show-excerpt.js', dirname( __FILE__ ) ) );\n}", "function hook_template_footer() {\r\n\t\tglobal $site;\r\n\t\t$site->addScriptVar('constants', array(\r\n\t\t\t'siteUrl' => $site->urlTo('/'),\r\n\t\t\t'slug' => json_encode( $site->getSlugs() )\r\n\t\t));\r\n\t}", "function themeslug_enqueue_script() {\n}", "function health_access2017_scripts() {\n\t// theme style.css file\n\t// wp_enqueue_style( 'google-fonts', 'http://fonts.googleapis.com/css?family=Lato:400,700,900', false ); \n\twp_enqueue_style( 'health-access2017-style', get_stylesheet_uri() );\n\n\t//enqueue additional stylesheet for custom css to be added in addition to theme css\n\twp_enqueue_style( 'additional-styles', get_stylesheet_directory_uri() . '/custom.css' );\n\t\n\t// threaded comments\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\t// vendor scripts\n//\twp_enqueue_script(\n//\t\t'vendor',\n//\t\tget_template_directory_uri() . '/assets/vendor/newscript.js',\n//\t\tarray('jquery')\n//\t);\n\t// theme scripts\n\twp_enqueue_script(\n\t\t'theme-init',\n\t\tget_template_directory_uri() . '/assets/theme.js',\n\t\tarray('jquery')\n\t);\n}", "function addThemeScripts() \n {\n wp_enqueue_script('constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/js/ready.js', array('jquery'));\n }", "function theme_name_scripts() {\n\t\t// wp_enqueue_style( 'style-name', get_stylesheet_uri() );\n\t\twp_enqueue_script( 'jquery', get_template_directory_uri() . '/js/jquery.min.js', array(), '1.0.0', true );\n\t\twp_enqueue_script( 'retina.min', get_template_directory_uri() . '/js/retina.min.js', array(), '1.0.0', true );\n\t\twp_enqueue_script( 'isotope.pkgd.min', get_template_directory_uri() . '/js/isotope.pkgd.min.js', array(), '1.0.0', true );\n\t\twp_enqueue_script( 'jquery.magnific-popup.min', get_template_directory_uri() . '/js/jquery.magnific-popup.min.js', array(), '1.0.0', true );\n\t\twp_enqueue_script( 'jquery.mousewheel.min', get_template_directory_uri() . '/js/jquery.mousewheel.min.js', array(), '1.0.0', true );\n\t\twp_enqueue_script( 'jquery.tinycarousel.min', get_template_directory_uri() . '/js/jquery.tinycarousel.min.js', array(), '1.0.0', true );\n\t\twp_enqueue_script( 'jquery.lazylinepainter.min.js', get_template_directory_uri() . '/js/jquery.lazylinepainter.min.js', array(), '1.0.0', true );\n\t\tif ( is_page( 'contact' ) ){ wp_enqueue_script( 'jquery.gmap.min', get_template_directory_uri() . '/js/jquery.gmap.min.js', array(), '1.0.0', true ); }\n\t\twp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', array(), '1.0.0', true );\n\t}", "function rest_theme_scripts() {\n // Styles\n wp_enqueue_style( 'normalize', get_template_directory_uri() . '/assets/normalize.css', false, '3.0.3' );\n wp_enqueue_style( 'style', get_stylesheet_directory_uri() . '/dist/styles.css', array( 'normalize' ) );\n\n // Pace\n wp_enqueue_script( 'pace', get_template_directory_uri() . '/assets/js/pace.min.js', array(), '1.0.0', true );\n\n // 3rd party scripts from default setup that will not be used\n wp_deregister_script('mailpoet_vendor');\n wp_deregister_script('mailpoet_public');\n wp_deregister_style('mailpoet_public');\n\n wp_enqueue_script( 'wyvern-vue', get_stylesheet_directory_uri() . '/dist/build.js', array(), '1.0.8', true );\n\n $base_url = esc_url_raw( home_url() );\n $base_path = rtrim( parse_url( $base_url, PHP_URL_PATH ), '/' );\n\n wp_localize_script( 'wyvern-vue', 'config', apply_filters( 'wyvern_wp_settings', [\n 'root' => esc_url_raw( rest_url() ),\n 'base_url' => $base_url,\n 'base_path' => $base_path ? $base_path . '/' : '/',\n 'nonce' => wp_create_nonce( 'wp_rest' ),\n 'site_name' => get_bloginfo( 'name' ),\n 'site_desc' => get_bloginfo('description'),\n 'routes' => rest_theme_routes(),\n 'assets_path' => get_stylesheet_directory_uri() . '/assets',\n\n // Inline configurations\n 'show_on_front' => get_option('show_on_front'), // (posts|page) Settings -> Reading -> Front page displays\n 'page_on_front' => get_option('page_on_front'), // (int) Settings -> Reading -> Front page displays when \"page\" is selected and type is \"Front page\"\n 'page_for_posts'=> get_option('page_for_posts'), // (int) Settings -> Reading -> Front page displays when \"page\" is selected and type is \"Posts page\"\n\n 'excerpt_word' => is_array(get_option('wyvern_theme_options_excerpt')) ? get_option('wyvern_theme_options_excerpt')['excerpt_word'] : 'Read more', // @todo remove hardcoded Read more\n ] ) );\n}", "function rawlins_scripts(){\n\tif (!is_admin()) {\n\t### Core\n\t\t// Deregister WordPress jQuery and register Google's\n\t\twp_deregister_script('jquery');\n\t\twp_enqueue_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', array(), '2.1.0', false);\n\n\t\t// Conditionizr\n\t\t//wp_enqueue_script('conditionizr', JSDIR.'/conditionizr.min.js', array(), '2.1.1', false);\n\n\t\t// Modernizr\n\t\t//wp_enqueue_script('modernizr', JSDIR.'/modernizr.custom.2.8.1.js', array(), '2.8.1', false);\n\n\t\t// Bootstrap\n\t\twp_enqueue_script('bootstrap__scripts', STYLEDIR.'/bootstrap/javascripts/bootstrap.min.js', array('jquery'), '1.0', true);\n\n\t\t// Main Stylsheet\n\t\twp_enqueue_style('css', STYLEDIR.'/style.css', false, '1.0');\n\n\t\t// Main Scripts (this file is concatenated from the files inside of js/development/ )\n\t\twp_enqueue_script('scripts', JSDIR.'/scripts.min.js', array('jquery'), '1.0', true);\n\n\n\n\t### Modules\n\t\t// moduleName\n\t\t// wp_register_script('template-default-js', MODDIR.'moduleName/js/moduleName.js', array('jquery'), '1.0', true);\n\n\n\n\t### Templates\n\t\t// Template Name\n\t\t// wp_register_script('template-default-js', JSDIR.'/template-default.js', array('jquery'), '1.0', true);\n\n\n\n\t}\n}", "function kre_scripts() {\n\tif (is_customize_preview()) {\n\t\twp_enqueue_script(\n 'kre-customize-preview', get_template_directory_uri() . '/build/customize-preview.js',\n array(\n 'jquery',\n 'customize-preview',\n 'customize-preview-nav-menus',\n KRE_APP\n ),\n KRE_VERSION,\n true\n );\n\t}\n\n\twp_enqueue_style('kre-style', get_template_directory_uri() . '/build/app.css', array(), KRE_VERSION);\n wp_enqueue_script('yt-player', 'https://www.youtube.com/iframe_api', array(), true);\n\n\twp_enqueue_script(\n KRE_APP, get_template_directory_uri() . '/build/app.js',\n array(\n 'jquery',\n 'wp-a11y'\n ),\n KRE_VERSION,\n true\n );\n\n\tif (is_child_theme()) {\n\t\twp_enqueue_style('kre-child-style', get_stylesheet_uri());\n\t}\n\n\t$url = trailingslashit(home_url());\n\t$path = trailingslashit(wp_parse_url( $url )['path']);\n\n\t$front_page_slug = false;\n\t$blog_page_slug = false;\n\n\tif ('posts' !== get_option('show_on_front')) {\n\t\t$front_page_id = get_option('page_on_front');\n\t\t$front_page = get_post( $front_page_id );\n\n\t\tif ( $front_page->post_name ) {\n\t\t\t$front_page_slug = $front_page->post_name;\n\t\t}\n\n\t\t$blog_page_id = get_option('page_for_posts');\n\t\t$blog_page = get_post($blog_page_id);\n\n\t\tif ($blog_page->post_name) {\n\t\t\t$blog_page_slug = $blog_page->post_name;\n\t\t}\n\t}\n\n\t$user_id = get_current_user_id();\n\t$kre_settings = sprintf(\n\t\t'var SiteSettings = %s; var WPSettings = %s;',\n\t\twp_json_encode(array(\n\t\t\t'endpoint' => esc_url_raw($url),\n\t\t\t'nonce' => wp_create_nonce('wp_rest'),\n\t\t)),\n\t\twp_json_encode(array(\n\t\t\t'user' => $user_id,\n\t\t\t'userDisplay' => $user_id ? get_the_author_meta('display_name', $user_id) : '',\n 'templateUrl' => get_template_directory_uri(),\n\t\t\t'frontPage' => array(\n\t\t\t\t'page' => $front_page_slug,\n\t\t\t\t'blog' => $blog_page_slug,\n\t\t\t),\n\t\t\t'URL' => array(\n\t\t\t\t'base' => esc_url_raw($url),\n\t\t\t\t'path' => $path,\n\t\t\t),\n\t\t\t'meta' => array(\n\t\t\t\t'title' => get_bloginfo('name', 'display'),\n\t\t\t\t'description' => get_bloginfo('description', 'display'),\n\t\t\t),\n\t\t))\n\t);\n\n\twp_add_inline_script(KRE_APP, $kre_settings, 'before');\n}", "public function footer_scripts()\n\t{\n\t\tglobal $context, $settings;\n\n\t\tif(!empty($context['theme_scripts'])) {\n\t\t\tforeach($context['theme_scripts'] as $type => $script) {\n\t\t\t\techo '\n\t\t<script type=\"text/javascript\" src=\"',($script['default'] ? $settings['default_theme_url'] : $settings['theme_url']) . '/' . $script['name'] . $context['jsver'], '\"></script>';\n\t\t\t}\n\t\t}\n\t\tif(!empty($context['inline_footer_script']))\n\t\t\techo '\n\t\t<script type=\"text/javascript\">\n\t\t<!-- // --><![CDATA[\n\t\t',$context['inline_footer_script'],'\n\n\t\t';\n\t\techo '\n\t\t// ]]>\n\t\t</script>\n\t\t';\n\t}", "function tvlc_scripts() {\n\twp_enqueue_style( 'theme', get_stylesheet_uri() );\n\n\twp_deregister_script('jquery');\n wp_enqueue_script( 'jquery', TVLC_JS_DIR . '/jquery-3.3.1.min.js' );\n// wp_enqueue_script('num_animator', TVLC_JS_DIR . '/num-animator.js', false, null, false);\n wp_enqueue_script('mainscript', TVLC_JS_DIR . '/main.min.js', array('jquery'), null, true);\n wp_enqueue_script('wowscript', TVLC_JS_DIR . '/wow.js', false, null, true);\n\n}", "function wptheme_scripts() {\n wp_enqueue_style( 'wptheme-style-xlarge', get_template_directory_uri().\"/css/skel.css\" );\n wp_enqueue_style( 'wptheme-style-default', get_template_directory_uri().\"/css/style-default.css\" );\n wp_enqueue_style( 'wptheme-style-default', get_template_directory_uri().\"/css/style-xlarge.css\" );\n wp_enqueue_style( 'wptheme-style', get_stylesheet_uri() );\n\n // for ie 8\n if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])){\n wp_enqueue_script('wptheme-ie8-style', get_template_directory_uri().\"/css/ie/html5shiv.js\");\n wp_enqueue_style('wptheme-style', get_stylesheet_uri().\"css/ie/v8.css\");\n }\n\n wp_enqueue_script(\"jquery\");\n wp_enqueue_script(\"wptheme-poptrox-js\",get_template_directory_uri().\"/js/jquery.poptrox.min.js\",array(\"jquery\"),\"1.0\", true);\n wp_enqueue_script(\"wptheme-skel-js\",get_template_directory_uri().\"/js/skel.min.js\",array(\"jquery\"),\"1.0\", true);\n wp_enqueue_script(\"wptheme-init-js\",get_template_directory_uri().\"/js/init\",array(\"jquery\", \"wptheme-skel-js\"),\"1.0\", true);\n}", "function gssettings_settings_scripts() {\n global $_gssettings_settings_pagehook;\n wp_enqueue_script( 'common' );\n wp_enqueue_script( 'wp-lists' );\n wp_enqueue_script( 'postbox' );\n }", "function purity_theme_init() {\n elgg_extend_view('page/elements/head', 'purity_theme/meta');\n elgg_unregister_menu_item('topbar', 'elgg_logo');\n\telgg_register_plugin_hook_handler('index', 'system', 'purity_theme');\n}", "function grd_scripts() {\n\twp_enqueue_style( 'main-style', get_stylesheet_uri() );\n\tif( !is_admin() ) {\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'modernizr', get_template_directory_uri() . '/bower_components/modernizr/modernizr.js', array('jquery'), NULL, true );\n\t\twp_enqueue_script( 'plugins', get_template_directory_uri() . '/assets/scripts/plugins.min.js', array('jquery'), NULL, true );\n\t\twp_enqueue_script( 'scripts', get_template_directory_uri() . '/assets/scripts/main.min.js', array('jquery'), NULL, true );\n\t\tif( DEV ) {\n\t\t\twp_enqueue_script( 'livereload', '//localhost:35729/livereload.js', NULL, NULL, true);\n\t\t}\n\t}\n}", "function m59_theme_enqueue_scripts() {\n\t\t\t\t// javascript\n\t\t\t\twp_enqueue_script('jquery');\n\t\t\t\t//wp_enqueue_script('lazyload', get_stylesheet_directory_uri().'/js/jquery.lazyload.min.js','','',true);\n\t\t\t\tif(ENVIRONMENT != 'dev'){\n\t\t\t\t\twp_enqueue_style( 'live', get_stylesheet_directory_uri().'/styles/live.css', array());\n\t\t\t\t\twp_enqueue_script('jquery.site', get_stylesheet_directory_uri().'/js/live.js', 'jQuery',true);\n\n\t\t\t\t}else{\n\t\t\t\t\twp_enqueue_style( 'dev', get_stylesheet_directory_uri().'/styles/live.css');\n\t\t\t\t\twp_enqueue_script('jquery.site', get_stylesheet_directory_uri().'/js/live.js', 'jQuery','',true);\n\t\t\t\t}\n\t}", "public function scripts()\n {\n $scripts = array(\n array(\n 'handler' => 'yatri-google-fonts',\n 'style' => esc_url('//fonts.googleapis.com/css?family=Poppins:300,400,400i,500,600,700|Rubik:400,500,700,900'),\n 'absolute' => true\n ),\n\n array(\n 'handler' => 'yatri-style',\n 'style' => get_stylesheet_uri(),\n 'absolute' => true,\n ), array(\n 'handler' => 'yatri-main',\n 'style' => get_theme_file_uri('/assets/css/yatri.css'),\n 'absolute' => true,\n 'version' => YATRI_THEME_VERSION\n ),\n array(\n 'handler' => 'yatri-script',\n 'script' => get_theme_file_uri('/assets/js/yatri.js'),\n 'absolute' => true,\n 'prefix' => '',\n 'dependency' => array('jquery')\n )\n );\n\n\n Mantrabrain_Theme_Helper_Typo::render_fonts();\n\n $this->yatri_enqueue(apply_filters('yatri_scripts_styles', $scripts));\n\n $locale = apply_filters('yatri_localize_var', array(\n\n 'is_admin_bar' => is_admin_bar_showing() ? true : false,\n\n ));\n\n wp_localize_script('yatri-script', 'yatri_obj', $locale);\n\n if (is_singular() && comments_open()) {\n wp_enqueue_script('comment-reply');\n }\n }", "private function fn_load_scripts() {\n\n\t\t/**\n\t\t * Load Common CSS and JS for a blank Page\n\t\t */\n\n\t\t$fixed_version = $this->fixed_version;\n\t\t$common_css_version = '0.3';\n\t\t$common_js_version = '0.1';\n\t\t$custom_css_version = '0.4';\n\t\t$custom_js_version = '0.4';\n\n\t\t$registered_styles = $this->registered_css;\n\t\t$registered_scripts = $this->registered_js;\n\n\t\t/**\n\t\t * Load CSS--------------------------------------------------------------\n\t\t */\n\n /** Load Google Fonts */\n\t\t$this->google_fonts['google_opensans'] = $registered_styles['google_opensans'];\n\n\t\t/** Load CSS Assets @todo Move the components in their containers */\n\t\t\n\t\t$this->css_assets['bootstrap'] = $registered_styles['bootstrap'].\"?ver=\".$fixed_version;\n\t\t$this->css_assets['fontawesome'] = $registered_styles['fontawesome'].\"?ver=\".$fixed_version;\n\t\t\n\t\t/**\n\t\t * Load JS--------------------------------------------------------------\n\t\t */\n\t\t\n\t\t/** Load footer js **/\n\t\t$this->footer_js['jquery'] = $registered_scripts['jquery'].\"?ver=\".$fixed_version;\t\t\n\t\t$this->footer_js['jquery-ui'] = $registered_scripts['jquery-ui'].\"?ver=\".$fixed_version;\n\n\t\t$this->footer_js['bootstrap'] = $registered_scripts['bootstrap'].\"?ver=\".$fixed_version;\n\t\t/**let other controllers load their own css/js files **/\n\t}", "public function scripts()\n\t{\n\n\t\twp_enqueue_script('jquery');\n\n\t\t// If using the regular comments of wordpress\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\t\t//put modernizr as late as possible\n\t\twp_enqueue_script('bootstrap',DION_THEME_URL.'/assets/js/bootstrap.min.js');\n\t\twp_enqueue_script('owl-carousel',DION_THEME_URL.'/assets/js/owl.carousel.min.js');\n\t\twp_enqueue_script('darkmode','https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js');\n\t\twp_enqueue_script('main',DION_THEME_URL.'/assets/js/main.min.js');\n\t}", "function load_dev_styles_scripts() {\n // Theme styles\n wp_enqueue_style( 'themename', CHILD_SS_URI . '/assets/dev/style.css', false, null, 'all' );\n\n // Header Scripts\n wp_enqueue_script( 'header_scripts', CHILD_SS_URI . '/assets/dev/header.js', array(), null, false );\n\n // Footer Scripts\n wp_enqueue_script( 'footer_scripts', CHILD_SS_URI . '/assets/dev/footer.js', array( 'jquery' ), null, true );\n\n // Single Scripts\n if ( is_single() ) {\n wp_enqueue_script( 'single_scripts', CHILD_SS_URI . '/assets/dev/single.js', array( 'jquery' ), null, true );\n }\n}", "public function admin_enqueue_scripts() {\n\n\t\tif ( stristr( current_filter(), 'elementor' ) ) {\n\n\t\t\tself::register_assets();\n\t\t}\n\n\t\t/*\n\t\t * enqueue admin-scripts in all pages\n\t\t *\n\t\t// enqueue scripts if features enabled\n\t\tif( $this->sections['admin_panel'] == true ||\n\t\t\t$this->sections['meta_box'] == true ||\n\t\t\t$this->sections['better-menu'] == true ||\n\t\t\t$this->sections['taxonomy_meta_box'] == true\n\t\t){\n\t\t\tif( $this->get_current_page_type() != '' ){*/\n\n\t\t// Wordpress 3.5\n\t\tif ( function_exists( 'wp_enqueue_media' ) ) {\n\t\t\twp_enqueue_media();\n\t\t}\n\n\t\t// BetterFramework Admin scripts\n\t\twp_enqueue_script( 'better-framework-admin' );\n\n\t\tif ( ( $type = $this->get_current_page_type() ) == '' ) {\n\t\t\t$type = '0';\n\t\t}\n\n\t\t$better_framework_loc = array(\n\t\t\t'bf_ajax_url' => admin_url( 'admin-ajax.php' ),\n\t\t\t'nonce' => wp_create_nonce( 'bf_nonce' ),\n\t\t\t'type' => $type,\n\t\t\t'lang' => bf_get_current_lang(),\n\n\t\t\t// Localized Texts\n\t\t\t'translation' => array(\n\t\t\t\t'reset_panel' => array(\n\t\t\t\t\t'header' => __( 'Reset options', 'publisher' ),\n\t\t\t\t\t'title' => __( 'Are you sure to reset options?', 'publisher' ),\n\t\t\t\t\t'body' => __( 'With resetting panel all your changes will be lost and will be replaced with default settings.', 'publisher' ),\n\t\t\t\t\t'button_yes' => __( 'Yes, Reset options', 'publisher' ),\n\t\t\t\t\t'button_no' => __( 'No', 'publisher' ),\n\t\t\t\t\t'resetting' => __( 'Resetting options', 'publisher' ),\n\t\t\t\t),\n\t\t\t\t'import_panel' => array(\n\t\t\t\t\t'prompt' => __( 'Do you really wish to override your current settings?', 'publisher' ),\n\t\t\t\t),\n\t\t\t\t'icon_modal' => array(\n\t\t\t\t\t'custom_icon' => __( 'Custom icon', 'publisher' ),\n\t\t\t\t),\n\t\t\t\t'show_all' => __( '… See all', 'publisher' ),\n\t\t\t\t'widgets' => array(\n\t\t\t\t\t'save' => __( 'Save', 'publisher' ),\n\t\t\t\t)\n\t\t\t),\n\n\t\t\t'loading' => '<div class=\"bf-loading-wrapper\"><div class=\"bf-loading-anim\"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div></div>',\n\t\t\t'term_select' => array(\n\t\t\t\t'make_primary' => __( 'Make Primary', 'publisher' ),\n\t\t\t\t'excluded' => __( 'Excluded', 'publisher' ),\n\t\t\t),\n\n\t\t\t'on_error' => array(\n\t\t\t\t'button_ok' => __( 'Ok', 'publisher' ),\n\t\t\t\t'default_message' => __( 'Cannot complete ajax request.', 'publisher' ),\n\t\t\t\t'body' => __( 'please try again several minutes later or contact better studio team support.', 'publisher' ),\n\t\t\t\t'header' => __( 'ajax request failed', 'publisher' ),\n\t\t\t\t'title' => __( 'an error occurred', 'publisher' ),\n\t\t\t\t'display_error' => '<div class=\"bs-pages-error-section\"><a href=\"#\" class=\"btn bs-pages-error-copy\" data-copied=\"' . esc_attr__( 'Copied !', 'publisher' ) . '\"><i class=\"fa fa-files-o\" aria-hidden=\"true\"></i> ' . __( 'Copy', 'publisher' ) . '</a> <textarea> ' . __( 'Error', 'publisher' ) . ': %ERROR_CODE% %ERROR_MSG% </textarea></div>',\n\t\t\t\t'again' => __( 'Error: please try again', 'publisher' ),\n\t\t\t),\n\n\t\t\t'fields' => array(\n\t\t\t\t'select_popup' => array(\n\t\t\t\t\t'header' => '%%name%%',\n\t\t\t\t\t'search' => __( 'Search...', 'publisher' ),\n\t\t\t\t\t'btn_label' => __( 'Choose', 'publisher' ),\n\t\t\t\t\t'btn_label_active' => __( 'Current', 'publisher' ),\n\n\t\t\t\t\t'filter_cat_title' => __( 'Category', 'publisher' ),\n\t\t\t\t\t'categories' => array(),\n\n\n\t\t\t\t\t'filter_type_title' => __( 'Type', 'publisher' ),\n\t\t\t\t\t'all_l10n' => __( 'All', 'publisher' ),\n\n\t\t\t\t\t'types' => array(),\n\t\t\t\t),\n\n\t\t\t\t'select_popup_confirm' => array(\n\t\t\t\t\t'header' => __( 'Do you want to change %%name%%?', 'publisher' ),\n\t\t\t\t\t'button_ok' => __( 'Yes, Change', 'publisher' ),\n\t\t\t\t\t'button_cancel' => __( 'Cancel', 'publisher' ),\n\n\t\t\t\t\t'caption' => '%s',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\tif ( $this->sections['page-builder'] || $this->sections['vc-extender'] ) {\n\n\t\t\t$better_framework_loc['page_builder'] = BF_Page_Builder_Extender::active_page_builders();\n\n\t\t\tif ( $this->get_current_page_type() === 'widgets' &&\n\t\t\t 'Elementor' === $better_framework_loc['page_builder']\n\t\t\t) {\n\n\t\t\t\t$better_framework_loc['shortcodes_id'] = array_keys( BF_Shortcodes_Manager::$shortcodes );\n\t\t\t}\n\t\t} else {\n\t\t\t$better_framework_loc['page_builder'] = array();\n\t\t}\n\n\t\twp_localize_script( 'better-framework-admin', 'better_framework_loc', apply_filters( 'better-framework/localized-items', $better_framework_loc ) );\n\n\t\t// BetterFramework admin style\n\t\twp_enqueue_style( 'better-framework-admin' );\n\n\t\tif ( is_rtl() ) {\n\t\t\twp_enqueue_style( 'better-framework-admin-rtl' );\n\t\t}\n\n\t\tif ( $this->get_current_page_type() == 'metabox' ) {\n\t\t\tbf_enqueue_modal( 'icon' ); // safe enqueue for fixing visual composer bug\n\t\t}\n\n\t\tbf_enqueue_style( 'better-studio-admin-icon' );\n\t\tbf_enqueue_style( 'fontawesome' );\n\t}", "function front_scripts() {\n FWP()->display->assets['future-past-front.js'] = plugins_url( '', __FILE__ ) . '/assets/js/front.js';\n }", "function site_scripts() {\n wp_register_script( 'main-scripts',\n get_template_directory_uri() . '/site-scripts-min.js',\n array( 'jquery' ) );\n wp_enqueue_script( 'main-scripts' );\n}", "function wck_page_load_scripts() {\t\t\r\n\t\t?>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\t//<![CDATA[\r\n\t\t\tjQuery(document).ready( function($) {\r\n\t\t\t\t$('.if-js-closed').removeClass('if-js-closed').addClass('closed');\r\n\t\t\t\tpostboxes.add_postbox_toggles( '<?php echo $this->hookname; ?>' );\r\n\t\t\t});\r\n\t\t\t//]]>\r\n\t\t</script><?php\r\n\t}", "public function theme_scripts()\n\t{\n\t\t\n\n\t\t$user_id = get_current_user_id();\n\n\t\twp_enqueue_script(\n\t\t\t'theme',\n\t\t\tTHEME_URL . '/assets/js/theme.js',\n\t\t\t[],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\n\t\twp_enqueue_script(\n\t\t\t'react-script',\n\t\t\tTHEME_URL . '/assets/js/react-main.js',\n\t\t\t[],\n\t\t\t'auto',\n\t\t\ttrue\n\t\t);\n\n\t\t//$bannerImage = get_field('banner_image', 'option');\n\t\t//$welcomeContent = get_field('welcome_text', 'option');\n\n\t\t$banner = array(\n\t\t\t'title' => __('Search Page', 'freshportfolio'),\n\t\t\t'image' => $bannerImage,\n\t\t);\n\n\t\t$welcome = array(\n\t\t\t'title' => __('Welcome', 'freshportfolio'),\n\t\t\t'content' => $welcomeContent,\n\t\t);\n\n\t\t$filter = array(\n\t\t\t'title' => __('Search for', 'freshportfolio'),\n\t\t\t'placeholder' => __('Type keywords here...', 'freshportfolio'),\n\t\t\t'sorting' => array(\n\t\t\t\t'name' => __('Name', 'freshportfolio'),\n\t\t\t\t'time' => __('Date', 'freshportfolio'),\n\t\t\t),\n\t\t);\n\n\t\t// user data\n\t\t// 1. avatar\n\t\t// 2. displayname\n\t\t// 3. first login\n\t\t$user \t\t\t= get_user_by('id', $user_id);\n\t\t$avatar_url \t= get_avatar_url($user_id);\n\t\t$display_name = $user->display_name;\n\n\t\t$is_first_login = get_user_meta($user_id, 'first_login', true);\n\n\t\twp_localize_script('theme', 'SITE_OPTIONS', array(\n\t\t\t'siteURL' => site_url(),\n\t\t\t'ajaxURL' => admin_url('admin-ajax.php'),\n\t\t\t'themeURL' => THEME_URL,\n\t\t));\n\n\t\twp_localize_script('theme', 'SITE_AJAX', array(\n\t\t\t'hideWelcome' => array(\n\t\t\t\t'action' => 'hide_welcome',\n\t\t\t\t'nonce' => wp_create_nonce('HideWelcome'),\n\t\t\t),\n\t\t));\n\n\t\twp_localize_script('theme', 'SITE_DATA', array(\n\t\t\t'banner' => $banner,\n\t\t\t'welcome' => $welcome,\n\t\t\t'filter' => $filter,\n\t\t\t'first_login' => $is_first_login,\n\t\t\t'user_data' => array(\n\t\t\t\t'avatar' => $avatar_url,\n\t\t\t\t'display_name' => $display_name,\n\t\t\t)\n\t\t));\n\t}", "function windsor_hovers_frontend_scripts() {\n\t\tif ( windsor_is_on(windsor_get_theme_option('debug_mode')) && file_exists(windsor_get_file_dir('includes/theme.hovers/jquery.slidemenu.js')) && in_array(windsor_get_theme_option('menu_hover'), array('slide_line', 'slide_box')) )\n\t\t\twindsor_enqueue_script( 'slidemenu', windsor_get_file_url('includes/theme.hovers/jquery.slidemenu.js'), array('jquery') );\n\t\tif ( windsor_is_on(windsor_get_theme_option('debug_mode')) && file_exists(windsor_get_file_dir('includes/theme.hovers/theme.hovers.js')) )\n\t\t\twindsor_enqueue_script( 'windsor-hovers', windsor_get_file_url('includes/theme.hovers/theme.hovers.js'), array('jquery') );\n\t\tif ( windsor_is_on(windsor_get_theme_option('debug_mode')) && file_exists(windsor_get_file_dir('includes/theme.hovers/theme.hovers.css')) )\n\t\t\twindsor_enqueue_style( 'windsor-hovers', windsor_get_file_url('includes/theme.hovers/theme.hovers.css'), array(), null );\n\t}", "function wp_scripts()\n {\n }", "public function gismo_scripts() {\n\t\t\t\n\t\t\t$gismo_ts = $this->settings;\n\t\t\t$layout = $gismo_ts['layout'];\n\t\t\t$style = $gismo_ts['style'];\n\t\t\t\n\t\t\t$uikit_theme = $layout['uikit']['theme'];\n\t\t\t\n\t\t\tif($layout['blog']['paging'] == 'infinite'){\n\t\t\t\t\n\t\t\t\t$args = array(\n\t\t\t\t\t'nonce' => wp_create_nonce('gismo-load-more-nonce'),\n\t\t\t\t\t'url' => admin_url('admin-ajax.php'),\n\t\t\t\t\t'query' => ''//$this->wp_query->query,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\twp_localize_script('gismo-load-more', 'gismoloadmore', $args);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\twp_enqueue_style( 'gismo-uikit' . ($uikit_theme != 'default' ? '-' . $uikit_theme : '') . '-style', get_template_directory_uri() . '/js/uikit-2.27.2/css/uikit' . ($uikit_theme != 'default' ? '.' . $uikit_theme : '') . '.min.css' );\n\t\t\t\n\t\t\tif(!empty($layout['uikit']['css_components'])){\n\t\t\t\t\n\t\t\t\tforeach($layout['uikit']['css_components'] as $component){\n\t\t\t\t\twp_enqueue_style( 'gismo-uikit-' . $component . '-style', get_template_directory_uri() . '/js/uikit-2.27.2/css/components/' . $component . (!empty($uikit_theme) && $uikit_theme != 'default' ? '.' . $uikit_theme : '') . '.min.css' );\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\twp_enqueue_style( 'gismo-menu', get_template_directory_uri() . '/js/menu/css/superfish.css' );\n\t\t\twp_enqueue_style( 'gismo-style', get_stylesheet_uri() );\n\t\t\t\n\t\t\tif($style['theme'] != 'default'){\n\t\t\t\twp_enqueue_style( 'gismo-'.$style['theme'].'-style', get_template_directory_uri() . '/css/themes/'.$style['theme'].'.css' );\t\n\t\t\t}\n\t\t\n\t\t\twp_enqueue_script( 'gismo-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20151215', true );\n\t\t\n\t\t\twp_enqueue_script( 'gismo-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );\n\t\t\n\t\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t\t}\n\t\t\t\n\t\t\twp_enqueue_script( 'gismo-uikit', get_template_directory_uri() . '/js/uikit-2.27.2/js/uikit.min.js', array('jquery'), '2.27.2', true );\n\t\t\twp_enqueue_script( 'gismo-hoverintent', get_template_directory_uri() . '/js/menu/js/hoverIntent.js', array('jquery'), '', true );\n\t\t\twp_enqueue_script( 'gismo-menu', get_template_directory_uri() . '/js/menu/js/superfish.min.js', array('jquery'), '1.7.9', true );\n\t\t\twp_enqueue_script( 'gismo-front', get_template_directory_uri() . '/js/front.js', array('jquery'), '12.1.16', true );\n\t\t\t\n\t\t\tif($layout['blog']['paging'] == 'infinite'){\n\t\t\t\t\n\t\t\t\t$args = array(\n\t\t\t\t\t'nonce' => wp_create_nonce('gismo-load-more-nonce'),\n\t\t\t\t\t'url' => admin_url('admin-ajax.php'),\n\t\t\t\t\t'query' => $this->wp_query->query,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\twp_localize_script('gismo-front', 'gismo_loadmore', $args);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($layout['blog']['layout'] == 'grid'){\n\t\t\t\twp_enqueue_script( 'gismo-uikit-grid', get_template_directory_uri() . '/js/uikit-2.27.2/js/components/grid.min.js', array('gismo-uikit'), '2.27.2', true );\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($layout['uikit']['js_components'])){\n\t\t\t\t\n\t\t\t\tforeach($layout['uikit']['js_components'] as $component){\n\t\t\t\t\twp_enqueue_script( 'gismo-uikit-' . $component, get_template_directory_uri() . '/js/uikit-2.27.2/js/components/'.$component.'.min.js', array('gismo-uikit'), '2.27.2', true );\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\twp_enqueue_style( 'dashicons' );\n\t\t\t\n\t\t}", "function load()\n {\n self::loadScriptsAndStyles($this->m_themeLoad ? $this->m_themeName : false);\n }", "function webbusiness_scripts() {\n\twp_enqueue_style('webbusiness-style', get_stylesheet_uri());\n\twp_enqueue_style('webbusiness-framework', get_template_directory_uri() . '/css/framework.css');\n\t$style = get_theme_mod(\"style\");\n\tif (!$style || $style == \"default\") {\n\t\t$style = \"dark\";\n\t}\n\t$wp_customize = \"\";\n\tif (isset($_POST[\"wp_customize\"])) $wp_customize = $_POST[\"wp_customize\"];\n\tif ($wp_customize == \"on\") {\n\t\twp_enqueue_style('webbusiness-color-dynamic', get_template_directory_uri() . '/css/dynamic-css-customizer.php');\n\t} else {\n\t\twebbusiness_save_css();\n\t\t$uploads = wp_upload_dir();\n\t\t$uploads_dir = trailingslashit($uploads[\"basedir\"]);\n\t\t$uploads_path = trailingslashit($uploads[\"baseurl\"]);\n\t\tif (file_exists($uploads_dir . \"webbusiness.css\") /* && !$save_custom_css */) {\n\t\t\twp_enqueue_style('webbusiness-color-dynamic', $uploads_path . \"webbusiness.css\");\n\t\t} else {\n\t\t\twp_enqueue_style('webbusiness-color-dynamic', get_template_directory_uri() . '/css/dynamic-css.php');\n\t\t}\n\t}\n\n\twp_enqueue_style('webbusiness-layout', get_template_directory_uri() . '/css/webbusiness.css');\n\t\n\tif (!get_theme_mod(\"googlefonts_link\")) {\n\t\twp_enqueue_style('webbusiness-googlefonts', \"http://fonts.googleapis.com/css?family=Ubuntu\");\n\t}\n\t\n\twp_enqueue_script('webbusiness-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);\n\n\twp_enqueue_script('webbusiness-jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-superfish', get_template_directory_uri() . '/js/superfish.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-tinynav', get_template_directory_uri() . '/js/tinynav.min.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-script', get_template_directory_uri() . '/js/script.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-retina', get_template_directory_uri() . '/js/retina-1.1.0.min.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-modernizr', get_template_directory_uri() . '/js/modernizr-2.0.6.min.js', array(), '20120206', false);\n\n\tif (is_singular() && comments_open() && get_option('thread_comments')) {\n\t\twp_enqueue_script('comment-reply');\n\t}\n\n\tif (is_singular() && wp_attachment_is_image()) {\n\t\twp_enqueue_script('webbusiness-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array('jquery'), '20120202');\n\t}\n}", "function load_theme_scripts() {\n\n // UCITAJ GOOGLE FONTOVE\n wp_enqueue_style( 'material-icons', 'http://fonts.googleapis.com/icon?family=Material+Icons');\n wp_enqueue_style( 'dosis-font', 'https://fonts.googleapis.com/css?family=Dosis:400,700&subset=latin,latin-ext');\n\n // UCITAJ CSS STILOVE\n // Dodaj Bootstrap 3 CSS >> Bootstrap framework CSS\n wp_enqueue_style( 'materialize', get_template_directory_uri() .'/css/materialize.css');\n\n // Dodaj SWIPER CSS\n wp_enqueue_style( 'swiper', get_template_directory_uri() .'/css/swiper/swiper.min.css');\n\n // Dodaj glavni Style CSS\n wp_enqueue_style( 'xception', get_stylesheet_uri() );\n\n // UCITAJ JAVASKRIPTE\n // Dodaj JQuery 1.11.3 JS\n wp_enqueue_script( 'theme-jquery', 'https://code.jquery.com/jquery-2.1.1.min.js', array(), '', true);\n\n // Dodaj Masonry\n wp_enqueue_script('masonry-js', get_template_directory_uri() .'/js/masonry/masonry.pkgd.min.js', array(),'theme-jquery', true);\n\n // Dodaj Materialize JS\n wp_enqueue_script('materialize-js', get_template_directory_uri() .'/js/materialize/materialize.min.js', array(),'theme-jquery', true);\n\n // Dodaj CLASSIE JS\n wp_enqueue_script( 'classie-js', get_template_directory_uri() .'/js/classie/classie.js', array(), 'theme-jquery', true);\n\n // Dodaj SWIPER JS\n wp_enqueue_script('swiper-js', get_template_directory_uri() .'/js/swiper/swiper.min.js', array(),'theme-jquery', true);\n\n // Add theme JS file\n wp_enqueue_script('xception-js', get_template_directory_uri() .'/js/theme.js', array(),'theme-jquery', true);\n\n }", "function load_theme_scripts() { \n\tif (!is_admin()) { \n\t\t/*wp_deregister_script('jquery'); \n\t\twp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'); \n\t\twp_enqueue_script('jquery'); */\n\t\t//wp_enqueue_script('fancybox', get_template_directory_uri() . '/js/jquery.fancybox.min.js', array('jquery')); \n\t\t// wp_enqueue_script('mousewheel', get_template_directory_uri() . '/js/jquery.mousewheel.min.js', array('jquery')); \n\t\t//wp_enqueue_script('respond', get_template_directory_uri() . '/js/respond.min.js', array('jquery') );\n\t\t//wp_enqueue_script('cycle', get_template_directory_uri() . '/js/jquery.cycle.js', array('jquery') );\n\t\t\n\t\t//wp_enqueue_script('colorbox', get_template_directory_uri() . '/js/jquery.colorbox.js', array('jquery')); \n\t\t//wp_enqueue_script('anythingslider', get_template_directory_uri() . '/js/jquery.anythingslider.min.js', array('jquery'));\n\t\t//wp_enqueue_script('superfish', get_template_directory_uri() . '/js/jquery.superfish.js', array('jquery'));\n\t\t//wp_enqueue_script('hoverIntent', get_template_directory_uri() . '/js/jquery.hoverIntent.min.js', array('jquery'));\n\t\t//wp_enqueue_script('supersubs', get_template_directory_uri() . '/js/jquery.supersubs.min.js', array('jquery'));\n\t\t//wp_enqueue_script('selectivizr', get_template_directory_uri() . '/js/selectivizr.min.js', array('jquery'));\n\t\t//wp_enqueue_script('hotkeys', get_template_directory_uri() . '/js/jquery.hotkeys2.js', array('jquery'));\n // wp_enqueue_script('jquery-ui', get_template_directory_uri(). '/js/jquery-ui.custom/js/jquery-ui.custom.min.js',array('jquery'), '1.1', false);\n wp_enqueue_script('plugins', get_template_directory_uri() . '/js/plugins.js', array('jquery'), 6 );\n\t\twp_enqueue_script('app', get_template_directory_uri() . '/js/app.js', array('jquery'), 6 );\n\t\n\t\tglobal $staticVars;\n\t\twp_localize_script('app', 'jsVars', array( \n\t\t\t'ajaxUrl' => admin_url( 'admin-ajax.php' ),\n\t\t\t'keysListUrl' => $keysListUrl,\n\t\t\t'siteUrl' => $staticVars['siteUrl'],\n\t\t\t'sitetreeUrl' => $staticVars['sitetreeUrl'],\n\t\t\t'eventsUrl' => $staticVars['eventsUrl'],\n\t\t\t'newsUrl' => $staticVars['newsUrl'],\n\t\t\t'keysListUrl' => $staticVars['keysListUrl'],\n\t\t\t'validateMessageRequired' => pll__(\"Privalomas laukelis\"),\n\t\t\t'validateMessageEmail' => pll__(\"Neteisingas el. pašto formatas\"),\n\t\t\t'validateMessageNumber' => pll__(\"Prašome įvesti skaičių\"),\n\t\t));\t\t\n\t} \n}", "function theme_scripts() {\n\twp_enqueue_style( 'theme-style', get_stylesheet_uri(), array(), _S_VERSION );\n\t// wp_style_add_data( 'theme-style', 'rtl', 'replace' );\n\n\twp_enqueue_script( 'lib-jquery', get_template_directory_uri() . '/lib/jquery-3.3.1.min.js', array(), _S_VERSION, true );\n\twp_enqueue_script( 'common-script', get_template_directory_uri() . '/assets/js/script.js', array(), _S_VERSION, true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}", "function childtheme_remove_scripts(){\n remove_action('wp_enqueue_scripts','thematic_head_scripts');\n}", "public function scripts_styles_footer() {\n\t\tif ( is_admin() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$theme_url = get_template_directory_uri();\n\t\t$fa_ver = '4.7.0';\n\t\t$fa_url = \"//maxcdn.bootstrapcdn.com/font-awesome/$fa_ver/css/font-awesome.min.css\";\n\t\t$main_js_url = $theme_url . '/js/main.min.js';\n\t\t$main_js_path = get_template_directory() . '/js/main.min.js';\n\t\t$main_js_ver = file_exists( $main_js_path ) ? filemtime( $main_js_path ) : '';\n\n\t\twp_enqueue_style( 'fa-style', $fa_url, null, $fa_ver );\n\t\twp_enqueue_style( 'gfont', 'https://fonts.googleapis.com/css?family=Handlee' );\n\t\twp_enqueue_script( 'superiocity-script', $main_js_url, null, $main_js_ver, true );\n\t}", "public function frontEndStyleScripts(): void\n {\n wp_enqueue_style('users-data-bootstrap', plugin_dir_url(dirname(__FILE__)) . 'assets/css/bootstrap.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-fontawsome', plugin_dir_url(dirname(__FILE__)) . 'assets/css/font-awesome.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-styles', plugin_dir_url(dirname(__FILE__)) . 'assets/css/users-data.css', [], UsersListing::getVersion());\n //\n wp_enqueue_script('jquery-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('jquery-popper', plugin_dir_url(dirname(__FILE__)) . 'assets/js/popper.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('bootstrap-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/bootstrap.min.js', ['jquery'], UsersListing::getVersion(), false);\n }", "function as_on_add_scripts() {\n // enqueue backbonejs, underscore\n add_existed_script('backbone');\n add_existed_script('underscore');\n if (as_option('as_option_smooth_scroll', '1')) {\n // Smoothscroll JS\n add_script('smoothscroll', TEMPLATEURL . '/js/smoothscroll.js', array(\n 'jquery'));\n }\n // Modernize JS\n add_script('modernizr', TEMPLATEURL . '/js/libs/modernizr.custom.js', array(\n 'jquery'));\n if (as_option('as_option_retina_img', '1')) {\n add_script('retina', TEMPLATEURL . '/js/libs/retina.min.js', array(\n 'jquery'));\n }\n add_script('front', TEMPLATEURL . '/js/front.js', array(\n 'jquery',\n 'backbone',\n 'underscore'));\n add_script('js-appear', TEMPLATEURL . '/js/libs/main.js', array(\n 'jquery',\n 'jquery'));\n //add js easing when plugin not active\n if (!(function_exists('dslc_register_modules'))) {\n //add js easing\n add_script('js-easing', TEMPLATEURL . '/js/libs/jquery.easing.js', array(\n 'jquery',\n 'jquery'));\n }\n wp_localize_script('front', 'as_globals', array(\n 'ajaxURL' => admin_url('admin-ajax.php'),\n 'imgURL' => get_template_directory_uri() . '/img/'\n ));\n // Custom\n add_script('main', TEMPLATEURL . '/js/main.js', array(\n 'jquery'));\n // add style demo\n if (file_exists(TEMPLATE_DIR . '/demo/js/custom_panel.js')) {\n add_script('custom_panel', TEMPLATEURL . '/demo/js/custom_panel.js', array(\n 'jquery'));\n }\n}", "protected function add_footer_scripts() {\n\t\t\tdo_action( 'admin_print_footer_scripts' );\n\t\t}", "function scripts() {\n\t/**\n\t * Flag whether to enable loading uncompressed/debugging assets. Default false.\n\t *\n\t * @param bool project_script_debug\n\t */\n\t$debug = apply_filters( 'project_script_debug', false );\n\t$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\twp_enqueue_script(\n\t\t'modernizr-custom',\n\t\tProject_TEMPLATE_URL . '/assets/js/vendor/modernizr-custom.min.js',\n\t\tfalse, '2.7.2'\n\t);\n\twp_enqueue_script(\n\t\t'project',\n\t\tProject_TEMPLATE_URL . \"/assets/js/project-theme{$min}.js\",\n\t\tarray(),\n\t\tProject_VERSION,\n\t\ttrue\n\t);\n}", "function abyp_scripts() {\n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n wp_enqueue_script( 'comment-reply' );\n }\n\n // Register scripts \n wp_register_script( 'modernizr', SCRIPTS . '/vendor/modernizr.custom.25133.js', false, false, true );\n wp_register_script( 'tween-max', SCRIPTS . '/vendor/TweenMax.min.js', false, false, true );\n wp_register_script( 'jquery-abyp', SCRIPTS . '/vendor/jquery-2.1.1.min.js', false, false, true );\n wp_register_script( 'easing', SCRIPTS . '/vendor/jquery.easing.1.3.js', false, false, true );\n wp_register_script( 'lightbox', SCRIPTS . '/vendor/lightbox-2.6.min.js', false, false, true );\n wp_register_script( 'vendor-bundle', SCRIPTS . '/vendor/vendor.bundle.js', false, false, true );\n wp_register_script( 'abyp-main', SCRIPTS . '/main.js', false, false, true );\n\n // Load the custom scripts \n wp_enqueue_script( 'modernizr' );\n wp_enqueue_script( 'tween-max' );\n wp_enqueue_script( 'jquery-abyp' );\n wp_enqueue_script( 'easing' );\n wp_enqueue_script( 'lightbox' );\n wp_enqueue_script( 'vendor-bundle' );\n wp_enqueue_script( 'abyp-main' ); \n\n // Load the stylesheets \n wp_enqueue_style( 'lightbox', THEMEROOT . '/assets/css/lightbox.css' );\n wp_enqueue_style( 'abyp-master', THEMEROOT . '/assets/css/master.css' );\n }", "function profile_scripts() {\n\n // Load Profile Schemes.\n wp_enqueue_style( 'yz-schemes' );\n\n // Load Profile Style\n wp_enqueue_style( 'yz-profile', YZ_PA . 'css/yz-profile-style.min.css', array(), YZ_Version );\n\n // Load Profile Script.\n\t wp_enqueue_script( 'yz-profile', YZ_PA . 'js/yz-profile.min.js', array( 'jquery', 'jquery-effects-fade' ), YZ_Version, true );\n\n // If Effects are enabled active effects scripts.\n if ( 'on' == yz_option( 'yz_use_effects', 'off' ) ) {\n // Profile Animation CSS\n wp_enqueue_style( 'yz-animation', YZ_PA . 'css/animate.min.css', array(), YZ_Version );\n\t // Load View Port Checker Script\n\t wp_enqueue_script( 'yz-viewchecker', YZ_PA . 'js/yz-viewportChecker.min.js', array( 'jquery' ), YZ_Version, true );\n }\n\n\t}", "function truethemes_hook_footer_scripts(){\n\n\t//get option values\n global $ttso;\n\t$jcycle_timeout = $ttso->ka_jcycle_timeout; // jQuery banner cycle time\n\t$jcycle_pause_hover = $ttso->ka_jcycle_pause_hover; //whether pause on hover.\n\n\tif ($jcycle_pause_hover == \"true\"){\n\t\t$jcycle_pause_hover_results = '1';\n\t}else{\n\t\t$jcycle_pause_hover_results = '';\n\t}\n\n\n//init slider if is Template Homepage :: jQuery 2\nif(is_page_template('template-homepage-jquery-2.php')){\n\necho \"<!-- jQuery Banner Init Script for Template Homepage :: jQuery 2 -->\\n\";\t\necho \"<script type='text/javascript'>\\n\";\necho \"//<![CDATA[\njQuery(window).load(function(){\n\tjQuery('.home-banner-wrap ul').css('background-image','none');\n\tjQuery('.jqslider').css('display','block');\n\tjQuery('.big-banner #main .main-area').css('padding-top','16px');\n \tjQuery('.home-banner-wrap ul').after('<div class=\\\"jquery-pager\\\">&nbsp;</div>').cycle({\n\t\tfx: 'fade',\n\t\ttimeout: '{$jcycle_timeout}',\n\t\theight: 'auto',\n\t\tpause: '{$jcycle_pause_hover_results}',\n\t\tpager: '.jquery-pager',\n\t\tcleartypeNoBg: true\n\n\t});\n});\n//]]>\\n\";\necho \"</script>\\n\";\n}\n\n//init slider if is Template Homepage :: jQuery\nif(is_page_template('template-homepage-jquery.php')){\n\necho \"<!-- jQuery Banner Init Script for Template Homepage :: jQuery -->\\n\";\t\necho \"<script type='text/javascript'>\\n\";\necho \"//<![CDATA[\njQuery(window).load(function(){\n\tjQuery('.home-bnr-jquery ul').css('background-image','none');\n\tjQuery('.jqslider').css('display','block');\n jQuery('.home-bnr-jquery ul').after('<div class=\\\"jquery-pager\\\">&nbsp;</div>').cycle({\n\t\tfx: 'fade',\n\t\ttimeout: '{$jcycle_timeout}',\n\t\theight: 'auto',\n\t\tpause: '{$jcycle_pause_hover_results}',\n\t\tpager: '.jquery-pager',\n\t\tcleartypeNoBg: true\n\t\t});\n});\n//]]>\n</script>\\n\";\t\n}\n\n//Testimonial init script\nglobal $ttso;\n$testimonial_enable = $ttso->ka_testimonial_enable;\n\nif($testimonial_enable == \"true\"){\n$testimonial_timeout = $ttso->ka_testimonial_timeout;\n$testimonial_pause_hover = $ttso->ka_testimonial_pause_hover;\n\tif ($testimonial_pause_hover == \"true\"){\n\t\t$testimonial_pause_hover_results = '1';\n\t}else{\n\t$testimonial_pause_hover_results = '0';\n\t}\n\necho \"<!-- Testimonial init script -->\\n\";\necho \"<script type='text/javascript'>\n//<![CDATA[\njQuery(document).ready(function(){\n\tfunction adjust_container_height(){\n\t\t//get the height of the current testimonial slide\n\t\tvar hegt = jQuery(this).height();\n\t\t//set the container's height to that of the current slide\n\t\tjQuery(this).parent().animate({height:hegt});\n\t}\n jQuery('.testimonials').after('<div class=\\\"testimonial-pager\\\">&nbsp;</div>').cycle({\n\t\tfx: 'fade',\n\t\ttimeout: '{$testimonial_timeout}',\n\t\theight: 'auto',\n\t\tpause: '{$testimonial_pause_hover_results}',\n\t\tpager: '.testimonial-pager',\n\t\tbefore: adjust_container_height,\n\t\tcleartypeNoBg: true\n\n\t});\n});\n\n//]]>\n</script>\\n\";\n}\t\t\t\t\t\n}", "function load_script() {\n \n wp_enqueue_script('jquery');\t\n\n wp_enqueue_script(\"fancy\",\n get_template_directory_uri() . '/js/fancy.js','','',true );\n\n wp_enqueue_script(\"wp-seo-admin\",\n get_template_directory_uri() . '/js/wp-seo-admin.js','','',true );\n\n wp_enqueue_script(\"wp-seo-metabox\",\n get_template_directory_uri() . '/js/wp-seo-metabox.js','','',true );\n \n wp_enqueue_script(\"core\",\n get_template_directory_uri() . '/js/core.js','','',true );\n \n wp_enqueue_script(\"main\",\n get_template_directory_uri() . '/js/main.js','','',true );\n\n wp_enqueue_script(\"file_a\",\n get_template_directory_uri() . '/js/core.js','','',true );\n \n \n \n}", "function linolakestheme_scripts_setup() {\n\t\twp_enqueue_style( 'linolakes-bootstrap-css', get_template_directory_uri() . '/lib/bootstrap/css/bootstrap.min.css', array( ), current_time( 'mysql' ), 'all' );\n\t\twp_enqueue_style( 'font-awesome-css', get_template_directory_uri() . '/lib/bootstrap/css/font-awesome.min.css', array( ), current_time( 'mysql' ), 'all' );\n\t\t \n\t\t// Loads our main stylesheet.\n\t\twp_enqueue_style( 'flat_responsive-style', get_stylesheet_uri(), array(), current_time( 'mysql' ) );\n\t\t\n\t\t// Loads our scripts.\t \n\t\twp_enqueue_script('linolakes-bootstrap-js', get_template_directory_uri() . '/lib/bootstrap/js/bootstrap.min.js', array('jquery'), current_time( 'mysql' ), true);\n\t\twp_enqueue_script('linolakes-jquery-js', get_template_directory_uri() . '/lib/bootstrap/js/jquery.min.js', array('jquery'), current_time( 'mysql' ), true);\n\t\t\t\t\n\t}", "public function admin_enqueue_scripts() {\n\t\t$pagenow = $GLOBALS['pagenow'];\n\n\t\tif ( ! ( self::is_term_edit( $pagenow ) || self::is_term_overview( $pagenow ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$asset_manager = new WPSEO_Admin_Asset_Manager();\n\t\t$asset_manager->enqueue_style( 'scoring' );\n\n\t\t$tab = new WPSEO_Help_Center_Template_Variables_Tab();\n\t\t$tab->enqueue_assets();\n\n\t\t$tag_id = filter_input( INPUT_GET, 'tag_ID' );\n\t\tif (\n\t\t\tself::is_term_edit( $pagenow ) &&\n\t\t\t! empty( $tag_id ) // After we drop support for <4.5 this can be removed.\n\t\t) {\n\t\t\twp_enqueue_media(); // Enqueue files needed for upload functionality.\n\n\t\t\t$asset_manager->enqueue_style( 'metabox-css' );\n\t\t\t$asset_manager->enqueue_style( 'snippet' );\n\t\t\t$asset_manager->enqueue_style( 'scoring' );\n\t\t\t$asset_manager->enqueue_script( 'metabox' );\n\t\t\t$asset_manager->enqueue_script( 'term-scraper' );\n\n\t\t\twp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper', 'wpseoTermScraperL10n', $this->localize_term_scraper_script() );\n\t\t\t$yoast_components_l10n = new WPSEO_Admin_Asset_Yoast_Components_l10n();\n\t\t\t$yoast_components_l10n->localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'term-scraper' );\n\n\t\t\twp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'replacevar-plugin', 'wpseoReplaceVarsL10n', $this->localize_replace_vars_script() );\n\t\t\twp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'metabox', 'wpseoSelect2Locale', WPSEO_Utils::get_language( WPSEO_Utils::get_user_locale() ) );\n\t\t\twp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'metabox', 'wpseoAdminL10n', WPSEO_Help_Center::get_translated_texts() );\n\n\t\t\t$asset_manager->enqueue_script( 'admin-media' );\n\n\t\t\twp_localize_script( WPSEO_Admin_Asset_Manager::PREFIX . 'admin-media', 'wpseoMediaL10n', array(\n\t\t\t\t'choose_image' => __( 'Use Image', 'wordpress-seo' ),\n\t\t\t) );\n\t\t}\n\n\t\tif ( self::is_term_overview( $pagenow ) ) {\n\t\t\t$asset_manager->enqueue_script( 'edit-page-script' );\n\t\t}\n\t}", "public function widget_scripts() {\n\t\twp_register_script( 'elementor-hello-world', plugins_url( '/assets/js/hello-world.js', __FILE__ ), [ 'jquery' ], false, true );\n\t}", "function niko_register_scripts() {\n $theme_version = wp_get_theme()->get( 'Version' );\n //Подключение стилей\n wp_deregister_script('jquery');\n wp_enqueue_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js', array(), null, true );\n wp_enqueue_script( 'aos', get_template_directory_uri() . '/assets/js/aos.js', array('jquery'), $theme_version, true );\n\n wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery'), $theme_version, true );\n wp_enqueue_script( 'magnific-popup', get_template_directory_uri() . '/assets/js/jquery.magnific-popup.min.js', array('jquery'), $theme_version, true );\n wp_enqueue_script( 'validate', get_template_directory_uri() . '/assets/js/jquery.validate.min.js', array('jquery'), $theme_version, true );\n wp_enqueue_script( 'smooth-scroll', get_template_directory_uri() . '/assets/js/jquery.smooth-scroll.min.js', array('jquery'), $theme_version, true );\n wp_enqueue_script( 'custom', get_template_directory_uri() . '/assets/js/custom.js', array('jquery'), $theme_version, true );\n wp_enqueue_script( 'valid-ajax', get_template_directory_uri() . '/assets/js/valid-ajax.js', array('jquery'), $theme_version, true );\n wp_enqueue_script( 'jquery-maskedinput', get_template_directory_uri() . '/assets/js/jquery.maskedinput.min.js', array('jquery'), $theme_version, true );\n wp_enqueue_script( 'goodshare', 'https://cdn.jsdelivr.net/jquery.goodshare.js/3.2.8/goodshare.min.js', array('jquery'), $theme_version, true );\n}", "function pp_load_scripts(){\n \t\n \t$path_js = get_template_directory_uri() . '/assets/js/min/';\n \t$path_css = get_template_directory_uri() . '/assets/css/';\n\n \tif (!is_admin()){\n \t\t\n\t\twp_enqueue_script('jquery');\t\n\t\t\t\t\t\t\n\t\twp_enqueue_script('pp-libs', $path_js . 'libs-min.js', ['jquery'], false);\t\t\n\t\twp_enqueue_script('pp-common', $path_js . 'common-min.js', ['jquery'], false, true);\n\t\t\t\t\t\n\t\t// wp_localize_script( 'jquery', 'siteVars', [] );\n\t \t\n\t \twp_enqueue_style( 'bootstrap', $path_css . 'bootstrap.css');\n\t \twp_enqueue_style( 'libs', $path_css . 'libs.css');\n\t \twp_enqueue_style( 'main', $path_css . 'main.css');\n\n } else {\n\n\t \twp_enqueue_style( 'custom_wp_admin_css', $path_css. 'admin-style.css', false, '1.0.0' );\n \t\n }\n\n}", "function ts_register_scripts(){\n\tglobal $smof_data, $ts_page_datas;\n\tts_register_google_font();\n\t\n\twp_deregister_style( 'font-awesome' );\n\twp_deregister_style( 'yith-wcwl-font-awesome' );\n\twp_register_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.css' );\n\twp_enqueue_style( 'font-awesome' );\n\t\n\twp_register_style( 'ts-reset', get_template_directory_uri() . '/css/reset.css' );\n\twp_enqueue_style( 'ts-reset' );\n\t\n\twp_enqueue_style( 'ts-style', get_stylesheet_uri() );\n\t\n\tif( isset($smof_data['ts_responsive']) && (int) $smof_data['ts_responsive'] == 1 ){\n\t\twp_register_style( 'ts-responsive', get_template_directory_uri() . '/css/responsive.css' );\n\t\twp_enqueue_style( 'ts-responsive' );\n\t}\n\t\n\twp_deregister_style( 'owl.carousel' );\n\twp_register_style( 'owl.carousel', get_template_directory_uri() . '/css/owl.carousel.css' );\n\twp_enqueue_style( 'owl.carousel' );\n\t\n\twp_register_style( 'prettyPhoto', get_template_directory_uri() . '/css/prettyPhoto.css' );\n\twp_enqueue_style( 'prettyPhoto' );\n\t\n\twp_deregister_style( 'select2' );\n\twp_register_style( 'select2', get_template_directory_uri() . '/css/select2.css' );\n\twp_enqueue_style( 'select2' );\n\t\n\tif( isset($ts_page_datas['ts_full_page']) && $ts_page_datas['ts_full_page'] ){\n\t\twp_register_style( 'fullPage', get_template_directory_uri() . '/css/jquery.fullPage.css' );\n\t\twp_enqueue_style( 'fullPage' );\n\t}\n\t\n\tif( isset($smof_data['ts_enable_rtl']) && $smof_data['ts_enable_rtl'] ){\n\t\twp_register_style( 'ts-rtl', get_template_directory_uri() . '/css/rtl.css' );\n\t\twp_enqueue_style( 'ts-rtl' );\n\t}\n\t\n\twp_deregister_script( 'ts-include-scripts' );\n\twp_register_script( 'ts-include-scripts', get_template_directory_uri().'/js/include_scripts.js', array('jquery'), null, true);\n\twp_enqueue_script( 'ts-include-scripts' );\n\t\n\twp_deregister_script( 'owl.carousel' );\n\twp_register_script( 'owl.carousel', get_template_directory_uri().'/js/owl.carousel.min.js', array(), null, true);\n\twp_enqueue_script( 'owl.carousel' );\n\t\n\twp_deregister_script( 'ts-script' );\n\twp_register_script( 'ts-script', get_template_directory_uri().'/js/main.js', array('jquery'), null, true);\n\twp_enqueue_script( 'ts-script' );\n\t\n\tif( isset($ts_page_datas['ts_full_page']) && $ts_page_datas['ts_full_page'] ){\n\t\twp_register_script( 'fullPage', get_template_directory_uri().'/js/jquery.fullPage.min.js', array(), null, true);\n\t\twp_enqueue_script( 'fullPage' );\n\t}\n\t\n\tif( is_singular('product') && $smof_data['ts_prod_cloudzoom'] ){\n\t\twp_deregister_script( 'cloud-zoom' );\n\t\twp_register_script( 'cloud-zoom', get_template_directory_uri().'/js/cloud-zoom.js', array('jquery'), null, true);\n\t\twp_enqueue_script( 'cloud-zoom' );\n\t}\n\t\n\tif( is_singular('product') && isset($smof_data['ts_prod_thumbnails_style']) && $smof_data['ts_prod_thumbnails_style'] == 'vertical' ){\n\t\twp_deregister_script( 'jquery.caroufredsel' );\n\t\twp_register_script( 'jquery.caroufredsel', get_template_directory_uri().'/js/jquery.carouFredSel-6.2.1.min.js', array(), null, true);\n\t\twp_enqueue_script( 'jquery.caroufredsel' );\n\t}\n\t\n\twp_register_script( 'cart-variation', get_template_directory_uri().'/js/add-to-cart-variation.min.js', array(), null, true);\n\twp_enqueue_script('cart-variation');\n\t\n\twp_deregister_script( 'select2' );\n\twp_register_script( 'select2', get_template_directory_uri().'/js/select2.min.js', array(), null, true);\n\twp_enqueue_script('select2');\n\t\n\tif( is_single() && get_option( 'thread_comments' ) ){ \t\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\t\n}", "function studio_scripts() {\n\n wp_register_script( 'modernizr', get_template_directory_uri() . '/javascripts/modernizr.custom.84485.js', array(), '', false );\n wp_enqueue_script( 'modernizr' );\n\n wp_enqueue_script( 'studio-navigation', get_template_directory_uri() . '/javascripts/navigation.js', array(), '20120206', true );\n\n wp_enqueue_script( 'studio-skip-link-focus-fix', get_template_directory_uri() . '/javascripts/skip-link-focus-fix.js', array(), '20130115', true );\n\n wp_enqueue_script( 'studio-fit-text', get_template_directory_uri() . '/javascripts/FitText.js', array(), '20140420', true );\n\n wp_enqueue_script( 'studio-pxu', get_template_directory_uri() . '/javascripts/_pxu.js', array( 'jquery' ), '', true );\n\n wp_register_script( 'scripts', get_template_directory_uri() . '/javascripts/theme.js', array( 'jquery' ), '', true );\n wp_enqueue_script( 'scripts' );\n\n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n wp_enqueue_script( 'comment-reply' );\n }\n\n if ( is_singular() && wp_attachment_is_image() ) {\n wp_enqueue_script( 'studio-keyboard-image-navigation', get_template_directory_uri() . '/javascripts/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );\n }\n\n wp_enqueue_style( 'studio-lato' );\n}", "function pure_theme_scripts() {\n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n wp_enqueue_script( 'comment-reply' );\n }\n\n # Register scripts\n wp_register_script( 'bootstrap-js', PURE_SCRIPTS_DIR . '/lib/bootstrap.min.js', array( 'jquery' ), false, true );\n wp_register_script( 'owl-carousel', PURE_SCRIPTS_DIR . '/lib/owl.carousel.min.js');\n wp_register_script( 'magnific-popup', PURE_SCRIPTS_DIR . '/lib/jquery.magnific-popup.min.js', array( 'jquery' ), false, true );\n wp_register_script( 'custom-scroll', PURE_SCRIPTS_DIR . '/lib/jquery.custom-scroll.min.js', array( 'jquery' ), false, true );\n wp_register_script( 'slick', PURE_SCRIPTS_DIR . '/lib/slick.min.js', array( 'jquery' ), false, true );\n wp_register_script( 'wildjs', PURE_SCRIPTS_DIR . '/wild.js', array( 'jquery' ), false, true );\n wp_register_script( 'purestore', PURE_SCRIPTS_DIR . '/pstore.js', array( 'jquery' ), false, true );\n\n wp_enqueue_script( 'jquery' );\n wp_enqueue_script( 'bootstrap-js' );\n wp_enqueue_script( 'owl-carousel' );\n wp_enqueue_script( 'magnific-popup' );\n wp_enqueue_script( 'custom-scroll' );\n wp_enqueue_script( 'slick' );\n wp_enqueue_script( 'wildjs' );\n wp_enqueue_script( 'purestore' );\n\n $wishlist_url = null;\n\n if ( function_exists( 'YITH_WCWL' ) && method_exists( 'YITH_WCWL', 'get_wishlist_url' ) ) {\n $wishlist_url = YITH_WCWL()->get_wishlist_url();\n }\n\n if ( pure_is_woo_exists() ) {\n $wo_exists = true;\n } else {\n $wo_exists = null;\n }\n\n $pureConf = array(\n 'ajaxurl' => admin_url( 'admin-ajax.php' ),\n 'wishlisturl' => $wishlist_url,\n 'woocommerce' => $wo_exists,\n );\n\n wp_localize_script( 'purestore', 'pureConfig', $pureConf );\n }", "function blur_header_scripts()\n {\n if ($GLOBALS['pagenow'] != 'wp-login.php' && !is_admin()) {\n\n wp_register_script('conditionizr', get_template_directory_uri() . '/js/lib/conditionizr-4.3.0.min.js', array(), '4.3.0'); // Conditionizr\n wp_enqueue_script('conditionizr'); // Enqueue it!\n\n wp_register_script('modernizr', get_template_directory_uri() . '/js/lib/modernizr-2.7.1.min.js', array(), '2.7.1'); // Modernizr\n wp_enqueue_script('modernizr'); // Enqueue it!\n\n wp_register_script('blur', get_template_directory_uri() . '/js/scripts.js', array('jquery'), '1.0.0'); // Custom scripts\n wp_enqueue_script('blur'); // Enqueue it!\n }\n }", "public function wcufd_load_styles_scripts() {\n //main script file of the plugin\n wp_register_script( 'wcufd-front-end-js', plugins_url( 'js/wcufd-script.js',__FILE__ ), array('jquery'), '', true );\n wp_localize_script( 'wcufd-front-end-js', 'wcufd_vars', array(\n 'ajaxurl' => admin_url('admin-ajax.php'),\n 'current_user_can' => current_user_can('administrator')\n )\n );\n wp_register_style( 'wcufd-front-end-style', plugins_url( 'css/wcufd-style.css',__FILE__ ) );\n }", "function register_crunchpress_panel_scripts(){\r\n\t\tglobal $post_type;\r\n\t\t//wp_enqueue_style('ie-style',CP_PATH_URL . '/stylesheet/ie-style.php?path=' . CP_PATH_URL);\t\r\n\t\r\n\t\tif($post_type == 'page'){\r\n\t\t\r\n\t\t}else{\r\n\t\t\twp_enqueue_style('bootstrap',CP_PATH_URL.'/framework/stylesheet/bootstrap.css');\r\n\t\t\t$cp_script_url = CP_PATH_URL.'/framework/javascript/cp-panel.js';\r\n\t\t\twp_enqueue_script('cp_scripts_admin', $cp_script_url, array('jquery','media-upload','thickbox', 'jquery-ui-droppable','jquery-ui-datepicker','jquery-ui-tabs', 'jquery-ui-slider','jquery-timepicker','jquery-ui-position','mini-color','confirm-dialog','dummy_content'));\r\n\r\n\t\t\twp_register_script('bootstrap', CP_PATH_URL.'/framework/javascript/bootstrap.js', false, '1.0', true);\r\n\t\t\twp_enqueue_script('bootstrap');\r\n\r\n\t\t\t//Font Awesome\r\n\t\t\twp_enqueue_style('cp-fontAW',CP_PATH_URL.'/frontend/cp_font/css/font-awesome.css');\r\n\t\t\twp_enqueue_style('cp-fontAW',CP_PATH_URL.'/frontend/cp_font/css/font-awesome-ie7.css');\r\n\t\t\r\n\t\t\r\n\t\t\twp_register_script('mini-color', CP_PATH_URL.'/framework/javascript/jquery.miniColors.js', false, '1.0', true);\r\n\t\t\twp_register_script('confirm-dialog', CP_PATH_URL.'/framework/javascript/jquery.confirm.js', false, '1.0', true);\r\n\t\t\twp_register_script('jquery-timepicker', CP_PATH_URL.'/framework/javascript/jquery.ui.timepicker.js', false, '1.0', true);\r\n\t\t\twp_register_script('dummy_content', CP_PATH_URL.'/framework/javascript/dummy_content.js', false, '1.0', true);\r\n\t\t}\t\t\r\n\t}", "function add_ordin_widget_scripts() {\n if( ! apply_filters( 'add_ordin_widget_scripts', true, $this->id_base ) )\n return;\n ?>\n <script>\n jQuery(document).ready(function( $ ) {\n\n });\n </script>\n <?php\n }", "function mandiberg_scripts() {\n\n\t\t//include bootstrap:\n\t\twp_register_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css' );\n\t\twp_enqueue_style( 'bootstrap-style');\n\n\n\n\t\t// Register the style like this for a theme:\n\t wp_register_style( 'mandiberg-style', get_template_directory_uri() . '/style.css', array(), '20120208', 'all' );\n\t\twp_enqueue_style( 'mandiberg-style');\n\n\t\t//barba js for transitions\n\n\t\t wp_register_script('barba', get_template_directory_uri() . '/build/barba.min.js', array ( 'jquery' ),'1.1', true);\n\t\t wp_enqueue_script('barba');\n\n\t\t//js\n\t\twp_register_script('js-file', get_template_directory_uri() . '/build/script.js', array ( 'jquery' ),'1.1', true);\n\t\t wp_enqueue_script('js-file');\n\n\t}", "private function load_admin_scripts() {\n\n\t}", "function theme_scripts_and_styles() {\n if (!is_admin()) {\n global $wp_scripts;\n wp_deregister_script('jquery');\n foreach($wp_scripts->registered as $handle => $script) {\n $wp_scripts->add_data($handle, 'group', 1);\n }\n\n theme_scripts::register();\n theme_styles::register();\n\n // comment reply script for threaded comments\n if ( is_singular() && comments_open() && (get_option('thread_comments') == 1)) {\n wp_enqueue_script('comment-reply');\n }\n\n theme_styles::enqueue();\n theme_scripts::enqueue();\n }\n}", "function cosmetics_register_back_end_scripts(){\n wp_enqueue_style( 'cosmetics-admin-styles', get_theme_file_uri( '/extension/assets/css/admin-styles.css' ) );\n\n}", "function theme_js(){\n\n\t\twp_register_script('custom-script1', get_template_directory_uri() . '/js/menu.js', array('jquery'),'', true);\n\t\twp_register_script('custom-script2', get_template_directory_uri() . '/js/main.js', array('jquery'),'', true);\n\t\twp_register_script('custom-script3', get_template_directory_uri() . '/js/css3-mediaqueries.js', array('jquery'),'', true);\n\t\n\t\twp_enqueue_script('custom-script1', get_template_directory_uri() . '/js/theme.js', array('jquery'),'', true );\n\t\twp_enqueue_script('custom-script2');\n\t\twp_enqueue_script('custom-script3');\n}", "function theme_scripts(){\n \n wp_deregister_script('jquery'); // removes jquery from the header (remove if causing issues, it was only moved to footer for page speed\n\n function prefix_add_footer_styles() {\n $belowFoldCSS = '/css/below-fold.css';\n if( file_exists(dirname(__FILE__) . '/../' . $belowFoldCSS) ) {\n $belowFoldCSSMtime = filemtime(dirname(__FILE__) . '/../' . $belowFoldCSS);\n wp_enqueue_style(\n 'main-styles',\n get_template_directory_uri() . $belowFoldCSS,\n false,\n $belowFoldCSSMtime,\n 'all'\n );\n }\n };\n add_action( 'get_footer', 'prefix_add_footer_styles' );\n\n // Google Fonts\n wp_enqueue_style( 'google-fonts', $src = 'https://fonts.googleapis.com/css2?family=Quando&display=swap', 'main-styles', $ver = false, $media = 'all' );\n\n $belowFoldJS = '/js/main.min.js';\n if( file_exists(dirname(__FILE__) . '/../' . $belowFoldJS) ) {\n $belowFoldJSMtime = filemtime(dirname(__FILE__) . '/../' . $belowFoldJS);\n wp_register_script(\n 'main-js',\n get_template_directory_uri() . '/js/main.min.js',\n false,\n $belowFoldJSMtime,\n true\n );\n wp_enqueue_script('main-js');\n }\n}", "function mystartertheme_scripts() {\n\t// wp_enqueue_script( 'mystartertheme-navigation', get_template_directory_uri() . '/dist/js/navigation.js', array(), '20151215', true );\n\t// wp_enqueue_script( 'mystartertheme-skip-link-focus-fix', get_template_directory_uri() . '/dist/js/skip-link-focus-fix.js', array(), '20151215', true );\n\twp_enqueue_script( 'mystartertheme-main', get_template_directory_uri() . '/dist/js/main.js', array(), '20151215', true );\n\t\n\tif (is_user_logged_in() ) {\n\t\t// wp_enqueue_script( 'mystartertheme-admin', get_template_directory_uri() . '/dist/js/admin.js', array(), '20151215', true );\n\t\twp_enqueue_style( 'mystartertheme-admin-style', get_template_directory_uri() . '/dist/css/admin.css' );\n\t}\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}", "function theme_page_javascript($custom_settings)\n{\n $theme_url = clearos_theme_url('AdminLTE');\n\n // The version is used to avoid upgrade/caching issues. Bump when required.\n $version = '7.0.0';\n\n // FIXME: review all of these\n return \"\n\n<script type='text/javascript' src='$theme_url/js/jquery.cookie.js'></script>\n<script type='text/javascript' src='$theme_url/js/jquery.base64.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/jquery-ui-1.11.1.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/bootstrap.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/lightbox.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/jquery.dotdotdot.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/bootstrap-dialog/bootstrap-dialog.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/metisMenu/jquery.metisMenu.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/colorpicker/bootstrap-colorpicker.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/datatables/jquery.dataTables.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/datatables/dataTables.bootstrap.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/datatables/jquery.dataTables.rowReordering.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/bootstrap-slider/bootstrap-slider.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/sparkline/jquery.sparkline.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/flot/jquery.flot.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/flot/jquery.flot.resize.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/flot/jquery.flot.pie.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/flot/jquery.flot.time.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/flot/jquery.flot.stack.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/plugins/flot/jquery.flot.categories.min.js'></script>\n<script type='text/javascript' src='$theme_url/js/jquery.flot.axislabels.js'></script>\n<script type='text/javascript' src='$theme_url/js/nav-menu-\" . $custom_settings['menu'] . \".js'></script>\n\n<!--[if IE 7]>\n\n<h1>Your browser is out of date, please update your browser by going to www.microsoft.com/download</h1>\n\n<![endif]-->\n\n<!-- Theme Javascript -->\n<script type='text/javascript' src='$theme_url/js/translations.js.php?v=$version'></script>\n<script type='text/javascript' src='$theme_url/js/widgets.js?v=$version'></script>\n<script type='text/javascript' src='$theme_url/js/marketplace.js?v=$version'></script>\n\n\n\";\n}", "function wpdocs_theme_name_scripts() {\n wp_enqueue_style('pva-style', get_stylesheet_uri());\n wp_enqueue_style('pva-bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.min.css', array(), '1.0.0', 'all');\n wp_enqueue_script('pva-script', get_template_directory_uri() . '/js/sitescript.js', array(), '1.0.0', true);\n}", "function theme_scripts() {\n // Registrace scriptu (bundle.js z webpacku)\n wp_register_script(\n // Název\n 'bundle',\n // Cesta\n get_template_directory_uri() . '/dist/bundle.js',\n // Závislosti (žádné)\n '',\n // Verze (žádná)\n false,\n // Umístit do patičky\n true\n );\n\n // Zařazení stylu do fronty\n wp_enqueue_script('bundle');\n}", "function nameless_sheep_scripts() {\n\t\t// Get the theme data.\n\t\t$the_theme = wp_get_theme();\n\t\t$theme_version = $the_theme->get( 'Version' );\n\n\t\t$css_version = $theme_version . '.' . filemtime( get_template_directory() . '/css/theme.min.css' );\n\t\twp_enqueue_style( 'nameless_sheep-styles', get_template_directory_uri() . '/css/theme.min.css', array(), $css_version );\n\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function wagw_scripts() {\n\t\t$theme = wp_get_theme();\n\t\t$ver = $theme->get( 'Version' );\n\t$themecsspath = get_stylesheet_directory() . '/style.css';\n\t$style_ver = filemtime( $themecsspath );\n\twp_enqueue_style( 'wagw-style', get_stylesheet_uri(),array(),$style_ver );\n\n\twp_enqueue_script( 'wagw-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n\n\twp_enqueue_script( 'wagw-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\n\twp_enqueue_script( 'thickbox', true );\n\twp_enqueue_style( 'thickbox' );\n\n\tif ( is_page_template( 'slider-page.php' ) ) {\n\t\twp_enqueue_style( 'flexslider-css', get_stylesheet_directory_uri() . '/flexslider/flexslider.css' );\n\t}\n\n}", "function scripts() {\n\n\twp_enqueue_script(\n\t\t'frontend',\n\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/js/frontend.js',\n\t\t[],\n\t\tERI_SCAFFOLD_VERSION,\n\t\ttrue\n\t);\n\n\tif ( is_page_template( 'templates/page-styleguide.php' ) ) {\n\t\twp_enqueue_script(\n\t\t\t'styleguide',\n\t\t\tERI_SCAFFOLD_TEMPLATE_URL . '/dist/js/styleguide.js',\n\t\t\t[],\n\t\t\tERI_SCAFFOLD_VERSION,\n\t\t\ttrue\n\t\t);\n\t}\n\n}", "function nightsky_user_scripts( ) {\n // enque your own stuff here. CSS should be added to the array above.\n // enqueue a script.\n // wp_enqueue_script( 'id', get_template_directory_uri() . 'path',array('dependencies'), filemtime(get_stylesheet_directory() . 'path'), header_or_footer );\n}", "function alm_filters_admin_enqueue_scripts(){\n\t \t$screen = get_current_screen();\n\t \t// Only load on settings page\n\t \tif($screen->base === 'toplevel_page_ajax-load-more'){\n \t\twp_enqueue_style( 'alm-filters-frontend', ALM_FILTERS_URL. '/dist/css/styles.css', '');\n \t}\n \t}", "public function scripts()\n {\n wp_deregister_script('jquery');\n //bootstrap styles for this theme\n wp_enqueue_style('na_theme-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), '1.0');\n\n // Add custom fonts, used in the main stylesheet\n $fonts = $this->fonts_url();\n wp_enqueue_style('na_theme-fonts', $fonts, array(), null);\n\n //main styles for this theme\n\n wp_enqueue_style('main-edge', get_template_directory_uri() . '/assets/css/edge.css', array(), '1.0');\n\n // font awesome icons\n wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/css/font-awesome.min.css', array(), '3.2');\n wp_enqueue_style('font-na-theme', get_template_directory_uri() . '/assets/fonts/na-theme/stylesheet.css', array(), '3.2');\n\n\n //custom styles for this theme\n if ($this->menu) {\n wp_enqueue_style('na_menu', get_template_directory_uri() . '/assets/css/menu/' . $this->menu, array('na_theme-main'), '1.0');\n } else {\n wp_enqueue_style('na_menu', get_template_directory_uri() . '/assets/css/menu/default.css', array('na_theme-main'), '1.0');\n }\n if (class_exists('woocommerce')) {\n wp_enqueue_style('na_woocommerce', get_template_directory_uri() . '/assets/css/woocommerce.css', array('na_theme-main', 'woocommerce-general'), '1.0');\n }\n\n if (function_exists('pll_current_language') && pll_current_language() == \"ar\") {\n wp_enqueue_style('na_theme-rtl', get_template_directory_uri() . '/rtl.css', '1.0');\n }\n if (is_singular() && comments_open() && get_option('thread_comments')) {\n wp_enqueue_script('comment-reply');\n }\n\n //main scripts\n wp_enqueue_script('bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), '1.0.0', true);\n\n\n\n wp_enqueue_script('na_theme-scripts', get_template_directory_uri() . '/assets/js/theme.js', array(), '1.0.0', true);\n wp_enqueue_script('na_theme-custom', get_template_directory_uri() . '/assets/js/custom.js', array('na_theme-scripts'), '1.0.0', true);\n\n if ($this->homepage_scrolling != \"\") {\n wp_add_inline_script('na_theme-scripts', 'options.scrolling = ' . strval($this->homepage_scrolling) . ';');\n\n if ($this->homepage_scrolling == 1) {\n wp_enqueue_script('na_theme-fullpage', get_template_directory_uri() . '/assets/js/plugins/fullpage/javascript.fullPage.min.js', array(), '1.0.0', true);\n wp_enqueue_style('na_theme-fullpage', get_template_directory_uri() . '/assets/css/plugins/fullpage.min.css', array(), '1.0');\n } else {\n wp_enqueue_script('na_theme-tweenmax', get_template_directory_uri() . '/assets/js/plugins/scrollmagic/TweenMax.min.js', array('jquery'), '1.0.0', true);\n wp_enqueue_script('na_theme-scrollmagic', get_template_directory_uri() . '/assets/js/plugins/scrollmagic/ScrollMagic.js', array('jquery'), '1.0.0', true);\n wp_enqueue_script('na_theme-gsap-animation', get_template_directory_uri() . '/assets/js/plugins/scrollmagic/animation.gsap.js', array('jquery'), '1.0.0', true);\n wp_enqueue_script('na_theme-gsap-scrollto-plugin', get_template_directory_uri() . '/assets/js/plugins/scrollmagic/ScrollToPlugin.min.js', array('jquery'), '1.0.0', true);\n }\n }\n wp_localize_script(\n 'na_theme-script',\n 'screenReaderText',\n array(\n 'expand' => '<span class=\"screen-reader-text\">' . __('expand child menu', NA_THEME_TEXT_DOMAIN) . '</span>',\n 'collapse' => '<span class=\"screen-reader-text\">' . __('collapse child menu', NA_THEME_TEXT_DOMAIN) . '</span>',\n )\n );\n\n wp_enqueue_style('na_theme-main', get_template_directory_uri() . '/assets/css/style.css', array('na_theme-bootstrap'), '1.0');\n\n // Load our main stylesheet.\n wp_enqueue_style('na_theme-style', get_stylesheet_uri(), array('na_theme-main'));\n }" ]
[ "0.72363716", "0.72196704", "0.7158386", "0.7154502", "0.7134843", "0.7122297", "0.7066796", "0.70324147", "0.7001308", "0.69625986", "0.69625986", "0.6956656", "0.69507635", "0.69403106", "0.6934532", "0.6933436", "0.6916004", "0.69113433", "0.69112563", "0.69099724", "0.68902224", "0.6884168", "0.6882232", "0.68662643", "0.68406767", "0.6838717", "0.68327993", "0.6799002", "0.6795728", "0.67942077", "0.67934227", "0.6791098", "0.6788157", "0.6783031", "0.67751217", "0.676037", "0.67584175", "0.67540365", "0.6747044", "0.67439884", "0.6732981", "0.6730646", "0.67301565", "0.6718749", "0.67172307", "0.67126936", "0.67024326", "0.6699716", "0.6691054", "0.6689462", "0.6686602", "0.6685902", "0.66811985", "0.66767305", "0.6668677", "0.665485", "0.66534424", "0.664673", "0.66466147", "0.66462934", "0.6643164", "0.66300815", "0.66259724", "0.6625382", "0.6624734", "0.6624732", "0.662285", "0.6622022", "0.661155", "0.66114795", "0.66111195", "0.66055536", "0.66047996", "0.65958315", "0.65949506", "0.65929484", "0.65924823", "0.65804106", "0.6572687", "0.65719", "0.6571118", "0.65644175", "0.65625834", "0.6561838", "0.6559268", "0.65556455", "0.65505326", "0.6549384", "0.6549207", "0.65468", "0.6544089", "0.6543544", "0.653799", "0.6537605", "0.6535084", "0.6534887", "0.65347844", "0.65311635", "0.6528953", "0.65243644", "0.65218353" ]
0.0
-1
Replaces the excerpt "Read More" text by a link
function new_excerpt_more($more) { global $post; return ' <a class="read_more" href="' . get_permalink($post->ID) . '">[...]</a>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpfme_replace_excerpt($content) {\n return str_replace('[...]',\n '<a class=\"readmore\" href=\"'. get_permalink() .'\">Continue Reading</a>',\n $content\n );\n}", "function new_excerpt_more( $more ) {\n\treturn '... <a class=\"read-more\" href=\"'. get_permalink( get_the_ID() ) . '\">' . __('Read More', 'your-text-domain') . '</a>';\n}", "function new_excerpt_more( $more ) {\n return ' <a class=\"read-more\" href=\"' . get_permalink( get_the_ID() ) . '\">' . __( 'Read More...', 'your-text-domain' ) . '</a>';\n}", "function new_excerpt_more( $more ) {\n\treturn '... <a class=\"read-more\" href=\"'. get_permalink( get_the_ID() ) . '\">Continue Reading...</a>';\n}", "function wpdocs_excerpt_more( $more ) {\n return sprintf( '<a class=\"read-more\" href=\"%1$s\">%2$s</a><br/>',\n get_permalink( get_the_ID() ),\n __( '<i class=\"fa fa-book\"></i> Read More...', 'textdomain' )\n );\n}", "function wpdocs_excerpt_more( $more ) {\n return sprintf( '<a class=\"understrap-read-more-link goodswave-read-more\" href=\"%1$s\">%2$s</a>',\n get_permalink( get_the_ID() ),\n __( 'Read More', 'textdomain' )\n );\n}", "function wpdocs_excerpt_more( $more ) {\n return ' <a href=\"' . get_the_permalink() . '\" rel=\"nofollow\">[Read More...]</a>';\n}", "function linolakestheme_excerpt_more( $more ) {\n return sprintf( '<a class=\"read-more\" href=\"%1$s\">%2$s</a>',\n get_permalink( get_the_ID() ),\n __( ' Read more', 'textdomain' )\n );\n}", "function new_excerpt_more( $more ) {\n return '&hellip; <span class=\"read-more\"><a href=\"'.get_permalink().'\" rel=\"bookmark\">continue reading</a></span>';\n}", "function new_excerpt_more($more) {\n global $post, $wpak_options;\n\n\treturn '<p class=\"readmore\"><a title=\"' . $wpak_options['linkto'] . $post->post_title.'\" href=\"'. get_permalink($post->ID) . '\">' . $wpak_options['readmore'] . '</a></p>';\n}", "function new_excerpt_more( $more ) {\r\n\treturn ' <a class=\"read-more\" href=\"'. get_permalink( get_the_ID() ) . '\">Continue Reading &#8594;</a>';\r\n}", "function wpdocs_excerpt_more( $more ) {\n return sprintf( '<a class=\"read-more\" href=\"%1$s\">%2$s</a>',\n get_permalink( get_the_ID() ),\n __( '...', 'textdomain' )\n );\n}", "function more_link( $link, $text ) {\n\treturn ( __( '(more&hellip;)' ) !== $text ) ? $link : str_replace( $text, __( 'Continue Reading', 'wpdh' ), $link );\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a href=\"'. get_permalink($post->ID) . '\"><em>(Continue Reading...)</em></a>';\n}", "function new_excerpt_more( $more ) {\n\treturn '...<br/>'.'<a href=\"'. get_permalink( get_the_ID() ) . '\" class=\"more\">Read More</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n return ' [...] <a href=\"' . get_permalink($post->ID) . '\">' . __('Continue reading <span class=\"meta-nav\">&rarr;</span>', 'twentytwelve') . '</a>';\n }", "function new_excerpt_more($more) {\n\n\tglobal $post;\n\n\treturn '...&nbsp; <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"><br/>read&nbsp;more</a>';\n\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '... (<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">Read more</a>)';\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<p><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More</a></p>';\n}", "function new_excerpt_more($more) {\n\tglobal $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Leia o artigo completo...</a>';\n}", "function new_excerpt_more($more) {\n\tglobal $post;\n\treturn '&hellip; </br> <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">Read more</a>';\n}", "function new_excerpt_more($more)\r\n{\r\n\tglobal $post;\r\n\treturn '<a class=\"moretag\" href=\"' . get_permalink($post->ID) . '\"> Read the full article...</a>';\r\n}", "function new_excerpt_more( $more ) {\n\tglobal $post;\n\treturn '... <div class=\"button small text-center\"><a href=\"'. get_permalink($post->ID) . '\">Continue Reading</a></div>';\n}", "function new_excerpt_more( $more ) {\n\treturn '[...]<div class=\"read-more\"><a href=\"'. get_permalink( get_the_ID() ) . '\">Lire la suite</a></div>';\n}", "function mintshow_excerpt_more( $more ) {\n return sprintf( '<a class=\"ms-read-more\" href=\"%1$s\">%2$s <i class=\"fa fa-long-arrow-right\"></i></a>',\n get_permalink( get_the_ID() ),\n __( 'Read More', 'textdomain' )\n );\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> read more...</a>';\n}", "function clrfl_excerpt_more($more) {\n\tglobal $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read the full article...</a>';\n}", "function swbtheme_excerpt_more($more) {\n global $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read the full article...</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n // return '<a class=\"read_more\" href=\"'. get_permalink($post->ID) . '\">'.__('Read More','textdomain').'</a>';\n return '';\n}", "function home_read_more($content) {\r\n $content = preg_replace('#(<a(.*) class=\"more-link\">(.*)</a>)#U', '</p><a $2 class=\"more-link\"><span>$3</span></a>', $content);\r\n return $content;\r\n}", "function dh_modify_read_more_link() {\r\n return '<a class=\"more-link\" href=\"' . get_permalink() . '\">Click to Read!</a>';\r\n}", "function wpdocs_excerpt_more( $more ) {\n return '<a href=\"'.get_the_permalink().'\" rel=\"nofollow\">...</a>';\n}", "function custom_excerpt_more($more) {\n\t\treturn 'Read More &raquo;';\n\t}", "function nightsky_excerpt_more( $more ) {\n global $post;\n return ' <p class=\"readmore\"><a href=\"' . get_permalink( $post->ID ) . '\">Continue reading ' . $post->post_title . '</a></p>';\n}", "function labs_auto_excerpt_more( $more ) {\n\treturn ' &hellip;' . labs_continue_reading_link();\n}", "function my_excerpt_more( $more ) {\n\treturn ' &hellip; <a href=\"'. get_permalink() .'\">Continue reading &ldquo;'. get_the_title() .'&rdquo; &rarr;</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<div class=\"readmore\"><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More <i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"></i></a></div>';\n}", "function mithpress_auto_excerpt_more( $more ) {\n\treturn ' . . . ' . mithpress_continue_reading_link();\n}", "function new_excerpt_more($more) {\n global $post;\n return '<a class=\"post-link\" href=\"'. get_permalink($post->ID) . '\"> ...Read the full article</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">[ more ]</a>';\n}", "function new_excerpt_more( $more ) {\n\treturn ' <a class=\"read-more\" href=\"' . get_permalink( get_the_ID() ) . '\">قراءة المزيد</a>';\n}", "function darksnow_auto_excerpt_more( $more ) {\n\treturn ' &hellip;' . darksnow_continue_reading_link();\n}", "function modify_read_more_link() {\n return '<a class=\"more-link\" href=\"' . get_permalink() . '\">View list..</a>';\n}", "function mt_filter_excerpt_more_link($excerpt) {\n\t$post = get_post();\n\t$excerpt .= '<a href=\"'. get_permalink($post->ID) .'\" class=\"btn btn-primary float-right\"> Läs mer &raquo; </a>';\n\t\n\treturn $excerpt;\n }", "function excerpt_read_more_link($output) {\r\n global $post;\r\n return $output . '<a class=\"more-link\" href=\"'. get_permalink($post->ID) . '\">'.__(\"Keep Reading\",TEXTDOMAIN ).'<span class=\"icon-arrow-right5\"></span></a>';\r\n}", "function excerpt_ellipse($text) {\nreturn str_replace(' [...]', ' &nbsp;<a href=\"'.get_permalink().'\">Read more</a>', $text);\n}", "function understrap_all_excerpts_get_more_link( $post_excerpt ) {\n\n\t\treturn $post_excerpt . '<br><a class=\"badge badge-primary\" href=\"' . esc_url( get_permalink( get_the_ID() )) . '\">' . __( 'Read More',\n\t\t'understrap' ) . ' <i class=\"fas fa-angle-double-right\"></i></a>';\n\t}", "function understrap_all_excerpts_get_more_link( $post_excerpt ) {\n\t\treturn $post_excerpt . ' [...]<p><a class = \"read-more-link\" href=\"' . esc_url( get_permalink( get_the_ID() )) . '\">Read Full Post</a></p>';\n\t}", "function more_link() {\n\tglobal $post;\t\n\tif (strpos($post->post_content, '<!--more-->')) :\n\t\t$more_link = '<p><a href=\"'.get_permalink().'\" class=\"'.$size.'\" title=\"'.get_the_title().'\">';\n\t\t$more_link .= '<span>Read More...</span>';\n\t\t$more_link .= '</a></p>';\n\t\techo $more_link;\n\tendif;\n}", "public static function excerpt_read_more( $more ) {\n global $post;\n // Defining the $output (read more link)\n $output = '...<br><p><a class=\"read-more more-link\" href=\"'. get_permalink( $post->ID ) . '\"> Read More</a></p>';\n // Returning the $output\n return $output;\n }", "function mila_custom_excerpt_more($more) {\n global $post;\n return '&nbsp;<div class=\"more-link\"><a href=\"'. get_permalink($post->ID) . '\">'. __('<i title=\"Läs mer\" class=\"fa fa-arrow-circle-right\"></i>', 'mila') .'</a></div>';\n }", "function generate_excerpt_more($more)\n {\n return apply_filters('generate_excerpt_more_output', sprintf(' ... <a title=\"%1$s\" class=\"read-more text-primary\" href=\"%2$s\">%3$s %4$s</a>',\n the_title_attribute('echo=0'),\n esc_url(get_permalink(get_the_ID())),\n __('Read more', 'generatepress'),\n '<span class=\"screen-reader-text\">' . get_the_title() . '</span>'\n ));\n }", "function twentyten_auto_excerpt_more( $more ) {\n\tif ( ! is_admin() ) {\n\t\treturn ' &hellip;' . twentyten_continue_reading_link();\n\t}\n\treturn $more;\n}", "function twentyseventeen_excerpt_more( $link ) {\n\tif ( is_admin() ) {\n\t\treturn $link;\n\t}\n\n\t$link = sprintf( '<p class=\"link-more\"><a href=\"%1$s\" class=\"more-link\">%2$s</a></p>',\n\t\tesc_url( get_permalink( get_the_ID() ) ),\n\t\t/* translators: %s: Name of current post */\n\t\tsprintf( __( 'Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'twentyseventeen' ), get_the_title( get_the_ID() ) )\n\t);\n\treturn ' &hellip; ' . $link;\n}", "function uwmadison_auto_excerpt_more( $more ) {\n\t\treturn ' &hellip;' . uwmadison_continue_reading_link();\n\t}", "function rw_auto_excerpt_more( )\n{\n return in_the_loop() ? '&hellip;' . rw_continue_reading_link() : '&hellip;';\n}", "function monaco_child_get_the_excerpt($content) {\n global $post;\n $link = '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> ' . __('[Read the full article...]', 'patrick') . '</a>';\n return preg_replace('/\\[.*\\]$/', '', $content) . $link;\n}", "function new_excerpt_more( $more ) {\n return '';\n}", "function new_excerpt_more( $more ) {\n\treturn '...';\n}", "function ppo_excerpt_more($more) {\n $link = sprintf('<a href=\"%1$s\" class=\"more-link\">%2$s</a>', esc_url(get_permalink(get_the_ID())),\n /* translators: %s: Name of current post */ \n sprintf(__('Xem thêm <span class=\"meta-nav\">&rarr;</span>', SHORT_NAME))\n );\n return ' &hellip; ' . $link;\n}", "function echotheme_auto_excerpt_more($more) {\n\treturn '&hellip; <br />' . echotheme_continue_reading_link();\n}", "function et_excerpt_more($more) {\n global $post;\n return '<div><a href=\"'. get_permalink($post->ID) . '\" > ... Click to View Full Post</a></div>;';\n}", "function tac_new_excerpt_more( $more ) {\n\treturn '...';\n}", "function read_more($string){\n\t$string = strip_tags($string);\n\n\tif (strlen($string) > 200) {\n\t $stringCut = substr($string, 0, 200);\n\t\t$string = substr($stringCut, 0, strrpos($stringCut, ' ')).'... \n\t\t<a href=\"'.get_permalink().'\" title=\"'.get_the_title().'\">\n\t\tRead More\n\t\t</a>'; \n\t}\n\treturn $string;\n}", "function more_link($more) {\n global $post;\n return '... <a class=\"view-article\" href=\"' . get_permalink($post->ID) . '\">' . __('Mehr', 'myTheme') . '</a>';\n }", "function et_excerpt_more($more) {\n global $post;\n return '<div class=\"view-full-post\"><a href=\"'. get_permalink($post->ID) . '\" class=\"view-full-post-btn\">Skaityti</a></div>';\n}", "function barjeel_excerpt($more) {\n global $post;\n return '&nbsp; &nbsp;<a href=\"'. get_permalink($post->ID) . '\">...Continue Reading</a>';\n}", "public function a11yExcerpt($more)\n {\n return sprintf(\n '&hellip; <a class=\"text-nowrap\" href=\"%s\">Continue reading<span class=\"sr-only\"> %s</span></a>',\n get_permalink(get_the_ID()),\n get_the_title()\n );\n }", "function pulcherrimum_excerpt_more($link)\n {\n if (is_admin()) {\n return $link;\n }\n\n $link = sprintf(\n '<p class=\"link-more\"><a href=\"%1$s\" class=\"more-link\">%2$s</a></p>',\n esc_url(get_permalink(get_the_ID())),\n /* translators: %s: Post title. */\n sprintf(__('Continue reading<span class=\"screen-reader-text\"> \"%s\"</span>', 'pulcherrimum'), get_the_title(get_the_ID()))\n );\n return ' &hellip; ' . $link;\n }", "function start_replace_excerpt_more( $more ) {\n\tglobal $post;\n\t// edit here if you like\n\treturn null;\n}", "function modify_read_more_link() {\n $post_slug = get_post_field( 'post_name', get_post() );\n return '<a href=\"/'. $post_slug .'\" class=\"btn btn-info btn-sm mb-3\">Detail</a>';\n}", "function new_excerpt_more( $more ) {\n return ' ...';\n}", "function rw_custom_excerpt_more( $output )\n{\n if( has_excerpt() && !is_attachment() )\n {\n $output .= rw_continue_reading_link();\n }\n return $output;\n}", "public static function the_content_more_link() {\n\t\t\t$cpt = self::get_post_type();\n\n\t\t\tif ( $cpt && $cpt !== 'post' ) {\n\t\t\t\t$title = esc_html( self::option( 'readmore_' . $cpt ) );\n\t\t\t\t$icon = esc_attr( self::option( 'readmore_icon_' . $cpt ) );\n\t\t\t} else {\n\t\t\t\t$title = esc_html( self::option( 'readmore' ) );\n\t\t\t\t$icon = esc_attr( self::option( 'readmore_icon' ) );\n\t\t\t}\n\t\t\t\n\t\t\t$icon = $icon ? '<i class=\"' . $icon . '\"></i>' : '';\n\n\t\t\treturn ( $title || $icon ) ? '<a class=\"cz_readmore' . ( $title ? '' : ' cz_readmore_no_title' ) . ( $icon ? '' : ' cz_readmore_no_icon' ) . '\" href=\"' . esc_url( get_the_permalink( self::$post->ID ) ) . '\">' . $icon . '<span>' . $title . '</span></a>' : '';\n\t\t}", "function echotheme_auto_content_more($more) {\n\treturn echotheme_continue_reading_link();\n}", "function voyage_mikado_modify_read_more_link() {\n $link = '<div class=\"mkdf-more-link-container\">';\n $link .= voyage_mikado_get_button_html(array(\n 'link' => get_permalink().'#more-'.get_the_ID(),\n 'text' => esc_html__('Continue reading', 'voyage'),\n 'size' => 'small'\n ));\n\n $link .= '</div>';\n\n return $link;\n }", "function wpdocs_excerpt_more( $more ) {\n return ' ...';\n}", "function medigroup_mikado_modify_read_more_link() {\n $link = '<div class=\"mkd-more-link-container\">';\n $link .= medigroup_mikado_get_button_html(array(\n 'link' => get_permalink().'#more-'.get_the_ID(),\n 'text' => esc_html__('Continue reading', 'medigroup'),\n 'size' => 'small'\n ));\n\n $link .= '</div>';\n\n return $link;\n }", "function new_excerpt_more($more) {\r\n global $post;\r\n return '<button class=\"btn btn-primary hvr-grow clearfix\"><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read the full article...</a></button>';\r\n}", "function DF_read_more($matches) {\r\n\treturn '<p>'.$matches[1].'</p><p><a '.$matches[3].' class=\"more-link\"><i class=\"icon-double-angle-right\"></i>'.$matches[4].'</a></p> ';\r\n}", "function rls_read_more_button($more) {\n global $post;\n return '<div class=\"center-align read-more\"><a class=\" gray view-article button\" href=\"'.get_permalink($post->ID).'\">'\n .__('Read More', 'rls')\n .'</a></div>';\n}", "function new_excerpt_more( $more ) {\n\treturn '&hellip;';\n/*\n\tif(is_front_page()){\n\treturn '&nbsp;<span class=\"genericon genericon-next\"></span>';\t\t\n\t} else {\n\treturn '&hellip;';\n\t}\n*/\n}", "function new_excerpt_more($more) {\n\treturn '...';\n}", "function custom_excerpt_more( $more ) {\r\n\t return '...';\r\n}", "function rw_continue_reading_link( )\n{\n return ' <a href=\"'. get_permalink() . '\" class=\"more-link\">' . __( 'More', 'rotorwash' ) . '</a>';\n}", "function excerpt($num) {\n$limit = $num+1;\n$excerpt = explode(' ', get_the_excerpt(), $limit);\narray_pop($excerpt);\n$excerpt = implode(\" \",$excerpt).\" <a href='\" .get_permalink($post->ID) .\" ' class='\".readmore.\"'>READ THIS</a>\";\necho $excerpt;\n}", "function lightseek_read_more_link() {\n\treturn '<p><a class=\"btn btn-primary\" href=\"' . get_permalink() . '\">Read More</a></p>';\n}", "function wp_embed_excerpt_more($more_string)\n {\n }", "function excerpt($num) {\n$limit = $num+1;\n$excerpt = explode(' ', get_the_excerpt(), $limit);\narray_pop($excerpt);\n$excerpt = implode(\" \",$excerpt).\" <a href='\" .get_permalink($post->ID) .\" ' class='\".readmore.\"'>Read More</a>\";\necho $excerpt;\n}", "function cera_grimlock_the_excerpt( $more_link ) {\n\t\t$allowed_html = array(\n\t\t\t'a' => array(\n\t\t\t\t'href' => array(),\n\t\t\t\t'title' => array(),\n\t\t\t\t'class' => array(),\n\t\t\t),\n\t\t\t'span' => array(\n\t\t\t\t'class' => array(),\n\t\t\t),\n\t\t);\n\n\t\tif ( has_post_format( array( 'link', 'quote' ) ) ) : ?>\n\t\t\t<div class=\"entry-content clearfix\">\n\t\t\t\t<?php\n\t\t\t\tthe_content();\n\t\t\t\techo wp_kses( $more_link, $allowed_html ); ?>\n\t\t\t</div><!-- .entry-content -->\n\t\t\t<?php\n\t\telse : ?>\n\t\t\t<div class=\"entry-summary clearfix\">\n\t\t\t\t<?php\n\t\t\t\tthe_excerpt();\n\t\t\t\techo wp_kses( $more_link, $allowed_html ); ?>\n\t\t\t</div><!-- .entry-summary -->\n\t\t\t<?php\n\t\tendif;\n\t}", "function ci_e_content($more_link_text = null, $stripteaser = false)\n{\n\tglobal $post, $ci;\n\tif (is_single() or is_page())\n\t\tthe_content(); \n\telse\n\t{\n\t\tif(ci_setting('preview_content')=='enabled')\n\t\t{\n\t\t\tthe_content($more_link_text, $stripteaser);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthe_excerpt();\n\t\t}\n\t}\n}", "function minorite_more_link($variables) {\n return '<p class=\"readmore\">' . l($variables['title'], $variables['url'], array('attributes' => array('title' => $variables['title']), 'query' => $variables['query'])) . '</p>';\n}", "function <%= functionPrefix %>_custom_post_more($more) {\n global $post;\n return '... <a class=\"article-more\" href=\"' . get_permalink($post->ID) . '\">' . __('Read More', '<%= projectName %>') . '</a>';\n}", "function twentyten_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() && ! is_attachment() && ! is_admin() ) {\n\t\t$output .= twentyten_continue_reading_link();\n\t}\n\treturn $output;\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function the_content($more_link_text = \\null, $strip_teaser = \\false)\n {\n }", "function voyage_mikado_excerpt_more($more) {\n return '...';\n }", "function emc_learn_more_link() {\r\n\r\n\t$more = sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a>',\r\n\t\tget_permalink(),\r\n\t\tesc_attr__( 'View full post', 'emc' ),\r\n\t\tesc_html__( '&nbsp;&nbsp;More&nbsp;&rarr;', 'emc' )\r\n\t);\r\n\treturn $more;\r\n\r\n}", "function darksnow_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() && ! is_attachment() ) {\n\t\t$output .= darksnow_continue_reading_link();\n\t}\n\treturn $output;\n}" ]
[ "0.80780786", "0.797886", "0.7916905", "0.78647536", "0.78588927", "0.78242916", "0.7820188", "0.77927387", "0.7791788", "0.7789418", "0.7787512", "0.7784378", "0.77241176", "0.7721402", "0.7715685", "0.7703253", "0.77029073", "0.7692605", "0.7682849", "0.7664288", "0.7662811", "0.7660161", "0.7633344", "0.7631787", "0.76129395", "0.7610431", "0.7610217", "0.76083404", "0.7606522", "0.7586755", "0.7552774", "0.75453347", "0.7529981", "0.7515269", "0.75149846", "0.75084424", "0.7476595", "0.74558735", "0.74524426", "0.7436947", "0.7435971", "0.7406922", "0.7383177", "0.736995", "0.73650414", "0.7356393", "0.73552644", "0.73155504", "0.7268693", "0.72663665", "0.7261024", "0.7237581", "0.7217233", "0.721078", "0.7173644", "0.71095246", "0.7096646", "0.7095451", "0.70704997", "0.7054669", "0.703503", "0.7030982", "0.70196253", "0.7019208", "0.70143294", "0.70048696", "0.7004049", "0.70026654", "0.69757813", "0.69703615", "0.69646925", "0.6952682", "0.6937115", "0.6926592", "0.6924529", "0.69186246", "0.69080377", "0.6885422", "0.6881057", "0.68723893", "0.6863772", "0.6861102", "0.68594044", "0.6850922", "0.6850369", "0.6843952", "0.6833476", "0.6831728", "0.68307793", "0.68304557", "0.68252826", "0.68217665", "0.68115044", "0.6805325", "0.67984784", "0.67984784", "0.67897916", "0.6786811", "0.6784792", "0.6768989" ]
0.7657476
22
Retorna um array com o as etapas do censo que a escola disponibiliza. retornamos apenas as etapas que exista um aluno matriculo na mesma
public function getEtapasNaEscola() { $aEtapas = array(); $oDaoCensoEtapas = db_utils::getDao("censoetapamodal"); $sCamposEtapasNaEscola = "ed273_i_sequencia as codigo, "; $sCamposEtapasNaEscola .= "ed273_i_codigo as codigo_Seq, "; $sCamposEtapasNaEscola .= "ed273_i_modalidade as modalidade, "; $sCamposEtapasNaEscola .= "ed273_c_etapa "; $sSqlEtapaModal = $oDaoCensoEtapas->sql_query("", $sCamposEtapasNaEscola, "ed273_i_sequencia", ""); $rsEtapaNaEscola = $oDaoCensoEtapas->sql_record($sSqlEtapaModal); $aEtapas = db_utils::getCollectionByRecord($rsEtapaNaEscola); $oDaoMatricula = db_utils::getDao("matricula"); foreach ($aEtapas as $oEtapa) { $sCamposModalidade = " serie.ed11_i_codcenso as codigoetapa"; $oEtapa->etapa_na_escola = '0'; $sWhereModalidade = " turma.ed57_i_escola = {$this->iCodigoEscola} "; $sWhereModalidade .= " AND calendario.ed52_i_ano = {$this->iAnoCenso}"; $sWhereModalidade .= " AND ed60_c_situacao = 'MATRICULADO' "; $sWhereModalidade .= " AND serie.ed11_i_codcenso in ({$oEtapa->ed273_c_etapa}) "; $sWhereModalidade .= " AND ensino.ed10_i_tipoensino = {$oEtapa->modalidade}"; $sWhereModalidade .= " AND ed60_d_datamatricula <= '{$this->dtBaseCenso}'"; $sSqlModalidade = $oDaoMatricula->sql_query("", $sCamposModalidade, "", $sWhereModalidade); $rsModalidades = $oDaoMatricula->sql_record($sSqlModalidade); if ($oDaoMatricula->numrows > 0) { $oEtapa->etapa_na_escola = 1; } } return $aEtapas; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tableauMatieres()\n\t\t{\n\t\t\t// On dit à mysql que l'on veut travailler en UTF-8\n\t\t\tmysqli_query($this->co,\"SET NAMES UTF8\");\n\t\t\t$result = mysqli_query($this->co,\n\t\t\t\t\t\t\t\t \"SELECT nom_matiere FROM matiere\")\n\t\t\tor die(\"Connexion impossible : Connexion tableauMatieres()\");\n\n\t\t\t$matiere = Array ();\n\n\t\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\t\t$matiere[] = $row[0];\n\t\t\t}\n\n\t\t\treturn $matiere;\n\t\t}", "function arrayColaEstudiantes (){\n\t\t\t$host = \"localhost\";\n\t\t\t$usuario = \"root\";\n\t\t\t$password = \"\";\n\t\t\t$BaseDatos = \"pide_turno\";\n\n\t $link=mysql_connect($host,$usuario,$password);\n\n\t\t\tmysql_select_db($BaseDatos,$link);\n\t\t\t$retorno = array();\n\t\t\t$consultaSQL = \"SELECT turnos.codigo, turnos.nombre, turnos.carrera FROM turnos WHERE turnos.estado='No atendido' ORDER BY guia;\";\n\t\t\tmysql_query(\"SET NAMES utf8\");\n\t\t\t$result = mysql_query($consultaSQL);\n\t\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t\t}\n\t\t\t};\n\t\t\tmysql_close($link);\n\n\t\t\treturn $retorno;\n\t\t}", "function matricularVehiculo(){\r\n $mat_aleatoria= rand();\r\n\r\n $enc=false;\r\n $pos=0;\r\n for($i=0;$i<count($this->vehiculos)&&($enc==false;$i++){\r\n if($this->vehículos[$i]!= null){\r\n if($this->vehículos[$i]!= null){\r\n $this->vehiculos[$i]->setMatricula($mat_aleatoria);\r\n $enc=true;\r\n $pos=$i;\r\n }\r\n } \r\n } \r\n return $this->vehiculos[$pos];\r\n }", "function niz_koeficijenata_sa_vrednostima($matrica)\n{\n\t$resenje = array();\n\t$dim = count($matrica);\n\n\tfor($i = 0, $indeks_cvora = 1; $i < $dim; $i = $i + 3, $indeks_cvora++)\n\t{\n\t\t$resenje[\"a{$indeks_cvora}\"] = $matrica [$i ] [$dim];\n\t\t$resenje[\"b{$indeks_cvora}\"] = $matrica [$i + 1] [$dim];\n\t\t$resenje[\"c{$indeks_cvora}\"] = $matrica [$i + 2] [$dim];\n\t}\n\treturn $resenje;\n}", "function matricularVehiculo(){\r\n $matricula _aleatoria = rand();\r\n\r\n $encontrado = false;\r\n for ($i=0; $i< count ($this->vehiculos) && ($encontrado==false); $i++) {\r\n if ($this->vehiculos[$i] != null) {\r\n if($this->vehiculos[$i]->getMatricula() =='') {}\r\n $this->vehiculos[$i]->getMatricula($matricula_aleatoria);\r\n $encontrado = true;\r\n $pos = $i;\r\n }\r\n }\r\n }", "protected function armaColeccionMapeoCarac() {\n $dao = new PGDAO();\n $where = $this->strZpTprop();\n $strSql = $this->COLECCIONMAPEOCARAC . \" WHERE tipoprop in (\" . $where . \");\";\n $arrayRet = $this->leeDBArray($dao->execSql($strSql));\n\treturn $arrayRet;\n }", "public function getComputerMarks()\n {\n $db = $this->createConection(); // 1. abro la conexión con MySQL \n //Creamos la consulta para obtener una categoria\n $sentencia = $db->prepare(\"SELECT computadora.id_computadora, computadora.nombre_comp, computadora.imagen, computadora.sistOperativo, marca.nombre_marca\n FROM computadora \n INNER JOIN marca ON computadora.id_marca_fk = marca.id_marca \n WHERE computadora.id_computadora\"); // prepara la consulta\n $sentencia->execute(); // ejecuta --> LLEGA BIEN SIN FILTRAR POR MARCA\n $computadoraConMarca = $sentencia->fetchAll(PDO::FETCH_OBJ); // obtiene la respuesta\n return $computadoraConMarca;\n }", "private function somaPorMoeda($ativos){\n $retorno = [];\n foreach($ativos as $at){\n if(!isset($at->dt_venda) && sizeof($at->cotacaos)>0){\n if(!array_key_exists($at->titulo->moeda, $retorno)){\n $retorno[$at->titulo->moeda] = $at->saldoSemMoeda;\n }else{\n $retorno[$at->titulo->moeda]+= $at->saldoSemMoeda;\n }\n }\n }\n return $retorno;\n }", "protected function armaArrayClavesListas() {\n $arrayClaves = array_keys($this->arrayObligatorios);\n $arrayListas = array();\n $pos = 0;\n $cantC = sizeof($arrayClaves);\n foreach ($arrayClaves as $clave) {\n if ($clave != 0) {\n $atrib = $this->buscoAtributo($clave);\n $pos++;\n for ($x = $pos; $x < $cantC; $x++) {\n if ($arrayClaves[$x] != 0) {\n $atrAct = $this->buscoAtributo($arrayClaves[$x]);\n if ($atrib == $atrAct && $atrib != '' && $atrib != 'especificaciones.adicional' && $atrib != 'especificaciones.servicios') {\n $arrayListas[$clave][] = $arrayClaves[$x];\n $arrayClaves[$x] = 0;\n }\n }\n }\n }\n }\n return $arrayListas;\n }", "protected function armaColeccionObligatorios() {\n $dao = new PGDAO();\n $result = array();\n $where = $this->strZpTprop();\n if ($where != '') {\n $colec = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARACOBLIG . \" and tipoprop in (\" . $where . \")\"));\n } else {\n $colec = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARACOBLIG));\n }\n foreach ($colec as $carac) {\n $result[$carac['id_zpcarac']] = 0;\n }\n return $result;\n }", "public function getMatriz() {\n return $this->matriz;\n }", "function arrayTurnosCola (){\n\t\t$host = \"localhost\";\n\t\t$usuario = \"root\";\n\t\t$password = \"\";\n\t\t$BaseDatos = \"pide_turno\";\n\n $link=mysql_connect($host,$usuario,$password);\n\n\t\tmysql_select_db($BaseDatos,$link);\n\n\t\t$consultaSQL= \"SELECT estado_programas.programa, estado_programas.Comentarios, estado_programas.turnos_atendidos, estado_programas.codigo, estado_programas.turnos_manana, estado_programas.turnos_tarde, estado_programas.segundos_espera, estado_programas.estado FROM estado_programas GROUP BY estado_programas.programa\";\n\t\t$retorno =\"\";\n\t\tmysql_query(\"SET NAMES utf8\");\n\t\t$result = mysql_query($consultaSQL);\n\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t}\n\t\t};\n\t\tmysql_close($link);\n\n\t\treturn $retorno;\n\t}", "static function cursadas(){\n\t\t\n\t\t$cs = array();\n\t\t\n\t\t$conn = new Conexion();\n\t\t\n\t\t$sql = 'SELECT id_carrera, materia, anio FROM cursada';\n\t\t\n\t\t$consulta = $conn->prepare($sql);\n\t\t\n\t\t$consulta->setFetchMode(PDO::FETCH_ASSOC);\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\t$consulta->execute();\n\t\t\t\n\t\t\t$results = $consulta->fetchall();\n\t\t\t\n\t\t\tforeach($results as $r){\n\t\t\t\t\n\t\t\t\t$c = Cursada::cursada($r['id_carrera'], $r['materia'], $r['anio']);\n\t\t\t\t\n\t\t\t\tarray_push($cs, $c);\n\t\t\t}\n\t\t\t\n\t\t}catch(PDOException $e){\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $cs;\n\t}", "function get_guias_nominadas(){\n\t\t$conect=ms_conect_server();\t\t\n\t\t$sQuery=\"SELECT * FROM nomina_detalle WHERE 1=1 ORDER BY id_guia\";\n\t\t\n\t\t//echo($sQuery);\n\t\t$result=mssql_query($sQuery) or die(mssql_min_error_severity());\n\t\t$i=0;\n\t\twhile($row=mssql_fetch_array($result)){\n\t\t\tforeach($row as $key=>$value){\n\t\t\t\t$res_array[$i][$key]=$value; \n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn($res_array);\t\n}", "public function getInformeCMI()\n {\n $objetivo = array();\n\n $c = new Criteria();\n $c->add(IndicadorPeer::OBJETIVO_ID, $this->getId());\n $c->add(IndicadorPeer::PROCESO, null, Criteria::ISNULL);\n $c->add(IndicadorPeer::BORRADOR, 0, Criteria::EQUAL);\n $indicadores = IndicadorPeer::doSelect($c);\n\n foreach ($indicadores as $indicador)\n {\n $objetivo[] = array (\n $this->getNombre(),\n $indicador->getIndicador(),\n $indicador->getCategoria(),\n $indicador->getFormulaTextual(),\n $indicador->getUmbralRojo(),\n $indicador->getUmbralAmarillo(),\n $indicador->getUmbralVerde(),\n $indicador->getValorActual(),\n $indicador->getMeta(),\n $indicador->getIniciativa(),\n );\n }\n return $objetivo;\n }", "public function get_mascota_ex(){\n\t\t$id_zootecnico = $this->session->userdata('s_id_zootecnico');\n\t\t$data = array();\n\t\t$this->db->select('m.id_mascota, m.nombre, m.sexo, m.color, r.nombre AS \"raza\"');\n\t\t$this->db->from('mascota m, raza r, zootecnico z, cliente c, \n\t\t\tasignacion_cliente_z cz, asignacion_cliente_m cm');\n\t\t$this->db->where('m.id_raza = r.id_raza');\n\t\t$this->db->where('m.status != ','Perdido');\n\t\t$this->db->where('m.status != ','Finado');\n\t\t$this->db->where('m.id_mascota = cm.id_mascota');\n\t\t$this->db->where('cm.id_cliente = c.id_cliente');\n\t\t$this->db->where('c.id_cliente = cz.id_cliente');\n\t\t$this->db->where('cz.id_zootecnico = z.id_zootecnico');\n\t\t$this->db->where('z.id_zootecnico !=', $id_zootecnico);\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t}\n\t\t$query->free_result();\n\t\treturn $data;\n\t}", "function obtener_aulas ($espacios_concedidos){\n $aulas=array();\n $indice=0;\n foreach($espacios_concedidos as $clave=>$valor){\n $aula=array(); // indice => (aula, id_aula)\n $aula['aula']=$valor['aula'];\n $aula['id_aula']=$valor['id_aula'];\n //$aula=$valor['aula'];\n $existe=$this->existe($aulas, $aula);\n if(!$existe){\n $aulas[$indice]=$aula;\n $indice += 1;\n }\n }\n return $aulas;\n }", "function busca_hueco_almacen(&$Localizaciones,$numero_huecos){\n\tfor($i = 1;$i < $numero_huecos['n_planta'];$i++)\n\t\t for($j = 1;$j < $numero_huecos['n_pasillo'];$j++)\n\t\t\t\t for($k = 1;$k < $numero_huecos['n_fila'];$k++)\n\t\t\t\t\t\tfor($l = 1;$l < $numero_huecos['n_columna'];$l++)\n\t\t\t\t\t\t\t\t if($Localizaciones[$i][$j][$k][$l] != 1){\n\t\t\t\t\t\t\t\t\t $Localizaciones[$i][$j][$k][$l] = 1;\n\t\t\t\t\t\t\t\t\t return array( \"planta\" => $i ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"pasillo\" => $j ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"fila\" => $k ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"columna\" => $l ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t\t }\n}", "public function mezclar() {\n if ($this->cantcartas == -1 || $this->cantcartas == 0)\n return TRUE;\n $inicio = 0;\n $final = $this->cantcartas;\n $mezcla = [];\n $punt = 0;\n for (; $inicio != $final && $inicio < $final; $inicio++, $final--) {\n $mezcla[$punt] = $this->cajita[$final];\n $punt++;\n $mezcla[$punt] = $this->cajita[$inicio];\n $punt++;\n }\n if (($this->cantcartas % 2) == 0)\n $mezcla[$punt] = $this->cajita[$inicio];\n $this->cajita = $mezcla;\n return TRUE;\n }", "public function lmostrarExamenesLaboratorio() {\n $oDLaboratorio = new DLaboratorio();\n $rs = $oDLaboratorio->dmostrarExamenesLaboratorio();\n\n\n// foreach ($rs as $i => $valuey) {\n// array_push($rs[$i], \"../../../../fastmedical_front/imagen/icono/editar.png ^ Editar Examen\");\n// }\n//\n// foreach ($rs as $j => $valuem) {\n// array_push($rs[$j], \"../../../../fastmedical_front/imagen/icono/cancel.png ^ Eliminar Examen\");\n// }\n\n return $rs;\n }", "public function getMontacargasMarca()\n {\n\n return $this->montacargas_marca;\n }", "public function getAtividadesComplementares() {\n\n $oDaoMatriculaAc = new cl_turmaacmatricula();\n $iCodigoAluno = $this->oMatricula->getAluno()->getCodigoAluno();\n $iAnoCalendario = $this->oMatricula->getTurma()->getCalendario()->getAnoExecucao();\n $iEscola = $this->oMatricula->getTurma()->getEscola()->getCodigo();\n $sWhere = \"ed269_aluno = {$iCodigoAluno}\";\n $sWhere .= \" and ed52_i_ano = {$iAnoCalendario}\";\n\n $aAtividadesComplementares = array();\n\n $sSqlMatriculaAluno = $oDaoMatriculaAc->sql_query_turma(null, \"*\", null, $sWhere);\n $rsMatriculaAluno = $oDaoMatriculaAc->sql_record($sSqlMatriculaAluno);\n\n if ($rsMatriculaAluno && $oDaoMatriculaAc->numrows > 0) {\n\n $iTurmasAc = $oDaoMatriculaAc->numrows;\n for ($i = 0; $i < $iTurmasAc; $i++) {\n\n $oDadosTurmaComplementar = db_utils::fieldsMemory($rsMatriculaAluno, $i);\n $oEscola = EscolaRepository::getEscolaByCodigo($oDadosTurmaComplementar->ed268_i_escola);\n\n $iCodigoTurma = $oDadosTurmaComplementar->ed268_i_codigo;\n $iTipoTurma = $oDadosTurmaComplementar->ed268_i_tipoatend;\n $oDadosAtendimento = $oDadosTurmaComplementar->ed268_c_aee;\n $oTurmaComplementar = new stdclass();\n $oTurmaComplementar->nome_turma = utf8_encode($oDadosTurmaComplementar->ed268_c_descr);\n $oTurmaComplementar->codigo_turma = utf8_encode($oDadosTurmaComplementar->ed268_i_codigo);\n $oTurmaComplementar->turno_turma = utf8_encode($oDadosTurmaComplementar->ed15_c_nome);\n $oTurmaComplementar->escola = utf8_encode($oEscola->getNome());\n $oTurmaComplementar->tipo_turma = $iTipoTurma;\n $oTurmaComplementar->atividades = $this->getAtividades($iCodigoTurma, $iTipoTurma, $oDadosAtendimento);\n $oTurmaComplementar->aProfissionais = $this->getProfessoresVinculadosTurmaAtividadeComplementar($oDadosTurmaComplementar->ed268_i_codigo);\n $aAtividadesComplementares[] = $oTurmaComplementar;\n }\n }\n return $aAtividadesComplementares;\n }", "public function getMontacargasC()\n {\n\n return $this->montacargas_c;\n }", "public function getSumas() {\n $aDatos = $this->getAsistentes();\n $aAsi = array();\n $aPer = array();\n $aRep = array();\n $prop = 0;\n $repr = 0;\n $vosp = 0;\n $vonp = 0;\n $vosr = 0;\n $vonr = 0;\n $cofp = 0;\n $cofr = 0;\n \n foreach ($aDatos as $aAsistente) {\n if($aAsistente[3] == 'S') {\n // Representante.\n $repr++; // Numero de respresentantes.\n $aRep[$aAsistente[1]] = $aAsistente[1]; // Para el numero de respresentantes diferentes.\n $vosr += ($aAsistente[4] == 'S') ? 1 : 0; // Representantes con voto.\n $vonr += ($aAsistente[4] == 'N') ? 1 : 0; // Representantes sin voto.\n $cofr += $aAsistente[5]; // Coeficiente fase.\n } else {\n // Propietario.\n $prop++;\n $aPer[$aAsistente[1]] = $aAsistente[1]; // Para el numero de propietarios diferentes.\n $vosp += ($aAsistente[4] == 'S') ? 1 : 0; // Propietarios con voto.\n $vonp += ($aAsistente[4] == 'N') ? 1 : 0; // Propietarios sin voto.\n $cofp += $aAsistente[5]; // Coeficiente fase.\n }\n }\n $aAsi['prop'] = array($prop, count($aPer), $vosp, $vonp, $cofp);\n $aAsi['repr'] = array($repr, count($aRep), $vosr, $vonr, $cofr);\n return $aAsi;\n }", "public function buscarMotivosGeral() {\r\n\r\n $retorno = array();\r\n\r\n $sql = \"\r\n SELECT\r\n mtroid,\r\n mtrdescricao\r\n FROM\r\n motivo_reclamacao\r\n WHERE\r\n mtrexclusao IS NULL\r\n ORDER BY\r\n mtrdescricao\";\r\n\r\n if (!$rs = pg_query($this->conn, $sql)) {\r\n throw new ErrorException(self::MENSAGEM_ERRO_PROCESSAMENTO);\r\n }\r\n\r\n while ($row = pg_fetch_object($rs)) {\r\n $retorno[] = $row;\r\n }\r\n\r\n return $retorno;\r\n\r\n }", "function consultarMatriculas($cod_estudiante){\r\n $cadena_sql = $this->sql->cadena_sql(\"matriculas\", $cod_estudiante);\r\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\r\n return $resultado;\r\n }", "function get_all_materia()\n {\n $materia = $this->db->query(\"\n SELECT\n m.*, a.*, n.*, e.*, t.materia_nombre as 'requisito', pa.carrera_id, ca.carrera_nombre\n\n FROM\n materia m\n LEFT JOIN area_materia a ON m.area_id=a.area_id\n LEFT JOIN nivel n ON m.nivel_id=n.nivel_id\n LEFT JOIN plan_academico pa ON pa.planacad_id=n.planacad_id\n LEFT JOIN carrera ca ON ca.carrera_id=pa.carrera_id\n LEFT JOIN estado e ON m.estado_id=e.estado_id\n LEFT JOIN materia t ON m.mat_materia_id=t.materia_id\n\n WHERE\n 1 = 1\n\n ORDER BY carrera_id, n.nivel_id ASC\n \")->result_array();\n\n return $materia;\n }", "public static function obtenerMatrices()\n {\n $consulta = \"SELECT * FROM matrices ORDER BY matriz ASC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "public function retornaMarcas(){\n\t\t\t\n\t\t\t$this->load->database();\n\t\t\t\n\t\t\t$query = $this->db->query(\"SELECT * FROM marca ORDER BY nome_marca ASC\");\n\t\t\t\n\t\t\t\t $dados = array();\n\t\t\t\t $cont=1;\n\t\t\t\t \tforeach($query->result() as $linha)\n\t\t\t\t \t{\n\t\t\t\t \t\t$dados['id_marca'.$cont] = $linha->id_marca;\n\t\t\t\t \t\t$dados['nome_marca'.$cont] = $linha->nome_marca;\n\t\t\t\t \t\t$dados['data_cadastro'.$cont] = $linha->data_cadastro;\n\t\t\t\t \t\t\n\t\t\t\t \t\t$this->db->select('nome');\n\t\t\t\t \t\t$this->db->from('user');\n\t\t\t\t \t\t$this->db->where('id_user', $linha->id_usuario);\n\t\t\t\t \t\t$get = $this->db->get();\n\t\t\t\t \t\t$nome = $get->result_array();\n\t\t\t\t \t\t$dados['id_usuario'.$cont] = $nome['0']['nome'];\n\t\t\t\t \t\t$cont++;\t\t\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t\n\n\t\t\treturn($dados);\n\t\t\t\n\t\t}", "function getCampos(){\n\t\t$this->con->executa( \"select id, campo from workflow_campos\");\n\t\t\t//$this->con->navega();\n\n\t\t\t$i=0;\n\t\t\twhile ($this->con->navega(0)){\n\t\t\t\t$campos[ strtolower(trim($this->con->dados[\"id\"])) ] = strtolower(trim($this->con->dados[\"campo\"]));\n\n\t\t\t\t$i++;\n\t\t\t}\n $campos = $this->globais->ArrayMergeKeepKeys( $this->globais->SYS_ADD_CAMPOS, $campos);\n //$campos[ \"entradanoposto\" ] = \"entradanoposto\";\n //$array[\"FETCH\"] [$this->con->dados[\"idprocesso\"]][\"entradanoposto\" ] = $this->con->dados[\"wt_inicio\"] ;\n\n\t\treturn $campos;\n\n\t}", "function getArrayCampos() {\n\t\t$arr = array(\n\t\t\t\"id\"=>$this->id,\n\t\t\t\"idov\"=>$this->idov,\n\t\t\t\"ordinal\"=>$this->ordinal,\n\t\t\t\"visible\"=>$this->visible,\n\t\t\t\"iconoov\"=>$this->iconoov,\n\t\t\t\"name\"=>$this->name,\n\t\t\t\"idov_refered\"=>$this->idov_refered,\n\t\t\t\"idresource_refered\"=>$this->idresource_refered,\n\t\t\t\"type\"=>$this->type\n\t\t);\n\t\treturn $arr;\n\t}", "function carrega_vetor_lexicos($id_projeto, $id_lexico_atual, $semAtual) {\n \n //testes if the variable is not null\n assert($id_projeto != NULL);\n assert($id_lexico_atual != NULL);\n assert($semAtual != NULL);\n \n //tests if the variable has the correct type\n assert(is_string($id_projeto));\n assert(is_string($id_lexico_atual));\n assert(is_string($semAtual));\n \n $vetorDeLexicos = array();\n if ($semAtual) {\n $queryLexicos = \"SELECT id_lexico, nome \n\t\t\tFROM lexico \n\t\t\tWHERE id_projeto = '$id_projeto' \n AND id_lexico <> '$id_lexico_atual' \n\t\t\tORDER BY nome DESC\";\n\n $querySinonimos = \"SELECT id_lexico, nome \n\t\t\tFROM sinonimo\n\t\t\tWHERE id_projeto = '$id_projeto' \n AND id_lexico <> '$id_lexico_atual' \n\t\t\tORDER BY nome DESC\";\n } else {\n\n $queryLexicos = \"SELECT id_lexico, nome \n\t\t\tFROM lexico \n\t\t\tWHERE id_projeto = '$id_projeto' \n\t\t\tORDER BY nome DESC\";\n\n $querySinonimos = \"SELECT id_lexico, nome \n\t\t\tFROM sinonimo\n\t\t\tWHERE id_projeto = '$id_projeto' \n ORDER BY nome DESC\";\n }\n\n $resultadoQueryLexicos = mysql_query($queryLexicos) or\n die(\"Erro ao enviar a query de selecao na tabela lexicos !\" . \\mysql_error());\n\n $i = 0;\n while ($linhaLexico = mysql_fetch_object($resultadoQueryLexicos)) {\n $vetorDeLexicos[$i] = $linhaLexico;\n $i++;\n }\n\n $resultadoQuerySinonimos = mysql_query($querySinonimos) or\n die(\"Erro ao enviar a query de selecao na tabela sinonimos !\" . mysql_error());\n while ($linhaSinonimo = mysql_fetch_object($resultadoQuerySinonimos)) {\n $vetorDeLexicos[$i] = $linhaSinonimo;\n $i++;\n }\n return $vetorDeLexicos;\n}", "function listaMaterial(){\n //Construimos la consulta\n $sql=\"SELECT * from material_entregado\";\n //Realizamos la consulta\n $resultado=$this->realizarConsulta($sql);\n if($resultado!=null){\n //Montamos la tabla de resultados\n $tabla=[];\n while($fila=$resultado->fetch_assoc()){\n $tabla[]=$fila;\n }\n return $tabla;\n }else{\n return null;\n }\n }", "function llenarMatrizPlaneServicios(){\n\t\t\t\n\t\t\tunset($matriz); \n\t\t\tglobal $matriz;\t\n\t\t\t$res = llamarRegistrosMySQLPlaneServicios();\n\t\t\t$posicion=0;\n\t\t\t\t\n\t\t\t\twhile ($fila = mysql_fetch_array($res))\n\t\t\t\t{\t\n\t\t\t\t\t\n\t\t\t\t\t$matriz[\"nombreplan\"][$posicion] = $fila[\"Nombre\"];\n\t\t\t\t\t$matriz[\"autoid\"][$posicion] = $fila[\"AutoId\"];\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$posicion++;\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t}", "public function get_mascota(){\n\t\t$id_zootecnico = $this->session->userdata('s_id_zootecnico');\n\t\t$data = array();\n\t\t$this->db->select('m.id_mascota, m.nombre, m.sexo, m.color, r.nombre AS \"raza\"');\n\t\t$this->db->from('mascota m, raza r, zootecnico z, cliente c, \n\t\t\tasignacion_cliente_z cz, asignacion_cliente_m cm');\n\t\t$this->db->where('m.id_raza = r.id_raza');\n\t\t$this->db->where('m.status != ','Perdido');\n\t\t$this->db->where('m.status != ','Finado');\n\t\t$this->db->where('m.id_mascota = cm.id_mascota');\n\t\t$this->db->where('cm.id_cliente = c.id_cliente');\n\t\t$this->db->where('c.id_cliente = cz.id_cliente');\n\t\t$this->db->where('cz.id_zootecnico = z.id_zootecnico');\n\t\t$this->db->where('z.id_zootecnico', $id_zootecnico);\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t}\n\t\t$query->free_result();\n\t\treturn $data;\n\t}", "function get ()\n\t{\n\t\t$ ret = array ();\n\t\t\n\t\t// Loop por todos os registros no banco de dados\n\t\tfor ( $ x = 0 ; ( $ x < $ this -> num_records () && count ( $ ret ) < $ this -> _limit ); $ x ++)\n\t\t{\t\t\t\n\t\t\t$ row = $ this -> _px -> retrieve_record ( $ x );\n\t\t\t\n\t\t\tif ( $ this -> _test ( $ row ))\n\t\t\t{\n\t\t\t\tforeach ( $ row as $ key => $ val )\n\t\t\t\t{\n\t\t\t\t\t// Encontre todos os campos que não estão na matriz selecionada\n\t\t\t\t\tif (! in_array ( $ key , $ this -> _select ) &&! empty ( $ this -> _select )) unset ( $ row [ $ key ]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$ ret [] = $ linha ;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $ ret ;\n\t}", "public function residue () :array\n {\n return [\n\n ];\n }", "public function listaMovimientos()\n {\n $conexion = conexion::conectar();\n $sql = \"SELECT * FROM movimientos WHERE compra_venta ='c' order by id_producto asc;\";\n $stmt = $conexion->prepare($sql);\n $stmt->execute();\n $array = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt = null;\n return $array;\n }", "public function getMontacargasModelo()\n {\n\n return $this->montacargas_modelo;\n }", "function buscarEspaciosVistos(){\r\n $i=0;\r\n $espacios_vistos=isset($espacios_vistos)?$espacios_vistos:'';\r\n $espacios=isset($reprobados)?$reprobados:'';\r\n \r\n if(is_array($this->espaciosCursados)){\r\n foreach ($this->espaciosCursados as $espacio) {\r\n $espacios[$i]=$espacio[0];\r\n $i++;\r\n }\r\n }\r\n \r\n if(is_array($espacios)){\r\n $espacios= array_unique($espacios);\r\n if($this->datosEstudiante['IND_CRED']=='S'){\r\n foreach ($espacios as $key => $espacio) {\r\n foreach ($this->espaciosCursados as $cursado) {\r\n if($espacio==$cursado['CODIGO']){\r\n $espacios_vistos[$key]['CODIGO']=$cursado['CODIGO'];\r\n $espacios_vistos[$key]['CREDITOS']=(isset($cursado['CREDITOS'])?$cursado['CREDITOS']:0);\r\n }\r\n }\r\n }\r\n }else{\r\n $espacios_vistos=$espacios;\r\n }\r\n \r\n }\r\n return $espacios_vistos;\r\n }", "public function getDados() {\n\n $oDadosMatricula = new stdClass();\n $iCodigoMatricula = $this->oMatricula->getCodigo();\n $iCodigoAluno = $this->oMatricula->getAluno()->getCodigoAluno();\n $iCodigoTurma = $this->oMatricula->getTurma()->getCodigo();\n $iCodigoEnsino = $this->oMatricula->getTurma()->getBaseCurricular()->getCurso()\n ->getEnsino()->getCodigo();\n $oDadosMatricula->codigo_matricula = $this->oMatricula->getMatricula();\n $oDadosMatricula->data_matricula = $this->oMatricula->getDataMatricula()->convertTo(DBDate::DATA_EN);\n $oDadosMatricula->situacao_matricula = utf8_encode($this->oMatricula->getSituacao());\n if ($this->oMatricula->getTipo() == 'R' && $this->oMatricula->getSituacao() == 'MATRICULADO') {\n $oDadosMatricula->situacao_matricula = utf8_encode(\"REMATRICULADO\");\n }\n if ($this->oMatricula->isConcluida()) {\n $oDadosMatricula->situacao_matricula .= \" (\".utf8_encode(\"CONCLUÍDA\").\")\";\n }\n $oDadosMatricula->etapa_matricula = utf8_encode($this->oMatricula->getEtapaDeOrigem()->getNome());\n $oDadosMatricula->turma_matricula = utf8_encode($this->oMatricula->getTurma()->getDescricao());\n $oDadosMatricula->turma_turno = utf8_encode($this->oMatricula->getTurma()->getTurno()->getDescricao());\n $oDadosMatricula->turma_calendario = utf8_encode($this->oMatricula->getTurma()->getCalendario()->getDescricao());\n $oDadosMatricula->turma_escola = utf8_encode($this->oMatricula->getTurma()->getEscola()->getNome());\n $oDadosMatricula->data_saida = '';\n if ($this->oMatricula->getDataEncerramento() != \"\") {\n $oDadosMatricula->data_saida = $this->oMatricula->getDataEncerramento()->convertTo(DBDate::DATA_EN);\n }\n\n\n $oDadosMatricula->periodos_etapa = $this->getPeridosEtapa();\n $oDadosMatricula->grade_aproveitamento = $this->getGradeAproveitamento();\n $oDadosMatricula->resultado_final_etapa = utf8_encode(ResultadoFinal($iCodigoMatricula,\n $iCodigoAluno,\n $iCodigoTurma,\n $this->oMatricula->getSituacao(),\n $this->oMatricula->isConcluida()?'S':'N',\n $iCodigoEnsino\n ));\n $oDadosMatricula->atividades_complementares = $this->getAtividadesComplementares();\n return $oDadosMatricula;\n }", "public function verMarcaslista(){\n\t\t\t//$this->producto->set(\"marca\",$marca);\n\t\t\t$resultado=$this->producto->verMarcaslista();\n\t\t return $resultado;\n\t\t\t\n\t\t}", "public function readProductosMarcas()\n {\n $sql = 'SELECT nombre, id_producto, imagen_producto,producto, descripcion, precio\n FROM producto INNER JOIN marca USING(id_marca)\n WHERE id_marca = ? \n ORDER BY producto';\n $params = array($this->nombre);\n return Database::getRows($sql, $params);\n }", "function arrayProgramas (){\n\t\t$host = \"localhost\";\n\t\t$usuario = \"root\";\n\t\t$password = \"\";\n\t\t$BaseDatos = \"pide_turno\";\n\n $link=mysql_connect($host,$usuario,$password);\n\n\t\tmysql_select_db($BaseDatos,$link);\n\n\t\t$consultaSQL = \"SELECT estado_programas.codigo, estado_programas.estado, estado_programas.programa, estado_programas.user, estado_programas.pass, estado_programas.comentarios FROM estado_programas;\";\n\t\t$retorno =array();\n\t\tmysql_query(\"SET NAMES utf8\");\n\t\t$result = mysql_query($consultaSQL);\n\t\tfor($i=0;$fila= mysql_fetch_assoc($result); $i++) {\n\t\t\tfor($a= 0;$a<mysql_num_fields($result);$a++){\n\t\t\t\t$campo = mysql_field_name($result,$a);\n\t\t\t\t$retorno[$i][$campo] = $fila[$campo];\n\t\t\t}\n\t\t};\n\t\tmysql_close($link);\n\n\t\treturn $retorno;\n\t}", "protected function armaColeccionZpCarac() {\n $arrayRet = array();\n $dao = new PGDAO();\n $where = $this->strZpTprop();\n if ($where != '') {\n $arrayRet = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARAC . \" where tipoprop in (\" . $where . \")\"));\n } else {\n $arrayRet = $this->leeDBArray($dao->execSql($this->COLECCIONZPCARAC));\n }\n return $arrayRet;\n }", "public static function getVinculosMasculinos() {\n return array_values(array_unique(self::$vinculosMasculinos));\n }", "private function codMonedas(): array\n {\n $codigos = [];\n if ($this->ws === 'wsfe') {\n $codigos = $this->FEParamGetTiposMonedas();\n $codigos = array_map(function ($o) {\n return $o->Id;\n }, $codigos->Moneda);\n } elseif ($this->ws === 'wsmtxca') {\n /** @var array $authRequest */\n $authRequest = $this->service->authRequest;\n $codigos = (new WsParametros())->consultarMonedas($this->service->client, $authRequest);\n $codigos = array_map(function ($o) {\n return $o->codigo;\n }, $codigos->arrayMonedas->codigoDescripcion);\n }\n\n return $codigos;\n }", "function porEstudiante($cod_clase, $cod_interno = null) {\n\t\t\t$estudiantes = TAsistencia::all($cod_clase);\n\t\t\tif($estudiantes == null)\n\t\t\t\treturn null;\n\t\t\t$asistencias = array();\n\t\t\tforeach ($estudiantes as $estudiante) {\n\t\t\t\t$asistencias[$estudiante['cod_interno']] = array('asiste' => $estudiante['asiste'], 'cod_motivo' => $estudiante['cod_motivo']);\n\t\t\t}\n\t\t\treturn $asistencias;\n\t\t}", "public function cbo_mascota(){\n $data = array();\n $query = $this->db->get('mascota');\n if ($query->num_rows() > 0) {\n foreach ($query->result_array() as $row){\n $data[] = $row;\n }\n }\n $query->free_result();\n return $data;\n }", "function criaArrayModeloDeCompra()\n{\n $compra = array(\n 'id' => null,\n 'id_colaborador' => '',\n 'id_produto' => '',\n 'data_compra' => '',\n 'horario_compra' => '',\n 'email' => '',\n 'envio_email' => '',\n 'quantidade' => null\n );\n\n return $compra;\n\n}", "public function getMatrix($asArray = false) {}", "public function buscar_comprobante_compras($anio) {\n //CPC_TipoDocumento => F factura, B boleta\n //CPC_total => total de la FACTURA o BOLETA\n $sql = \" SELECT c.*, m.MONED_Simbolo FROM cji_comprobante c inner JOIN cji_moneda m ON m.MONED_Codigo=c.MONED_Codigo WHERE c.CPC_TipoOperacion='C' AND c.CPC_TipoDocumento='F' AND YEAR(c.CPC_FechaRegistro)=\" . $anio . \"\";\n //echo $sql;\n $query = $this->db->query($sql);\n if ($query->num_rows > 0) {\n foreach ($query->result() as $fila) {\n $data[] = $fila;\n }\n return $data;\n }\n return array();\n }", "public function getMarcasEmpresa($_ID_Empresa){\n\t\t$respuesta=$this->db->select(\"*\")->where(\"IDEmpresa='$_ID_Empresa'\")->get(\"marcas\");\n\t\treturn $respuesta->result_array();\n\t}", "function get_ArregloAlumnos(){\n\t\t$query_2 = $this->db->query('SELECT rut, id_clase FROM datos_alumnos');\n\t\t\n\t\tif ($query_2->num_rows() > 0){\n\t\t\t//se guarda los datos en arreglo bidimensional\n\t\t\tforeach($query_2->result() as $row)\n\t\t\t$arrDatos_2[htmlspecialchars($row->rut, ENT_QUOTES)]=htmlspecialchars($row->rut,ENT_QUOTES);\n\t\t\t$query_2->free_result();\n\t\t\treturn $arrDatos_2;\n\t\t}\t\n\t\t\n\t}", "public function getSumas() {\n $aVot = $this->votos;\n $aCoe = $this->coeficientes;\n \n $asis = 0; $vots = 0; $votn = 0; $pres = 0;\n $opc1 = 0; $opc2 = 0; $opc3 = 0; $opc4 = 0;\n $urb1 = 0; $urb2 = 0; $urb3 = 0; $urb4 = 0;\n $fas1 = 0; $fas2 = 0; $fas3 = 0; $fas4 = 0;\n $blo1 = 0; $blo2 = 0; $blo3 = 0; $blo4 = 0;\n \n foreach ($aVot as $apa => $aDat) {\n $asis += ($aDat[0] == 'S') ? 1 : 0;\n $vots += ($aDat[1] == 'S') ? 1 : 0;\n $votn += ($aDat[1] == 'S') ? 0 : 1;\n $pres += ($aDat[2] == 'S') ? 1 : 0;\n \n $opc1 += ($aDat[3] == 'S') ? 1 : 0;\n $opc2 += ($aDat[4] == 'S') ? 1 : 0;\n $opc3 += ($aDat[5] == 'S') ? 1 : 0;\n $opc4 += ($aDat[6] == 'S') ? 1 : 0;\n \n $urb1 += ($aDat[3] == 'S') ? $aCoe[$apa][0] : 0;\n $urb2 += ($aDat[4] == 'S') ? $aCoe[$apa][0] : 0;\n $urb3 += ($aDat[5] == 'S') ? $aCoe[$apa][0] : 0;\n $urb4 += ($aDat[6] == 'S') ? $aCoe[$apa][0] : 0;\n \n $fas1 += ($aDat[3] == 'S') ? $aCoe[$apa][1] : 0;\n $fas2 += ($aDat[4] == 'S') ? $aCoe[$apa][1] : 0;\n $fas3 += ($aDat[5] == 'S') ? $aCoe[$apa][1] : 0;\n $fas4 += ($aDat[6] == 'S') ? $aCoe[$apa][1] : 0;\n \n $blo1 += ($aDat[3] == 'S') ? $aCoe[$apa][2] : 0;\n $blo2 += ($aDat[4] == 'S') ? $aCoe[$apa][2] : 0;\n $blo3 += ($aDat[5] == 'S') ? $aCoe[$apa][2] : 0;\n $blo4 += ($aDat[6] == 'S') ? $aCoe[$apa][2] : 0;\n }\n $aSumas['asis'] = array($asis, $vots, $votn, $pres);\n $aSumas['opci'] = array($opc1, $opc2, $opc3, $opc4);\n $aSumas['urba'] = array($urb1, $urb2, $urb3, $urb4);\n $aSumas['fase'] = array($fas1, $fas2, $fas3, $fas4);\n $aSumas['bloq'] = array($blo1, $blo2, $blo3, $blo4);\n \n return $aSumas;\n }", "function tieneCursosConMatriculas($idTipoMatricula){\n \t/*******************************************************\n * Consulta en BD si un curso tiene matriculas asociadas\n *******************************************************/\n $pd = DatabaseCao::connect();\n $pd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n $sql = \"SELECT m.id id\n\t\t\t\tFROM ca_tipo_matricula tp\n\t\t\t\tINNER JOIN \tca_tipo_matricula_curso tmc ON tmc.tipo_matricula = tp.id\n\t\t\t\tINNER JOIN ca_matricula m ON tmc.id = m.ID_TM_CURSO\n\t\t\t\tAND tp.id = ?\"; \n $q = $pd->prepare($sql);\n $q->execute(array($idTipoMatricula)); \n\n /*****************************************************\n * Carga de datos en variables\n *****************************************************/\n $TieneMatriculasAsociadasACursos = FALSE;\n while ($fila = $q->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) { \n $TieneMatriculasAsociadasACursos = TRUE; \n break; \n } \n return $TieneMatriculasAsociadasACursos;\n }", "public function getComputerByMarks()\n {\n $db = $this->createConection(); // 1. abro la conexión con MySQL \n //Creamos la consulta para obtener una categoria\n $sentencia = $db->prepare(\"SELECT * FROM computadora WHERE nombre_marca=?\"); // prepara la consulta\n $sentencia->execute(); // ejecuta\n $computadora = $sentencia->fetchAll(PDO::FETCH_OBJ); // obtiene la respuesta\n return $computadora;\n }", "function consultarenviodetallesCedula (){\n\t\t$x = $this->pdo->prepare('SELECT En.empresa,En.telefono,En.fechaEnvio,Cl.cedula FROM enviodetalles EN INNER JOIN cliente Cl ON En.cedulaCliente = Cl.cedula');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function contarEspaciosNivelados($cantidadMatriculas) {\r\n $creditos=0;\r\n $nivelados=array();\r\n if (is_array($this->espaciosPlan))\r\n {\r\n foreach ($this->espaciosPlan as $key => $espacio) {\r\n if ($espacio['SEMESTRE']<=$cantidadMatriculas)\r\n {\r\n $nivelados[]=$espacio;\r\n $creditos=$creditos+(isset($espacio['CREDITOS'])?$espacio['CREDITOS']:'');\r\n }\r\n }\r\n }\r\n if($this->datosEstudiante['IND_CRED']=='N')\r\n {\r\n return count($nivelados);\r\n }elseif($this->datosEstudiante['IND_CRED']=='S')\r\n {\r\n return $creditos;\r\n }else{}\r\n }", "function Listeconsommation()\n\t{\n\t\t$cnn = getConnexion('tpi-fictif');\n\t\t$i = 0;\n\t\t//Permet de savoir plus facilement si login correct ou pas\n\t\t$consom = [];\n\t\t$stmt = $cnn -> prepare('SELECT `ID`, `Nom`, `Prix` FROM `consommation`');\n\t\t$stmt -> execute();\n\t\t//Remplissange tab 2 dimensions pour avoir les infos qu'on souhaite\n\t\t//Passage en param plus facile\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_OBJ)) {\n\t\t\t$consom[$i][0] = $row->ID;\n\t\t\t$consom[$i][1] = $row->Nom;\n\t\t\t$consom[$i][2] = $row->Prix;\n\t\t\t$i++;\n\t\t}\n\t\tif(!empty($consom))\n\t\t{\n\t\t\treturn $consom;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function extraeMascotas($idCliente)\n{\n $link = conection();\n $return = array();\n $contador = null;\n \n $query = \"select * from Mascota where idCliente = '$idCliente'\";\n $result = mysqli_query($link, $query);\n \n $rows = mysqli_num_rows($result);\n \n if($rows > 0)\n {\n while ($rows = mysqli_fetch_assoc($result))\n {\n $contador ++;\n // Nota: esto se hace para validar los acentos, si no de lo \n // contrario marca horrores con las tildes o acentos al momento \n // retornar los datos recolectados\n $return[$contador] = [\"idMascota\" => $rows[\"idMascota\"], \n \"nombreMa\" => utf8_encode($rows[\"nombreMa\"]),\n \"idRaza\" => $rows[\"idRaza\"],\n \"idCliente\" => $rows[\"idCliente\"],\n \"idArchivo\" => $rows[\"idArchivo\"]];\n }\n }\n \n mysqli_close($link);\n return $return;\n}", "public function obtenerComprasSinAdecsys()\n {\n $sql = $this->getAdapter()->select()->from(array('c' => 'compra'),\n array('id', 'id_tarifa', 't.medio_pub'))\n ->joinLeft(array('cac' => 'compra_adecsys_codigo'),\n 'c.id = cac.id_compra', null)\n ->joinInner(array('t' => 'tarifa'), 't.id = c.id_tarifa', null)\n ->where('cac.id is null')\n ->where('c.estado = ?', self::ESTADO_PAGADO)\n ->where('c.id_tarifa <> ?', Application_Model_Tarifa::GRATUITA)\n ->where('c.medio_pago in (?)',\n array(self::FORMA_PAGO_VISA, self::FORMA_PAGO_PAGO_EFECTIVO,\n self::FORMA_PAGO_MASTER_CARD, self::FORMA_PAGO_CREDITO))\n ->order('c.id asc');\n\n return $this->getAdapter()->fetchAll($sql);\n }", "public function calculConge($id){\n $indispos = array();\n // array du genre 'type','mois','nb'\n $sql =\"select DATE_FORMAT(DATE,'%m') as MOIS,activite_id,SUM(TOTAL) as TOTAL\n from activitesreelles \n where activitesreelles.utilisateur_id = \".$id.\"\n and activitesreelles.activite_id = 1\n and DATE_FORMAT(DATE,'%Y') = DATE_FORMAT(NOW(),'%Y')\n group by MOIS,activite_id\";\n $results = $this->Utilisateur->query($sql);\n foreach($results as $result):\n $indispos[$result[0]['MOIS']]=$result[0]['TOTAL'];\n endforeach;\n for($i=1;$i<13;$i++){\n $mois = $i < 10 ? '0'.$i : (String)$i;\n if (!array_key_exists($mois, $indispos)) {\n $indispos[$mois]='0';\n }\n }\n return $indispos;\n }", "public function costo_offset_color_merma() {\n\n $sql = \"SELECT * from proc_merma where status = 'A'\";\n\n $query = $this->db->prepare($sql);\n $query->execute();\n\n $result = array();\n\n while ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n\n $result[] = $row;\n }\n\n return $result;\n }", "public function getOpcionesEstadosPosiblesDeCambio(){\n \t//return array('planificado' => 'Planificado','parcial' => 'Realizada Parcialmente','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n \tif($this->esPlanificada()){\n\t\t\treturn array('planificado' => 'Planificado','parcial' => 'Realizada Parcialmente','cancelado' => 'Cancelada');\n\t\t}\n\t\telseif($this->esParcial()){\n\t\t\treturn array('parcial' => 'Realizada Parcialmente','atrasado' => 'Atrasado','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n\t\t}\n\t\telseif($this->esAtrasada()){\n\t\t\treturn array('parcial' => 'Realizada Parcialmente','atrasado' => 'Atrasado','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n\t\t}\n\t\telseif($this->esCancelada()){\n\t\t\treturn array('cancelado' => 'Cancelada');\n\t\t}\n\t\telseif($this->esRealizada()){\n\t\t\treturn array('realizado' => 'Realizada');\n\t\t}\n\t\treturn array('planificado' => 'Planificado','parcial' => 'Realizada Parcialmente','cancelado' => 'Cancelada', 'realizado' => 'Realizada');\n\t}", "function get_mecanismos_carga()\n\t{\n\t\t$param = $this->get_definicion_parametros(true);\t\t\n\t\t$tipos = array();\n\t\tif (in_array('carga_metodo', $param, true)) {\n\t\t\t$tipos[] = array('carga_metodo', 'Método de consulta PHP');\n\t\t}\n\t\tif (in_array('carga_lista', $param, true)) {\n\t\t\t$tipos[] = array('carga_lista', 'Lista fija de Opciones');\n\t\t}\t\t\n\t\tif (in_array('carga_sql', $param, true)) {\t\t\n\t\t\t$tipos[] = array('carga_sql', 'Consulta SQL');\n\t\t}\n\t\treturn $tipos;\n\t}", "public function materias(){\n\t\t\n\t\t$connection = Connection::getInstance();\n\t\t$result \t= $connection->query(\"SELECT grupos.materia_id \n\t\t\t\t\t\t\t\t\t\t FROM usuarios, inscripciones, grupos \n\t\t\t\t\t\t\t\t\t\t WHERE tipo_usuario = \".Usuario::ESTUDIANTE.\" AND \n\t\t\t\t\t\t\t\t\t\t usuarios.id = $this->id AND \n\t\t\t\t\t\t\t\t\t\t usuarios.id = inscripciones.usuario_id AND \n\t\t\t\t\t\t\t\t\t\t grupos.id = inscripciones.grupo_id\");\n\t\t$res \t\t= array();\n\t\t\n\t\twhile ($id = pg_fetch_array($result)[0]){\n\t\t\t$res[] = new Materia($id);\n\t\t}\n\t\t\n\t\treturn $res;\n\t}", "public function getMetasAlcanzadas()\n {\n $metasAlcanzadas = 0;\n foreach ($this->objetivos as $objetivo)\n {\n if (count($objetivo->getActividades())!=0)\n {\n foreach($objetivo->getActividades() as $actividad)\n {\n if (count($actividad->getMetaAlcanzada())!=0)\n {\n foreach($actividad->getMetaAlcanzada() as $metaAlcanzada)\n { \n $metasAlcanzadas+=$metaAlcanzada->getMeta();\n }\n }\n } \n }\n }\n return $metasAlcanzadas;\n }", "function promedio_por_alumno($vector){\n $promedios_alumnos=array();\n foreach ($vector as $key => $value) {\n $promedio=0;\n foreach ($value as $c) {\n $promedio=$promedio+$c;\n }\n $promedio=$promedio/6;\n $alumno=array($key=>$promedio);\n array_push($promedios_alumnos,$alumno);\n }\n return $promedios_alumnos;\n }", "function retornaCampos($tabelaProcura){\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 if($tabelaProcura != (string)$aTabela['NOME']) \n continue;\n # Varre a estrutura dos campos da tabela em questao\n foreach($aTabela as $oCampo){\n # Recupera valores a serem substituidos no modelo\n $aRetorno[] = (string)$oCampo->FKTABELA;\n }\n break;\n }\n return $aRetorno;\n }", "public static function findByCuatri(): array{\n $cuatris = array();\n\n for($i=0; $i<10; $i++){\n $cuatris[$i] = Materia::where('cuatrimestre','=',($i+1))\n ->orderBy('cuatrimestre', 'ASC')\n ->get()\n ->load('correlativas_cursadas_cursadas')\n ->load('correlativas_cursadas_aprobadas')\n ->load('correlativas_aprobadas_cursadas') \n ->load('correlativas_aprobadas_aprobadas'); \n }\n return $cuatris;\n }", "function getTelefonos(){\n\t\t$socio\t\t\t= $this->mCodigo;\n\t\t$mArrTelefonos\t= array();\n\t\t$sql = \"SELECT\n\t\t\t\t\tTRIM(`socios_vivienda`.`telefono_residencial`) AS 'telefono'\n\t\t\t\tFROM\n\t\t\t\t\t`socios_vivienda` `socios_vivienda`\n\t\t\t\tWHERE\n\t\t\t\t\t(`socios_vivienda`.`socio_numero` =$socio)\n\t\t\t\tUNION\n\t\t\t\tSELECT\n\t\t\t\t\tTRIM(`socios_vivienda`.`telefono_movil`)\n\t\t\t\tFROM\n\t\t\t\t\t`socios_vivienda` `socios_vivienda`\n\t\t\t\tWHERE\n\t\t\t\t\t(`socios_vivienda`.`socio_numero` =$socio)\";\n\t\t$rs\t= mysql_query($sql, cnnGeneral() );\n\t\twhile($rw = mysql_fetch_array($rs) ){\n\t\t\t$mArrTelefonos[]\t= $rw[\"telefono\"];\n\t\t}\n\t\t$mArrTelefonos[\"principal\"]\t= $this->mTelefonoP;\n\t\treturn $mArrTelefonos;\n\t}", "public function create_calculation_array_matrix(){\n\t\t/*\n\t\t* Public and private sets of date for more complex frontend managament\n\t\t*/\n\t\t$calculation_array_matrix = array(\n\t\t\t\"public\" => array(\n\t\t\t\t'calc' => array()\n\t\t\t),\n\t\t\t\"auth\" => array(\n\t\t\t\t'calc_details' => array()\n\t\t\t)\n\t\t);\n\t\treturn $calculation_array_matrix;\n\t}", "public function getTextMatrix() {}", "public function getCotizaciones() {\n $sql = \"SELECT cot_odt.id_odt, cot_odt.num_odt, cot_odt.id_modelo, cot_odt.tiraje, cot_odt.fecha_odt\n , cot_odt.hora_odt, modelos_cajas.nombre as nombre_caja\n , clientes.nombre as nombre_cliente\n FROM cot_odt\n join modelos_cajas on cot_odt.id_modelo = modelos_cajas.id_modelo\n join clientes on cot_odt.id_cliente = clientes.id_cliente\n WHERE cot_odt.status = 'A' order by cot_odt.fecha_odt desc, cot_odt.hora_odt desc\";\n\n $query = $this->db->prepare($sql);\n\n $query->execute();\n\n $result = array();\n\n while ($row = $query->fetch(PDO::FETCH_ASSOC)) {\n\n $result[] = $row;\n }\n\n return $result;\n\n }", "public function get_casetreatments()\n\t{\n\t\t$query = $this->db->get('tblcasetreatments');\n\t\treturn $query->result_array(); \n\t}", "public static function get():array{\n $consulta=\"SELECT a.id AS idAccion, a.codigo AS codigoAcc, a.nombre AS nombreAcc,m.* \n\t\t\t\t\tFROM acciones a \n\t\t\t\t\t\tINNER JOIN modulos_acciones md ON a.id=md.idAccion\n\t\t\t\t\t RIGHT JOIN modulos m ON idModulo= m.id\"; //preparar la consulta\n return DB::selectAll($consulta,'Modulo');\n }", "public function buscarMaterias($datos){\n try {\n $parametros = array(\"id_plan\" => $datos[\"id_plan\"] , \n \"anio\" => $datos[\"anio\"]);\n $resultado = $this->refControladorPersistencia->ejecutarSentencia(DbSentencias::BUSCAR_MATERIAS_EC, $parametros);\n $fila = $resultado->fetchAll(PDO::FETCH_ASSOC);\n\n return $fila;\n } catch(Exception $e){\n echo \"Error :\" . $e->getMessage(); \n }\n }", "function obtenerAlumnosMestro($idMaestro){\n $consulta1=\"SELECT aulas_usuarios_juegos.id_aula FROM aulas_usuarios_juegos WHERE id_usuario='$idMaestro'\";\n $resultado1=hacerListado($consulta1);\n $id_aulas=array();\n foreach ($resultado1 as $valores) {\n $id_aulas[]=$valores['id_aula'];\n }\n $cadenaAulas=implode(\",\", $id_aulas);\n //buscamos todos los alumnos de esas aulas\n $consulta2=\"SELECT aulas_usuarios_juegos.id_usuario,usuarios.nombre AS nombre_usuario,usuarios.apellidos,aulas_usuarios_juegos.id_aula,aulas.nombre AS nombre_aula FROM aulas_usuarios_juegos INNER JOIN usuarios ON aulas_usuarios_juegos.id_usuario=usuarios.id INNER JOIN aulas ON aulas_usuarios_juegos.id_aula=aulas.id WHERE id_aula IN($cadenaAulas)\";\n $resultado2=hacerListado($consulta2);\n $n=count($resultado2);\n //agrupamos las aulas para que no halla repeticion de datos\n for ($i=0; $i < $n; $i++) { \n for ($j=$i+1; $j < $n; $j++) { \n if(!empty($resultado2[$i]) && !empty($resultado2[$j])){\n if($resultado2[$i]['id_usuario']==$resultado2[$j]['id_usuario']){\n if($resultado2[$i]['id_aula']!=$resultado2[$j]['id_aula']){\n $aulas=explode(\",\", $resultado2[$i]['nombre_aula']);\n $entrar=true;\n for($z=0;$z<count($aulas) && $entrar!=false;$z++){\n if($aulas[$z]==$resultado2[$j]['nombre_aula']){\n $entrar=false;\n }\n }\n if($entrar==true){\n $resultado2[$i]['nombre_aula'] .=\",\" . $resultado2[$j]['nombre_aula'];\n $resultado2[$i]['id_aula'] .=\",\" . $resultado2[$j]['id_aula'];\n }\n }\n unset($resultado2[$j]);\n }\n elseif ($resultado2[$i]['id_usuario']==$idMaestro) {\n unset($resultado2[$i]);\n }\n }\n }\n }\n return $resultado2;\n }", "function Array_Get_Eps($estado)\n{\n\tif($estado)\n\t{\n\t$clubs = consultar(\"SELECT `id_eps`, `nombre`, `estado` FROM `tb_eps` where estado='activo' order by nombre asc \");\t\n\t}\n\telse\n\t{\n\t\t\n\t$clubs = consultar(\"SELECT `id_eps`, `nombre`, `estado` FROM `tb_eps` order by nombre asc \");\t\n\t}\n\n\n\t$datos = array();\n\twhile ($valor = mysqli_fetch_array($clubs)) {\n\t\t$id_eps = $valor['id_eps'];\n\t\t$nombre = $valor['nombre'];\n\t\t$estado = $valor['estado'];\n\n\n\t\t$vector = array(\n\t\t\t'id_eps'=>\"$id_eps\",\n\t\t\t'nombre'=>\"$nombre\",\n\t\t\t'estado'=>\"$estado\"\n\n\t\t\t);\n\t\tarray_push($datos, $vector);\n\t}\n\n\treturn $datos;\t\n}", "public function DataContasPagarEmissao($where){\n\t\t\t\t\n\t\t$dba = $this->dba;\n\n\t\t$vet = array();\n\n\n\t\t$sql =\"SELECT \n\t\t\t\td.emissao\n\t\t\tFROM\n\t\t\t\tduplic d\n\t\t\t\t\tinner join\n\t\t\t\tfornecedores f ON (f.codigo = d.cedente)\n\t\t\t\".$where.\"\n\t\t\tgroup by d.emissao order by d.emissao\";\n\t\n\t\t$res = $dba->query($sql);\n\n\t\t$num = $dba->rows($res); \n\n\t\t$i = 0;\n\t\t\t\n\t\twhile($dup = ibase_fetch_object($res)){\t\t\n\t\t\t\n\n\t\t\t$emissao\t = $dup->EMISSAO;\n\n\t\t\t\n\t\t\t$duplic = new Duplic();\t\t\t\n\t\t\n\t\t\t$duplic->setEmissao($emissao);\n\t\t\n\t\t\t$vet[$i++] = $duplic;\n\n\t\t}\n\n\t\treturn $vet;\n\n\t}", "private function getMateriais() {\n\n $oDaoMaterial = new cl_matmater();\n $sCampos = \" m60_codmater as codigo, m60_descr as descricao, m61_descr as unidade\";\n\n $sCamposGrupo = \" , 0 as codigogrupo \";\n if ($this->lAgruparGrupoSubgrupo) {\n $sCamposGrupo = \" , m65_sequencial as codigogrupo \";\n }\n $sCampos .= $sCamposGrupo;\n\n $aOrdem = array();\n $aWhere = array();\n $aWhere[] = \" instit = {$this->iInstituicao} \";\n\n $aOrdem[] = \" m60_descr \";\n\n if ($this->sDepartamentos) {\n $aWhere[] = \" m70_coddepto in ({$this->sDepartamentos}) \";\n }\n\n if ($this->sGrupoSubgrupo) {\n $aWhere[] = \" db121_sequencial in ({$this->sGrupoSubgrupo}) \";\n }\n\n $sCampoDepartamento = \", 0 as depto, '' as departamento\";\n if ($this->iQuebraPagina == RelatorioDeDistribuicao::QUEBRA_PAGINA_DEPARTAMENTO) {\n $sCampoDepartamento = \", m70_coddepto as depto, descrdepto as departamento \";\n }\n $sCampos .= $sCampoDepartamento;\n $sWhere = \" where \" . implode(\" and \", $aWhere);\n $sOrdem = \" order by \" . implode(\", \", $aOrdem);\n\n $sql = \" select distinct {$sCampos} \";\n $sql .= \" from matmater \";\n $sql .= \" inner join matunid on m60_codmatunid = m61_codmatunid \";\n $sql .= \" inner join matmatermaterialestoquegrupo on m60_codmater = m68_matmater \";\n $sql .= \" inner join materialestoquegrupo on m68_materialestoquegrupo = m65_sequencial \";\n $sql .= \" inner join db_estruturavalor on db121_sequencial = m65_db_estruturavalor \";\n $sql .= \" inner join matestoque on m60_codmater = m70_codmatmater \";\n $sql .= \" inner join db_depart on coddepto = m70_coddepto \";\n\n\n $sql .= \"{$sWhere} {$sOrdem} \";\n\n $rsMateriais = $oDaoMaterial->sql_record($sql);\n\n $aMateriais = array();\n for ($i = 0; $i < $oDaoMaterial->numrows; $i++) {\n\n $oMaterial = db_utils::fieldsMemory($rsMateriais, $i);\n $oMaterial->totalPeriodo = 0.0;\n $oMaterial->mediaPeriodo = 0.0;\n $aMateriais[] = $oMaterial;\n\n if (!isset($this->aDepartamentos[$oMaterial->depto])) {\n\n $oDeptartamento = new stdClass();\n $oDeptartamento->codigo = $oMaterial->depto;\n $oDeptartamento->descricao = $oMaterial->departamento;\n $oDeptartamento->itens = array();\n $this->aDepartamentos[$oDeptartamento->codigo] = $oDeptartamento;\n }\n }\n return $aMateriais;\n }", "static public function mdlSelecMembresiasNuevas($tabla,$empresa){\n\n\t\tif($empresa == \"0\"){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE m.estado = '0'\");\n\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}else{\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE t.id_empresa = '\".$empresa.\"' AND m.estado = '0' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "function get_control_salida_extra_mov(){\n\t\t$sQuery=\"SELECT id, id_sucursal, placa FROM control_salida_extra WHERE placa > 'NULL' \";\n\t\n\t\t//die($sQuery);\n\t\t$result=mssql_query($sQuery) or die(mssql_min_error_severity());\n\t\t$i=0;\n\t\twhile($row=mssql_fetch_array($result)){\n\t\t\tforeach($row as $key=>$value){\n\t\t\t\t$res_array[$i][$key]=$value;\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\treturn($res_array);\n\t\t\t\n\t}", "public function Redutor_De_Ordem_Chio(Array $matriz, int $coeficiente_final) {\n \n echo \"Antes da redução de ordem:\";\n\n echo \"<br>\";\n echo \"<br>\"; \n\n $m = $matriz; \n \n $linha = 0;\n $coluna = 0;\n \n \n if($m['ordem'] == 1) {\n\n /**\n * o coeficiente_final será usado para multiplicar o resultado da\n * última iteração da regra de chio\n */ \n\n $resultado = $m['matriz'][0][0] * $coeficiente_final;\n\n echo \"Coeficiente final: \" . $coeficiente_final;\n\n echo \"<br>\";\n\n echo \"O resultado do Determinante é: \" . $resultado;\n\n return $resultado;\n \n }else{\n \n \n $determinante = $m['matriz'];\n\n print_r($determinante);\n\n echo \"<br>\";\n echo \"<br>\"; \n\n //ira força o número 1 em um elemento da primeira linha\n\n $soma_de_elementos = 0;\n\n for ($i=0; $i < $m['ordem']; $i++) { \n\n \n \n if($determinante[0][$i] != 0) {\n\n $coeficiente = $determinante[0][$i];\n\n $linha = 0;\n $coluna = $i;\n\n\n break;\n \n\n }\n \n // Se a primeira linha só apresentar elementos igual a 0 então a matriz 1x1 resultado da reduções por chió será um elemento nulo\n // poís o determinante tem que ser zero pois a primeira linha é nula\n // logo se todos os elementos são zero a soma de todos os elemento tem que ser zero\n\n $soma_de_elementos += $determinante[0][$i];\n\n \n\n } \n\n if($soma_de_elementos == 0 ) {\n\n $resultado = 0;\n\n echo \"Coeficiente final: \" . $coeficiente_final;\n\n echo \"<br>\";\n \n echo \"O resultado do Determinante é: \" . $resultado;\n \n return $resultado;\n\n }else{\n\n\n\n\n /**\n * A regra de Chió só ser aplicado no elemento que está primeira linha e na primeira coluna cujo valor é igual a 1.\n * Como nem todos o determinante vão satisfazer essa condição, será nesse inverter algumas fileiras (linha ou coluna)\n * e também dividir as fileiras para forçar que o primeiro elemento do determinante tenha valor igual a 1.\n * \n * Logo serão usados as propriedades do determinante:\n * Uma fileira (linha ou coluna) nula resulta em um determinante de valor igual a zero;\n * Para cada inversão de fileiro inverte-se o sinal do valor do determinante;\n * Multiplicar uma fileira por valor faz com o resultado do determinante seja multiplicado pelo mesmo valor\n */\n\n \n \n \n \n\n /**\n * o coeficiente_final será usado para multiplicar o resultado da\n * última iteração da regra de chio\n * \n */ \n\n\n /**\n * Inversão de fileira.\n * Só a primeira linha será válidada, pois se todos os elementos dela forem nulos então o \n * determinante será nulo.\n * Caso o primeiro seja zero e os outros diferente de zero então será necessário uma inversão\n * que matematicamente signica multiplicar o valor do determinante pelo valor -1\n * \n */\n\n $fileira = $linha + $coluna;\n\n $inverte_fileira = ( $fileira == 0 ) ? 1 : -1;\n \n \n $coeficiente_final *= $inverte_fileira * $coeficiente; \n \n \n \n echo \"Coeficiente: \" . $coeficiente; \n echo \"<br>\";\n echo \"Coeficiente final: \" . $coeficiente_final; \n echo \"<br>\";\n echo \"Linha: \" . $linha;\n echo \"<br>\"; \n echo \"Coluna: \" . $coluna;\n\n echo \"<br>\";\n echo \"<br>\";\n\n\n \n\n \n \n\n for ($i=0; $i < $m['ordem']; $i++) { \n \n // analisando as colunas\n \n $determinante[0][$i] = $m['matriz'][0][$i] / $coeficiente; \n\n \n }\n\n\n \n\n\n echo \"Analisando o determinante parte 1\";\n\n echo \"<br>\";\n echo \"<br>\";\n\n\n print_r($determinante);\n\n echo \"<br>\";\n echo \"<br>\";\n echo \"<br>\";\n echo \"<br>\";\n\n \n \n \n // ---------------- daqui pra cima esta certo ---------------------\n \n \n \n // aplicando a regra de Chió\n\n \n\n $chio = array();\n\n for ($i=0; $i < $m['ordem']; $i++) {\n \n for ($j=0; $j < $m['ordem'] ; $j++) { \n\n \n if($i != $linha && $j != $coluna) {\n \n\n $det[] = $determinante[$i][$j];\n \n\n $chio[] = $determinante[$i][$j] -( $determinante[$linha][$j] * $determinante[$i][$coluna] );\n\n \n\n }\n \n\n }\n \n }\n\n\n // Vai permitir a usar recursividade pois deixará o array no formato certo\n\n $chio = $this->mostra_Matriz($chio);\n\n\n\n // Debug \n\n\n echo \"Depois da redução de ordem:\";\n\n echo \"<br>\";\n echo \"<br>\";\n\n \n\n echo \"Para Debug: Matriz em processo de redução de ordem: \";\n echo \"<br>\";\n print_r($det);\n \n echo \"<br>\";\n echo \"<br>\";\n\n echo \"Redução de Chió Completa: \";\n echo \"<br>\"; \n\n print_r($chio);\n\n\n echo \"<br>\";\n echo \"<br>\";\n\n echo \"---------------------------------------------------------\";\n\n echo \"<br>\";\n\n echo \"Nova redução de ordem do Determinante\";\n\n echo \"<br>\";\n\n echo \"---------------------------------------------------------\";\n\n\n echo \"<br>\";\n echo \"<br>\";\n\n\n \n\n\n\n\n\n // ---------------- daqui pra cima esta certo ---------------------\n\n // Usando a recursidade para chegar na matriz de ordem 1\n\n \n\n $this->Redutor_De_Ordem_Chio($chio, $coeficiente_final);\n\n\n }\n\n \n\n\n }\n\n\n \n \n\n\n }", "function get_ListarClase(){\n\t$query = $this->db->query('SELECT id_clase, nombre_clase FROM clase');\n\t\n\t//si hay resultados \n\tif ($query->num_rows() > 0){\n\t\t//almacenamos en una matriz bidimensional\n\t\tforeach($query->result() as $row)\n\t\t$arrDatos[htmlspecialchars($row->id_clase, ENT_QUOTES)]=htmlspecialchars($row->nombre_clase,ENT_QUOTES);\n\t\t$query->free_result();\n\t\treturn $arrDatos;\n\t}\n\t\t\n\t$this->db->order_by('id_clase ASC');\n\treturn $this->db->get('clase')->result();\n\t}", "public function queryMarcasPrincipales($opcion){\n $contador = 0;\n $vectorImagenes = array();\n $vectorNombres = array();\n if ($opcion == 1){\n $nombre = \"padreContent\";\n }else if ($opcion == 2){\n $nombre = \"hijoContent\";\n }else if ($opcion == 3){\n $nombre = \"nietoContent\";\n }\n foreach ($this->{$nombre} as $content){\n $dom = new DOMDocument();\n $dom->loadHTML(\"$content\");\n $xpath = new DOMXPath($dom);\n $tag = \"div\";\n $class = \"home-category-box\";\n $consulta = \"//\".$tag.\"[@class='\".$class.\"']\";\n $elemento = $xpath->query($consulta);\n if ($elemento->length > 0){\n $div = $elemento->item(0);\n $imgs = $div->getElementsByTagName(\"img\");\n $strongs = $div->getElementsByTagName(\"strong\");\n foreach($imgs as $img){\n array_push($vectorImagenes,$img->getAttribute(\"src\"));\n }\n foreach($strongs as $strong){\n $marcaNombre = explode(\" \",$strong->nodeValue);\n $marca = $marcaNombre[count($marcaNombre)-1];\n $marca = rtrim(ltrim($marca));\n array_push($vectorNombres,$marca);\n }\n }\n $contador++;\n }\n $vectorNombreMarcaImagen = array_combine($vectorNombres,$vectorImagenes);\n $this->vectorImagenesPrincipalesMarcas = array_merge($this->vectorImagenesPrincipalesMarcas,$vectorNombreMarcaImagen);\n }", "function ultimos_materiales() {\n\t\n\t\t\n\t\t$query = \"SELECT materiales.*, licencias.*\n\t\tFROM materiales, licencias\n\t\tWHERE materiales.material_licencia=licencias.id_licencia\n\t\tORDER BY materiales.fecha_alta desc\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function readProductosMarca()\n {\n $sql = 'SELECT nombre, id_producto, imagen_producto, producto, descripcion, precio\n FROM producto INNER JOIN marca USING(id_marca)\n WHERE id_marca = ? \n ORDER BY producto';\n $params = array($this->nombre);\n return Database::getRows($sql, $params);\n }", "public function getMayorCantidadAlumnos()\n {\n $resultados = null;\n $cursos = Course::select('id','nombre')\n ->where('period_id',\\Session::get('idPeriodo'))\n ->get();\n\n foreach ($cursos as $value) {\n $resultados[] = array(\n \"id\" => $value->id,\n \"curso\" => $value->nombre,\n \"cantidad\" => $value->students->count()\n );\n }\n return $resultados;\n }", "public function contAlumNormal($anio)\n { \n //$gradosMatTercerCiclo=[];$gradosVespertino=[];$gradosCompleto=[];\n //para contar alumnas en periodo normal\n //hay q filtrar por turnos Matutino,Vespertino y Completo\n $match=['anios_id'=>$anio,'turnos_id'=>1];\n $gradosMatutino=grado::where($match)->select('categoria','grado','seccion','capacidad','turnos_id','id')->orderBy('grado')->orderBy('seccion')->get()->toArray();\n //$countMat=count($gradosMatutino);\n $arreglo_grados_inscritos_matutino=[];\n for($i=0;$i<count($gradosMatutino);$i++){\n $gradoId=$gradosMatutino[$i]['id'];\n $busqueda=matricula::where('grados_id',$gradoId)->get();\n $cont=$busqueda->count();\n $gradoSeccion=$gradosMatutino[$i]['grado'].$gradosMatutino[$i]['seccion'];\n $aux=[\"gradoSeccion\"=>$gradoSeccion,\n \"cantidad\"=>$cont,\n \"categoria\"=>$gradosMatutino[$i]['categoria'],\n \"capacidad\"=>$gradosMatutino[$i]['capacidad'],\n \"turno\"=>\"matutino\",\n ];\n array_push($arreglo_grados_inscritos_matutino,$aux);\n }\n\n \n $match=['anios_id'=>$anio,'turnos_id'=>2];\n $gradosVespertino=grado::where($match)->select('categoria','grado','seccion','capacidad','turnos_id','id')->orderBy('grado')->orderBy('seccion')->get()->toArray();\n $arreglo_grados_inscritos_vespertino=[];\n for($i=0;$i<count($gradosVespertino);$i++){\n $gradoId=$gradosVespertino[$i]['id'];\n $busqueda=matricula::where('grados_id',$gradoId)->get();\n $cont=$busqueda->count();\n $gradoSeccion=$gradosVespertino[$i]['grado'].$gradosVespertino[$i]['seccion'];\n $aux=[\"gradoSeccion\"=>$gradoSeccion,\n \"cantidad\"=>$cont,\n \"categoria\"=>$gradosVespertino[$i]['categoria'],\n \"capacidad\"=>$gradosVespertino[$i]['capacidad'],\n \"turno\"=>\"Vespertino\", \n ];\n array_push($arreglo_grados_inscritos_vespertino,$aux);\n }\n\n //$countVesp=count($gradosVespertino);\n $match=['anios_id'=>$anio,'turnos_id'=>3];\n $gradosCompleto=grado::where($match)->select('categoria','grado','seccion','capacidad','turnos_id','id')->orderBy('grado')->orderBy('seccion')->get()->toArray();\n\n $arreglo_grados_inscritos_completo=[];\n for($i=0;$i<count($gradosCompleto);$i++){\n $gradoId=$gradosCompleto[$i]['id'];\n $busqueda=matricula::where('grados_id',$gradoId)->get();\n $cont=$busqueda->count();\n $gradoSeccion=$gradosCompleto[$i]['grado'].$gradosCompleto[$i]['seccion'];\n $aux=[\"gradoSeccion\"=>$gradoSeccion,\n \"cantidad\"=>$cont,\n \"categoria\"=>$gradosCompleto[$i]['categoria'],\n \"capacidad\"=>$gradosCompleto[$i]['capacidad'],\n \"turno\"=>\"completo\",\n ];\n array_push($arreglo_grados_inscritos_completo,$aux);\n }\n\n //$countComp=count($gradosCompleto);\n //dd($gradosCompleto);\n $arreglo_de_grados=[\"gradosMatutino\"=>$arreglo_grados_inscritos_matutino,\n \"gradosVespertino\"=>$arreglo_grados_inscritos_vespertino,\n \"gradosCompleto\"=>$arreglo_grados_inscritos_completo,\n \n ];\n //dd($arreglo_de_grados);\n //dd($arreglo_grados_inscritos_matutino);\n return $arreglo_de_grados;\n //$match=[''=>];\n //$nomMat=matricula::\n\n }", "static public function mdlSelecMembresiasCaducadas($tabla,$empresa){\n\n\t\tif($empresa == \"0\"){\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE m.estado = '2'\");\n\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}else{\n\n\t\t\t$stmt = Conexion::conectar()->prepare(\"SELECT m.*,t.nombre_membresia,mb.nombre_completo,e.nombre,mb.celular FROM $tabla m LEFT JOIN tipo_membresia t ON t.id_tipo_membresia=m.id_tipo_membresia LEFT JOIN miembros mb ON mb.id_miembro=m.id_miembro LEFT JOIN empresa e ON e.id_empresa=t.id_empresa WHERE t.id_empresa = '\".$empresa.\"' AND m.estado = '2' \");\n\n\t\t\t$stmt -> execute();\n\n\t\t\treturn $stmt -> fetchAll();\n\n\t\t}\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n }", "public function getCouplesPerChampionship()\n { \n $stmt = $this->db->prepare(\"select count(idPareja) as num, ca.nombreCampeonato as name \n FROM pareja p, categoriascampeonato c , campeonato ca \n WHERE p.idCategoriaCampeonato = c.idCategoriasCampeonato AND c.idCampeonato = ca.idCampeonato \n GROUP BY c.idCampeonato\");\n $stmt->execute();\n \n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \n $torret = array();\n \n foreach ($results as $result) {\n array_push($torret, array(\n \"left\" => $result[\"name\"],\n \"rigth\" => $result[\"num\"]\n ));\n }\n return $torret;\n }", "public function temporalizacion_productos($prod_id){\n $producto = $this->model_producto->get_producto_id($prod_id);\n $prod_prog= $this->model_producto->producto_programado($prod_id,$this->gestion);//// Temporalidad Programado\n $prod_ejec= $this->model_producto->producto_ejecutado($prod_id,$this->gestion); //// Temporalidad ejecutado\n\n $mp[1]='enero';\n $mp[2]='febrero';\n $mp[3]='marzo';\n $mp[4]='abril';\n $mp[5]='mayo';\n $mp[6]='junio';\n $mp[7]='julio';\n $mp[8]='agosto';\n $mp[9]='septiembre';\n $mp[10]='octubre';\n $mp[11]='noviembre';\n $mp[12]='diciembre';\n\n for ($i=1; $i <=12 ; $i++) { \n $matriz[1][$i]=0; /// Programado\n $matriz[2][$i]=0; /// Programado Acumulado\n $matriz[3][$i]=0; /// Programado Acumulado %\n $matriz[4][$i]=0; /// Ejecutado\n $matriz[5][$i]=0; /// Ejecutado Acumulado\n $matriz[6][$i]=0; /// Ejecutado Acumulado %\n $matriz[7][$i]=0; /// Eficacia\n }\n \n $pa=0; $ea=0;\n if(count($prod_prog)!=0){\n for ($i=1; $i <=12 ; $i++) { \n $matriz[1][$i]=$prod_prog[0][$mp[$i]];\n }\n }\n \n return $matriz;\n }", "public function buscar_comprobante_compras($anio)\n {\n //CPC_TipoDocumento => F factura, B boleta\n //CPC_total => total de la FACTURA o BOLETA\n $sql = \" SELECT * FROM cji_comprobante c WHERE CPC_TipoOperacion='C' AND CPC_TipoDocumento='F' AND YEAR(CPC_FechaRegistro)=\" . $anio . \"\";\n //echo $sql;\n $query = $this->db->query($sql);\n if ($query->num_rows > 0) {\n foreach ($query->result() as $fila) {\n $data[] = $fila;\n }\n return $data;\n }\n return array();\n }", "public function getCampeonatos()\n {\n $stmt = $this->db->query(\"SELECT *\n\t\t\tFROM campeonato\");\n $toret_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \n $championships = array();\n \n foreach ($toret_db as $championship) {\n array_push($championships, new Championship($championship[\"idCampeonato\"], $championship[\"fechaInicioInscripcion\"], $championship[\"fechaFinInscripcion\"], $championship[\"fechaInicioCampeonato\"], $championship[\"fechaFinCampeonato\"], $championship[\"nombreCampeonato\"], $championship[\"fase\"]));\n }\n return $championships;\n }", "public function citas_tiposCitas(){\n \t\n\t\t\t$resultado = array();\n\t\t\n\t\t\t$query = \" SELECT idTipoCita, nombre\n\t\t\t\t\t\tFROM tb_tiposCita\";\n\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\t\n }", "public function getMontacargasCiclosiniciales()\n {\n\n return $this->montacargas_ciclosiniciales;\n }", "function retornaAtributos($tabelaProcura){\n # abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $aRetorno = array();\n # varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n # recupera o nome da tabela e gera o nome da classe\n $nomeTabela = (string)$aTabela['NOME'];\n if($nomeTabela != $tabelaProcura) continue;\n # varre a estrutura dos campos da tabela em questao\n foreach($aTabela as $oCampo){\n # recupera valores a serem substituidos no modelo\n $sFKTabela = (string)$oCampo->FKTABELA;\n if($sFKTabela != ''){\n $nomeClasse = ucfirst($this->getCamelMode($sFKTabela));\n $aRetorno[] = \"\\$o\".$nomeClasse;\n }\n else{\n $aRetorno[] = \"\\$\".(string)$oCampo->NOME;\n }\n }\n break;\n }\n //print_r($aRetorno);\n return $aRetorno;\t\n }", "public function getMarcas(){\n\t\t//consulta a la tabla roles usando el objeto db de la clase modelo\n\t\t$marcas = $this->_db->query(\"SELECT id, nombre FROM marcas ORDER BY nombre\");\n\n\t\t//retornamos lo que haya en la tabla roles\n\t\treturn $marcas->fetchall();\n\t}" ]
[ "0.6620419", "0.63969326", "0.6340149", "0.6295867", "0.62428", "0.61065894", "0.59875625", "0.5971302", "0.59652627", "0.59237176", "0.5920678", "0.5897849", "0.58815765", "0.58411765", "0.58376676", "0.5827408", "0.5815303", "0.5807598", "0.5783372", "0.5779222", "0.57581526", "0.5750288", "0.5736236", "0.5728985", "0.57180476", "0.57167226", "0.5700722", "0.5672894", "0.5667033", "0.5664206", "0.5658368", "0.5651299", "0.56454515", "0.5643979", "0.5641463", "0.56389064", "0.5623645", "0.5620837", "0.5619246", "0.5611779", "0.56075317", "0.5604684", "0.56041175", "0.5602127", "0.55896944", "0.5589468", "0.558882", "0.55818284", "0.5577528", "0.55698216", "0.5563855", "0.55562955", "0.5546992", "0.55449486", "0.5541273", "0.552441", "0.5518858", "0.5515869", "0.5515206", "0.55150497", "0.54987675", "0.5490896", "0.5488114", "0.5483473", "0.54783046", "0.547673", "0.54705477", "0.5464981", "0.5459412", "0.5456299", "0.54534733", "0.5450459", "0.544976", "0.5443476", "0.543359", "0.5427099", "0.54161924", "0.5413467", "0.541083", "0.54107714", "0.5397862", "0.53952634", "0.5389665", "0.5378722", "0.53746164", "0.53718925", "0.5371191", "0.5368341", "0.53682595", "0.53594", "0.5358791", "0.53513294", "0.5344427", "0.5340146", "0.5332173", "0.533165", "0.53258455", "0.5324152", "0.53217673", "0.53114396" ]
0.5853751
13
Retorna os telefones que a escola tem.
public function getTelefones() { $aTelefones = array(); $oDaoTelefones = new cl_telefoneescola(); $sCampos = "ed26_i_ddd as ddd, ed26_i_numero as numero, ed13_c_descr as tipo_telefone"; $sSqlTelefones = $oDaoTelefones->sql_query(null, $sCampos, "ed26_i_numero", "ed26_i_escola = {$this->iCodigoEscola}" ); $rsTelefones = db_query($sSqlTelefones); if ( !$rsTelefones ) { throw new DBException("Erro ao buscar os telefones.\n" . pg_last_error()); } $iTotalTelefones = pg_num_rows($rsTelefones); $oDadosTelefone = new stdClass(); $oDadosTelefone->ddd = ''; $oDadosTelefone->fax = ''; $oDadosTelefone->telefone = ''; $oDadosTelefone->telefone_publico = ''; $oDadosTelefone->telefone_outro = ''; for ($i = 0; $i < $iTotalTelefones; $i++) { $oTelefone = db_utils::fieldsMemory($rsTelefones, $i); $oDadosTelefone->ddd = $oTelefone->ddd; if (strpos(strtoupper($oTelefone->tipo_telefone), "FAX") !== false) { $oDadosTelefone->fax = $oTelefone->numero; continue; } if ( empty($oDadosTelefone->telefone_publico) && strlen($oTelefone->numero) == 8 ) { $oDadosTelefone->telefone_publico = $oTelefone->numero; continue; } if ( empty($oDadosTelefone->telefone) ) { $oDadosTelefone->telefone = $oTelefone->numero; continue; } if ( empty($oDadosTelefone->telefone_outro) ) { $oDadosTelefone->telefone_outro = $oTelefone->numero; continue; } } return $oDadosTelefone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTelefonos(){\n\t\t$socio\t\t\t= $this->mCodigo;\n\t\t$mArrTelefonos\t= array();\n\t\t$sql = \"SELECT\n\t\t\t\t\tTRIM(`socios_vivienda`.`telefono_residencial`) AS 'telefono'\n\t\t\t\tFROM\n\t\t\t\t\t`socios_vivienda` `socios_vivienda`\n\t\t\t\tWHERE\n\t\t\t\t\t(`socios_vivienda`.`socio_numero` =$socio)\n\t\t\t\tUNION\n\t\t\t\tSELECT\n\t\t\t\t\tTRIM(`socios_vivienda`.`telefono_movil`)\n\t\t\t\tFROM\n\t\t\t\t\t`socios_vivienda` `socios_vivienda`\n\t\t\t\tWHERE\n\t\t\t\t\t(`socios_vivienda`.`socio_numero` =$socio)\";\n\t\t$rs\t= mysql_query($sql, cnnGeneral() );\n\t\twhile($rw = mysql_fetch_array($rs) ){\n\t\t\t$mArrTelefonos[]\t= $rw[\"telefono\"];\n\t\t}\n\t\t$mArrTelefonos[\"principal\"]\t= $this->mTelefonoP;\n\t\treturn $mArrTelefonos;\n\t}", "public function telefones() {\n return $this->hasMany('App\\Telefone', 'pessoa_id');\n }", "public function getTelefone()\n {\n return $this->telefone;\n }", "public function obtenerTelefono()\n {\n try {\n\n if (!$this->validateShedule()) {\n return response_json(true, \"En este momento no puede predicar porque no es un horario de predicación. La aplicación solo esta activa en horarios de predicación\");\n }\n\n $telefono = $this->consultaTelefonos();\n\n if ($telefono == null) {\n return response_json(true, \"En este momento no tenemos más números de teléfonos para mostrar\");\n }\n\n $update = $this->updateTelefono($telefono->id, [\n \"usado\" => true,\n ]);\n\n if (!$update) {\n return response_json(false, \"Ocurrio un problema interno, recargue la pagina por favor\");\n }\n\n return response_json(true, \"Ahora puede llamar al número que aparecerá en pantalla\", $telefono);\n\n } catch (\\Exception $ex) {\n return response_json(false, \"Ocurrio un problema interno, recargue la pagina por favor\");\n }\n }", "public function getTelefone()\n {\n return $this->telefone;\n }", "public function getTelefone()\n\t{\n\t\treturn $this->telefone;\n\t}", "public function getTelefone()\n {\n return $this->telefone;\n }", "public function getTelefone1()\n {\n return $this->telefone1;\n }", "public function getTelephone() {}", "function getallphonenos()\n\t{\n\t\tinclude_once('twilio/Twilio.php');\n\t\t$twilio_creds=getTwlioCreds();\n\t\t$client = new Services_Twilio($twilio_creds['sid'], $twilio_creds['auth_token']);\n\t\t$allnos = array();\n\t\tforeach ($client->account->incoming_phone_numbers as $number) \n\t\t{\n\t\t\tif($number->voice_application_sid == $twilio_creds['app_sid'])\n\t\t\t{\n\t\t\t\t$allnos[]['incoming_no'] = $number->phone_number;\t\t \n\t\t\t}\n\t\t}\n\t\treturn($allnos);\n\t}", "public function obtenerTiposDeTelefonos() {\n $builder = $this->db->table($this->table);\n $res = [\n 'error' => false,\n 'code_error' => null,\n 'error_title' => null,\n 'error_message' => null,\n 'response' => $builder->get()->getResult()\n ];\n return $this->response->setStatusCode(200)->setJSON($res);\n }", "public function get_telephone();", "public function getAllTelefonate($num_voci = null, $start = null) {\n\t\t$this->db->order_by('data_e_ora', 'ASC');\n\t\t$query = $this->db->get($this->tabella_telefonate, $num_voci, $start);\n\t\t\n\t\tif( $query->num_rows() > 0 ) {\n\t\t\treturn $query->result();\n\t\t} else {\n\t\t\treturn NULL;\n\t\t}\n\t}", "function leer_telefonos($idproveedor){\n\t\t$sql=\"\n\t\tSELECT\n\t\t\tcpt.IDPROVEEDOR,ctsp.DESCRIPCION,\n\t\t\tcpt.CODIGOAREA,\n\t\t\tcpt.NUMEROTELEFONO\n\t\tFROM\n\t\t$this->catalogo.catalogo_proveedor_telefono cpt,\n\t\t$this->catalogo.catalogo_tsp ctsp\n\t\tWHERE\n\t\t\tcpt.IDTSP = ctsp.IDTSP\n\t\t\tAND cpt.IDPROVEEDOR='$idproveedor'\n\t\t\t\";\n\t\t$result = $this->query($sql);\n\t\twhile($reg= $result->fetch_object())\n\t\t{\n\t\t\t$telef[$reg->IDTELEFONO] = array(\n\t\t\t'TSP'=>$reg->DESCRIPCION,\n\t\t\t'CODIGOAREA'=>$reg->CODIGOAREA,\n\t\t\t'NUMEROTELEFONO'=>$reg->NUMEROTELEFONO\n\t\t\t);\n\t\t}\n\t\treturn $telef;\n\t}", "public function getNuTelefone()\n\t{\n\t\treturn $this->nu_telefone;\n\t}", "public function getTelefone2()\n {\n return $this->telefone2;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM telefonos';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function getTelefono()\n\t\t{\n\t\treturn $this->telefono;\n\t\t}", "public function index()\n {\n $telefone = Telefone::with(['perfils','operadoras'])->latest()->get();\n return $telefone;\n }", "public function getTelefono()\n {\n return $this->_telefono;\n }", "public function getTelefono()\n {\n return $this->telefono;\n }", "public function getTelefono()\n {\n return $this->telefono;\n }", "public function getTones()\n {\n return $this->request('/tone/', array());\n }", "function getNum_teleco()\n {\n if (!isset($this->snum_teleco) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->snum_teleco;\n }", "public static function RetornaTelefone() : ?string\n {\n if (self::$obj_entidade instanceof OBJ_Entidade) {\n $fone = self::$obj_entidade->get_usuario()->get_fone();\n \n if (strlen($fone) === 11) {\n return preg_replace(\"/([0-9]{2})([0-9]{5})([0-9]{4})/\", \"($1) $2-$3\", $fone);\n } else {\n return preg_replace(\"/([0-9]{2})([0-9]{4})([0-9]{4})/\", \"($1) $2-$3\", $fone);\n }\n } else {\n return null;\n }\n }", "function getTelefone($fone){\n\t$telefone = substr($fone, 2);\n\treturn $telefone;\n}", "public function getTelefono() {\n\t\treturn $this->telefono;\n\t}", "public function achatListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Achat\");//type array\n\t}", "public function getTelefone3()\n {\n return $this->telefone3;\n }", "public function getRECEPCIONISTA()\n {\n return $this->RECEPCIONISTA;\n }", "public function getTel()\n {\n return $this->Tel;\n }", "public function getTel()\n {\n return $this->tel;\n }", "public function getTel()\n {\n return $this->tel;\n }", "public function getTel()\n {\n return $this->tel;\n }", "public function getTel()\n {\n return $this->tel;\n }", "public function getTelevision()\n {\n return $this->television;\n }", "public function getTelefone($instance=false){\n if ($instance && !is_object($this->_data['telefone'])){\n $this->setTelefone('',array('required'=>false));\n }\n return $this->_data['telefone'];\n }", "public function seleccionarTodosEuno() {\n\n $planConsulta = \"SELECT c.IdContacto,c.ConNombres,c.ConApellidos,c.ConCorreo,r.Idrolcontacto,r.Nomrol\";\n $planConsulta .= \" FROM contacto c\";\n $planConsulta .= \" JOIN rolcontacto r ON c.rolcontacto_Idrolcontacto=r.Idrolcontacto \";\n $planConsulta .= \" WHERE c.Estado = 1 \";\n $planConsulta .= \" ORDER BY c.IdContacto ASC \";\n\n $registrosContactos = $this->conexion->prepare($planConsulta);\n $registrosContactos->execute(); //Ejecución de la consulta \n\n $listadoRegistrosContacto = array();\n\n while ($registro = $registrosContactos->fetch(PDO::FETCH_OBJ)) {\n $listadoRegistrosContacto[] = $registro;\n }\n\n $this->cierreBd();\n\n return $listadoRegistrosContacto;\n }", "public function telecoms()\n {\n return View::make('telecommunications.telecomms_intro');\n }", "public function validarTelefono($texto){\n $patron = \"/[0-9]{9}/\";\n return preg_match_all($patron, $texto);\n }", "public function getTelephone()\n {\n $stmt = $this->conn->prepare(\"SELECT *\n FROM Telephone\");\n //Exécution de la requete\n $stmt->execute();\n //Récupération du résultat dans la variable resultat\n $resultat = $stmt->get_result();\n //Fermeture de la connection avec la base de données MySql\n $stmt->close();\n //Retour de la variable resultat\n return $resultat;\n }", "public static function traerTodosLosChoferes()\n {\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n $consulta = $objetoAccesoDato->RetornarConsulta(\"SELECT * \n FROM usuarios AS u, choferes AS c \n WHERE u.id_usuario=c.id_usuario\");\n \n $consulta->execute();\n $consulta = $consulta->fetchAll(PDO::FETCH_ASSOC);\n return json_encode($consulta);\n }", "public function etatListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Etat\");//type array\n\t}", "public function getTelephoneLink(): ?array;", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function getTelephone()\n {\n return $this->telephone;\n }", "public function get_tel()\n {\n return $this->_tel;\n }", "public function equipementachatListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"EquipementAchat\");//type array\n\t}", "public function getShipToPhone();", "public function possederListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Posseder\");//type array\n\t}", "public function retrieveMessengers()\n {\n return $this->start()->uri(\"/api/messenger\")\n ->get()\n ->go();\n }", "public function receivables()\n {\n $receivables = Receivable::all();\n return response()->json(['receivables'=>$receivables]);\n }", "public function telefone()\n\t{\n\t\treturn $this->belongsTo('Telefone');\n\t}", "function send_ingame_mail_MT($realm_id, $massmails, $return = false)\r{\r require_once \"libs/telnet_lib.php\";\r\r global $server, $sql;\r\r $telnet = new telnet_lib();\r\r $result = $telnet->Connect($server[$realm_id][\"addr\"], $server[$realm_id][\"telnet_port\"], $server[$realm_id][\"telnet_user\"], $server[$realm_id][\"telnet_pass\"]);\r\r if ( $result == 0 )\r {\r $mess_str = '';\r $result = '';\r $receivers = array();\r foreach( $massmails as $mails )\r {\r $att_item = $mails[\"att_item\"];\r $att_stack = $mails[\"att_stack\"];\r\r if ( $mails[\"att_gold\"] && ( count($att_item) > 0 ) )\r {\r $mess_str1 = \"send money \".$mails[\"receiver_name\"].\" \\\"\".$mails[\"subject\"].\"\\\" \\\"\".$mails[\"body\"].\"\\\" \".$mails[\"att_gold\"].\"\";\r $telnet->DoCommand($mess_str1, $result1);\r\r $mess_str .= $mess_str1.\"<br >\";\r $result .= $result1.\"\";\r\r $mess_str1 = \"send item \".$mails[\"receiver_name\"].\" \\\"\".$mails[\"subject\"].\"\\\" \\\"\".$mails[\"body\"].\"\\\" \";\r\r for ( $i = 0; $i < count($att_item); $i++ )\r $mess_str1 .= $att_item[$i].( ( $att_stack[$i] > 1 ) ? \":\".$att_stack[$i].\" \" : \" \" );\r\r $telnet->DoCommand($mess_str1, $result1);\r\r $mess_str .= $mess_str1.\"<br >\";\r $result .= $result1.\"\";\r }\r elseif ( $mails[\"att_gold\"] )\r {\r $mess_str1 = \"send money \".$mails[\"receiver_name\"].\" \\\"\".$mails[\"subject\"].\"\\\" \\\"\".$mails[\"body\"].\"\\\" \".$mails[\"att_gold\"].\"\";\r $telnet->DoCommand($mess_str1, $result1);\r\r $mess_str .= $mess_str1.\"<br >\";\r $result .= $result1.\"\";\r }\r elseif ( count($att_item) > 0 )\r {\r $mess_str1 = \"send item \".$mails[\"receiver_name\"].\" \\\"\".$mails[\"subject\"].\"\\\" \\\"\".$mails[\"body\"].\"\\\" \";\r\r for ( $i = 0; $i < count($att_item); $i++ )\r $mess_str1 .= $att_item[$i].( ( $att_stack[$i] > 1 ) ? \":\".$att_stack[$i].\" \" : \" \" );\r\r $telnet->DoCommand($mess_str1, $result1);\r\r $mess_str .= $mess_str1.\"<br >\";\r $result .= $result1.\"\";\r }\r else\r {\r $mess_str1 = \"send mail \".$mails[\"receiver_name\"].\" \\\"\".$mails[\"subject\"].\"\\\" \\\"\".$mails[\"body\"].\"\\\"\";\r $telnet->DoCommand($mess_str1, $result1);\r\r $mess_str .= $mess_str1.\"<br >\";\r $result .= $result1.\"\";\r }\r array_push($receivers, $mails[\"receiver_name\"]);\r }\r if ( $core == 2 )\r $core_prompt = \"mangos\";\r elseif ( $core == 3 )\r $core_prompt = \"TC\";\r $result = str_replace($core_prompt.\">\",\"\",$result);\r $result = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), '<br />', $result);\r $mess_str .= \"<br /><br />\".$result;\r $telnet->Disconnect();\r\r $receiver_list = '';\r foreach ( $receivers as $receiver )\r {\r $receiver_list .= ', '.$receiver;\r }\r $receiver_list = substr($receiver_list, 2, strlen($receiver_list)-2);\r }\r elseif ( $result == 1 )\r $mess_str = lang(\"telnet\", \"unable\");\r elseif ( $result == 2 )\r $mess_str = lang(\"telnet\", \"unknown_host\");\r elseif ( $result == 3 )\r $mess_str = lang(\"telnet\", \"login_failed\");\r elseif ( $result == 4 )\r $mess_str = lang(\"telnet\", \"not_supported\");\r\r if ( !$return )\r {\r if ( !isset($_GET[\"redirect\"]) )\r {\r if ( count($massmails) == 1 )\r redirect(\"mail.php?action=result&error=6&mess=\".$mess_str.\"&mailresult=\".$result.\"&recipient=\".$receiver_list);\r else\r redirect(\"mail.php?action=result&error=6&mess=&mailresult=\".$result.\"&recipient=\".$receiver_list);\r }\r else\r {\r $money_result = $sql[\"char\"]->quote_smart($_GET[\"moneyresult\"]);\r $redirect = $sql[\"char\"]->quote_smart($_GET[\"redirect\"]);\r\r redirect($redirect.\"?moneyresult=\".$money_result.\"&mailresult=\".$result);\r }\r }\r else\r return $result;\r}", "public function getTo();", "public function lerTodos() {\n\n $xml = self::$soapClient->lerTodos();\n $xml = $this->xmlToArray($xml);\n \n if (isset($xml)) {\n foreach ($xml[\"NODELIST\"] as $key => $value) {\n $result[$key] = $value;\n }\n }\n return $result;\n }", "public function telephoneNumber(): TelephoneNumber\n {\n return $this->telephoneNumber;\n }", "public function getPhone();", "public function enviarContactos(){\n $this->enviarPeticion(\"VIDEOCONFERENCIA:CONTACTOS:LISTA:DIOCE=0,LOOPBACK\n1=0,LOOPBACK 2=0,MIGUEL ALTUNA=1,POLYCOM AUSTIN STEREO=0,POLYCOM AUSTIN\nSTEREO=0,POLYCOM AUSTIN USA=0,POLYCOM AUSTIN USA IP=0,POLYCOM\nAUSTRALIA=0,POLYCOM BRAZIL=0,POLYCOM EUROPE=0,POLYCOM HONG\nKONG=0,POLYCOM JAPAN=0,POLYCOM JAPAN=0,POLYCOM MEXICO=0,POLYCOM MILPITAS\nLOBBY=0,POLYCOM PERU=0,POLYCOM SOUTHERN EUROPE=0,TELESONIC=0\");\n }", "public function getTELEFONO_1()\r\n {\r\n return $this->TELEFONO_1;\r\n }", "public function getTelephone() {\n\t\treturn $this->telephone;\n\t}", "public function getTel_partner()\n {\n return $this->tel_partner;\n }", "function retrieve_users_fftt()\n\t{\n\t\tglobal $gCms;\n\t\t$adherents = new adherents();\n\t\t$ping = cms_utils::get_module('Ping');\n\t\t$saison = $ping->GetPreference ('saison_en_cours');\n\t\t$ping_ops = new ping_admin_ops();\n\t\t$db = cmsms()->GetDb();\n\t\t$now = trim($db->DBTimeStamp(time()), \"'\");\n\t\t$aujourdhui = date('Y-m-d');\n\t\t$club_number = $adherents->GetPreference('club_number');\n\t\t//echo $club_number;\n\t\t\n\t\t\n\t\t\t$page = \"xml_liste_joueur\";\n\t\t\t$service = new Servicen();\n\t\t\t//paramètres nécessaires \n\t\t\t\n\t\t\t$var = \"club=\".$club_number;\n\t\t\t$lien = $service->GetLink($page,$var);\n\t\t\t//echo $lien;\n\t\t\t$xml = simplexml_load_string($lien, 'SimpleXMLElement', LIBXML_NOCDATA);\n\t\t\t\n\t\t\t\n\t\t\tif($xml === FALSE)\n\t\t\t{\n\t\t\t\t$array = 0;\n\t\t\t\t$lignes = 0;\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$array = json_decode(json_encode((array)$xml), TRUE);\n\t\t\t\t$lignes = count($array['joueur']);\n\t\t\t}\n\t\t\t//echo \"le nb de lignes est : \".$lignes;\n\t\t\tif($lignes == 0)\n\t\t\t{\n\t\t\t\t$message = \"Pas de lignes à récupérer !\";\n\t\t\t\t//$this->SetMessage(\"$message\");\n\t\t\t\t//$this->RedirectToAdminTab('joueurs');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//on supprime tt\n\t\t\t\t$query = \"TRUNCATE TABLE \".cms_db_prefix().\"module_ping_joueurs\";\n\t\t\t\t$dbresult = $db->Execute($query);\n\t\t\t\tif($dbresult)\n\t\t\t\t{\n\t\t\t\t\t$i =0;//compteur pour les nouvelles inclusions\n\t\t\t\t\t$a = 0;//compteur pour les mises à jour\n\t\t\t\t\t$joueurs_ops = new ping_admin_ops();\n\t\t\t\t\tforeach($xml as $tab)\n\t\t\t\t\t{\n\t\t\t\t\t\t$licence = (isset($tab->licence)?\"$tab->licence\":\"\");\n\t\t\t\t\t\t$nom = (isset($tab->nom)?\"$tab->nom\":\"\");\n\t\t\t\t\t\t$prenom = (isset($tab->prenom)?\"$tab->prenom\":\"\");\n\t\t\t\t\t\t$club = (isset($tab->club)?\"$tab->club\":\"\");\n\t\t\t\t\t\t$nclub = (isset($tab->nclub)?\"$tab->nclub\":\"\");\n\t\t\t\t\t\t$clast = (isset($tab->clast)?\"$tab->clast\":\"\");\n\t\t\t\t\t\t$actif = 1;\n\n\t\t\t\t\t\t$insert = $joueurs_ops->add_joueur($actif, $licence, $nom, $prenom, $club, $nclub, $clast);\n\t\t\t\t\t\t$player_exists = $joueurs_ops->player_exists($licence);\n\t\t\t\t\t//\tvar_dump($player_exists);\n\t\t\t\t\t\tif($insert === TRUE && $player_exists === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$query = \"INSERT INTO \".cms_db_prefix().\"module_ping_recup_parties (saison, datemaj, licence, sit_mens, fftt, maj_fftt, spid, maj_spid) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t\t\t\t\t\t$dbresult = $db->Execute($query, array($saison,$aujourdhui,$licence,'Janvier 2000', '0', '1970-01-01', '0', '1970-01-01'));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}//$a++;\n\t\t\t\t\t \t\n\n\t\t\t\t\t}// fin du foreach\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t//on redirige sur l'onglet joueurs\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function demandeListeTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Demande\");//type array\n\t}", "public function seleccionarTodos() {\n\n $planConsulta = \"SELECT c.IdContacto,c.ConNombres,c.ConApellidos,c.ConCorreo,r.Idrolcontacto,r.Nomrol\";\n $planConsulta .= \" FROM contacto c\";\n $planConsulta .= \" JOIN rolcontacto r ON c.rolcontacto_Idrolcontacto=r.Idrolcontacto \";\n $planConsulta .= \" ORDER BY c.IdContacto ASC \";\n\n $registrosContactos = $this->conexion->prepare($planConsulta);\n $registrosContactos->execute(); //Ejecución de la consulta \n\n $listadoRegistrosContacto = array();\n\n while ($registro = $registrosContactos->fetch(PDO::FETCH_OBJ)) {\n $listadoRegistrosContacto[] = $registro;\n }\n\n $this->cierreBd();\n\n return $listadoRegistrosContacto;\n }", "public function getReceivers() {\n\n if (count($this->cachedReceivers) === 0) {\n $restUrl = $this->configuration->getApiUrl() . '/receivers/for/' . $this->configuration->getClientId();\n $rawJson = $this->configuration->getRestImplementation()->get($restUrl);\n\n $response = json_decode($rawJson, TRUE);\n $this->cachedReceivers = $response;\n }\n\n // Let's get the country specific receivers\n if (!isset($this->cachedReceivers['receivers'][$this->configuration->getCountrycode()])) {\n throw new ElefundsCommunicationException(\n 'Requested countrycode was not available. Available country codes are: ' . implode(', ', array_keys($this->cachedReceivers['receivers'])) . '.',\n 1347966301\n );\n }\n\n $receivers = array();\n\n foreach ($this->cachedReceivers['receivers'][$this->configuration->getCountrycode()] as $rec) {\n $receiver = $this->createReceiver();\n $receivers[] = $receiver->setId($rec['id'])\n ->setName($rec['name'])\n ->setDescription($rec['description'])\n ->setImages($rec['images']);\n }\n\n return $receivers;\n }", "function main() {\r\n $restaurants_list = getOrders();\r\n \r\n \r\n if ( count($restaurants_list) > 0 ) {\r\n \r\n //POPULATE RESTAURANTS WITH DATA (EMAIL, FAX, WHATSAPP)\r\n $ready_restaurants_list = populateWithData($restaurants_list);\r\n \r\n //SEND MESSAGES TO EVERY RESTAURANT FROM THE ARRAY $ready_restaurants_list\r\n sendMessages($ready_restaurants_list, TEST_MODE);\r\n \r\n echo '<pre>'; var_dump($ready_restaurants_list); echo '</pre>';\r\n } else {\r\n echo \"No orders for the last 24h.\";\r\n }\r\n}", "function get_mensajes($all = false) {\n\t\t\tif ($all) {\n\t\t\t\t//return todos los mensajes\n\t\t\t} else {\n\t\t\t\t//return mensajes nuevos\n\t\t\t}\n\t\t}", "function Listar_Clientes()\n\t {\n\t\tlog_message('INFO','#TRAZA| CLIENTES | Listar_Clientes() >> ');\n\t\t$data['list'] = $this->Clientes->Listar_Clientes();\n return $data;\n\t }", "public function getTelefonoUsuario(){\n return $this->telefonoUsuario;\n }", "public function getToList(): string {\n\t\treturn $this->createEMailList($this->getTo());\n\t}", "public function _getAllSender() {\r\n $gate = $this->config->api;\r\n $url = $gate.self::$apiMethods['get_alphanames']['url'];\r\n $method = self::$apiMethods['get_alphanames']['method'];\r\n return json_decode($this->_curl($url, $method), true);\r\n\t}", "public static function traerTodosLosClientes()\n {\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n $consulta = $objetoAccesoDato->RetornarConsulta(\"SELECT * \n FROM usuarios AS u, clientes AS c \n WHERE u.id_usuario=c.id_usuario\");\n \n $consulta->execute();\n $consulta = $consulta->fetchAll(PDO::FETCH_ASSOC);\n return json_encode($consulta);\n }", "public function getContacts(){\n\t\t// ***\n\t\t// the following code should be ported\n\t\t// so multiple backends are allowed\n\t\t$userOnlineMapper = $this->app['UserOnlineMapper'];\n\t\t$usersOnline = $userOnlineMapper->getOnlineUsers();\n\t\t$syncOnline = $this->app['SyncOnlineCommand'];\n\t\t$syncOnline->execute();\n\t\t// ***\n\n\t\tif(count(self::$contacts) == 0){\n\t\t\t$cm = \\OC::$server->getContactsManager();\n\n\t\t\t$result = $cm->search('',array('FN'));\n\t\t\t$receivers = array();\n\t\t\t$contactList = array();\n\t\t\t$contactsObj = array();\n\t\t\tforeach ($result as $r) {\n\t\t\t\t$data = array();\n\n\t\t\t\t$contactList[] = $r['FN'];\n\n\t\t\t\t$data['id'] = $r['id'];\n\t\t\t\t$data['online'] = in_array($r['id'], $usersOnline);\n\t\t\t\t$data['displayname'] = $r['FN'];\n\n\t\t\t\tif(!isset($r['EMAIL'])){\n\t\t\t\t\t$r['EMAIL'] = array();\n\t\t\t\t}\n\n\t\t\t\tif(!isset($r['IMPP'])){\n\t\t\t\t\t$r['IMPP'] = array();\n\t\t\t\t}\n\t\t\t\t$data['backends'] = $this->contactBackendToBackend($r['EMAIL'], $r['IMPP']);\n\t\t\t\tlist($addressBookBackend, $addressBookId) = explode(':', $r['addressbook-key']);\n\t\t\t\t$data['address_book_id'] = $addressBookId;\n\t\t\t\t$data['address_book_backend'] = $addressBookBackend;\n\t\t\t\t$receivers[] = $data;\n\t\t\t\t$contactsObj[$r['id']] = $data;\n\t\t\t}\n\t\t\tself::$contacts = array('contacts' => $receivers, 'contactsList' => $contactList, 'contactsObj' => $contactsObj);\n\t\t}\n\t\treturn self::$contacts;\n\t}", "function leerClientes(){\n \n try{\n $stmt = $this->dbh->prepare(\"SELECT c.idClienteTg, c.NombreCte,c.RFCCte, c.direccion, c.ciudad,c.estado, c.email, c.telefono, c.numTg,r.nombreReferencia FROM referencias r join tarjetas_clientes c on r.idreferencia=c.referenciaId where c.status=1\");\n // Especificamos el fetch mode antes de llamar a fetch()\n $stmt->execute();\n $clientes = $stmt->fetchAll(PDO::FETCH_NUM);\n } catch (PDOException $e){\n $clientes=array(\"status\"=>\"0\",\"mensaje\"=>$e->getMessage());\n }\n \n return $clientes;\n }", "public function getTELEFONO1()\r\n {\r\n return $this->TELEFONO_1;\r\n }", "function ZerteileRufnummer()\n {\n if (ereg (\"^\\+\", $this->PhoneInput)) // Ein Plus am Anfang = Ländervorwahl\n {\n $NutzFeld = 1; // >>> Ein Feld muss schon mal ausgelassen werden.\n\n $TelFragmente = explode(\" \", $this->PhoneInput); // Trenne die Telefonnummer bei den Leerzeichen\n\n if (count($TelFragmente) > 1) // Wenn die Nummer nicht \"aus einem Guss\" besteht\n {\n $this->Landesvorwahl = $TelFragmente[0]; // Die Ländervorwahl Vorwahl ist im ersten Feld\n\n if (count($TelFragmente) > 2) // Die nationale Vorwahl ist im zweiten Feld. Gibt es diese hier ?\n {\n $this->Ortsnetzkennzahl = \"(0)\".$TelFragmente[1];\n $NutzFeld += 1; // >>> Also sind es 2 Felder, die nachher beim Zusammensetzen ausgelassen werden.\n }\n $this->Teilnehmerkennzahl = \"\";\n for($nn= $NutzFeld ;$nn<count($TelFragmente);$nn++)\n { $this->Teilnehmerkennzahl .= $TelFragmente[$nn]; } // Die Zahlen ohne Vorwahlen zusammenfügen\n\n }\n\n else\n {\n // Pech... Ohne Leerzeichen kann die Rufnummer nur schwer unterteilt werden.\n // Ich versuche wenigstens anhand der Vorwahl etwas zu erkennen.\n\n $l=strlen($this->PhoneInput); // Länge der Telefonnummer ermitteln\n if ($l < 6) {$AnzSuche = $l;} // Ist die Rufnummer kleiner als das Suchmuster muss ich die Länge des Suchmusters kürzen.\n else {$AnzSuche = 6;} // Sonst nehme ich mal die ersten 5 Zahlen sowie das Plus, um zu suchen.\n\n $Feldname = \"Vorwahl\";\n for($n=$AnzSuche;$n>1;$n--)\n {\n $SuchInVorwahl = substr($this->PhoneInput, 0, $n); // Als Suchmuster etwas von Vorderteil der Nummer nehmen\n $x = $this->suche_ID_multi_array($Feldname, $SuchInVorwahl);\n if($x) // Glück gehabt. Die Vohrwahl passt zu einer in der Tabelle.\n {\n $this->Landesvorwahl= $SuchInVorwahl;\n $this->TabID= $x;\n $this->PHONE_WARNUNG .= \"Landesvorwahl wurde erkannt, nicht aber die Ortsvorwahl !<br>\";\n $this->Teilnehmerkennzahl = substr($this->PhoneInput, $n);\n break; // Schleife verlassen\n }\n }\n\n\n if ($x > 1) {$this->Landesvorwahl = $this->LandTabelle[$x][\"Vorwahl\"];} // Es wurde eine passende internationale Vorwahl gefunden\n else {\n // Die Vorwahl kann nicht erraten werden und der Rest klebt an einem Block.\n $this->PHONE_ERROR = \"Kein g&uuml;ltiges Muster in der Rufnummer erkannt.<br>\\n\". // Nummer zur Formatierung unbrauchbar\n \" Bitte benutzen Sie Leerzeichen zur optischen Unterteilung\";\n }\n }\n }\n\n // N A T I O N A L E Schreibweise: ---------------------------------------------------------------------------\n else /// Es hatte kein + am Anfang ...\n {\n\n $TelInlandBereich = explode(\" \", $this->PhoneInput);\n if (trim($TelInlandBereich[1]) != \"\") // Ist im Feld eins nichts, ist die Nummer aus einem Guss. Sonst ...\n {\n $this->Ortsnetzkennzahl = $TelInlandBereich[0]; // Hier ist die Ortsvorwahl zu erwarten\n $this->Teilnehmerkennzahl = \"\";\n for($x=1;$x<count($TelInlandBereich);$x++)\n { $this->Teilnehmerkennzahl .= $TelInlandBereich[$x]; }\n\n $this->Teilnehmerkennzahl = trim(eregi_replace(\"[^0-9]\", null, $this->Teilnehmerkennzahl));\n\n if (!ereg (\"^0\", trim($this->Ortsnetzkennzahl)))\n $this->PHONE_WARNUNG .= \"Ortsvorwahl vermutlich falsch! (Sie beginnt ohne \\\"0\\\") <br>\";\n }\n else\n {\n $this->Teilnehmerkennzahl = $this->PhoneInput;\n $this->PHONE_WARNUNG .= \"Konnte keine Ortsvorwahl ermitteln. Die Nummer wird daher am Stück zurückgegeben !<br>\";\n }\n }\n }", "public function getResponsableContactos()\n {\n return $this->responsableContactos;\n }", "public static function traerTodosLosChoferesLibres()\n {\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n $consulta = $objetoAccesoDato->RetornarConsulta(\"SELECT * FROM choferes AS c, usuarios AS u \n WHERE c.id_usuario=u.id_usuario AND \n NOT EXISTS (SELECT * FROM vehiculos WHERE vehiculos.id_chofer = c.id_chofer)\");\n \n $consulta->execute();\n $consulta = $consulta->fetchAll(PDO::FETCH_ASSOC);\n return json_encode($consulta);\n }", "public function setTelefone($telefone)\n {\n $this->telefone = $telefone;\n\n return $this;\n }", "private function recipients()\n {\n if (request('type') === 'bulk') {\n return $recipients = count(Contact::active()->where('group_id', request('recipients'))->pluck('mobile'));\n } elseif (request('type') === 'single') {\n return $recipients = 1;\n }\n }", "public function getPlanesTelefonos()\n {\n return $this->hasMany(PlanesTelefono::className(), ['id_planes' => 'id_planes']);\n }", "function mesAchats()\n\t{\n\t\t$cnn = getConnexion('tpi-fictif');\n\n\t\t$i = 0;\n\t\t//Permet de savoir plus facilement si login correct ou pas\n\t\t$mesAchats = [];\n\t\t$sql = 'SELECT `consommation`.`Nom`, `consomme`.`DateConsommation`, `consomme`.`Nombre`, `consomme`.`PrixVendu`, `consomme`.`Paye` FROM `consomme` INNER JOIN `consommation` ON `consomme`.`Consommation_ID` = `consommation`.`ID` and `consomme`.`User_ID` = :ID ORDER BY `consomme`.`IDConsomme` DESC';\n\t\t$stmt = $cnn -> prepare($sql);\n\t\t$stmt -> bindValue(':ID', $_SESSION['user'][1], PDO::PARAM_INT);\n\t\t$stmt -> execute();\n\t\t//Remplissange tab 2 dimensions pour avoir les infos qu'on souhaite\n\t\t//Passage en param plus facile\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_OBJ)) {\n\t\t\t$mesAchats[$i][0] = $row->Nom;\n\t\t\t$mesAchats[$i][1] = $row->DateConsommation;\n\t\t\t$mesAchats[$i][2] = $row->Nombre;\n\t\t\t$mesAchats[$i][3] = $row->PrixVendu;\n\t\t\t$mesAchats[$i][4] = $row->Paye;\n\t\t\t$i++;\n\t\t}\n\t\tif(!empty($mesAchats))\n\t\t{\n\t\t\treturn $mesAchats;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getFax() {}", "public function getFax();", "public function getTTCoffees() {\n $result = $this->_db->select('SELECT * FROM '.PREFIX.'coffee AS c\n INNER JOIN '.PREFIX.'roaster AS r ON c.roaster_id = r.roaster_id\n INNER JOIN '.PREFIX.'grower AS g ON c.grower_id = g.grower_id\n INNER JOIN '.PREFIX.'contact AS ct ON r.contact_id = ct.contact_id');\n $ttcoffees = array();\n foreach ($result as $ttcoffee) {\n $current = new \\TTCoffee($ttcoffee->coffee_id, $ttcoffee->roaster_name, $ttcoffee->roaster_logo, $ttcoffee->farm_name, $ttcoffee->farm_country, $ttcoffee->farm_region, $ttcoffee->coffee_name,\n $ttcoffee->description, $ttcoffee->retail_price, $ttcoffee->currency, $ttcoffee->bag_size, $ttcoffee->gppp, $ttcoffee->egs, $ttcoffee->url);\n $ttcoffees[] = $current;\n }\n return $ttcoffees;\n }", "public function setTelefone($telefone)\n {\n $this->telefone = $telefone;\n\n return $this;\n }", "function redirecionaClienteParaDepartamentoTecnologia($cliente)\n{\n\n # montando URL\n $url =\n \"index.php/por/chat/startchat/(leaveamessage)/true?prefill%5Busername%5D={$cliente['razao_social']}&value_items_admin[0]={$cliente['duvida']}&value_items_admin[1]={$cliente['nome_usuario']}&value_items_admin[2]={$cliente['conta_contrato']}&value_items_admin[3]={$cliente['razao_social']}&value_items_admin[4]={$cliente['cnpj']}&value_items_admin[5]=0&nome_departamento=Tecnologia&codigo_ticket=0&novo_erp={$cliente['novo_erp']}&prefill%5Bphone%5D=2&value_items_admin[6]={$cliente['telefone']}&value_items_admin[7]=0\";\n\n # redirecionando cliente para o colaborador no chat teste\n echo json_encode(['url' => 'http://192.168.0.47:9999/' . $url], JSON_UNESCAPED_UNICODE);\n\n # redirecionando cliente para o colaborador no chat produção\n #echo json_encode(['url' => 'https://chat.avancoinfo.net/' . $url], JSON_UNESCAPED_UNICODE);\n\n exit;\n}", "public function getPhones()\n {\n return $this->phones;\n }", "public function getComentarios()\n\t\t{\n\t\t\t $this->limpiarVariables();\n\t\t\t $this->conexion = new Conexion();\n\t\t\t $registros[]=array();\n\t\t\t $this->queryComentarios=\"select * from contacto\";\n\t\t\t $resultado=$this->conexion->consultar( $this->queryComentarios );\n\t\t\t \n\t\t\t \n\t\t\t return $resultado;\n\t\t}", "function grabar_contacto($datos)\n\t{\n\n\t\t$contacto[IDPROVEEDOR]= $datos[IDPROVEEDOR];\n\t\t$contacto[IDCONTACTO]=$datos[IDCONTACTO];\n\t\t$contacto[IDUSUARIOMOD]= $datos[IDUSUARIOMOD];\n\t\t$contacto[NOMBRE]= strtoupper(trim(($datos[NOMBRE])));\n\t\t$contacto[APPATERNO]=strtoupper(trim(($datos[APPATERNO])));\n\t\t$contacto[APMATERNO]=strtoupper(trim(($datos[APMATERNO])));\n\t\t$contacto[EMAIL1]= trim($datos[EMAIL1]);\n\t\t$contacto[EMAIL2]= trim($datos[EMAIL2]);\n\t\t$contacto[EMAIL3]= trim($datos[EMAIL3]);\n\t\t$contacto[RESPONSABLE]=($datos[RESPONSABLE]=='on')?1:0;\n\t\t$contacto[FECHANAC]= ($datos[ANIO]==''?'0000':$datos[ANIO]).'-'.($datos[MES]==''?'00':$datos[MES]).'-'.($datos[DIA]==''?'00':$datos[DIA]);\n\n\t\t//\t\t$contacto_telf[CODIGOAREA]=$datos[CODIGOAREA];\n\t\t//\t\t$contacto_telf[NUMEROTELEFONO]=$datos[NUMEROTELEFONO];\n\t\t//\t\t$contacto_telf[EXTENSION]=$datos[EXTENSION];\n\t\t//\t\t$contacto_telf[IDTIPOTELEFONO]=$datos[IDTIPOTELEFONO];\n\t\t//\t\t$contacto_telf[COMENTARIO]=$datos[TELF_COMENTARIO];\n\t\t//\t\t$contacto_telf[IDTSP]=$datos[IDTSP];\n\n\n\t\t$this->insert_update(\"$this->catalogo.catalogo_proveedor_contacto\",$contacto);\n\t\tif ($this->reg_id()) $datos[IDCONTACTO] = $this->reg_id();\n\n\t\t$this->borrar_telefono_contacto($datos[IDCONTACTO]); // BORRA LOS TELEFONOS DE CONTACTO\n\n\t\tif ($datos[IDCONTACTO]!=''){\n\t\t\tfor($i=0;$i<=count($datos[NUMEROTELEFONO]);$i++)\n\t\t\t{\n\t\t\t\t$telf[IDCONTACTO] = $datos[IDCONTACTO];\n\t\t\t\t$telf[CODIGOAREA]=$datos[CODIGOAREA][$i];\n\t\t\t\t$telf[IDTIPOTELEFONO]=$datos[IDTIPOTELEFONO][$i];\n\t\t\t\t$telf[NUMEROTELEFONO]=$datos[NUMEROTELEFONO][$i];\n\t\t\t\t$telf[EXTENSION]=$datos[EXTENSION][$i];\n\t\t\t\t$telf[IDTSP]=$datos[IDTSP][$i];\n\t\t\t\t$telf[COMENTARIO]=$datos[TELF_COMENTARIO][$i];\n\t\t\t\t$telf[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\t\t\t\t$telf[PRIORIDAD]=$i+1;\n\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_contacto_telefono\",$telf);\n\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}", "public static function obtenerNotificaciones()\n {\n //$consulta = \"SELECT * FROM notificaciones WHERE ((estado=0) AND (id_user= ?)) ORDER BY id_notificacion DESC\";\n $consulta = \"SELECT * FROM notificaciones WHERE estado=1 ORDER BY id_notificacion DESC\";\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n \n\n return $comando->fetchAll(PDO::FETCH_ASSOC);\n\n } catch (PDOException $e) {\n return false;\n }\n }", "function teleinfor ($port = \"/dev/ttyAMA0\") {\n // Resultat : liste etiquette=>valeur\n $trame_array = array();\n \n // Ouvrir le port en lecture\n $handle = fopen ($port, \"r\");\n $char = \"\";\n $contents = \"\";\n while (fread($handle, 1) != chr(2));\n do {\n $char = fread($handle, 1);\n if ($char != chr(2)) $contents .= $char;\n } while ($char != chr(2));\n\n // Fermer le port\n fclose ($handle);\n\n // Supprimer les caracteres debut/fin de trame\n $trame = substr($contents,1,-1);\n\n // Separer les messages\n $trame = explode(chr(10).chr(10), $trame);\n\n // Verifier les checksum et supprimer les trames incorrectes\n foreach ($trame as $key=>$message) {\n \n // Separer l'etiquette, la valeur et le checksum\n $message = explode (chr(32), $message, 3);\n list ($etiquette, $valeur, $checksum) = $message;\n \n // Supprimer le message si incomplet ou incorrect (checksum invalide) \n if (count($message)<3 || \n checksum($etiquette, $valeur) != $checksum \n\t\t \n\t//\t|| \n // messize($etiquette) != strlen($valeur) \n ) { \n unset($trame[$key]); \n \n } else {\n // Enregistrer le message dans la liste trame_array\n $trame_array[$etiquette] = $valeur;\n\t\t\t \n }\n }\n \n return $trame_array;\n }", "public function getLotesFraccionar(){\n log_message('INFO','#TRAZA | #TRAZ-PROD-TRAZASOFT | Etapa | getLotesFraccionar() ');\n\n $batch_id = $this->input->post('batch_id');\n\n $lotesFracc['data'] = $this->Etapas->getLotesaFraccionar($batch_id)->lotes->lote;\n \n if(!empty($lotesFracc)){\n $lotesFracc['status'] = true;\n echo json_encode($lotesFracc);\n }else{\n echo json_encode(array(\"status\" => false,\"msj\" => \"No se encontraron lotes a fraccionar\"));\n }\n }", "public function getRecibidos()\n {\n return $this->hasMany(Message::className(), ['receptor_id' => 'id'])->inverseOf('receptor');\n }" ]
[ "0.71565455", "0.68757594", "0.654493", "0.65406376", "0.6531317", "0.6508314", "0.6418184", "0.6213722", "0.62043756", "0.61502117", "0.6138295", "0.6011169", "0.598546", "0.5967378", "0.58932984", "0.58794475", "0.5833447", "0.58040017", "0.57950926", "0.5794389", "0.576247", "0.576247", "0.574844", "0.57417023", "0.5739396", "0.5726013", "0.5713273", "0.56718117", "0.56553936", "0.56378835", "0.5626517", "0.55972254", "0.55972254", "0.55972254", "0.55972254", "0.55789304", "0.5576557", "0.55733263", "0.552102", "0.5483723", "0.54828286", "0.54492503", "0.54247147", "0.54046553", "0.54025817", "0.53467315", "0.53467315", "0.53467315", "0.53467315", "0.53467315", "0.53467315", "0.5336711", "0.5326824", "0.53113455", "0.5306708", "0.5306503", "0.5298814", "0.5298546", "0.52896357", "0.52822673", "0.5269193", "0.5255258", "0.5254979", "0.5249358", "0.5237903", "0.5232599", "0.52316", "0.5229201", "0.52247804", "0.522086", "0.5217863", "0.5216205", "0.5210523", "0.52037525", "0.5196736", "0.5192903", "0.5185369", "0.51845634", "0.51813614", "0.5180575", "0.51804054", "0.5179743", "0.51778895", "0.51751", "0.5167196", "0.5163134", "0.5162538", "0.51379937", "0.5126181", "0.5124423", "0.5124395", "0.51242846", "0.5123717", "0.5119577", "0.511957", "0.5118766", "0.51175183", "0.51167995", "0.51139015", "0.5110373" ]
0.7341893
0